#include <L1TriggerConfig/L1GtConfigProducers/interface/L1GtTriggerMenuTester.h>
Public Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
L1GtTriggerMenuTester (const edm::ParameterSet &) | |
virtual | ~L1GtTriggerMenuTester () |
Implementation: <TODO: enter implementation details>
$Date$ $Revision$
Definition at line 37 of file L1GtTriggerMenuTester.h.
L1GtTriggerMenuTester::L1GtTriggerMenuTester | ( | const edm::ParameterSet & | parSet | ) | [explicit] |
L1GtTriggerMenuTester::~L1GtTriggerMenuTester | ( | ) | [virtual] |
void L1GtTriggerMenuTester::analyze | ( | const edm::Event & | iEvent, | |
const edm::EventSetup & | evSetup | |||
) | [virtual] |
Implements edm::EDAnalyzer.
Definition at line 62 of file L1GtTriggerMenuTester.cc.
References asciidump::at, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), flush(), and edm::EventSetup::get().
00063 { 00064 00065 edm::ESHandle< L1GtTriggerMenu> l1GtMenu; 00066 evSetup.get< L1GtTriggerMenuRcd>().get(l1GtMenu); 00067 00068 // print with various level of verbosities 00069 00070 int printVerbosity = 0; 00071 l1GtMenu->print(std::cout, printVerbosity); 00072 std::cout << std::flush << std::endl; 00073 00074 printVerbosity = 1; 00075 l1GtMenu->print(std::cout, printVerbosity); 00076 std::cout << std::flush << std::endl; 00077 00078 printVerbosity = 2; 00079 l1GtMenu->print(std::cout, printVerbosity); 00080 std::cout << std::flush << std::endl; 00081 00082 // 00083 // print menu, prescale factors and trigger mask in wiki format 00084 // 00085 00086 // L1 GT prescale factors for algorithm triggers 00087 edm::ESHandle< L1GtPrescaleFactors> l1GtPfAlgo; 00088 evSetup.get< L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo); 00089 00090 int indexPfSet = 0; // FIXME 00091 00092 std::vector<int> prescaleFactorsAlgoTrig = 00093 (l1GtPfAlgo->gtPrescaleFactors()).at(indexPfSet); 00094 00095 00096 // L1 GT prescale factors for technical triggers 00097 edm::ESHandle< L1GtPrescaleFactors> l1GtPfTech; 00098 evSetup.get< L1GtPrescaleFactorsTechTrigRcd>().get(l1GtPfTech); 00099 00100 std::vector<int> prescaleFactorsTechTrig = 00101 (l1GtPfTech->gtPrescaleFactors()).at(indexPfSet); 00102 00103 00104 // L1 GT trigger masks for algorithm triggers 00105 edm::ESHandle< L1GtTriggerMask> l1GtTmAlgo; 00106 evSetup.get< L1GtTriggerMaskAlgoTrigRcd>().get(l1GtTmAlgo); 00107 00108 std::vector<unsigned int> triggerMaskAlgoTrig = l1GtTmAlgo->gtTriggerMask(); 00109 00110 00111 // L1 GT trigger masks for technical triggers 00112 edm::ESHandle< L1GtTriggerMask> l1GtTmTech; 00113 evSetup.get< L1GtTriggerMaskTechTrigRcd>().get(l1GtTmTech); 00114 00115 std::vector<unsigned int> triggerMaskTechTrig = l1GtTmTech->gtTriggerMask(); 00116 00117 00118 // L1 GT trigger veto masks for algorithm triggers 00119 edm::ESHandle< L1GtTriggerMask> l1GtTmVetoAlgo; 00120 evSetup.get< L1GtTriggerMaskVetoAlgoTrigRcd>().get(l1GtTmVetoAlgo); 00121 00122 std::vector<unsigned int> triggerMaskVetoAlgoTrig = l1GtTmVetoAlgo->gtTriggerMask(); 00123 00124 00125 // L1 GT trigger veto masks for technical triggers 00126 edm::ESHandle< L1GtTriggerMask> l1GtTmVetoTech; 00127 evSetup.get< L1GtTriggerMaskVetoTechTrigRcd>().get(l1GtTmVetoTech); 00128 00129 std::vector<unsigned int> triggerMaskVetoTechTrig = l1GtTmVetoTech->gtTriggerMask(); 00130 00131 // set the index of physics DAQ partition TODO EventSetup? 00132 int physicsDaqPartition = 0; 00133 00134 // use another map <int, L1GtAlgorithm> to get the menu sorted after bit number 00135 // both algorithm and bit numbers are unique 00136 std::map<int, const L1GtAlgorithm*> algoBitToAlgo; 00137 typedef std::map<int, const L1GtAlgorithm*>::const_iterator CItBit; 00138 00139 const AlgorithmMap& algorithmMap = l1GtMenu->gtAlgorithmMap(); 00140 00141 for (CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) { 00142 00143 int bitNumber = (itAlgo->second).algoBitNumber(); 00144 algoBitToAlgo[bitNumber] = &(itAlgo->second); 00145 } 00146 00147 // header for printing algorithms 00148 00149 std::cout 00150 << "\n ********** L1 Trigger Menu - printing ********** \n\n" 00151 << "L1 Trigger Menu Name: " << l1GtMenu->gtTriggerMenuName() << "\n\n" << std::flush 00152 << std::endl; 00153 00154 std::cout 00155 << "| *Algorithm* | *Bit number* | *Prescale factor* | *Mask* |" 00156 << std::endl; 00157 00158 for (CItBit itBit = algoBitToAlgo.begin(); itBit != algoBitToAlgo.end(); itBit++) { 00159 00160 int bitNumber = itBit->first; 00161 std::string aName = (itBit->second)->algoName(); 00162 00163 unsigned int triggerMaskAlgo = 00164 (triggerMaskAlgoTrig.at(bitNumber)) & (1 << physicsDaqPartition); 00165 00166 std::cout 00167 << "|" << std::left << aName << " | " << std::right << bitNumber 00168 << "| " << prescaleFactorsAlgoTrig.at(bitNumber) 00169 << "| " << triggerMaskAlgo 00170 << " |" 00171 << std::endl; 00172 } 00173 00174 std::cout 00175 << "\nNOTE: only the prescale factors from set index zero are printed!" 00176 << std::endl; 00177 00178 }