22 #include <ext/hash_map>
124 const edm::InputTag& muGmtInputTag,
const int iBxInEvent,
const bool receiveMu,
129 <<
"\n**** L1GlobalTriggerGTL receiving muon data for BxInEvent = "
130 << iBxInEvent <<
"\n from input tag " << muGmtInputTag <<
"\n"
146 <<
"\nWarning: std::vector<L1MuGMTCand> with input tag "
148 <<
"\nrequested in configuration, but not found in the event.\n"
153 std::vector<L1MuGMTCand>::const_iterator itMuon;
154 for (itMuon = muonData->begin(); itMuon != muonData->end(); itMuon++) {
155 if ((*itMuon).bx() == iBxInEvent) {
157 (*m_candL1Mu).push_back(&(*itMuon));
178 const bool produceL1GtObjectMapRecord,
179 const int iBxInEvent,
180 std::auto_ptr<L1GlobalTriggerObjectMapRecord>& gtObjectMapRecord,
181 const unsigned int numberPhysTriggers,
183 const int nrL1NoIsoEG,
const int nrL1IsoEG,
184 const int nrL1CenJet,
const int nrL1ForJet,
const int nrL1TauJet,
185 const int nrL1JetCounts,
186 const int ifMuEtaNumberBits,
const int ifCaloEtaNumberBits) {
208 const std::vector<std::vector<L1GtMuonTemplate> >& corrMuon =
211 const std::vector<std::vector<L1GtCaloTemplate> >& corrCalo =
214 const std::vector<std::vector<L1GtEnergySumTemplate> >& corrEnergySum =
221 bool convertScale =
false;
225 unsigned long long l1CaloGeometryCacheID =
241 unsigned long long l1MuTriggerScalesCacheID =
256 ifCaloEtaNumberBits, ifMuEtaNumberBits);
265 std::vector<L1GtAlgorithmEvaluation::ConditionEvaluationMap> conditionResultMaps;
266 conditionResultMaps.reserve(conditionMap.size());
270 for (std::vector<ConditionMap>::const_iterator
271 itCondOnChip = conditionMap.begin(); itCondOnChip != conditionMap.end(); itCondOnChip++) {
278 for (
CItCond itCond = itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {
281 switch ((itCond->second)->condCategory()) {
285 nrL1Mu, ifMuEtaNumberBits);
290 cMapResults[itCond->first] = muCondition;
293 std::ostringstream myCout;
294 muCondition->
print(myCout);
296 LogTrace(
"L1GlobalTriggerGTL") << myCout.str() << std::endl;
306 itCond->second, ptrGtPSB,
312 ifCaloEtaNumberBits);
317 cMapResults[itCond->first] = caloCondition;
320 std::ostringstream myCout;
321 caloCondition->
print(myCout);
323 LogTrace(
"L1GlobalTriggerGTL") << myCout.str() << std::endl;
331 itCond->second, ptrGtPSB);
336 cMapResults[itCond->first] = eSumCondition;
339 std::ostringstream myCout;
340 eSumCondition->
print(myCout);
342 LogTrace(
"L1GlobalTriggerGTL") << myCout.str() << std::endl;
350 itCond->second, ptrGtPSB, nrL1JetCounts);
355 cMapResults[itCond->first] = jcCondition;
358 std::ostringstream myCout;
359 jcCondition->
print(myCout);
361 LogTrace(
"L1GlobalTriggerGTL") << myCout.str() << std::endl;
370 itCond->second, ptrGtPSB);
375 cMapResults[itCond->first] = bcCondition;
378 std::ostringstream myCout;
379 bcCondition->
print(myCout);
381 LogTrace(
"L1GlobalTriggerGTL") << myCout.str() << std::endl;
390 itCond->second, ptrGtPSB);
395 cMapResults[itCond->first] = etCondition;
398 std::ostringstream myCout;
399 etCondition->
print(myCout);
401 LogTrace(
"L1GlobalTriggerGTL") << myCout.str() << std::endl;
409 bool castorCondResult =
false;
417 itCond->second, castorCondResult);
422 cMapResults[itCond->first] = castorCondition;
425 std::ostringstream myCout;
426 castorCondition->
print(myCout);
428 LogTrace(
"L1GlobalTriggerGTL") << myCout.str() << std::endl;
436 bool bptxCondResult =
true;
441 itCond->second, bptxCondResult);
446 cMapResults[itCond->first] = bptxCondition;
449 std::ostringstream myCout;
450 bptxCondition->
print(myCout);
452 LogTrace(
"L1GlobalTriggerGTL") << myCout.str() << std::endl;
460 bool externalCondResult =
true;
465 itCond->second, externalCondResult);
470 cMapResults[itCond->first] = externalCondition;
473 std::ostringstream myCout;
474 externalCondition->
print(myCout);
476 LogTrace(
"L1GlobalTriggerGTL") << myCout.str() << std::endl;
490 const int cond0Ind = corrTemplate->
cond0Index();
491 const int cond1Ind = corrTemplate->
cond1Index();
497 int cond0NrL1Objects = 0;
498 int cond1NrL1Objects = 0;
500 int cond0EtaBits = 0;
501 int cond1EtaBits = 0;
503 switch (cond0Categ) {
505 cond0Condition = &((corrMuon[iChip])[cond0Ind]);
506 cond0NrL1Objects = nrL1Mu;
507 cond0EtaBits = ifMuEtaNumberBits;
511 cond0Condition = &((corrCalo[iChip])[cond0Ind]);
515 cond0NrL1Objects= nrL1NoIsoEG;
518 cond0NrL1Objects = nrL1IsoEG;
521 cond0NrL1Objects = nrL1CenJet;
524 cond0NrL1Objects = nrL1ForJet;
527 cond0NrL1Objects = nrL1TauJet;
530 cond0NrL1Objects = 0;
534 cond0EtaBits = ifCaloEtaNumberBits;
538 cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
539 cond0NrL1Objects = 1;
548 switch (cond1Categ) {
550 cond1Condition = &((corrMuon[iChip])[cond1Ind]);
551 cond1NrL1Objects = nrL1Mu;
552 cond1EtaBits = ifMuEtaNumberBits;
556 cond1Condition = &((corrCalo[iChip])[cond1Ind]);
560 cond1NrL1Objects= nrL1NoIsoEG;
563 cond1NrL1Objects = nrL1IsoEG;
566 cond1NrL1Objects = nrL1CenJet;
569 cond1NrL1Objects = nrL1ForJet;
572 cond1NrL1Objects = nrL1TauJet;
575 cond1NrL1Objects = 0;
579 cond1EtaBits = ifCaloEtaNumberBits;
583 cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
584 cond1NrL1Objects = 1;
595 cond0Condition, cond1Condition,
596 cond0NrL1Objects, cond1NrL1Objects,
597 cond0EtaBits, cond1EtaBits,
603 cMapResults[itCond->first] = correlationCond;
606 std::ostringstream myCout;
607 correlationCond->
print(myCout);
609 LogTrace(
"L1GlobalTriggerGTL") << myCout.str() << std::endl;
632 conditionResultMaps.push_back(cMapResults);
639 std::vector<L1GlobalTriggerObjectMap> objMapVec;
640 objMapVec.reserve(numberPhysTriggers);
642 for (
CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
647 int algBitNumber = (itAlgo->second).algoBitNumber();
655 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
667 std::ostringstream myCout1;
668 objMap.
print(myCout1);
670 LogTrace(
"L1GlobalTriggerGTL") << myCout1.str() << std::endl;
673 objMapVec.push_back(objMap);
678 std::ostringstream myCout;
679 ( itAlgo->second ).
print(myCout);
682 LogTrace(
"L1GlobalTriggerGTL") << myCout.str() << std::endl;
688 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
689 gtObjectMapRecord->setGtObjectMap(objMapVec);
695 for (std::vector<L1GtAlgorithmEvaluation::ConditionEvaluationMap>::iterator
696 itCondOnChip = conditionResultMaps.begin(); itCondOnChip != conditionResultMaps.end();
700 itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {
702 if (itCond->second != 0) {
703 delete itCond->second;
709 itCondOnChip->clear();
712 conditionResultMaps.clear();
730 <<
"\nL1GlobalTrigger: GMT data received for BxInEvent = "
731 << iBxInEvent << std::endl;
735 <<
"Number of GMT muons = " << nrL1Mu <<
"\n"
738 for (std::vector<const L1MuGMTCand*>::const_iterator iter =
741 LogTrace(
"L1GlobalTriggerGTL") << *(*iter) << std::endl;
745 LogTrace(
"L1GlobalTriggerGTL") << std::endl;
void print(std::ostream &myCout) const
print condition
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlAlgorithmOR
void init(const int nrL1Mu, const int numberPhysTriggers)
initialize the class (mainly reserve)
void print(std::ostream &myCout) const
print condition
virtual ~L1GlobalTriggerGTL()
void run(edm::Event &iEvent, const edm::EventSetup &evSetup, const L1GlobalTriggerPSB *ptrGtPSB, const bool produceL1GtObjectMapRecord, const int iBxInEvent, std::auto_ptr< L1GlobalTriggerObjectMapRecord > >ObjectMapRecord, 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 printGmtData(const int iBxInEvent) const
print received Muon dataWord
void setAlgoName(const std::string &algoNameValue)
void print(std::ostream &myCout) const
print condition
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
void setVerbosity(const int verbosity)
const std::vector< L1GtObject > & objectType() const
get / set the trigger object type(s) in the condition
void print(std::ostream &myCout) const
print condition
void print(std::ostream &myCout) const
print condition
std::vector< const L1MuGMTCand * > * m_candL1Mu
const L1GtConditionCategory cond1Category() const
void evaluateConditionStoreResult()
call evaluateCondition and save last result
std::vector< OperandToken > & operandTokenVector()
return the vector of operand tokens
__gnu_cxx::hash_map< std::string, L1GtConditionEvaluation * > ConditionEvaluationMap
int m_verbosity
verbosity level
const L1GtTriggerMenu * m_l1GtMenu
const std::vector< CombinationsInCond > * gtAlgoCombinationVector() const
void print(std::ostream &myCout) const
print the full object map
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlDecisionWord
const L1GtConditionCategory cond0Category() const
get / set the category of the two sub-conditions
unsigned long long m_l1GtMenuCacheID
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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
print condition
L1GtConditionCategory
condition categories
void print(std::ostream &myCout) const
print condition
T const * product() const
void receiveGmtObjectData(edm::Event &, const edm::InputTag &, const int iBxInEvent, const bool receiveMu, const int nrL1Mu)
receive data from Global Muon Trigger
const bool & gtAlgoResult() const
get / set the result of the algorithm
void convert(const L1CaloGeometry *, const L1MuTriggerScales *, const int, const int)
perform all conversions
void print(std::ostream &myCout) const
print condition
void print(std::ostream &myCout) const
print condition
void setAlgoBitNumber(int algoBitNumberValue)
void print(std::ostream &myCout) const
print condition
void setCombinationVector(const std::vector< CombinationsInCond > &combinationVectorValue)
const int cond1Index() const
ConditionEvaluationMap::iterator ItEvalMap
void print(std::ostream &myCout) const
const L1CaloGeometry * m_l1CaloGeometry
void setOperandTokenVector(const std::vector< L1GtLogicParser::OperandToken > &operandTokenVectorValue)
void evaluateAlgorithm(const int chipNumber, const std::vector< ConditionEvaluationMap > &)
evaluate an algorithm
unsigned long long m_l1MuTriggerScalesCacheID
unsigned long long m_l1CaloGeometryCacheID