Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AXOL1TL change to v3 of model #43791

Merged
merged 2 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion L1Trigger/L1TGlobal/python/simGtStage2Digis_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
JetInputTag = cms.InputTag("simCaloStage2Digis"),
EtSumInputTag = cms.InputTag("simCaloStage2Digis"),
EtSumZdcInputTag = cms.InputTag("etSumZdcProducer"),
AXOL1TLModelVersion = cms.string("GTADModel_v1"),
AXOL1TLModelVersion = cms.string("GTADModel_v3"),
AlgorithmTriggersUnmasked = cms.bool(True),
AlgorithmTriggersUnprescaled = cms.bool(True),
GetPrescaleColumnFromData = cms.bool(False),
Expand Down
9 changes: 5 additions & 4 deletions L1Trigger/L1TGlobal/src/AXOL1TLCondition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,12 @@ const bool l1t::AXOL1TLCondition::evaluateCondition(const int bxEval) const {
int useBx = bxEval + m_gtAXOL1TLTemplate->condRelativeBx();

//HLS4ML stuff
std::string AXOL1TLmodelversion = m_AXOL1TLmodelversion;
std::string AXOL1TLmodelversion = m_AXOL1TLmodelversion; //config loading method
// std::string AXOL1TLmodelversion = "L1Trigger/L1TGlobal/test/GTADModel_v3"; //for .so file in test dir loading method
hls4mlEmulator::ModelLoader loader(AXOL1TLmodelversion);
std::shared_ptr<hls4mlEmulator::Model> model;
model = loader.load_model();
cout << "loading model... " << AXOL1TLmodelversion << std::endl;
// cout << "loading model... " << AXOL1TLmodelversion << std::endl;
rappoccio marked this conversation as resolved.
Show resolved Hide resolved

// //pointers to objects
const BXVector<const l1t::Muon*>* candMuVec = m_gtGTB->getCandL1Mu();
Expand Down Expand Up @@ -129,9 +130,9 @@ const bool l1t::AXOL1TLCondition::evaluateCondition(const int bxEval) const {
ap_fixed<18, 13> EtSumInput[EtSumVecSize];

//declare result vectors +score
std::array<ap_fixed<10, 7>, 13> result;
std::array<ap_fixed<10, 7, AP_RND_CONV, AP_SAT>, 8> result; //v3
ap_ufixed<18, 14> loss;
std::pair<std::array<ap_fixed<10, 7>, 13>, ap_ufixed<18, 14>>
std::pair<std::array<ap_fixed<10, 7, AP_RND_CONV, AP_SAT>, 8>, ap_ufixed<18, 14>>
rappoccio marked this conversation as resolved.
Show resolved Hide resolved
ADModelResult; //model outputs a pair of the (result vector, loss)
float score = -1.0; //not sure what the best default is hm??

Expand Down