20 #include <ext/hash_map> 94 iC.consumes<std::vector<L1MuGMTCand>>(m_muGmtInputTag);
123 const int iBxInEvent,
const bool receiveMu,
const int nrL1Mu) {
127 <<
"\n**** L1GlobalTriggerGTL receiving muon data for BxInEvent = " 128 << iBxInEvent <<
"\n from input tag " << muGmtInputTag <<
"\n" 143 <<
"\nWarning: std::vector<L1MuGMTCand> with input tag " 145 <<
"\nrequested in configuration, but not found in the event.\n" 150 std::vector<L1MuGMTCand>::const_iterator itMuon;
151 for (itMuon = muonData->begin(); itMuon != muonData->end(); itMuon++) {
152 if ((*itMuon).bx() == iBxInEvent) {
154 (*m_candL1Mu).push_back(&(*itMuon));
172 const unsigned int numberPhysTriggers,
const int nrL1Mu,
173 const int nrL1NoIsoEG,
const int nrL1IsoEG,
const int nrL1CenJet,
174 const int nrL1ForJet,
const int nrL1TauJet,
const int nrL1JetCounts,
175 const int ifMuEtaNumberBits,
const int ifCaloEtaNumberBits) {
180 unsigned long long l1GtMenuCacheID =
194 const std::vector<std::vector<L1GtMuonTemplate>> &corrMuon =
197 const std::vector<std::vector<L1GtCaloTemplate>> &corrCalo =
200 const std::vector<std::vector<L1GtEnergySumTemplate>> &corrEnergySum =
206 bool convertScale =
false;
210 unsigned long long l1CaloGeometryCacheID =
225 unsigned long long l1MuTriggerScalesCacheID =
247 std::ostringstream myCout;
250 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
256 convertScale =
false;
271 for (std::vector<ConditionMap>::const_iterator itCondOnChip =
272 conditionMap.begin();
273 itCondOnChip != conditionMap.end(); itCondOnChip++) {
283 for (
CItCond itCond = itCondOnChip->begin(); itCond != itCondOnChip->end();
287 switch ((itCond->second)->condCategory()) {
291 itCond->second,
this, nrL1Mu, ifMuEtaNumberBits);
298 cMapResults[itCond->first] = muCondition;
301 std::ostringstream myCout;
302 muCondition->
print(myCout);
304 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
313 itCond->second, ptrGtPSB, nrL1NoIsoEG, nrL1IsoEG, nrL1CenJet,
314 nrL1ForJet, nrL1TauJet, ifCaloEtaNumberBits);
319 ((itCond->second)->objectType())[0])) /
324 cMapResults[itCond->first] = caloCondition;
327 std::ostringstream myCout;
328 caloCondition->
print(myCout);
330 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
342 cMapResults[itCond->first] = eSumCondition;
345 std::ostringstream myCout;
346 eSumCondition->
print(myCout);
348 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
360 cMapResults[itCond->first] = jcCondition;
363 std::ostringstream myCout;
364 jcCondition->
print(myCout);
366 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
379 cMapResults[itCond->first] = bcCondition;
382 std::ostringstream myCout;
383 bcCondition->
print(myCout);
385 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
398 cMapResults[itCond->first] = etCondition;
401 std::ostringstream myCout;
402 etCondition->
print(myCout);
404 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
411 bool castorCondResult =
false;
424 cMapResults[itCond->first] = castorCondition;
427 std::ostringstream myCout;
428 castorCondition->
print(myCout);
430 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
437 bool bptxCondResult =
true;
447 cMapResults[itCond->first] = bptxCondition;
450 std::ostringstream myCout;
451 bptxCondition->
print(myCout);
453 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
460 bool externalCondResult =
true;
470 cMapResults[itCond->first] = externalCondition;
473 std::ostringstream myCout;
474 externalCondition->
print(myCout);
476 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
489 const int cond0Ind = corrTemplate->
cond0Index();
490 const int cond1Ind = corrTemplate->
cond1Index();
496 int cond0NrL1Objects = 0;
497 int cond1NrL1Objects = 0;
499 int cond0EtaBits = 0;
500 int cond1EtaBits = 0;
502 switch (cond0Categ) {
504 cond0Condition = &((corrMuon[iChip])[cond0Ind]);
505 cond0NrL1Objects = nrL1Mu;
506 cond0EtaBits = ifMuEtaNumberBits;
509 cond0Condition = &((corrCalo[iChip])[cond0Ind]);
513 cond0NrL1Objects = nrL1NoIsoEG;
516 cond0NrL1Objects = nrL1IsoEG;
519 cond0NrL1Objects = nrL1CenJet;
522 cond0NrL1Objects = nrL1ForJet;
525 cond0NrL1Objects = nrL1TauJet;
528 cond0NrL1Objects = 0;
532 cond0EtaBits = ifCaloEtaNumberBits;
535 cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
536 cond0NrL1Objects = 1;
543 switch (cond1Categ) {
545 cond1Condition = &((corrMuon[iChip])[cond1Ind]);
546 cond1NrL1Objects = nrL1Mu;
547 cond1EtaBits = ifMuEtaNumberBits;
550 cond1Condition = &((corrCalo[iChip])[cond1Ind]);
554 cond1NrL1Objects = nrL1NoIsoEG;
557 cond1NrL1Objects = nrL1IsoEG;
560 cond1NrL1Objects = nrL1CenJet;
563 cond1NrL1Objects = nrL1ForJet;
566 cond1NrL1Objects = nrL1TauJet;
569 cond1NrL1Objects = 0;
573 cond1EtaBits = ifCaloEtaNumberBits;
576 cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
577 cond1NrL1Objects = 1;
586 itCond->second, cond0Condition, cond1Condition,
587 cond0NrL1Objects, cond1NrL1Objects, cond0EtaBits, cond1EtaBits,
593 cMapResults[itCond->first] = correlationCond;
596 std::ostringstream myCout;
597 correlationCond->
print(myCout);
599 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
622 std::vector<L1GlobalTriggerObjectMap> objMapVec;
623 if (produceL1GtObjectMapRecord && (iBxInEvent == 0))
624 objMapVec.reserve(numberPhysTriggers);
626 for (
CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end();
633 int algBitNumber = (itAlgo->second).algoBitNumber();
641 std::ostringstream myCout;
642 (itAlgo->second).
print(myCout);
645 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
649 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
662 std::ostringstream myCout1;
663 objMap.
print(myCout1);
665 LogTrace(
"L1GlobalTrigger") << myCout1.str() << std::endl;
668 objMapVec.push_back(objMap);
673 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
681 for (std::vector<L1GtAlgorithmEvaluation::ConditionEvaluationMap>::iterator
686 itCond != itCondOnChip->end(); itCond++) {
688 delete itCond->second;
689 itCond->second =
nullptr;
707 <<
"\nL1GlobalTrigger: GMT data received for BxInEvent = " << iBxInEvent
711 LogTrace(
"L1GlobalTrigger") <<
"Number of GMT muons = " << nrL1Mu <<
"\n" 714 for (std::vector<const L1MuGMTCand *>::const_iterator iter =
718 LogTrace(
"L1GlobalTrigger") << *(*iter) << std::endl;
721 LogTrace(
"L1GlobalTrigger") << std::endl;
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlAlgorithmOR
std::vector< L1GtAlgorithmEvaluation::ConditionEvaluationMap > m_conditionResultMaps
void init(const int nrL1Mu, const int numberPhysTriggers)
initialize the class (mainly reserve)
void print(std::ostream &myCout) const override
print condition
virtual ~L1GlobalTriggerGTL()
void printGmtData(const int iBxInEvent) const
print received Muon dataWord
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 print(std::ostream &myCout) const override
print condition
void swapGtObjectMap(std::vector< L1GlobalTriggerObjectMap > >ObjectMapValue)
void setVerbosity(const int verbosity)
void print(std::ostream &myCout) const override
print condition
std::vector< L1GtLogicParser::OperandToken > & operandTokenVector()
const std::vector< L1GtObject > & objectType() const
get / set the trigger object type(s) in the condition
void swapOperandTokenVector(std::vector< L1GtLogicParser::OperandToken > &operandTokenVectorValue)
S & print(S &os, JobReport::InputFile const &f)
const L1GtConditionCategory cond1Category() const
void evaluateConditionStoreResult()
call evaluateCondition and save last result
void print(std::ostream &myCout) const override
print condition
void print(std::ostream &myCout) const override
print condition
void setVerbosity(const int verbosity)
bool gtAlgoResult() const
get / set the result of the algorithm
void convertL1Scales(const L1CaloGeometry *, const L1MuTriggerScales *, const int, const int)
perform all scale conversions
int m_verbosity
verbosity level
const L1GtTriggerMenu * m_l1GtMenu
void print(std::ostream &myCout) const
print the full object map
L1GtConditionCategory
condition categories
void print(std::ostream &myCout) const override
print condition
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlDecisionWord
const L1GtConditionCategory cond0Category() const
get / set the category of the two sub-conditions
const unsigned int gtObjectNrBinsPhi(const L1GtObject &) const
return the number of phi bins for a GT object
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
unsigned long long m_l1GtMenuCacheID
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< const L1MuGMTCand * > * m_candL1Mu
void print(std::ostream &myCout) const override
print condition
const int cond0Index() const
get / set the index of the two sub-conditions in the cor* vector from menu
const L1MuTriggerScales * m_l1MuTriggerScales
void setAlgoGtlResult(bool algoGtlResultValue)
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
void print(std::ostream &myCout) const override
print condition
void setAlgoBitNumber(int algoBitNumberValue)
const int cond1Index() const
void setGtCorrParDeltaPhiNrBins(const int &)
virtual void print(std::ostream &myCout) const
print all the performed conversions
ConditionEvaluationMap::iterator ItEvalMap
void print(std::ostream &myCout) const
const L1CaloGeometry * m_l1CaloGeometry
__gnu_cxx::hash_map< std::string, L1GtConditionEvaluation * > ConditionEvaluationMap
copy constructor
T const * product() const
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 &)