CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/CondFormats/L1TObjects/src/L1GtTriggerMenu.cc

Go to the documentation of this file.
00001 
00017 // this class header
00018 #include "CondFormats/L1TObjects/interface/L1GtTriggerMenu.h"
00019 
00020 // system include files
00021 #include <iostream>
00022 #include <iomanip>
00023 
00024 // user include files
00025 #include "CondFormats/L1TObjects/interface/L1GtCondition.h"
00026 #include "CondFormats/L1TObjects/interface/L1GtAlgorithm.h"
00027 
00028 
00029 // forward declarations
00030 
00031 // constructor
00032 L1GtTriggerMenu::L1GtTriggerMenu()
00033   : m_triggerMenuInterface( "NULL" ),
00034     m_triggerMenuName( "NULL" ),
00035     m_triggerMenuImplementation( "NULL" ),
00036     m_scaleDbKey( "NULL" )
00037 {
00038     // empty
00039 }
00040 
00041 L1GtTriggerMenu::L1GtTriggerMenu(
00042         const std::string& triggerMenuNameVal,
00043         const unsigned int numberConditionChips,
00044         const std::vector<std::vector<L1GtMuonTemplate> >& vecMuonTemplateVal,
00045         const std::vector<std::vector<L1GtCaloTemplate> >& vecCaloTemplateVal,
00046         const std::vector<std::vector<L1GtEnergySumTemplate> >& vecEnergySumTemplateVal,
00047         const std::vector<std::vector<L1GtJetCountsTemplate> >& vecJetCountsTemplateVal,
00048         const std::vector<std::vector<L1GtCastorTemplate> >& vecCastorTemplateVal,
00049         const std::vector<std::vector<L1GtHfBitCountsTemplate> >& vecHfBitCountsTemplateVal,
00050         const std::vector<std::vector<L1GtHfRingEtSumsTemplate> >& vecHfRingEtSumsTemplateVal,
00051         const std::vector<std::vector<L1GtBptxTemplate> >& vecBptxTemplateVal,
00052         const std::vector<std::vector<L1GtExternalTemplate> >& vecExternalTemplateVal,
00053         const std::vector<std::vector<L1GtCorrelationTemplate> >& vecCorrelationTemplateVal,
00054         const std::vector<std::vector<L1GtMuonTemplate> >& corMuonTemplateVal,
00055         const std::vector<std::vector<L1GtCaloTemplate> >& corCaloTemplateVal,
00056         const std::vector<std::vector<L1GtEnergySumTemplate> >& corEnergySumTemplateVal
00057 
00058 ) :
00059     m_triggerMenuInterface( "NULL" ),
00060     m_triggerMenuName(triggerMenuNameVal),
00061     m_triggerMenuImplementation( "NULL" ),
00062     m_scaleDbKey( "NULL" ),
00063             m_vecMuonTemplate(vecMuonTemplateVal),
00064             m_vecCaloTemplate(vecCaloTemplateVal),
00065             m_vecEnergySumTemplate(vecEnergySumTemplateVal),
00066             m_vecJetCountsTemplate(vecJetCountsTemplateVal),
00067             m_vecCastorTemplate(vecCastorTemplateVal),
00068             m_vecHfBitCountsTemplate(vecHfBitCountsTemplateVal),
00069             m_vecHfRingEtSumsTemplate(vecHfRingEtSumsTemplateVal),
00070             m_vecBptxTemplate(vecBptxTemplateVal),
00071             m_vecExternalTemplate(vecExternalTemplateVal),
00072             m_vecCorrelationTemplate(vecCorrelationTemplateVal),
00073             m_corMuonTemplate(corMuonTemplateVal),
00074             m_corCaloTemplate(corCaloTemplateVal),
00075             m_corEnergySumTemplate(corEnergySumTemplateVal)
00076 {
00077 
00078     m_conditionMap.resize(numberConditionChips);
00079     buildGtConditionMap();
00080 
00081 }
00082 
00083 // copy constructor
00084 L1GtTriggerMenu::L1GtTriggerMenu(const L1GtTriggerMenu& rhs)
00085 {
00086 
00087     m_triggerMenuInterface = rhs.m_triggerMenuInterface;
00088     m_triggerMenuName = rhs.m_triggerMenuName;
00089     m_triggerMenuImplementation = rhs.m_triggerMenuImplementation;
00090     m_scaleDbKey = rhs.m_scaleDbKey ;
00091 
00092     // copy physics conditions
00093     m_vecMuonTemplate = rhs.m_vecMuonTemplate;
00094     m_vecCaloTemplate = rhs.m_vecCaloTemplate;
00095     m_vecEnergySumTemplate = rhs.m_vecEnergySumTemplate;
00096     m_vecJetCountsTemplate = rhs.m_vecJetCountsTemplate;
00097     m_vecCastorTemplate = rhs.m_vecCastorTemplate;
00098     m_vecHfBitCountsTemplate = rhs.m_vecHfBitCountsTemplate;
00099     m_vecHfRingEtSumsTemplate = rhs.m_vecHfRingEtSumsTemplate;
00100     m_vecBptxTemplate = rhs.m_vecBptxTemplate;
00101     m_vecExternalTemplate = rhs.m_vecExternalTemplate;
00102 
00103     m_vecCorrelationTemplate = rhs.m_vecCorrelationTemplate;
00104     m_corMuonTemplate = rhs.m_corMuonTemplate;
00105     m_corCaloTemplate = rhs.m_corCaloTemplate;
00106     m_corEnergySumTemplate = rhs.m_corEnergySumTemplate;
00107 
00108     // rebuild condition map to update the pointers
00109     // (only physics conditions are included in it)
00110     m_conditionMap.resize(rhs.m_conditionMap.size());
00111     (*this).buildGtConditionMap();
00112 
00113     // copy algorithm map
00114     m_algorithmMap = rhs.m_algorithmMap;
00115     m_algorithmAliasMap = rhs.m_algorithmAliasMap;
00116 
00117     // copy technical triggers
00118     // (separate map for technical triggers and physics triggers)
00119     m_technicalTriggerMap = rhs.m_technicalTriggerMap;
00120 
00121 }
00122 
00123 // destructor
00124 L1GtTriggerMenu::~L1GtTriggerMenu()
00125 {
00126 
00127     // loop over condition maps (one map per condition chip)
00128     for (std::vector<ConditionMap>::iterator
00129         itCondOnChip = m_conditionMap.begin(); itCondOnChip != m_conditionMap.end(); itCondOnChip++) {
00130 
00131         itCondOnChip->clear();
00132 
00133     }
00134 
00135     m_algorithmMap.clear();
00136     m_algorithmAliasMap.clear();
00137 }
00138 
00139 // assignment operator
00140 L1GtTriggerMenu& L1GtTriggerMenu::operator=(const L1GtTriggerMenu& rhs) {
00141 
00142     if ( this != &rhs ) {
00143 
00144         m_triggerMenuInterface = rhs.m_triggerMenuInterface;
00145         m_triggerMenuName = rhs.m_triggerMenuName;
00146         m_triggerMenuImplementation = rhs.m_triggerMenuImplementation;
00147 
00148         m_vecMuonTemplate = rhs.m_vecMuonTemplate;
00149         m_vecCaloTemplate = rhs.m_vecCaloTemplate;
00150         m_vecEnergySumTemplate = rhs.m_vecEnergySumTemplate;
00151         m_vecJetCountsTemplate = rhs.m_vecJetCountsTemplate;
00152         m_vecCastorTemplate = rhs.m_vecCastorTemplate;
00153         m_vecHfBitCountsTemplate = rhs.m_vecHfBitCountsTemplate;
00154         m_vecHfRingEtSumsTemplate = rhs.m_vecHfRingEtSumsTemplate;
00155         m_vecBptxTemplate = rhs.m_vecBptxTemplate;
00156         m_vecExternalTemplate = rhs.m_vecExternalTemplate;
00157 
00158         m_vecCorrelationTemplate = rhs.m_vecCorrelationTemplate;
00159         m_corMuonTemplate = rhs.m_corMuonTemplate;
00160         m_corCaloTemplate = rhs.m_corCaloTemplate;
00161         m_corEnergySumTemplate = rhs.m_corEnergySumTemplate;
00162 
00163         m_algorithmMap = rhs.m_algorithmMap;
00164         m_algorithmAliasMap = rhs.m_algorithmAliasMap;
00165 
00166         m_technicalTriggerMap = rhs.m_technicalTriggerMap;
00167 
00168     }
00169 
00170     // rebuild condition map to update the pointers
00171     // (only physics conditions are included in it)
00172     m_conditionMap.resize(rhs.m_conditionMap.size());
00173     (*this).buildGtConditionMap();
00174 
00175     // return the object
00176     return *this;
00177 
00178 }
00179 
00180 // set the condition maps
00181 void L1GtTriggerMenu::setGtConditionMap(const std::vector<ConditionMap>& condMap) {
00182     m_conditionMap = condMap;
00183 }
00184 
00185 // build the condition maps
00186 void L1GtTriggerMenu::buildGtConditionMap() {
00187 
00188     // clear the conditions from the maps, if any
00189     for (std::vector<ConditionMap>::iterator itCondOnChip =
00190             m_conditionMap.begin(); itCondOnChip != m_conditionMap.end(); itCondOnChip++) {
00191 
00192         itCondOnChip->clear();
00193 
00194     }
00195 
00196     // always check that the size of the condition map is greater than the size
00197     // of the specific condition vector
00198     size_t condMapSize = m_conditionMap.size();
00199 
00200     //
00201     size_t vecMuonSize = m_vecMuonTemplate.size();
00202     if (condMapSize < vecMuonSize) {
00203         m_conditionMap.resize(vecMuonSize);
00204         condMapSize = m_conditionMap.size();
00205     }
00206 
00207     int chipNr = -1;
00208 
00209     for (std::vector<std::vector<L1GtMuonTemplate> >::iterator
00210             itCondOnChip = m_vecMuonTemplate.begin();
00211             itCondOnChip != m_vecMuonTemplate.end();
00212             itCondOnChip++) {
00213 
00214         chipNr++;
00215 
00216         for (std::vector<L1GtMuonTemplate>::iterator
00217                 itCond = itCondOnChip->begin(); itCond != itCondOnChip->end();
00218                 itCond++) {
00219 
00220             (m_conditionMap.at(chipNr))[itCond->condName()] = &(*itCond);
00221         }
00222     }
00223 
00224     //
00225     size_t vecCaloSize = m_vecCaloTemplate.size();
00226     if (condMapSize < vecCaloSize) {
00227         m_conditionMap.resize(vecCaloSize);
00228         condMapSize = m_conditionMap.size();
00229     }
00230 
00231     chipNr = -1;
00232     for (std::vector<std::vector<L1GtCaloTemplate> >::iterator
00233             itCondOnChip = m_vecCaloTemplate.begin();
00234             itCondOnChip != m_vecCaloTemplate.end();
00235             itCondOnChip++) {
00236 
00237         chipNr++;
00238 
00239         for (std::vector<L1GtCaloTemplate>::iterator
00240                 itCond = itCondOnChip->begin(); itCond != itCondOnChip->end();
00241                 itCond++) {
00242 
00243             (m_conditionMap.at(chipNr))[itCond->condName()] = &(*itCond);
00244         }
00245     }
00246 
00247     //
00248     size_t vecEnergySumSize = m_vecEnergySumTemplate.size();
00249     if (condMapSize < vecEnergySumSize) {
00250         m_conditionMap.resize(vecEnergySumSize);
00251         condMapSize = m_conditionMap.size();
00252     }
00253 
00254     chipNr = -1;
00255     for (std::vector<std::vector<L1GtEnergySumTemplate> >::iterator
00256             itCondOnChip = m_vecEnergySumTemplate.begin();
00257             itCondOnChip != m_vecEnergySumTemplate.end();
00258             itCondOnChip++) {
00259 
00260         chipNr++;
00261 
00262         for (std::vector<L1GtEnergySumTemplate>::iterator
00263                 itCond = itCondOnChip->begin(); itCond != itCondOnChip->end();
00264                 itCond++) {
00265 
00266             (m_conditionMap.at(chipNr))[itCond->condName()] = &(*itCond);
00267         }
00268     }
00269 
00270     //
00271     size_t vecJetCountsSize = m_vecJetCountsTemplate.size();
00272     if (condMapSize < vecJetCountsSize) {
00273         m_conditionMap.resize(vecJetCountsSize);
00274         condMapSize = m_conditionMap.size();
00275     }
00276 
00277     chipNr = -1;
00278     for (std::vector<std::vector<L1GtJetCountsTemplate> >::iterator
00279             itCondOnChip = m_vecJetCountsTemplate.begin();
00280             itCondOnChip != m_vecJetCountsTemplate.end();
00281             itCondOnChip++) {
00282 
00283         chipNr++;
00284 
00285         for (std::vector<L1GtJetCountsTemplate>::iterator
00286                 itCond = itCondOnChip->begin(); itCond != itCondOnChip->end();
00287                 itCond++) {
00288 
00289             (m_conditionMap.at(chipNr))[itCond->condName()] = &(*itCond);
00290         }
00291     }
00292 
00293 
00294     //
00295     size_t vecCastorSize = m_vecCastorTemplate.size();
00296     if (condMapSize < vecCastorSize) {
00297         m_conditionMap.resize(vecCastorSize);
00298         condMapSize = m_conditionMap.size();
00299     }
00300 
00301     chipNr = -1;
00302     for (std::vector<std::vector<L1GtCastorTemplate> >::iterator
00303             itCondOnChip = m_vecCastorTemplate.begin();
00304             itCondOnChip != m_vecCastorTemplate.end();
00305             itCondOnChip++) {
00306 
00307         chipNr++;
00308 
00309         for (std::vector<L1GtCastorTemplate>::iterator
00310                 itCond = itCondOnChip->begin(); itCond != itCondOnChip->end();
00311                 itCond++) {
00312 
00313             (m_conditionMap.at(chipNr))[itCond->condName()] = &(*itCond);
00314         }
00315     }
00316 
00317     //
00318     size_t vecHfBitCountsSize = m_vecHfBitCountsTemplate.size();
00319     if (condMapSize < vecHfBitCountsSize) {
00320         m_conditionMap.resize(vecHfBitCountsSize);
00321         condMapSize = m_conditionMap.size();
00322     }
00323 
00324     chipNr = -1;
00325     for (std::vector<std::vector<L1GtHfBitCountsTemplate> >::iterator
00326             itCondOnChip = m_vecHfBitCountsTemplate.begin();
00327             itCondOnChip != m_vecHfBitCountsTemplate.end();
00328             itCondOnChip++) {
00329 
00330         chipNr++;
00331 
00332         for (std::vector<L1GtHfBitCountsTemplate>::iterator
00333                 itCond = itCondOnChip->begin(); itCond != itCondOnChip->end();
00334                 itCond++) {
00335 
00336             (m_conditionMap.at(chipNr))[itCond->condName()] = &(*itCond);
00337         }
00338     }
00339 
00340     //
00341     size_t vecHfRingEtSumsSize = m_vecHfRingEtSumsTemplate.size();
00342     if (condMapSize < vecHfRingEtSumsSize) {
00343         m_conditionMap.resize(vecHfRingEtSumsSize);
00344         condMapSize = m_conditionMap.size();
00345     }
00346 
00347     chipNr = -1;
00348     for (std::vector<std::vector<L1GtHfRingEtSumsTemplate> >::iterator
00349             itCondOnChip = m_vecHfRingEtSumsTemplate.begin();
00350             itCondOnChip != m_vecHfRingEtSumsTemplate.end();
00351             itCondOnChip++) {
00352 
00353         chipNr++;
00354 
00355         for (std::vector<L1GtHfRingEtSumsTemplate>::iterator
00356                 itCond = itCondOnChip->begin(); itCond != itCondOnChip->end();
00357                 itCond++) {
00358 
00359             (m_conditionMap.at(chipNr))[itCond->condName()] = &(*itCond);
00360         }
00361     }
00362 
00363     //
00364     size_t vecBptxSize = m_vecBptxTemplate.size();
00365     if (condMapSize < vecBptxSize) {
00366         m_conditionMap.resize(vecBptxSize);
00367         condMapSize = m_conditionMap.size();
00368     }
00369 
00370     chipNr = -1;
00371     for (std::vector<std::vector<L1GtBptxTemplate> >::iterator
00372             itCondOnChip = m_vecBptxTemplate.begin();
00373             itCondOnChip != m_vecBptxTemplate.end();
00374             itCondOnChip++) {
00375 
00376         chipNr++;
00377 
00378         for (std::vector<L1GtBptxTemplate>::iterator
00379                 itCond = itCondOnChip->begin(); itCond != itCondOnChip->end();
00380                 itCond++) {
00381 
00382             (m_conditionMap.at(chipNr))[itCond->condName()] = &(*itCond);
00383         }
00384     }
00385 
00386     //
00387     size_t vecExternalSize = m_vecExternalTemplate.size();
00388     if (condMapSize < vecExternalSize) {
00389         m_conditionMap.resize(vecExternalSize);
00390         condMapSize = m_conditionMap.size();
00391     }
00392 
00393     chipNr = -1;
00394     for (std::vector<std::vector<L1GtExternalTemplate> >::iterator
00395             itCondOnChip = m_vecExternalTemplate.begin();
00396             itCondOnChip != m_vecExternalTemplate.end();
00397             itCondOnChip++) {
00398 
00399         chipNr++;
00400 
00401         for (std::vector<L1GtExternalTemplate>::iterator
00402                 itCond = itCondOnChip->begin(); itCond != itCondOnChip->end();
00403                 itCond++) {
00404 
00405             (m_conditionMap.at(chipNr))[itCond->condName()] = &(*itCond);
00406         }
00407     }
00408 
00409     //
00410     size_t vecCorrelationSize = m_vecCorrelationTemplate.size();
00411     if (condMapSize < vecCorrelationSize) {
00412         m_conditionMap.resize(vecCorrelationSize);
00413         condMapSize = m_conditionMap.size();
00414     }
00415 
00416     chipNr = -1;
00417     for (std::vector<std::vector<L1GtCorrelationTemplate> >::iterator
00418             itCondOnChip = m_vecCorrelationTemplate.begin();
00419             itCondOnChip != m_vecCorrelationTemplate.end();
00420             itCondOnChip++) {
00421 
00422         chipNr++;
00423 
00424         for (std::vector<L1GtCorrelationTemplate>::iterator
00425                 itCond = itCondOnChip->begin(); itCond != itCondOnChip->end();
00426                 itCond++) {
00427 
00428             (m_conditionMap.at(chipNr))[itCond->condName()] = &(*itCond);
00429         }
00430     }
00431 
00432 
00433 
00434 
00435 }
00436 
00437 // set the trigger menu name
00438 void L1GtTriggerMenu::setGtTriggerMenuInterface(const std::string& menuInterface) {
00439     m_triggerMenuInterface = menuInterface;
00440 }
00441 
00442 void L1GtTriggerMenu::setGtTriggerMenuName(const std::string& menuName) {
00443     m_triggerMenuName = menuName;
00444 }
00445 
00446 void L1GtTriggerMenu::setGtTriggerMenuImplementation(const std::string& menuImplementation) {
00447     m_triggerMenuImplementation = menuImplementation;
00448 }
00449 
00450 // set menu associated scale key
00451 void L1GtTriggerMenu::setGtScaleDbKey(const std::string& scaleKey) {
00452     m_scaleDbKey = scaleKey;
00453 }
00454 
00455 // get / set the vectors containing the conditions
00456 void L1GtTriggerMenu::setVecMuonTemplate(
00457         const std::vector<std::vector<L1GtMuonTemplate> >& vecMuonTempl) {
00458 
00459     m_vecMuonTemplate = vecMuonTempl;
00460 }
00461 
00462 void L1GtTriggerMenu::setVecCaloTemplate(
00463         const std::vector<std::vector<L1GtCaloTemplate> >& vecCaloTempl) {
00464 
00465     m_vecCaloTemplate = vecCaloTempl;
00466 }
00467 
00468 void L1GtTriggerMenu::setVecEnergySumTemplate(
00469         const std::vector<std::vector<L1GtEnergySumTemplate> >& vecEnergySumTempl) {
00470 
00471     m_vecEnergySumTemplate = vecEnergySumTempl;
00472 }
00473 
00474 void L1GtTriggerMenu::setVecJetCountsTemplate(
00475         const std::vector<std::vector<L1GtJetCountsTemplate> >& vecJetCountsTempl) {
00476 
00477     m_vecJetCountsTemplate = vecJetCountsTempl;
00478 }
00479 
00480 void L1GtTriggerMenu::setVecCastorTemplate(
00481         const std::vector<std::vector<L1GtCastorTemplate> >& vecCastorTempl) {
00482 
00483     m_vecCastorTemplate = vecCastorTempl;
00484 }
00485 
00486 void L1GtTriggerMenu::setVecHfBitCountsTemplate(
00487         const std::vector<std::vector<L1GtHfBitCountsTemplate> >& vecHfBitCountsTempl) {
00488 
00489     m_vecHfBitCountsTemplate = vecHfBitCountsTempl;
00490 }
00491 
00492 void L1GtTriggerMenu::setVecHfRingEtSumsTemplate(
00493         const std::vector<std::vector<L1GtHfRingEtSumsTemplate> >& vecHfRingEtSumsTempl) {
00494 
00495     m_vecHfRingEtSumsTemplate = vecHfRingEtSumsTempl;
00496 }
00497 
00498 void L1GtTriggerMenu::setVecBptxTemplate(
00499         const std::vector<std::vector<L1GtBptxTemplate> >& vecBptxTempl) {
00500 
00501     m_vecBptxTemplate = vecBptxTempl;
00502 }
00503 
00504 void L1GtTriggerMenu::setVecExternalTemplate(
00505         const std::vector<std::vector<L1GtExternalTemplate> >& vecExternalTempl) {
00506 
00507     m_vecExternalTemplate = vecExternalTempl;
00508 }
00509 
00510 void L1GtTriggerMenu::setVecCorrelationTemplate(
00511         const std::vector<std::vector<L1GtCorrelationTemplate> >& vecCorrelationTempl) {
00512 
00513     m_vecCorrelationTemplate = vecCorrelationTempl;
00514 }
00515 
00516 // set the vectors containing the conditions for correlation templates
00517 void L1GtTriggerMenu::setCorMuonTemplate(
00518         const std::vector<std::vector<L1GtMuonTemplate> >& corMuonTempl) {
00519 
00520     m_corMuonTemplate = corMuonTempl;
00521 }
00522 
00523 void L1GtTriggerMenu::setCorCaloTemplate(
00524         const std::vector<std::vector<L1GtCaloTemplate> >& corCaloTempl) {
00525 
00526     m_corCaloTemplate = corCaloTempl;
00527 }
00528 
00529 void L1GtTriggerMenu::setCorEnergySumTemplate(
00530         const std::vector<std::vector<L1GtEnergySumTemplate> >& corEnergySumTempl) {
00531 
00532     m_corEnergySumTemplate = corEnergySumTempl;
00533 }
00534 
00535 
00536 
00537 // set the algorithm map (by algorithm names)
00538 void L1GtTriggerMenu::setGtAlgorithmMap(const AlgorithmMap& algoMap) {
00539     m_algorithmMap = algoMap;
00540 }
00541 
00542 // set the algorithm map (by algorithm aliases)
00543 void L1GtTriggerMenu::setGtAlgorithmAliasMap(const AlgorithmMap& algoMap) {
00544     m_algorithmAliasMap = algoMap;
00545 }
00546 
00547 // set the technical trigger map
00548 void L1GtTriggerMenu::setGtTechnicalTriggerMap(const AlgorithmMap& ttMap) {
00549     m_technicalTriggerMap = ttMap;
00550 }
00551 
00552 // print the trigger menu (bit number, algorithm name, logical expression)
00553 void L1GtTriggerMenu::print(std::ostream& myCout, int& printVerbosity) const {
00554 
00555     // use another map <int, L1GtAlgorithm> to get the menu sorted after bit number
00556     // both algorithm and bit numbers are unique
00557     std::map<int, const L1GtAlgorithm*> algoBitToAlgo;
00558     typedef std::map<int, const L1GtAlgorithm*>::const_iterator CItBit;
00559 
00560     for (CItAlgo itAlgo = m_algorithmMap.begin(); itAlgo != m_algorithmMap.end(); itAlgo++) {
00561 
00562         int bitNumber = (itAlgo->second).algoBitNumber();
00563         algoBitToAlgo[bitNumber] = &(itAlgo->second);
00564     }
00565 
00566     size_t nrDefinedAlgo = algoBitToAlgo.size();
00567 
00568     // idem for technical trigger map - only name and bit number are relevant for them
00569     std::map<int, const L1GtAlgorithm*> ttBitToTt;
00570 
00571     for (CItAlgo itAlgo = m_technicalTriggerMap.begin(); itAlgo
00572             != m_technicalTriggerMap.end(); itAlgo++) {
00573 
00574         int bitNumber = (itAlgo->second).algoBitNumber();
00575         ttBitToTt[bitNumber] = &(itAlgo->second);
00576     }
00577 
00578     size_t nrDefinedTechTrig = ttBitToTt.size();
00579 
00580     //
00581 
00582     switch (printVerbosity) {
00583 
00584         case 0: {
00585 
00586             // header for printing algorithms
00587 
00588             myCout << "\n   ********** L1 Trigger Menu - printing   ********** \n"
00589             << "\nL1 Trigger Menu Interface: " << m_triggerMenuInterface
00590             << "\nL1 Trigger Menu Name:      " << m_triggerMenuName
00591             << "\nL1 Trigger Menu Implementation: " << m_triggerMenuImplementation
00592             << "\nAssociated Scale DB Key: " << m_scaleDbKey << "\n\n"
00593             << "\nL1 Physics Algorithms: " << nrDefinedAlgo << " algorithms defined." << "\n\n"
00594             << "Bit Number "
00595             << std::right << std::setw(35) << "Algorithm Name" << "  "
00596             << std::right << std::setw(35) << "Algorithm Alias"
00597             << std::endl;
00598 
00599             for (CItBit itBit = algoBitToAlgo.begin(); itBit != algoBitToAlgo.end(); itBit++) {
00600 
00601                 int bitNumber = itBit->first;
00602                 std::string aName = (itBit->second)->algoName();
00603                 std::string aAlias = (itBit->second)->algoAlias();
00604 
00605                 myCout << std::setw(6) << bitNumber << "     "
00606                     << std::right << std::setw(35) << aName << "  "
00607                     << std::right << std::setw(35) << aAlias
00608                     << std::endl;
00609             }
00610 
00611             myCout
00612             << "\nL1 Technical Triggers: " << nrDefinedTechTrig
00613             << " technical triggers defined." << "\n\n" << std::endl;
00614             if (nrDefinedTechTrig) {
00615                 myCout << "Bit Number " << " Technical trigger name " << std::endl;
00616             }
00617 
00618             for (CItBit itBit = ttBitToTt.begin(); itBit != ttBitToTt.end(); itBit++) {
00619 
00620                 int bitNumber = itBit->first;
00621                 std::string aName = (itBit->second)->algoName();
00622                 std::string aAlias = (itBit->second)->algoAlias();
00623 
00624                 myCout << std::setw(6) << bitNumber << "       "
00625                 << std::right << std::setw(35) << aName << "  "
00626                 << std::right << std::setw(35) << aAlias
00627                 << std::endl;
00628             }
00629 
00630         }
00631             break;
00632 
00633         case 1: {
00634 
00635             // header for printing algorithms
00636 
00637             myCout << "\n   ********** L1 Trigger Menu - printing   ********** \n"
00638             << "\nL1 Trigger Menu Interface: " << m_triggerMenuInterface
00639             << "\nL1 Trigger Menu Name:      " << m_triggerMenuName
00640             << "\nL1 Trigger Menu Implementation: " << m_triggerMenuImplementation
00641             << "\nAssociated Scale DB Key: " << m_scaleDbKey << "\n\n"
00642             << "\nL1 Physics Algorithms: " << nrDefinedAlgo << " algorithms defined." << "\n\n"
00643             << "Bit Number "
00644             << std::right << std::setw(35) << "Algorithm Name" << "  "
00645             << std::right << std::setw(35) << "Algorithm Alias"
00646             << "\n  Logical Expression \n"
00647             << std::endl;
00648 
00649             for (CItBit itBit = algoBitToAlgo.begin(); itBit != algoBitToAlgo.end(); itBit++) {
00650 
00651                 int bitNumber = itBit->first;
00652                 std::string aName = (itBit->second)->algoName();
00653                 std::string aAlias = (itBit->second)->algoAlias();
00654                 std::string aLogicalExpression = (itBit->second)->algoLogicalExpression();
00655 
00656                 myCout << std::setw(6) << bitNumber << "     "
00657                 << std::right << std::setw(35) << aName << "  "
00658                 << std::right << std::setw(35) << aAlias
00659                 << "\n  Logical expression: " << aLogicalExpression << "\n"
00660                 << std::endl;
00661             }
00662 
00663             myCout
00664             << "\nL1 Technical Triggers: " << nrDefinedTechTrig
00665             << " technical triggers defined." << "\n\n" << std::endl;
00666             if (nrDefinedTechTrig) {
00667                 myCout << "Bit Number " << " Technical trigger name " << std::endl;
00668             }
00669 
00670             for (CItBit itBit = ttBitToTt.begin(); itBit != ttBitToTt.end(); itBit++) {
00671 
00672                 int bitNumber = itBit->first;
00673                 std::string aName = (itBit->second)->algoName();
00674 
00675                 myCout << std::setw(6) << bitNumber << "       " << aName << std::endl;
00676             }
00677         }
00678             break;
00679 
00680         case 2: {
00681 
00682             // header for printing algorithms
00683 
00684             myCout << "\n   ********** L1 Trigger Menu - printing   ********** \n"
00685             << "\nL1 Trigger Menu Interface: " << m_triggerMenuInterface
00686             << "\nL1 Trigger Menu Name:      " << m_triggerMenuName
00687             << "\nL1 Trigger Menu Implementation: " << m_triggerMenuImplementation
00688             << "\nAssociated Scale DB Key: " << m_scaleDbKey << "\n\n"
00689             << "\nL1 Physics Algorithms: " << nrDefinedAlgo << " algorithms defined." << "\n\n"
00690             << std::endl;
00691 
00692             for (CItBit itBit = algoBitToAlgo.begin(); itBit != algoBitToAlgo.end(); itBit++) {
00693                 (itBit->second)->print(myCout);
00694             }
00695 
00696 
00697             myCout << "\nNumber of condition chips: " << m_conditionMap.size() << "\n"
00698             << std::endl;
00699 
00700             int chipNr = -1;
00701             int totalNrConditions = 0;
00702 
00703             for (std::vector<ConditionMap>::const_iterator
00704                     itCondOnChip = m_conditionMap.begin();
00705                     itCondOnChip != m_conditionMap.end(); itCondOnChip++) {
00706 
00707                 chipNr++;
00708 
00709                 int condMapSize = itCondOnChip->size();
00710                 totalNrConditions += condMapSize;
00711 
00712                 myCout << "\nTotal number of conditions on condition chip " << chipNr
00713                 << ": " << condMapSize
00714                 << " conditions.\n" << std::endl;
00715 
00716                 for (CItCond itCond = itCondOnChip->begin(); itCond != itCondOnChip->end();
00717                     itCond++) {
00718 
00719                     (itCond->second)->print(myCout);
00720 
00721                 }
00722 
00723             }
00724 
00725             myCout << "\nTotal number of conditions on all condition chips: "
00726             << totalNrConditions << "\n"
00727             << std::endl;
00728 
00729             myCout
00730             << "\nL1 Technical Triggers: " << nrDefinedTechTrig
00731             << " technical triggers defined." << "\n\n" << std::endl;
00732             if (nrDefinedTechTrig) {
00733                 myCout << "Bit Number " << " Technical trigger name " << std::endl;
00734             }
00735 
00736             for (CItBit itBit = ttBitToTt.begin(); itBit != ttBitToTt.end(); itBit++) {
00737 
00738                 int bitNumber = itBit->first;
00739                 std::string aName = (itBit->second)->algoName();
00740 
00741                 myCout << std::setw(6) << bitNumber << "       " << aName << std::endl;
00742             }
00743 
00744 
00745         }
00746             break;
00747 
00748         default: {
00749             myCout << "\n   ********** L1 Trigger Menu - printing   ********** \n\n"
00750             << "Verbosity level: " << printVerbosity << " not implemented.\n\n"
00751             << std::endl;
00752         }
00753             break;
00754     }
00755 
00756 }
00757 
00758 // get the result for algorithm with name algName
00759 // use directly the format of decisionWord (no typedef)
00760 const bool L1GtTriggerMenu::gtAlgorithmResult(const std::string& algName,
00761         const std::vector<bool>& decWord) const {
00762 
00763     bool algResult = false;
00764 
00765     CItAlgo itAlgo = m_algorithmMap.find(algName);
00766     if (itAlgo != m_algorithmMap.end()) {
00767         int bitNumber = (itAlgo->second).algoBitNumber();
00768         algResult = decWord.at(bitNumber);
00769         return algResult;
00770     }
00771 
00772     // return false if the algorithm name is not found in the menu
00773     // TODO throw exception or LogInfo would be better - but the class is used in
00774     // XDAQ Trigger Supervisor (outside CMSSW) hence no CMSSW dependence
00775     // is allowed here...
00776 
00777     return false;
00778 
00779 }
00780 
00781