22 #include <ext/hash_map>
125 const edm::InputTag& muGmtInputTag,
const int iBxInEvent,
const bool receiveMu,
130 <<
"\n**** L1GlobalTriggerGTL receiving muon data for BxInEvent = "
131 << iBxInEvent <<
"\n from input tag " << muGmtInputTag <<
"\n"
147 <<
"\nWarning: std::vector<L1MuGMTCand> with input tag "
149 <<
"\nrequested in configuration, but not found in the event.\n"
154 std::vector<L1MuGMTCand>::const_iterator itMuon;
155 for (itMuon = muonData->begin(); itMuon != muonData->end(); itMuon++) {
156 if ((*itMuon).bx() == iBxInEvent) {
158 (*m_candL1Mu).push_back(&(*itMuon));
179 const bool produceL1GtObjectMapRecord,
180 const int iBxInEvent,
181 std::auto_ptr<L1GlobalTriggerObjectMapRecord>& gtObjectMapRecord,
182 const unsigned int numberPhysTriggers,
184 const int nrL1NoIsoEG,
const int nrL1IsoEG,
185 const int nrL1CenJet,
const int nrL1ForJet,
const int nrL1TauJet,
186 const int nrL1JetCounts,
187 const int ifMuEtaNumberBits,
const int ifCaloEtaNumberBits) {
209 const std::vector<std::vector<L1GtMuonTemplate> >& corrMuon =
212 const std::vector<std::vector<L1GtCaloTemplate> >& corrCalo =
215 const std::vector<std::vector<L1GtEnergySumTemplate> >& corrEnergySum =
220 bool convertScale =
false;
224 unsigned long long l1CaloGeometryCacheID =
240 unsigned long long l1MuTriggerScalesCacheID =
261 std::ostringstream myCout;
264 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
270 convertScale =
false;
286 for (std::vector<ConditionMap>::const_iterator
287 itCondOnChip = conditionMap.begin(); itCondOnChip != conditionMap.end(); itCondOnChip++) {
296 for (
CItCond itCond = itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {
299 switch ((itCond->second)->condCategory()) {
303 nrL1Mu, ifMuEtaNumberBits);
311 cMapResults[itCond->first] = muCondition;
314 std::ostringstream myCout;
315 muCondition->
print(myCout);
317 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
327 itCond->second, ptrGtPSB,
333 ifCaloEtaNumberBits);
338 ((itCond->second)->objectType())[0])) / 2
342 cMapResults[itCond->first] = caloCondition;
345 std::ostringstream myCout;
346 caloCondition->
print(myCout);
348 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
356 itCond->second, ptrGtPSB);
361 cMapResults[itCond->first] = eSumCondition;
364 std::ostringstream myCout;
365 eSumCondition->
print(myCout);
367 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
375 itCond->second, ptrGtPSB, nrL1JetCounts);
380 cMapResults[itCond->first] = jcCondition;
383 std::ostringstream myCout;
384 jcCondition->
print(myCout);
386 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
395 itCond->second, ptrGtPSB);
400 cMapResults[itCond->first] = bcCondition;
403 std::ostringstream myCout;
404 bcCondition->
print(myCout);
406 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
415 itCond->second, ptrGtPSB);
420 cMapResults[itCond->first] = etCondition;
423 std::ostringstream myCout;
424 etCondition->
print(myCout);
426 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
434 bool castorCondResult =
false;
442 itCond->second, castorCondResult);
447 cMapResults[itCond->first] = castorCondition;
450 std::ostringstream myCout;
451 castorCondition->
print(myCout);
453 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
461 bool bptxCondResult =
true;
466 itCond->second, bptxCondResult);
471 cMapResults[itCond->first] = bptxCondition;
474 std::ostringstream myCout;
475 bptxCondition->
print(myCout);
477 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
485 bool externalCondResult =
true;
490 itCond->second, externalCondResult);
495 cMapResults[itCond->first] = externalCondition;
498 std::ostringstream myCout;
499 externalCondition->
print(myCout);
501 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
515 const int cond0Ind = corrTemplate->
cond0Index();
516 const int cond1Ind = corrTemplate->
cond1Index();
522 int cond0NrL1Objects = 0;
523 int cond1NrL1Objects = 0;
525 int cond0EtaBits = 0;
526 int cond1EtaBits = 0;
528 switch (cond0Categ) {
530 cond0Condition = &((corrMuon[iChip])[cond0Ind]);
531 cond0NrL1Objects = nrL1Mu;
532 cond0EtaBits = ifMuEtaNumberBits;
536 cond0Condition = &((corrCalo[iChip])[cond0Ind]);
540 cond0NrL1Objects= nrL1NoIsoEG;
543 cond0NrL1Objects = nrL1IsoEG;
546 cond0NrL1Objects = nrL1CenJet;
549 cond0NrL1Objects = nrL1ForJet;
552 cond0NrL1Objects = nrL1TauJet;
555 cond0NrL1Objects = 0;
559 cond0EtaBits = ifCaloEtaNumberBits;
563 cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
564 cond0NrL1Objects = 1;
573 switch (cond1Categ) {
575 cond1Condition = &((corrMuon[iChip])[cond1Ind]);
576 cond1NrL1Objects = nrL1Mu;
577 cond1EtaBits = ifMuEtaNumberBits;
581 cond1Condition = &((corrCalo[iChip])[cond1Ind]);
585 cond1NrL1Objects= nrL1NoIsoEG;
588 cond1NrL1Objects = nrL1IsoEG;
591 cond1NrL1Objects = nrL1CenJet;
594 cond1NrL1Objects = nrL1ForJet;
597 cond1NrL1Objects = nrL1TauJet;
600 cond1NrL1Objects = 0;
604 cond1EtaBits = ifCaloEtaNumberBits;
608 cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
609 cond1NrL1Objects = 1;
620 cond0Condition, cond1Condition,
621 cond0NrL1Objects, cond1NrL1Objects,
622 cond0EtaBits, cond1EtaBits,
628 cMapResults[itCond->first] = correlationCond;
631 std::ostringstream myCout;
632 correlationCond->
print(myCout);
634 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
662 std::vector<L1GlobalTriggerObjectMap> objMapVec;
663 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) objMapVec.reserve(numberPhysTriggers);
665 for (
CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
670 int algBitNumber = (itAlgo->second).algoBitNumber();
678 std::ostringstream myCout;
679 ( itAlgo->second ).
print(myCout);
682 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
687 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
700 std::ostringstream myCout1;
701 objMap.
print(myCout1);
703 LogTrace(
"L1GlobalTrigger") << myCout1.str() << std::endl;
706 objMapVec.push_back(objMap);
714 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
715 gtObjectMapRecord->swapGtObjectMap(objMapVec);
721 for (std::vector<L1GtAlgorithmEvaluation::ConditionEvaluationMap>::iterator
726 itCond = itCondOnChip->begin();
727 itCond != itCondOnChip->end(); itCond++) {
729 delete itCond->second;
750 <<
"\nL1GlobalTrigger: GMT data received for BxInEvent = "
751 << iBxInEvent << std::endl;
755 <<
"Number of GMT muons = " << nrL1Mu <<
"\n"
758 for (std::vector<const L1MuGMTCand*>::const_iterator iter =
761 LogTrace(
"L1GlobalTrigger") << *(*iter) << std::endl;
765 LogTrace(
"L1GlobalTrigger") << std::endl;
void print(std::ostream &myCout) const
print condition
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
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 swapCombinationVector(std::vector< CombinationsInCond > &combinationVectorValue)
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.
std::vector< CombinationsInCond > & gtAlgoCombinationVector()
void setVerbosity(const int verbosity)
__gnu_cxx::hash_map< std::string, L1GtConditionEvaluation * > ConditionEvaluationMap
copy constructor
std::vector< L1GtLogicParser::OperandToken > & operandTokenVector()
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 swapOperandTokenVector(std::vector< L1GtLogicParser::OperandToken > &operandTokenVectorValue)
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
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
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
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
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
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
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
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 &)