Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-03-23 15:57:29

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   }
0355 
0356   chipNr = -1;
0357   for (std::vector<std::vector<L1GtCorrelationTemplate> >::iterator itCondOnChip = m_vecCorrelationTemplate.begin();
0358        itCondOnChip != m_vecCorrelationTemplate.end();
0359        itCondOnChip++) {
0360     chipNr++;
0361 
0362     for (std::vector<L1GtCorrelationTemplate>::iterator itCond = itCondOnChip->begin(); itCond != itCondOnChip->end();
0363          itCond++) {
0364       (m_conditionMap.at(chipNr))[itCond->condName()] = &(*itCond);
0365     }
0366   }
0367 }
0368 
0369 // set the trigger menu name
0370 void L1GtTriggerMenu::setGtTriggerMenuInterface(const std::string& menuInterface) {
0371   m_triggerMenuInterface = menuInterface;
0372 }
0373 
0374 void L1GtTriggerMenu::setGtTriggerMenuName(const std::string& menuName) { m_triggerMenuName = menuName; }
0375 
0376 void L1GtTriggerMenu::setGtTriggerMenuImplementation(const std::string& menuImplementation) {
0377   m_triggerMenuImplementation = menuImplementation;
0378 }
0379 
0380 // set menu associated scale key
0381 void L1GtTriggerMenu::setGtScaleDbKey(const std::string& scaleKey) { m_scaleDbKey = scaleKey; }
0382 
0383 // get / set the vectors containing the conditions
0384 void L1GtTriggerMenu::setVecMuonTemplate(const std::vector<std::vector<L1GtMuonTemplate> >& vecMuonTempl) {
0385   m_vecMuonTemplate = vecMuonTempl;
0386 }
0387 
0388 void L1GtTriggerMenu::setVecCaloTemplate(const std::vector<std::vector<L1GtCaloTemplate> >& vecCaloTempl) {
0389   m_vecCaloTemplate = vecCaloTempl;
0390 }
0391 
0392 void L1GtTriggerMenu::setVecEnergySumTemplate(
0393     const std::vector<std::vector<L1GtEnergySumTemplate> >& vecEnergySumTempl) {
0394   m_vecEnergySumTemplate = vecEnergySumTempl;
0395 }
0396 
0397 void L1GtTriggerMenu::setVecJetCountsTemplate(
0398     const std::vector<std::vector<L1GtJetCountsTemplate> >& vecJetCountsTempl) {
0399   m_vecJetCountsTemplate = vecJetCountsTempl;
0400 }
0401 
0402 void L1GtTriggerMenu::setVecCastorTemplate(const std::vector<std::vector<L1GtCastorTemplate> >& vecCastorTempl) {
0403   m_vecCastorTemplate = vecCastorTempl;
0404 }
0405 
0406 void L1GtTriggerMenu::setVecHfBitCountsTemplate(
0407     const std::vector<std::vector<L1GtHfBitCountsTemplate> >& vecHfBitCountsTempl) {
0408   m_vecHfBitCountsTemplate = vecHfBitCountsTempl;
0409 }
0410 
0411 void L1GtTriggerMenu::setVecHfRingEtSumsTemplate(
0412     const std::vector<std::vector<L1GtHfRingEtSumsTemplate> >& vecHfRingEtSumsTempl) {
0413   m_vecHfRingEtSumsTemplate = vecHfRingEtSumsTempl;
0414 }
0415 
0416 void L1GtTriggerMenu::setVecBptxTemplate(const std::vector<std::vector<L1GtBptxTemplate> >& vecBptxTempl) {
0417   m_vecBptxTemplate = vecBptxTempl;
0418 }
0419 
0420 void L1GtTriggerMenu::setVecExternalTemplate(const std::vector<std::vector<L1GtExternalTemplate> >& vecExternalTempl) {
0421   m_vecExternalTemplate = vecExternalTempl;
0422 }
0423 
0424 void L1GtTriggerMenu::setVecCorrelationTemplate(
0425     const std::vector<std::vector<L1GtCorrelationTemplate> >& vecCorrelationTempl) {
0426   m_vecCorrelationTemplate = vecCorrelationTempl;
0427 }
0428 
0429 // set the vectors containing the conditions for correlation templates
0430 void L1GtTriggerMenu::setCorMuonTemplate(const std::vector<std::vector<L1GtMuonTemplate> >& corMuonTempl) {
0431   m_corMuonTemplate = corMuonTempl;
0432 }
0433 
0434 void L1GtTriggerMenu::setCorCaloTemplate(const std::vector<std::vector<L1GtCaloTemplate> >& corCaloTempl) {
0435   m_corCaloTemplate = corCaloTempl;
0436 }
0437 
0438 void L1GtTriggerMenu::setCorEnergySumTemplate(
0439     const std::vector<std::vector<L1GtEnergySumTemplate> >& corEnergySumTempl) {
0440   m_corEnergySumTemplate = corEnergySumTempl;
0441 }
0442 
0443 // set the algorithm map (by algorithm names)
0444 void L1GtTriggerMenu::setGtAlgorithmMap(const AlgorithmMap& algoMap) { m_algorithmMap = algoMap; }
0445 
0446 // set the algorithm map (by algorithm aliases)
0447 void L1GtTriggerMenu::setGtAlgorithmAliasMap(const AlgorithmMap& algoMap) { m_algorithmAliasMap = algoMap; }
0448 
0449 // set the technical trigger map
0450 void L1GtTriggerMenu::setGtTechnicalTriggerMap(const AlgorithmMap& ttMap) { m_technicalTriggerMap = ttMap; }
0451 
0452 // print the trigger menu (bit number, algorithm name, logical expression)
0453 void L1GtTriggerMenu::print(std::ostream& myCout, int& printVerbosity) const {
0454   // use another map <int, L1GtAlgorithm> to get the menu sorted after bit number
0455   // both algorithm and bit numbers are unique
0456   std::map<int, const L1GtAlgorithm*> algoBitToAlgo;
0457   typedef std::map<int, const L1GtAlgorithm*>::const_iterator CItBit;
0458 
0459   for (CItAlgo itAlgo = m_algorithmMap.begin(); itAlgo != m_algorithmMap.end(); itAlgo++) {
0460     int bitNumber = (itAlgo->second).algoBitNumber();
0461     algoBitToAlgo[bitNumber] = &(itAlgo->second);
0462   }
0463 
0464   size_t nrDefinedAlgo = algoBitToAlgo.size();
0465 
0466   // idem for technical trigger map - only name and bit number are relevant for them
0467   std::map<int, const L1GtAlgorithm*> ttBitToTt;
0468 
0469   for (CItAlgo itAlgo = m_technicalTriggerMap.begin(); itAlgo != m_technicalTriggerMap.end(); itAlgo++) {
0470     int bitNumber = (itAlgo->second).algoBitNumber();
0471     ttBitToTt[bitNumber] = &(itAlgo->second);
0472   }
0473 
0474   size_t nrDefinedTechTrig = ttBitToTt.size();
0475 
0476   //
0477 
0478   switch (printVerbosity) {
0479     case 0: {
0480       // header for printing algorithms
0481 
0482       myCout << "\n   ********** L1 Trigger Menu - printing   ********** \n"
0483              << "\nL1 Trigger Menu Interface: " << m_triggerMenuInterface
0484              << "\nL1 Trigger Menu Name:      " << m_triggerMenuName
0485              << "\nL1 Trigger Menu Implementation: " << m_triggerMenuImplementation
0486              << "\nAssociated Scale DB Key: " << m_scaleDbKey << "\n\n"
0487              << "\nL1 Physics Algorithms: " << nrDefinedAlgo << " algorithms defined."
0488              << "\n\n"
0489              << "Bit Number " << std::right << std::setw(35) << "Algorithm Name"
0490              << "  " << std::right << std::setw(35) << "Algorithm Alias" << std::endl;
0491 
0492       for (CItBit itBit = algoBitToAlgo.begin(); itBit != algoBitToAlgo.end(); itBit++) {
0493         int bitNumber = itBit->first;
0494         std::string aName = (itBit->second)->algoName();
0495         std::string aAlias = (itBit->second)->algoAlias();
0496 
0497         myCout << std::setw(6) << bitNumber << "     " << std::right << std::setw(35) << aName << "  " << std::right
0498                << std::setw(35) << aAlias << std::endl;
0499       }
0500 
0501       myCout << "\nL1 Technical Triggers: " << nrDefinedTechTrig << " technical triggers defined."
0502              << "\n\n"
0503              << std::endl;
0504       if (nrDefinedTechTrig) {
0505         myCout << "Bit Number "
0506                << " Technical trigger name " << std::endl;
0507       }
0508 
0509       for (CItBit itBit = ttBitToTt.begin(); itBit != ttBitToTt.end(); itBit++) {
0510         int bitNumber = itBit->first;
0511         std::string aName = (itBit->second)->algoName();
0512         std::string aAlias = (itBit->second)->algoAlias();
0513 
0514         myCout << std::setw(6) << bitNumber << "       " << std::right << std::setw(35) << aName << "  " << std::right
0515                << std::setw(35) << aAlias << std::endl;
0516       }
0517 
0518     } break;
0519 
0520     case 1: {
0521       // header for printing algorithms
0522 
0523       myCout << "\n   ********** L1 Trigger Menu - printing   ********** \n"
0524              << "\nL1 Trigger Menu Interface: " << m_triggerMenuInterface
0525              << "\nL1 Trigger Menu Name:      " << m_triggerMenuName
0526              << "\nL1 Trigger Menu Implementation: " << m_triggerMenuImplementation
0527              << "\nAssociated Scale DB Key: " << m_scaleDbKey << "\n\n"
0528              << "\nL1 Physics Algorithms: " << nrDefinedAlgo << " algorithms defined."
0529              << "\n\n"
0530              << "Bit Number " << std::right << std::setw(35) << "Algorithm Name"
0531              << "  " << std::right << std::setw(35) << "Algorithm Alias"
0532              << "\n  Logical Expression \n"
0533              << std::endl;
0534 
0535       for (CItBit itBit = algoBitToAlgo.begin(); itBit != algoBitToAlgo.end(); itBit++) {
0536         int bitNumber = itBit->first;
0537         std::string aName = (itBit->second)->algoName();
0538         std::string aAlias = (itBit->second)->algoAlias();
0539         std::string aLogicalExpression = (itBit->second)->algoLogicalExpression();
0540 
0541         myCout << std::setw(6) << bitNumber << "     " << std::right << std::setw(35) << aName << "  " << std::right
0542                << std::setw(35) << aAlias << "\n  Logical expression: " << aLogicalExpression << "\n"
0543                << std::endl;
0544       }
0545 
0546       myCout << "\nL1 Technical Triggers: " << nrDefinedTechTrig << " technical triggers defined."
0547              << "\n\n"
0548              << std::endl;
0549       if (nrDefinedTechTrig) {
0550         myCout << "Bit Number "
0551                << " Technical trigger name " << std::endl;
0552       }
0553 
0554       for (CItBit itBit = ttBitToTt.begin(); itBit != ttBitToTt.end(); itBit++) {
0555         int bitNumber = itBit->first;
0556         std::string aName = (itBit->second)->algoName();
0557 
0558         myCout << std::setw(6) << bitNumber << "       " << aName << std::endl;
0559       }
0560     } break;
0561 
0562     case 2: {
0563       // header for printing algorithms
0564 
0565       myCout << "\n   ********** L1 Trigger Menu - printing   ********** \n"
0566              << "\nL1 Trigger Menu Interface: " << m_triggerMenuInterface
0567              << "\nL1 Trigger Menu Name:      " << m_triggerMenuName
0568              << "\nL1 Trigger Menu Implementation: " << m_triggerMenuImplementation
0569              << "\nAssociated Scale DB Key: " << m_scaleDbKey << "\n\n"
0570              << "\nL1 Physics Algorithms: " << nrDefinedAlgo << " algorithms defined."
0571              << "\n\n"
0572              << std::endl;
0573 
0574       for (CItBit itBit = algoBitToAlgo.begin(); itBit != algoBitToAlgo.end(); itBit++) {
0575         (itBit->second)->print(myCout);
0576       }
0577 
0578       myCout << "\nNumber of condition chips: " << m_conditionMap.size() << "\n" << std::endl;
0579 
0580       int chipNr = -1;
0581       int totalNrConditions = 0;
0582 
0583       for (std::vector<ConditionMap>::const_iterator itCondOnChip = m_conditionMap.begin();
0584            itCondOnChip != m_conditionMap.end();
0585            itCondOnChip++) {
0586         chipNr++;
0587 
0588         int condMapSize = itCondOnChip->size();
0589         totalNrConditions += condMapSize;
0590 
0591         myCout << "\nTotal number of conditions on condition chip " << chipNr << ": " << condMapSize << " conditions.\n"
0592                << std::endl;
0593 
0594         for (CItCond itCond = itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {
0595           (itCond->second)->print(myCout);
0596         }
0597       }
0598 
0599       myCout << "\nTotal number of conditions on all condition chips: " << totalNrConditions << "\n" << std::endl;
0600 
0601       myCout << "\nL1 Technical Triggers: " << nrDefinedTechTrig << " technical triggers defined."
0602              << "\n\n"
0603              << std::endl;
0604       if (nrDefinedTechTrig) {
0605         myCout << "Bit Number "
0606                << " Technical trigger name " << std::endl;
0607       }
0608 
0609       for (CItBit itBit = ttBitToTt.begin(); itBit != ttBitToTt.end(); itBit++) {
0610         int bitNumber = itBit->first;
0611         std::string aName = (itBit->second)->algoName();
0612 
0613         myCout << std::setw(6) << bitNumber << "       " << aName << std::endl;
0614       }
0615 
0616     } break;
0617 
0618     default: {
0619       myCout << "\n   ********** L1 Trigger Menu - printing   ********** \n\n"
0620              << "Verbosity level: " << printVerbosity << " not implemented.\n\n"
0621              << std::endl;
0622     } break;
0623   }
0624 }
0625 
0626 // get the result for algorithm with name algName
0627 // use directly the format of decisionWord (no typedef)
0628 const bool L1GtTriggerMenu::gtAlgorithmResult(const std::string& algName, const std::vector<bool>& decWord) const {
0629   bool algResult = false;
0630 
0631   CItAlgo itAlgo = m_algorithmMap.find(algName);
0632   if (itAlgo != m_algorithmMap.end()) {
0633     int bitNumber = (itAlgo->second).algoBitNumber();
0634     algResult = decWord.at(bitNumber);
0635     return algResult;
0636   }
0637 
0638   // return false if the algorithm name is not found in the menu
0639   // TODO throw exception or LogInfo would be better - but the class is used in
0640   // XDAQ Trigger Supervisor (outside CMSSW) hence no CMSSW dependence
0641   // is allowed here...
0642 
0643   return false;
0644 }