Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-09 00:01:11

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