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"
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;
223 convertScale =
false;
238 for (std::vector<ConditionMap>::const_iterator itCondOnChip = conditionMap.begin();
239 itCondOnChip != conditionMap.end();
248 for (
CItCond itCond = itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {
250 switch ((itCond->second)->condCategory()) {
258 cMapResults[itCond->first] = muCondition;
261 std::ostringstream myCout;
262 muCondition->
print(myCout);
264 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
272 itCond->second, ptrGtPSB, nrL1NoIsoEG, nrL1IsoEG, nrL1CenJet, nrL1ForJet, nrL1TauJet, ifCaloEtaNumberBits);
279 cMapResults[itCond->first] = caloCondition;
282 std::ostringstream myCout;
283 caloCondition->
print(myCout);
285 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
296 cMapResults[itCond->first] = eSumCondition;
299 std::ostringstream myCout;
300 eSumCondition->
print(myCout);
302 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
313 cMapResults[itCond->first] = jcCondition;
316 std::ostringstream myCout;
317 jcCondition->
print(myCout);
319 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
331 cMapResults[itCond->first] = bcCondition;
334 std::ostringstream myCout;
335 bcCondition->
print(myCout);
337 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
349 cMapResults[itCond->first] = etCondition;
352 std::ostringstream myCout;
353 etCondition->
print(myCout);
355 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
362 bool castorCondResult =
false;
374 cMapResults[itCond->first] = castorCondition;
377 std::ostringstream myCout;
378 castorCondition->
print(myCout);
380 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
387 bool bptxCondResult =
true;
396 cMapResults[itCond->first] = bptxCondition;
399 std::ostringstream myCout;
400 bptxCondition->
print(myCout);
402 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
409 bool externalCondResult =
true;
418 cMapResults[itCond->first] = externalCondition;
421 std::ostringstream myCout;
422 externalCondition->
print(myCout);
424 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
435 const int cond0Ind = corrTemplate->
cond0Index();
436 const int cond1Ind = corrTemplate->
cond1Index();
442 int cond0NrL1Objects = 0;
443 int cond1NrL1Objects = 0;
445 int cond0EtaBits = 0;
446 int cond1EtaBits = 0;
448 switch (cond0Categ) {
450 cond0Condition = &((corrMuon[iChip])[cond0Ind]);
451 cond0NrL1Objects = nrL1Mu;
452 cond0EtaBits = ifMuEtaNumberBits;
455 cond0Condition = &((corrCalo[iChip])[cond0Ind]);
459 cond0NrL1Objects = nrL1NoIsoEG;
462 cond0NrL1Objects = nrL1IsoEG;
465 cond0NrL1Objects = nrL1CenJet;
468 cond0NrL1Objects = nrL1ForJet;
471 cond0NrL1Objects = nrL1TauJet;
474 cond0NrL1Objects = 0;
478 cond0EtaBits = ifCaloEtaNumberBits;
481 cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
482 cond0NrL1Objects = 1;
489 switch (cond1Categ) {
491 cond1Condition = &((corrMuon[iChip])[cond1Ind]);
492 cond1NrL1Objects = nrL1Mu;
493 cond1EtaBits = ifMuEtaNumberBits;
496 cond1Condition = &((corrCalo[iChip])[cond1Ind]);
500 cond1NrL1Objects = nrL1NoIsoEG;
503 cond1NrL1Objects = nrL1IsoEG;
506 cond1NrL1Objects = nrL1CenJet;
509 cond1NrL1Objects = nrL1ForJet;
512 cond1NrL1Objects = nrL1TauJet;
515 cond1NrL1Objects = 0;
519 cond1EtaBits = ifCaloEtaNumberBits;
522 cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
523 cond1NrL1Objects = 1;
544 cMapResults[itCond->first] = correlationCond;
547 std::ostringstream myCout;
548 correlationCond->
print(myCout);
550 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
571 std::vector<L1GlobalTriggerObjectMap> objMapVec;
572 if (produceL1GtObjectMapRecord && (iBxInEvent == 0))
573 objMapVec.reserve(numberPhysTriggers);
575 for (
CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
579 int algBitNumber = (itAlgo->second).algoBitNumber();
587 std::ostringstream myCout;
588 (itAlgo->second).
print(myCout);
591 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
595 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
607 std::ostringstream myCout1;
608 objMap.
print(myCout1);
610 LogTrace(
"L1GlobalTrigger") << myCout1.str() << std::endl;
613 objMapVec.push_back(objMap);
618 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
626 for (std::vector<L1GtAlgorithmEvaluation::ConditionEvaluationMap>::iterator itCondOnChip =
631 delete itCond->second;
632 itCond->second =
nullptr;
647 LogTrace(
"L1GlobalTrigger") <<
"\nL1GlobalTrigger: GMT data received for BxInEvent = " << iBxInEvent << std::endl;
650 LogTrace(
"L1GlobalTrigger") <<
"Number of GMT muons = " << nrL1Mu <<
"\n" << std::endl;
652 for (std::vector<const L1MuGMTCand *>::const_iterator iter =
m_candL1Mu->begin(); iter !=
m_candL1Mu->end(); iter++) {
653 LogTrace(
"L1GlobalTrigger") << *(*iter) << std::endl;
656 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)
virtual ~L1GlobalTriggerGTL()
const edm::ESGetToken< L1CaloGeometry, L1CaloGeometryRecord > m_l1CaloGeometryToken
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 swapGtObjectMap(std::vector< L1GlobalTriggerObjectMap > >ObjectMapValue)
void setVerbosity(const int verbosity)
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)
void print(std::ostream &myCout) const override
print condition
const edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > m_l1GtMenuToken
bool getData(T &iHolder) const
const L1GtConditionCategory cond1Category() const
void evaluateConditionStoreResult()
call evaluateCondition and save last result
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
void print(std::ostream &myCout) const override
print condition
int m_verbosity
verbosity level
void print(std::ostream &myCout) const
print the full object map
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
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
void print(std::ostream &myCout) const override
print condition
const edm::ESGetToken< L1MuTriggerScales, L1MuTriggerScalesRcd > m_l1MuTriggerScalesToken
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< const L1MuGMTCand * > * m_candL1Mu
std::unordered_map< std::string, L1GtConditionEvaluation * > ConditionEvaluationMap
copy constructor
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)
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
void setAlgoBitNumber(int algoBitNumberValue)
void print(std::ostream &myCout) const override
print condition
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
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 &)