86 iC.consumes<std::vector<L1MuGMTCand>>(m_muGmtInputTag);
113 const int iBxInEvent,
114 const bool receiveMu,
117 LogDebug(
"L1GlobalTrigger") <<
"\n**** L1GlobalTriggerGTL receiving muon data for BxInEvent = " << iBxInEvent
118 <<
"\n from input tag " << muGmtInputTag <<
"\n" 127 iEvent.getByLabel(muGmtInputTag, muonData);
131 edm::LogWarning(
"L1GlobalTrigger") <<
"\nWarning: std::vector<L1MuGMTCand> with input tag " << muGmtInputTag
132 <<
"\nrequested in configuration, but not found in the event.\n" 136 std::vector<L1MuGMTCand>::const_iterator itMuon;
137 for (itMuon = muonData->begin(); itMuon != muonData->end(); itMuon++) {
138 if ((*itMuon).bx() == iBxInEvent) {
139 (*m_candL1Mu).push_back(&(*itMuon));
156 const bool produceL1GtObjectMapRecord,
157 const int iBxInEvent,
159 const unsigned int numberPhysTriggers,
161 const int nrL1NoIsoEG,
163 const int nrL1CenJet,
164 const int nrL1ForJet,
165 const int nrL1TauJet,
166 const int nrL1JetCounts,
167 const int ifMuEtaNumberBits,
168 const int ifCaloEtaNumberBits) {
172 const std::vector<ConditionMap> &conditionMap = l1GtMenu.gtConditionMap();
173 const AlgorithmMap &algorithmMap = l1GtMenu.gtAlgorithmMap();
175 const std::vector<std::vector<L1GtMuonTemplate>> &corrMuon = l1GtMenu.corMuonTemplate();
177 const std::vector<std::vector<L1GtCaloTemplate>> &corrCalo = l1GtMenu.corCaloTemplate();
179 const std::vector<std::vector<L1GtEnergySumTemplate>> &corrEnergySum = l1GtMenu.corEnergySumTemplate();
184 bool convertScale =
false;
214 std::ostringstream myCout;
217 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
233 for (std::vector<ConditionMap>::const_iterator itCondOnChip = conditionMap.begin();
234 itCondOnChip != conditionMap.end();
243 for (
CItCond itCond = itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {
245 switch ((itCond->second)->condCategory()) {
253 cMapResults[itCond->first] = muCondition;
256 std::ostringstream myCout;
257 muCondition->
print(myCout);
259 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
267 itCond->second, ptrGtPSB, nrL1NoIsoEG, nrL1IsoEG, nrL1CenJet, nrL1ForJet, nrL1TauJet, ifCaloEtaNumberBits);
274 cMapResults[itCond->first] = caloCondition;
277 std::ostringstream myCout;
278 caloCondition->
print(myCout);
280 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
291 cMapResults[itCond->first] = eSumCondition;
294 std::ostringstream myCout;
295 eSumCondition->
print(myCout);
297 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
308 cMapResults[itCond->first] = jcCondition;
311 std::ostringstream myCout;
312 jcCondition->
print(myCout);
314 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
326 cMapResults[itCond->first] = bcCondition;
329 std::ostringstream myCout;
330 bcCondition->
print(myCout);
332 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
344 cMapResults[itCond->first] = etCondition;
347 std::ostringstream myCout;
348 etCondition->
print(myCout);
350 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
357 bool castorCondResult =
false;
369 cMapResults[itCond->first] = castorCondition;
372 std::ostringstream myCout;
373 castorCondition->
print(myCout);
375 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
382 bool bptxCondResult =
true;
391 cMapResults[itCond->first] = bptxCondition;
394 std::ostringstream myCout;
395 bptxCondition->
print(myCout);
397 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
404 bool externalCondResult =
true;
413 cMapResults[itCond->first] = externalCondition;
416 std::ostringstream myCout;
417 externalCondition->
print(myCout);
419 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
430 const int cond0Ind = corrTemplate->
cond0Index();
431 const int cond1Ind = corrTemplate->
cond1Index();
437 int cond0NrL1Objects = 0;
438 int cond1NrL1Objects = 0;
440 int cond0EtaBits = 0;
441 int cond1EtaBits = 0;
443 switch (cond0Categ) {
445 cond0Condition = &((corrMuon[iChip])[cond0Ind]);
446 cond0NrL1Objects = nrL1Mu;
447 cond0EtaBits = ifMuEtaNumberBits;
450 cond0Condition = &((corrCalo[iChip])[cond0Ind]);
454 cond0NrL1Objects = nrL1NoIsoEG;
457 cond0NrL1Objects = nrL1IsoEG;
460 cond0NrL1Objects = nrL1CenJet;
463 cond0NrL1Objects = nrL1ForJet;
466 cond0NrL1Objects = nrL1TauJet;
469 cond0NrL1Objects = 0;
473 cond0EtaBits = ifCaloEtaNumberBits;
476 cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
477 cond0NrL1Objects = 1;
484 switch (cond1Categ) {
486 cond1Condition = &((corrMuon[iChip])[cond1Ind]);
487 cond1NrL1Objects = nrL1Mu;
488 cond1EtaBits = ifMuEtaNumberBits;
491 cond1Condition = &((corrCalo[iChip])[cond1Ind]);
495 cond1NrL1Objects = nrL1NoIsoEG;
498 cond1NrL1Objects = nrL1IsoEG;
501 cond1NrL1Objects = nrL1CenJet;
504 cond1NrL1Objects = nrL1ForJet;
507 cond1NrL1Objects = nrL1TauJet;
510 cond1NrL1Objects = 0;
514 cond1EtaBits = ifCaloEtaNumberBits;
517 cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
518 cond1NrL1Objects = 1;
539 cMapResults[itCond->first] = correlationCond;
542 std::ostringstream myCout;
543 correlationCond->
print(myCout);
545 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
566 std::vector<L1GlobalTriggerObjectMap> objMapVec;
567 if (produceL1GtObjectMapRecord && (iBxInEvent == 0))
568 objMapVec.reserve(numberPhysTriggers);
570 for (
CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
574 int algBitNumber = (itAlgo->second).algoBitNumber();
582 std::ostringstream myCout;
583 (itAlgo->second).
print(myCout);
586 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
590 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
602 std::ostringstream myCout1;
603 objMap.
print(myCout1);
605 LogTrace(
"L1GlobalTrigger") << myCout1.str() << std::endl;
608 objMapVec.push_back(objMap);
613 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
621 for (std::vector<L1GtAlgorithmEvaluation::ConditionEvaluationMap>::iterator itCondOnChip =
626 delete itCond->second;
627 itCond->second =
nullptr;
642 LogTrace(
"L1GlobalTrigger") <<
"\nL1GlobalTrigger: GMT data received for BxInEvent = " << iBxInEvent << std::endl;
645 LogTrace(
"L1GlobalTrigger") <<
"Number of GMT muons = " << nrL1Mu <<
"\n" << std::endl;
647 for (std::vector<const L1MuGMTCand *>::const_iterator iter =
m_candL1Mu->begin(); iter !=
m_candL1Mu->end(); iter++) {
648 LogTrace(
"L1GlobalTrigger") << *(*iter) << std::endl;
651 LogTrace(
"L1GlobalTrigger") << std::endl;
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlAlgorithmOR
std::vector< L1GtAlgorithmEvaluation::ConditionEvaluationMap > m_conditionResultMaps
void print(std::ostream &myCout) const
print the full object map
void init(const int nrL1Mu, const int numberPhysTriggers)
initialize the class (mainly reserve)
const L1GtConditionCategory cond0Category() const
get / set the category of the two sub-conditions
virtual ~L1GlobalTriggerGTL()
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const edm::ESGetToken< L1CaloGeometry, L1CaloGeometryRecord > m_l1CaloGeometryToken
void swapCombinationVector(std::vector< CombinationsInCond > &combinationVectorValue)
void setAlgoName(const std::string &algoNameValue)
std::vector< CombinationsInCond > & gtAlgoCombinationVector()
L1GlobalTriggerGTL(const edm::InputTag &mutag, edm::ConsumesCollector &&iC)
void swapGtObjectMap(std::vector< L1GlobalTriggerObjectMap > >ObjectMapValue)
void setVerbosity(const int verbosity)
bool gtAlgoResult() const
get / set the result of the algorithm
std::vector< L1GtLogicParser::OperandToken > & operandTokenVector()
void swapOperandTokenVector(std::vector< L1GtLogicParser::OperandToken > &operandTokenVectorValue)
const L1GtConditionCategory cond1Category() const
void print(std::ostream &myCout) const override
print condition
const edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > m_l1GtMenuToken
void evaluateConditionStoreResult()
call evaluateCondition and save last result
const unsigned int gtObjectNrBinsPhi(const L1GtObject &) const
return the number of phi bins for a GT object
void setVerbosity(const int verbosity)
void convertL1Scales(const L1CaloGeometry *, const L1MuTriggerScales *, const int, const int)
perform all scale conversions
void print(std::ostream &myCout) const override
print condition
void print(std::ostream &myCout) const
int m_verbosity
verbosity level
virtual void print(std::ostream &myCout) const
print all the performed conversions
const int cond0Index() const
get / set the index of the two sub-conditions in the cor* vector from menu
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlDecisionWord
void run(edm::Event &iEvent, const edm::EventSetup &evSetup, const L1GlobalTriggerPSB *ptrGtPSB, const bool produceL1GtObjectMapRecord, const int iBxInEvent, L1GlobalTriggerObjectMapRecord *gtObjectMapRecord, const unsigned int numberPhysTriggers, const int nrL1Mu, const int nrL1NoIsoEG, const int nrL1IsoEG, const int nrL1CenJet, const int nrL1ForJet, const int nrL1TauJet, const int nrL1JetCounts, const int ifMuEtaNumberBits, const int ifCaloEtaNumberBits)
run the GTL
void print(std::ostream &myCout) const override
print condition
const edm::ESGetToken< L1MuTriggerScales, L1MuTriggerScalesRcd > m_l1MuTriggerScalesToken
std::vector< const L1MuGMTCand * > * m_candL1Mu
std ::unordered_map< std::string, L1GtConditionEvaluation * > ConditionEvaluationMap
copy constructor
const L1MuTriggerScales * m_l1MuTriggerScales
void setAlgoGtlResult(bool algoGtlResultValue)
const std::vector< L1GtObject > & objectType() const
get / set the trigger object type(s) in the condition
void print(std::ostream &myCout) const override
print condition
void print(std::ostream &myCout) const override
print condition
L1GtEtaPhiConversions * m_gtEtaPhiConversions
void print(std::ostream &myCout) const override
print condition
void receiveGmtObjectData(edm::Event &, const edm::InputTag &, const int iBxInEvent, const bool receiveMu, const int nrL1Mu)
receive data from Global Muon Trigger
const int cond1Index() const
void setAlgoBitNumber(int algoBitNumberValue)
void print(std::ostream &myCout) const override
print condition
void setGtCorrParDeltaPhiNrBins(const int &)
ConditionEvaluationMap::iterator ItEvalMap
void printGmtData(const int iBxInEvent) const
print received Muon dataWord
const L1CaloGeometry * m_l1CaloGeometry
Log< level::Warning, false > LogWarning
void print(std::ostream &myCout) const override
print condition
void print(std::ostream &myCout) const override
print condition
void print(std::ostream &myCout) const override
print condition
void evaluateAlgorithm(const int chipNumber, const std::vector< ConditionEvaluationMap > &)
evaluate an algorithm
unsigned long long m_l1MuTriggerScalesCacheID
unsigned long long m_l1CaloGeometryCacheID
void setGtCorrParDeltaPhiNrBins(const int &)