20 #include <ext/hash_map>
94 iC.consumes<std::vector<L1MuGMTCand> >(m_muGmtInputTag);
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) {
206 const std::vector<std::vector<L1GtMuonTemplate> >& corrMuon =
209 const std::vector<std::vector<L1GtCaloTemplate> >& corrCalo =
212 const std::vector<std::vector<L1GtEnergySumTemplate> >& corrEnergySum =
217 bool convertScale =
false;
221 unsigned long long l1CaloGeometryCacheID =
237 unsigned long long l1MuTriggerScalesCacheID =
258 std::ostringstream myCout;
261 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
267 convertScale =
false;
283 for (std::vector<ConditionMap>::const_iterator
284 itCondOnChip = conditionMap.begin(); itCondOnChip != conditionMap.end(); itCondOnChip++) {
293 for (
CItCond itCond = itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {
296 switch ((itCond->second)->condCategory()) {
300 nrL1Mu, ifMuEtaNumberBits);
308 cMapResults[itCond->first] = muCondition;
311 std::ostringstream myCout;
312 muCondition->
print(myCout);
314 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
324 itCond->second, ptrGtPSB,
330 ifCaloEtaNumberBits);
335 ((itCond->second)->objectType())[0])) / 2
339 cMapResults[itCond->first] = caloCondition;
342 std::ostringstream myCout;
343 caloCondition->
print(myCout);
345 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
353 itCond->second, ptrGtPSB);
358 cMapResults[itCond->first] = eSumCondition;
361 std::ostringstream myCout;
362 eSumCondition->
print(myCout);
364 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
372 itCond->second, ptrGtPSB, nrL1JetCounts);
377 cMapResults[itCond->first] = jcCondition;
380 std::ostringstream myCout;
381 jcCondition->
print(myCout);
383 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
392 itCond->second, ptrGtPSB);
397 cMapResults[itCond->first] = bcCondition;
400 std::ostringstream myCout;
401 bcCondition->
print(myCout);
403 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
412 itCond->second, ptrGtPSB);
417 cMapResults[itCond->first] = etCondition;
420 std::ostringstream myCout;
421 etCondition->
print(myCout);
423 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
431 bool castorCondResult =
false;
439 itCond->second, castorCondResult);
444 cMapResults[itCond->first] = castorCondition;
447 std::ostringstream myCout;
448 castorCondition->
print(myCout);
450 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
458 bool bptxCondResult =
true;
463 itCond->second, bptxCondResult);
468 cMapResults[itCond->first] = bptxCondition;
471 std::ostringstream myCout;
472 bptxCondition->
print(myCout);
474 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
482 bool externalCondResult =
true;
487 itCond->second, externalCondResult);
492 cMapResults[itCond->first] = externalCondition;
495 std::ostringstream myCout;
496 externalCondition->
print(myCout);
498 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
512 const int cond0Ind = corrTemplate->
cond0Index();
513 const int cond1Ind = corrTemplate->
cond1Index();
519 int cond0NrL1Objects = 0;
520 int cond1NrL1Objects = 0;
522 int cond0EtaBits = 0;
523 int cond1EtaBits = 0;
525 switch (cond0Categ) {
527 cond0Condition = &((corrMuon[iChip])[cond0Ind]);
528 cond0NrL1Objects = nrL1Mu;
529 cond0EtaBits = ifMuEtaNumberBits;
533 cond0Condition = &((corrCalo[iChip])[cond0Ind]);
537 cond0NrL1Objects= nrL1NoIsoEG;
540 cond0NrL1Objects = nrL1IsoEG;
543 cond0NrL1Objects = nrL1CenJet;
546 cond0NrL1Objects = nrL1ForJet;
549 cond0NrL1Objects = nrL1TauJet;
552 cond0NrL1Objects = 0;
556 cond0EtaBits = ifCaloEtaNumberBits;
560 cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
561 cond0NrL1Objects = 1;
570 switch (cond1Categ) {
572 cond1Condition = &((corrMuon[iChip])[cond1Ind]);
573 cond1NrL1Objects = nrL1Mu;
574 cond1EtaBits = ifMuEtaNumberBits;
578 cond1Condition = &((corrCalo[iChip])[cond1Ind]);
582 cond1NrL1Objects= nrL1NoIsoEG;
585 cond1NrL1Objects = nrL1IsoEG;
588 cond1NrL1Objects = nrL1CenJet;
591 cond1NrL1Objects = nrL1ForJet;
594 cond1NrL1Objects = nrL1TauJet;
597 cond1NrL1Objects = 0;
601 cond1EtaBits = ifCaloEtaNumberBits;
605 cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
606 cond1NrL1Objects = 1;
617 cond0Condition, cond1Condition,
618 cond0NrL1Objects, cond1NrL1Objects,
619 cond0EtaBits, cond1EtaBits,
625 cMapResults[itCond->first] = correlationCond;
628 std::ostringstream myCout;
629 correlationCond->
print(myCout);
631 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
659 std::vector<L1GlobalTriggerObjectMap> objMapVec;
660 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) objMapVec.reserve(numberPhysTriggers);
662 for (
CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
667 int algBitNumber = (itAlgo->second).algoBitNumber();
675 std::ostringstream myCout;
676 ( itAlgo->second ).
print(myCout);
679 LogTrace(
"L1GlobalTrigger") << myCout.str() << std::endl;
684 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
697 std::ostringstream myCout1;
698 objMap.
print(myCout1);
700 LogTrace(
"L1GlobalTrigger") << myCout1.str() << std::endl;
703 objMapVec.push_back(objMap);
711 if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
712 gtObjectMapRecord->swapGtObjectMap(objMapVec);
718 for (std::vector<L1GtAlgorithmEvaluation::ConditionEvaluationMap>::iterator
723 itCond = itCondOnChip->begin();
724 itCond != itCondOnChip->end(); itCond++) {
726 delete itCond->second;
747 <<
"\nL1GlobalTrigger: GMT data received for BxInEvent = "
748 << iBxInEvent << std::endl;
752 <<
"Number of GMT muons = " << nrL1Mu <<
"\n"
755 for (std::vector<const L1MuGMTCand*>::const_iterator iter =
758 LogTrace(
"L1GlobalTrigger") << *(*iter) << std::endl;
762 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()
L1GlobalTriggerGTL(const edm::InputTag &mutag, edm::ConsumesCollector &&iC)
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 &)