20 #include <ext/hash_map>
89 iC.consumes<std::vector<L1MuGMTCand>>(m_muGmtInputTag);
116 const int iBxInEvent,
117 const bool receiveMu,
120 LogDebug(
"L1GlobalTrigger") <<
"\n**** L1GlobalTriggerGTL receiving muon data for BxInEvent = " << iBxInEvent
121 <<
"\n from input tag " << muGmtInputTag <<
"\n"
130 iEvent.getByLabel(muGmtInputTag, muonData);
134 edm::LogWarning(
"L1GlobalTrigger") <<
"\nWarning: std::vector<L1MuGMTCand> with input tag " << muGmtInputTag
135 <<
"\nrequested in configuration, but not found in the event.\n"
139 std::vector<L1MuGMTCand>::const_iterator itMuon;
140 for (itMuon = muonData->begin(); itMuon != muonData->end(); itMuon++) {
141 if ((*itMuon).bx() == iBxInEvent) {
142 (*m_candL1Mu).push_back(&(*itMuon));
159 const bool produceL1GtObjectMapRecord,
160 const int iBxInEvent,
162 const unsigned int numberPhysTriggers,
164 const int nrL1NoIsoEG,
166 const int nrL1CenJet,
167 const int nrL1ForJet,
168 const int nrL1TauJet,
169 const int nrL1JetCounts,
170 const int ifMuEtaNumberBits,
171 const int ifCaloEtaNumberBits) {
175 const std::vector<ConditionMap> &conditionMap = l1GtMenu.gtConditionMap();
176 const AlgorithmMap &algorithmMap = l1GtMenu.gtAlgorithmMap();
178 const std::vector<std::vector<L1GtMuonTemplate>> &corrMuon = l1GtMenu.corMuonTemplate();
180 const std::vector<std::vector<L1GtCaloTemplate>> &corrCalo = l1GtMenu.corCaloTemplate();
182 const std::vector<std::vector<L1GtEnergySumTemplate>> &corrEnergySum = l1GtMenu.corEnergySumTemplate();
187 bool convertScale =
false;
217 std::ostringstream myCout;
220 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
226 convertScale =
false;
241 for (std::vector<ConditionMap>::const_iterator itCondOnChip = conditionMap.begin();
242 itCondOnChip != conditionMap.end();
251 for (
CItCond itCond = itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {
253 switch ((itCond->second)->condCategory()) {
261 cMapResults[itCond->first] = muCondition;
264 std::ostringstream myCout;
265 muCondition->
print(myCout);
267 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
275 itCond->second, ptrGtPSB, nrL1NoIsoEG, nrL1IsoEG, nrL1CenJet, nrL1ForJet, nrL1TauJet, ifCaloEtaNumberBits);
282 cMapResults[itCond->first] = caloCondition;
285 std::ostringstream myCout;
286 caloCondition->
print(myCout);
288 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
299 cMapResults[itCond->first] = eSumCondition;
302 std::ostringstream myCout;
303 eSumCondition->
print(myCout);
305 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
316 cMapResults[itCond->first] = jcCondition;
319 std::ostringstream myCout;
320 jcCondition->
print(myCout);
322 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
334 cMapResults[itCond->first] = bcCondition;
337 std::ostringstream myCout;
338 bcCondition->
print(myCout);
340 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
352 cMapResults[itCond->first] = etCondition;
355 std::ostringstream myCout;
356 etCondition->
print(myCout);
358 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
365 bool castorCondResult =
false;
377 cMapResults[itCond->first] = castorCondition;
380 std::ostringstream myCout;
381 castorCondition->
print(myCout);
383 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
390 bool bptxCondResult =
true;
399 cMapResults[itCond->first] = bptxCondition;
402 std::ostringstream myCout;
403 bptxCondition->
print(myCout);
405 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
412 bool externalCondResult =
true;
421 cMapResults[itCond->first] = externalCondition;
424 std::ostringstream myCout;
425 externalCondition->
print(myCout);
427 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
438 const int cond0Ind = corrTemplate->
cond0Index();
439 const int cond1Ind = corrTemplate->
cond1Index();
445 int cond0NrL1Objects = 0;
446 int cond1NrL1Objects = 0;
448 int cond0EtaBits = 0;
449 int cond1EtaBits = 0;
451 switch (cond0Categ) {
453 cond0Condition = &((corrMuon[iChip])[cond0Ind]);
454 cond0NrL1Objects = nrL1Mu;
455 cond0EtaBits = ifMuEtaNumberBits;
458 cond0Condition = &((corrCalo[iChip])[cond0Ind]);
462 cond0NrL1Objects = nrL1NoIsoEG;
465 cond0NrL1Objects = nrL1IsoEG;
468 cond0NrL1Objects = nrL1CenJet;
471 cond0NrL1Objects = nrL1ForJet;
474 cond0NrL1Objects = nrL1TauJet;
477 cond0NrL1Objects = 0;
481 cond0EtaBits = ifCaloEtaNumberBits;
484 cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
485 cond0NrL1Objects = 1;
492 switch (cond1Categ) {
494 cond1Condition = &((corrMuon[iChip])[cond1Ind]);
495 cond1NrL1Objects = nrL1Mu;
496 cond1EtaBits = ifMuEtaNumberBits;
499 cond1Condition = &((corrCalo[iChip])[cond1Ind]);
503 cond1NrL1Objects = nrL1NoIsoEG;
506 cond1NrL1Objects = nrL1IsoEG;
509 cond1NrL1Objects = nrL1CenJet;
512 cond1NrL1Objects = nrL1ForJet;
515 cond1NrL1Objects = nrL1TauJet;
518 cond1NrL1Objects = 0;
522 cond1EtaBits = ifCaloEtaNumberBits;
525 cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
526 cond1NrL1Objects = 1;
547 cMapResults[itCond->first] = correlationCond;
550 std::ostringstream myCout;
551 correlationCond->
print(myCout);
553 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
574 std::vector<L1GlobalTriggerObjectMap> objMapVec;
575 if (produceL1GtObjectMapRecord && (iBxInEvent == 0))
576 objMapVec.reserve(numberPhysTriggers);
578 for (
CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
582 int algBitNumber = (itAlgo->second).algoBitNumber();
590 std::ostringstream myCout;
591 (itAlgo->second).
print(myCout);
594 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
598 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
610 std::ostringstream myCout1;
611 objMap.
print(myCout1);
613 LogTrace(
"L1GlobalTrigger") << myCout1.str() << std::endl;
616 objMapVec.push_back(objMap);
621 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
629 for (std::vector<L1GtAlgorithmEvaluation::ConditionEvaluationMap>::iterator itCondOnChip =
634 delete itCond->second;
635 itCond->second =
nullptr;
650 LogTrace(
"L1GlobalTrigger") <<
"\nL1GlobalTrigger: GMT data received for BxInEvent = " << iBxInEvent << std::endl;
653 LogTrace(
"L1GlobalTrigger") <<
"Number of GMT muons = " << nrL1Mu <<
"\n" << std::endl;
655 for (std::vector<const L1MuGMTCand *>::const_iterator iter =
m_candL1Mu->begin(); iter !=
m_candL1Mu->end(); iter++) {
656 LogTrace(
"L1GlobalTrigger") << *(*iter) << std::endl;
659 LogTrace(
"L1GlobalTrigger") << std::endl;