Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:47:14

0001 /**
0002  * \class L1GtTriggerMenu
0003  *
0004  *
0005  * Description: L1 trigger menu.
0006  *
0007  * Implementation:
0008  *    <TODO: enter implementation details>
0009  *
0010  * \author: Vasile Mihai Ghete - HEPHY Vienna
0011  *
0012  * $Date$
0013  * $Revision$
0014  *
0015  */
0016 
0017 // this class header
0018 #include "CondFormats/L1TObjects/interface/L1GtTriggerMenu.h"
0019 
0020 // system include files
0021 #include <iostream>
0022 #include <iomanip>
0023 
0024 // user include files
0025 #include "CondFormats/L1TObjects/interface/L1GtCondition.h"
0026 #include "CondFormats/L1TObjects/interface/L1GtAlgorithm.h"
0027 
0028 // forward declarations
0029 
0030 // constructor
0031 L1GtTriggerMenu::L1GtTriggerMenu()
0032     : m_triggerMenuInterface("NULL"),
0033       m_triggerMenuName("NULL"),
0034       m_triggerMenuImplementation("NULL"),
0035       m_scaleDbKey("NULL") {
0036   // empty
0037 }
0038 
0039 L1GtTriggerMenu::L1GtTriggerMenu(const std::string& triggerMenuNameVal,
0040                                  const unsigned int numberConditionChips,
0041                                  const std::vector<std::vector<L1GtMuonTemplate> >& vecMuonTemplateVal,
0042                                  const std::vector<std::vector<L1GtCaloTemplate> >& vecCaloTemplateVal,
0043                                  const std::vector<std::vector<L1GtEnergySumTemplate> >& vecEnergySumTemplateVal,
0044                                  const std::vector<std::vector<L1GtJetCountsTemplate> >& vecJetCountsTemplateVal,
0045                                  const std::vector<std::vector<L1GtCastorTemplate> >& vecCastorTemplateVal,
0046                                  const std::vector<std::vector<L1GtHfBitCountsTemplate> >& vecHfBitCountsTemplateVal,
0047                                  const std::vector<std::vector<L1GtHfRingEtSumsTemplate> >& vecHfRingEtSumsTemplateVal,
0048                                  const std::vector<std::vector<L1GtBptxTemplate> >& vecBptxTemplateVal,
0049                                  const std::vector<std::vector<L1GtExternalTemplate> >& vecExternalTemplateVal,
0050                                  const std::vector<std::vector<L1GtCorrelationTemplate> >& vecCorrelationTemplateVal,
0051                                  const std::vector<std::vector<L1GtMuonTemplate> >& corMuonTemplateVal,
0052                                  const std::vector<std::vector<L1GtCaloTemplate> >& corCaloTemplateVal,
0053                                  const std::vector<std::vector<L1GtEnergySumTemplate> >& corEnergySumTemplateVal
0054 
0055                                  )
0056     : m_triggerMenuInterface("NULL"),
0057       m_triggerMenuName(triggerMenuNameVal),
0058       m_triggerMenuImplementation("NULL"),
0059       m_scaleDbKey("NULL"),
0060       m_vecMuonTemplate(vecMuonTemplateVal),
0061       m_vecCaloTemplate(vecCaloTemplateVal),
0062       m_vecEnergySumTemplate(vecEnergySumTemplateVal),
0063       m_vecJetCountsTemplate(vecJetCountsTemplateVal),
0064       m_vecCastorTemplate(vecCastorTemplateVal),
0065       m_vecHfBitCountsTemplate(vecHfBitCountsTemplateVal),
0066       m_vecHfRingEtSumsTemplate(vecHfRingEtSumsTemplateVal),
0067       m_vecBptxTemplate(vecBptxTemplateVal),
0068       m_vecExternalTemplate(vecExternalTemplateVal),
0069       m_vecCorrelationTemplate(vecCorrelationTemplateVal),
0070       m_corMuonTemplate(corMuonTemplateVal),
0071       m_corCaloTemplate(corCaloTemplateVal),
0072       m_corEnergySumTemplate(corEnergySumTemplateVal) {
0073   m_conditionMap.resize(numberConditionChips);
0074   buildGtConditionMap();
0075 }
0076 
0077 // copy constructor
0078 L1GtTriggerMenu::L1GtTriggerMenu(const L1GtTriggerMenu& rhs) {
0079   m_triggerMenuInterface = rhs.m_triggerMenuInterface;
0080   m_triggerMenuName = rhs.m_triggerMenuName;
0081   m_triggerMenuImplementation = rhs.m_triggerMenuImplementation;
0082   m_scaleDbKey = rhs.m_scaleDbKey;
0083 
0084   // copy physics conditions
0085   m_vecMuonTemplate = rhs.m_vecMuonTemplate;
0086   m_vecCaloTemplate = rhs.m_vecCaloTemplate;
0087   m_vecEnergySumTemplate = rhs.m_vecEnergySumTemplate;
0088   m_vecJetCountsTemplate = rhs.m_vecJetCountsTemplate;
0089   m_vecCastorTemplate = rhs.m_vecCastorTemplate;
0090   m_vecHfBitCountsTemplate = rhs.m_vecHfBitCountsTemplate;
0091   m_vecHfRingEtSumsTemplate = rhs.m_vecHfRingEtSumsTemplate;
0092   m_vecBptxTemplate = rhs.m_vecBptxTemplate;
0093   m_vecExternalTemplate = rhs.m_vecExternalTemplate;
0094 
0095   m_vecCorrelationTemplate = rhs.m_vecCorrelationTemplate;
0096   m_corMuonTemplate = rhs.m_corMuonTemplate;
0097   m_corCaloTemplate = rhs.m_corCaloTemplate;
0098   m_corEnergySumTemplate = rhs.m_corEnergySumTemplate;
0099 
0100   // rebuild condition map to update the pointers
0101   // (only physics conditions are included in it)
0102   m_conditionMap.resize(rhs.m_conditionMap.size());
0103   (*this).buildGtConditionMap();
0104 
0105   // copy algorithm map
0106   m_algorithmMap = rhs.m_algorithmMap;
0107   m_algorithmAliasMap = rhs.m_algorithmAliasMap;
0108 
0109   // copy technical triggers
0110   // (separate map for technical triggers and physics triggers)
0111   m_technicalTriggerMap = rhs.m_technicalTriggerMap;
0112 }
0113 
0114 // destructor
0115 L1GtTriggerMenu::~L1GtTriggerMenu() {
0116   // loop over condition maps (one map per condition chip)
0117   for (std::vector<ConditionMap>::iterator itCondOnChip = m_conditionMap.begin(); itCondOnChip != m_conditionMap.end();
0118        itCondOnChip++) {
0119     itCondOnChip->clear();
0120   }
0121 
0122   m_algorithmMap.clear();
0123   m_algorithmAliasMap.clear();
0124 }
0125 
0126 // assignment operator
0127 L1GtTriggerMenu& L1GtTriggerMenu::operator=(const L1GtTriggerMenu& rhs) {
0128   if (this != &rhs) {
0129     m_triggerMenuInterface = rhs.m_triggerMenuInterface;
0130     m_triggerMenuName = rhs.m_triggerMenuName;
0131     m_triggerMenuImplementation = rhs.m_triggerMenuImplementation;
0132 
0133     m_vecMuonTemplate = rhs.m_vecMuonTemplate;
0134     m_vecCaloTemplate = rhs.m_vecCaloTemplate;
0135     m_vecEnergySumTemplate = rhs.m_vecEnergySumTemplate;
0136     m_vecJetCountsTemplate = rhs.m_vecJetCountsTemplate;
0137     m_vecCastorTemplate = rhs.m_vecCastorTemplate;
0138     m_vecHfBitCountsTemplate = rhs.m_vecHfBitCountsTemplate;
0139     m_vecHfRingEtSumsTemplate = rhs.m_vecHfRingEtSumsTemplate;
0140     m_vecBptxTemplate = rhs.m_vecBptxTemplate;
0141     m_vecExternalTemplate = rhs.m_vecExternalTemplate;
0142 
0143     m_vecCorrelationTemplate = rhs.m_vecCorrelationTemplate;
0144     m_corMuonTemplate = rhs.m_corMuonTemplate;
0145     m_corCaloTemplate = rhs.m_corCaloTemplate;
0146     m_corEnergySumTemplate = rhs.m_corEnergySumTemplate;
0147 
0148     m_algorithmMap = rhs.m_algorithmMap;
0149     m_algorithmAliasMap = rhs.m_algorithmAliasMap;
0150 
0151     m_technicalTriggerMap = rhs.m_technicalTriggerMap;
0152   }
0153 
0154   // rebuild condition map to update the pointers
0155   // (only physics conditions are included in it)
0156   m_conditionMap.resize(rhs.m_conditionMap.size());
0157   (*this).buildGtConditionMap();
0158 
0159   // return the object
0160   return *this;
0161 }
0162 
0163 // set the condition maps
0164 void L1GtTriggerMenu::setGtConditionMap(const std::vector<ConditionMap>& condMap) { m_conditionMap = condMap; }
0165 
0166 // build the condition maps
0167 void L1GtTriggerMenu::buildGtConditionMap() {
0168   // clear the conditions from the maps, if any
0169   for (std::vector<ConditionMap>::iterator itCondOnChip = m_conditionMap.begin(); itCondOnChip != m_conditionMap.end();
0170        itCondOnChip++) {
0171     itCondOnChip->clear();
0172   }
0173 
0174   // always check that the size of the condition map is greater than the size
0175   // of the specific condition vector
0176   size_t condMapSize = m_conditionMap.size();
0177 
0178   //
0179   size_t vecMuonSize = m_vecMuonTemplate.size();
0180   if (condMapSize < vecMuonSize) {
0181     m_conditionMap.resize(vecMuonSize);
0182     condMapSize = m_conditionMap.size();
0183   }
0184 
0185   int chipNr = -1;
0186 
0187   for (std::vector<std::vector<L1GtMuonTemplate> >::iterator itCondOnChip = m_vecMuonTemplate.begin();
0188        itCondOnChip != m_vecMuonTemplate.end();
0189        itCondOnChip++) {
0190     chipNr++;
0191 
0192     for (std::vector<L1GtMuonTemplate>::iterator itCond = itCondOnChip->begin(); itCond != itCondOnChip->end();
0193          itCond++) {
0194       (m_conditionMap.at(chipNr))[itCond->condName()] = &(*itCond);
0195     }
0196   }
0197 
0198   //
0199   size_t vecCaloSize = m_vecCaloTemplate.size();
0200   if (condMapSize < vecCaloSize) {
0201     m_conditionMap.resize(vecCaloSize);
0202     condMapSize = m_conditionMap.size();
0203   }
0204 
0205   chipNr = -1;
0206   for (std::vector<std::vector<L1GtCaloTemplate> >::iterator itCondOnChip = m_vecCaloTemplate.begin();
0207        itCondOnChip != m_vecCaloTemplate.end();
0208        itCondOnChip++) {
0209     chipNr++;
0210 
0211     for (std::vector<L1GtCaloTemplate>::iterator itCond = itCondOnChip->begin(); itCond != itCondOnChip->end();
0212          itCond++) {
0213       (m_conditionMap.at(chipNr))[itCond->condName()] = &(*itCond);
0214     }
0215   }
0216 
0217   //
0218   size_t vecEnergySumSize = m_vecEnergySumTemplate.size();
0219   if (condMapSize < vecEnergySumSize) {
0220     m_conditionMap.resize(vecEnergySumSize);
0221     condMapSize = m_conditionMap.size();
0222   }
0223 
0224   chipNr = -1;
0225   for (std::vector<std::vector<L1GtEnergySumTemplate> >::iterator itCondOnChip = m_vecEnergySumTemplate.begin();
0226        itCondOnChip != m_vecEnergySumTemplate.end();
0227        itCondOnChip++) {
0228     chipNr++;
0229 
0230     for (std::vector<L1GtEnergySumTemplate>::iterator itCond = itCondOnChip->begin(); itCond != itCondOnChip->end();
0231          itCond++) {
0232       (m_conditionMap.at(chipNr))[itCond->condName()] = &(*itCond);
0233     }
0234   }
0235 
0236   //
0237   size_t vecJetCountsSize = m_vecJetCountsTemplate.size();
0238   if (condMapSize < vecJetCountsSize) {
0239     m_conditionMap.resize(vecJetCountsSize);
0240     condMapSize = m_conditionMap.size();
0241   }
0242 
0243   chipNr = -1;
0244   for (std::vector<std::vector<L1GtJetCountsTemplate> >::iterator itCondOnChip = m_vecJetCountsTemplate.begin();
0245        itCondOnChip != m_vecJetCountsTemplate.end();
0246        itCondOnChip++) {
0247     chipNr++;
0248 
0249     for (std::vector<L1GtJetCountsTemplate>::iterator itCond = itCondOnChip->begin(); itCond != itCondOnChip->end();
0250          itCond++) {
0251       (m_conditionMap.at(chipNr))[itCond->condName()] = &(*itCond);
0252     }
0253   }
0254 
0255   //
0256   size_t vecCastorSize = m_vecCastorTemplate.size();
0257   if (condMapSize < vecCastorSize) {
0258     m_conditionMap.resize(vecCastorSize);
0259     condMapSize = m_conditionMap.size();
0260   }
0261 
0262   chipNr = -1;
0263   for (std::vector<std::vector<L1GtCastorTemplate> >::iterator itCondOnChip = m_vecCastorTemplate.begin();
0264        itCondOnChip != m_vecCastorTemplate.end();
0265        itCondOnChip++) {
0266     chipNr++;
0267 
0268     for (std::vector<L1GtCastorTemplate>::iterator itCond = itCondOnChip->begin(); itCond != itCondOnChip->end();
0269          itCond++) {
0270       (m_conditionMap.at(chipNr))[itCond->condName()] = &(*itCond);
0271     }
0272   }
0273 
0274   //
0275   size_t vecHfBitCountsSize = m_vecHfBitCountsTemplate.size();
0276   if (condMapSize < vecHfBitCountsSize) {
0277     m_conditionMap.resize(vecHfBitCountsSize);
0278     condMapSize = m_conditionMap.size();
0279   }
0280 
0281   chipNr = -1;
0282   for (std::vector<std::vector<L1GtHfBitCountsTemplate> >::iterator itCondOnChip = m_vecHfBitCountsTemplate.begin();
0283        itCondOnChip != m_vecHfBitCountsTemplate.end();
0284        itCondOnChip++) {
0285     chipNr++;
0286 
0287     for (std::vector<L1GtHfBitCountsTemplate>::iterator itCond = itCondOnChip->begin(); itCond != itCondOnChip->end();
0288          itCond++) {
0289       (m_conditionMap.at(chipNr))[itCond->condName()] = &(*itCond);
0290     }
0291   }
0292 
0293   //
0294   size_t vecHfRingEtSumsSize = m_vecHfRingEtSumsTemplate.size();
0295   if (condMapSize < vecHfRingEtSumsSize) {
0296     m_conditionMap.resize(vecHfRingEtSumsSize);
0297     condMapSize = m_conditionMap.size();
0298   }
0299 
0300   chipNr = -1;
0301   for (std::vector<std::vector<L1GtHfRingEtSumsTemplate> >::iterator itCondOnChip = m_vecHfRingEtSumsTemplate.begin();
0302        itCondOnChip != m_vecHfRingEtSumsTemplate.end();
0303        itCondOnChip++) {
0304     chipNr++;
0305 
0306     for (std::vector<L1GtHfRingEtSumsTemplate>::iterator itCond = itCondOnChip->begin(); itCond != itCondOnChip->end();
0307          itCond++) {
0308       (m_conditionMap.at(chipNr))[itCond->condName()] = &(*itCond);
0309     }
0310   }
0311 
0312   //
0313   size_t vecBptxSize = m_vecBptxTemplate.size();
0314   if (condMapSize < vecBptxSize) {
0315     m_conditionMap.resize(vecBptxSize);
0316     condMapSize = m_conditionMap.size();
0317   }
0318 
0319   chipNr = -1;
0320   for (std::vector<std::vector<L1GtBptxTemplate> >::iterator itCondOnChip = m_vecBptxTemplate.begin();
0321        itCondOnChip != m_vecBptxTemplate.end();
0322        itCondOnChip++) {
0323     chipNr++;
0324 
0325     for (std::vector<L1GtBptxTemplate>::iterator itCond = itCondOnChip->begin(); itCond != itCondOnChip->end();
0326          itCond++) {
0327       (m_conditionMap.at(chipNr))[itCond->condName()] = &(*itCond);
0328     }
0329   }
0330 
0331   //
0332   size_t vecExternalSize = m_vecExternalTemplate.size();
0333   if (condMapSize < vecExternalSize) {
0334     m_conditionMap.resize(vecExternalSize);
0335     condMapSize = m_conditionMap.size();
0336   }
0337 
0338   chipNr = -1;
0339   for (std::vector<std::vector<L1GtExternalTemplate> >::iterator itCondOnChip = m_vecExternalTemplate.begin();
0340        itCondOnChip != m_vecExternalTemplate.end();
0341        itCondOnChip++) {
0342     chipNr++;
0343 
0344     for (std::vector<L1GtExternalTemplate>::iterator itCond = itCondOnChip->begin(); itCond != itCondOnChip->end();
0345          itCond++) {
0346       (m_conditionMap.at(chipNr))[itCond->condName()] = &(*itCond);
0347     }
0348   }
0349 
0350   //
0351   size_t vecCorrelationSize = m_vecCorrelationTemplate.size();
0352   if (condMapSize < vecCorrelationSize) {
0353     m_conditionMap.resize(vecCorrelationSize);
0354     condMapSize = m_conditionMap.size();
0355   }
0356 
0357   chipNr = -1;
0358   for (std::vector<std::vector<L1GtCorrelationTemplate> >::iterator itCondOnChip = m_vecCorrelationTemplate.begin();
0359        itCondOnChip != m_vecCorrelationTemplate.end();
0360        itCondOnChip++) {
0361     chipNr++;
0362 
0363     for (std::vector<L1GtCorrelationTemplate>::iterator itCond = itCondOnChip->begin(); itCond != itCondOnChip->end();
0364          itCond++) {
0365       (m_conditionMap.at(chipNr))[itCond->condName()] = &(*itCond);
0366     }
0367   }
0368 }
0369 
0370 // set the trigger menu name
0371 void L1GtTriggerMenu::setGtTriggerMenuInterface(const std::string& menuInterface) {
0372   m_triggerMenuInterface = menuInterface;
0373 }
0374 
0375 void L1GtTriggerMenu::setGtTriggerMenuName(const std::string& menuName) { m_triggerMenuName = menuName; }
0376 
0377 void L1GtTriggerMenu::setGtTriggerMenuImplementation(const std::string& menuImplementation) {
0378   m_triggerMenuImplementation = menuImplementation;
0379 }
0380 
0381 // set menu associated scale key
0382 void L1GtTriggerMenu::setGtScaleDbKey(const std::string& scaleKey) { m_scaleDbKey = scaleKey; }
0383 
0384 // get / set the vectors containing the conditions
0385 void L1GtTriggerMenu::setVecMuonTemplate(const std::vector<std::vector<L1GtMuonTemplate> >& vecMuonTempl) {
0386   m_vecMuonTemplate = vecMuonTempl;
0387 }
0388 
0389 void L1GtTriggerMenu::setVecCaloTemplate(const std::vector<std::vector<L1GtCaloTemplate> >& vecCaloTempl) {
0390   m_vecCaloTemplate = vecCaloTempl;
0391 }
0392 
0393 void L1GtTriggerMenu::setVecEnergySumTemplate(
0394     const std::vector<std::vector<L1GtEnergySumTemplate> >& vecEnergySumTempl) {
0395   m_vecEnergySumTemplate = vecEnergySumTempl;
0396 }
0397 
0398 void L1GtTriggerMenu::setVecJetCountsTemplate(
0399     const std::vector<std::vector<L1GtJetCountsTemplate> >& vecJetCountsTempl) {
0400   m_vecJetCountsTemplate = vecJetCountsTempl;
0401 }
0402 
0403 void L1GtTriggerMenu::setVecCastorTemplate(const std::vector<std::vector<L1GtCastorTemplate> >& vecCastorTempl) {
0404   m_vecCastorTemplate = vecCastorTempl;
0405 }
0406 
0407 void L1GtTriggerMenu::setVecHfBitCountsTemplate(
0408     const std::vector<std::vector<L1GtHfBitCountsTemplate> >& vecHfBitCountsTempl) {
0409   m_vecHfBitCountsTemplate = vecHfBitCountsTempl;
0410 }
0411 
0412 void L1GtTriggerMenu::setVecHfRingEtSumsTemplate(
0413     const std::vector<std::vector<L1GtHfRingEtSumsTemplate> >& vecHfRingEtSumsTempl) {
0414   m_vecHfRingEtSumsTemplate = vecHfRingEtSumsTempl;
0415 }
0416 
0417 void L1GtTriggerMenu::setVecBptxTemplate(const std::vector<std::vector<L1GtBptxTemplate> >& vecBptxTempl) {
0418   m_vecBptxTemplate = vecBptxTempl;
0419 }
0420 
0421 void L1GtTriggerMenu::setVecExternalTemplate(const std::vector<std::vector<L1GtExternalTemplate> >& vecExternalTempl) {
0422   m_vecExternalTemplate = vecExternalTempl;
0423 }
0424 
0425 void L1GtTriggerMenu::setVecCorrelationTemplate(
0426     const std::vector<std::vector<L1GtCorrelationTemplate> >& vecCorrelationTempl) {
0427   m_vecCorrelationTemplate = vecCorrelationTempl;
0428 }
0429 
0430 // set the vectors containing the conditions for correlation templates
0431 void L1GtTriggerMenu::setCorMuonTemplate(const std::vector<std::vector<L1GtMuonTemplate> >& corMuonTempl) {
0432   m_corMuonTemplate = corMuonTempl;
0433 }
0434 
0435 void L1GtTriggerMenu::setCorCaloTemplate(const std::vector<std::vector<L1GtCaloTemplate> >& corCaloTempl) {
0436   m_corCaloTemplate = corCaloTempl;
0437 }
0438 
0439 void L1GtTriggerMenu::setCorEnergySumTemplate(
0440     const std::vector<std::vector<L1GtEnergySumTemplate> >& corEnergySumTempl) {
0441   m_corEnergySumTemplate = corEnergySumTempl;
0442 }
0443 
0444 // set the algorithm map (by algorithm names)
0445 void L1GtTriggerMenu::setGtAlgorithmMap(const AlgorithmMap& algoMap) { m_algorithmMap = algoMap; }
0446 
0447 // set the algorithm map (by algorithm aliases)
0448 void L1GtTriggerMenu::setGtAlgorithmAliasMap(const AlgorithmMap& algoMap) { m_algorithmAliasMap = algoMap; }
0449 
0450 // set the technical trigger map
0451 void L1GtTriggerMenu::setGtTechnicalTriggerMap(const AlgorithmMap& ttMap) { m_technicalTriggerMap = ttMap; }
0452 
0453 // print the trigger menu (bit number, algorithm name, logical expression)
0454 void L1GtTriggerMenu::print(std::ostream& myCout, int& printVerbosity) const {
0455   // use another map <int, L1GtAlgorithm> to get the menu sorted after bit number
0456   // both algorithm and bit numbers are unique
0457   std::map<int, const L1GtAlgorithm*> algoBitToAlgo;
0458   typedef std::map<int, const L1GtAlgorithm*>::const_iterator CItBit;
0459 
0460   for (CItAlgo itAlgo = m_algorithmMap.begin(); itAlgo != m_algorithmMap.end(); itAlgo++) {
0461     int bitNumber = (itAlgo->second).algoBitNumber();
0462     algoBitToAlgo[bitNumber] = &(itAlgo->second);
0463   }
0464 
0465   size_t nrDefinedAlgo = algoBitToAlgo.size();
0466 
0467   // idem for technical trigger map - only name and bit number are relevant for them
0468   std::map<int, const L1GtAlgorithm*> ttBitToTt;
0469 
0470   for (CItAlgo itAlgo = m_technicalTriggerMap.begin(); itAlgo != m_technicalTriggerMap.end(); itAlgo++) {
0471     int bitNumber = (itAlgo->second).algoBitNumber();
0472     ttBitToTt[bitNumber] = &(itAlgo->second);
0473   }
0474 
0475   size_t nrDefinedTechTrig = ttBitToTt.size();
0476 
0477   //
0478 
0479   switch (printVerbosity) {
0480     case 0: {
0481       // header for printing algorithms
0482 
0483       myCout << "\n   ********** L1 Trigger Menu - printing   ********** \n"
0484              << "\nL1 Trigger Menu Interface: " << m_triggerMenuInterface
0485              << "\nL1 Trigger Menu Name:      " << m_triggerMenuName
0486              << "\nL1 Trigger Menu Implementation: " << m_triggerMenuImplementation
0487              << "\nAssociated Scale DB Key: " << m_scaleDbKey << "\n\n"
0488              << "\nL1 Physics Algorithms: " << nrDefinedAlgo << " algorithms defined."
0489              << "\n\n"
0490              << "Bit Number " << std::right << std::setw(35) << "Algorithm Name"
0491              << "  " << std::right << std::setw(35) << "Algorithm Alias" << std::endl;
0492 
0493       for (CItBit itBit = algoBitToAlgo.begin(); itBit != algoBitToAlgo.end(); itBit++) {
0494         int bitNumber = itBit->first;
0495         std::string aName = (itBit->second)->algoName();
0496         std::string aAlias = (itBit->second)->algoAlias();
0497 
0498         myCout << std::setw(6) << bitNumber << "     " << std::right << std::setw(35) << aName << "  " << std::right
0499                << std::setw(35) << aAlias << std::endl;
0500       }
0501 
0502       myCout << "\nL1 Technical Triggers: " << nrDefinedTechTrig << " technical triggers defined."
0503              << "\n\n"
0504              << std::endl;
0505       if (nrDefinedTechTrig) {
0506         myCout << "Bit Number "
0507                << " Technical trigger name " << std::endl;
0508       }
0509 
0510       for (CItBit itBit = ttBitToTt.begin(); itBit != ttBitToTt.end(); itBit++) {
0511         int bitNumber = itBit->first;
0512         std::string aName = (itBit->second)->algoName();
0513         std::string aAlias = (itBit->second)->algoAlias();
0514 
0515         myCout << std::setw(6) << bitNumber << "       " << std::right << std::setw(35) << aName << "  " << std::right
0516                << std::setw(35) << aAlias << std::endl;
0517       }
0518 
0519     } break;
0520 
0521     case 1: {
0522       // header for printing algorithms
0523 
0524       myCout << "\n   ********** L1 Trigger Menu - printing   ********** \n"
0525              << "\nL1 Trigger Menu Interface: " << m_triggerMenuInterface
0526              << "\nL1 Trigger Menu Name:      " << m_triggerMenuName
0527              << "\nL1 Trigger Menu Implementation: " << m_triggerMenuImplementation
0528              << "\nAssociated Scale DB Key: " << m_scaleDbKey << "\n\n"
0529              << "\nL1 Physics Algorithms: " << nrDefinedAlgo << " algorithms defined."
0530              << "\n\n"
0531              << "Bit Number " << std::right << std::setw(35) << "Algorithm Name"
0532              << "  " << std::right << std::setw(35) << "Algorithm Alias"
0533              << "\n  Logical Expression \n"
0534              << std::endl;
0535 
0536       for (CItBit itBit = algoBitToAlgo.begin(); itBit != algoBitToAlgo.end(); itBit++) {
0537         int bitNumber = itBit->first;
0538         std::string aName = (itBit->second)->algoName();
0539         std::string aAlias = (itBit->second)->algoAlias();
0540         std::string aLogicalExpression = (itBit->second)->algoLogicalExpression();
0541 
0542         myCout << std::setw(6) << bitNumber << "     " << std::right << std::setw(35) << aName << "  " << std::right
0543                << std::setw(35) << aAlias << "\n  Logical expression: " << aLogicalExpression << "\n"
0544                << std::endl;
0545       }
0546 
0547       myCout << "\nL1 Technical Triggers: " << nrDefinedTechTrig << " technical triggers defined."
0548              << "\n\n"
0549              << std::endl;
0550       if (nrDefinedTechTrig) {
0551         myCout << "Bit Number "
0552                << " Technical trigger name " << std::endl;
0553       }
0554 
0555       for (CItBit itBit = ttBitToTt.begin(); itBit != ttBitToTt.end(); itBit++) {
0556         int bitNumber = itBit->first;
0557         std::string aName = (itBit->second)->algoName();
0558 
0559         myCout << std::setw(6) << bitNumber << "       " << aName << std::endl;
0560       }
0561     } break;
0562 
0563     case 2: {
0564       // header for printing algorithms
0565 
0566       myCout << "\n   ********** L1 Trigger Menu - printing   ********** \n"
0567              << "\nL1 Trigger Menu Interface: " << m_triggerMenuInterface
0568              << "\nL1 Trigger Menu Name:      " << m_triggerMenuName
0569              << "\nL1 Trigger Menu Implementation: " << m_triggerMenuImplementation
0570              << "\nAssociated Scale DB Key: " << m_scaleDbKey << "\n\n"
0571              << "\nL1 Physics Algorithms: " << nrDefinedAlgo << " algorithms defined."
0572              << "\n\n"
0573              << std::endl;
0574 
0575       for (CItBit itBit = algoBitToAlgo.begin(); itBit != algoBitToAlgo.end(); itBit++) {
0576         (itBit->second)->print(myCout);
0577       }
0578 
0579       myCout << "\nNumber of condition chips: " << m_conditionMap.size() << "\n" << std::endl;
0580 
0581       int chipNr = -1;
0582       int totalNrConditions = 0;
0583 
0584       for (std::vector<ConditionMap>::const_iterator itCondOnChip = m_conditionMap.begin();
0585            itCondOnChip != m_conditionMap.end();
0586            itCondOnChip++) {
0587         chipNr++;
0588 
0589         int condMapSize = itCondOnChip->size();
0590         totalNrConditions += condMapSize;
0591 
0592         myCout << "\nTotal number of conditions on condition chip " << chipNr << ": " << condMapSize << " conditions.\n"
0593                << std::endl;
0594 
0595         for (CItCond itCond = itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {
0596           (itCond->second)->print(myCout);
0597         }
0598       }
0599 
0600       myCout << "\nTotal number of conditions on all condition chips: " << totalNrConditions << "\n" << std::endl;
0601 
0602       myCout << "\nL1 Technical Triggers: " << nrDefinedTechTrig << " technical triggers defined."
0603              << "\n\n"
0604              << std::endl;
0605       if (nrDefinedTechTrig) {
0606         myCout << "Bit Number "
0607                << " Technical trigger name " << std::endl;
0608       }
0609 
0610       for (CItBit itBit = ttBitToTt.begin(); itBit != ttBitToTt.end(); itBit++) {
0611         int bitNumber = itBit->first;
0612         std::string aName = (itBit->second)->algoName();
0613 
0614         myCout << std::setw(6) << bitNumber << "       " << aName << std::endl;
0615       }
0616 
0617     } break;
0618 
0619     default: {
0620       myCout << "\n   ********** L1 Trigger Menu - printing   ********** \n\n"
0621              << "Verbosity level: " << printVerbosity << " not implemented.\n\n"
0622              << std::endl;
0623     } break;
0624   }
0625 }
0626 
0627 // get the result for algorithm with name algName
0628 // use directly the format of decisionWord (no typedef)
0629 const bool L1GtTriggerMenu::gtAlgorithmResult(const std::string& algName, const std::vector<bool>& decWord) const {
0630   bool algResult = false;
0631 
0632   CItAlgo itAlgo = m_algorithmMap.find(algName);
0633   if (itAlgo != m_algorithmMap.end()) {
0634     int bitNumber = (itAlgo->second).algoBitNumber();
0635     algResult = decWord.at(bitNumber);
0636     return algResult;
0637   }
0638 
0639   // return false if the algorithm name is not found in the menu
0640   // TODO throw exception or LogInfo would be better - but the class is used in
0641   // XDAQ Trigger Supervisor (outside CMSSW) hence no CMSSW dependence
0642   // is allowed here...
0643 
0644   return false;
0645 }