CMS 3D CMS Logo

L1GtTriggerMenuLiteProducer.cc
Go to the documentation of this file.
1 
17 // this class header
19 
20 // system include files
21 #include <iostream>
22 
23 // user include files
25 
28 
32 
35 
38 
41 
45 
49 
50 // constructor(s)
52  : m_l1GtStableParCacheID(0ULL),
53  m_numberPhysTriggers(0),
54 
55  m_numberTechnicalTriggers(0),
56 
57  m_l1GtMenuCacheID(0ULL),
58 
59  m_l1GtTmAlgoCacheID(0ULL),
60  m_l1GtTmTechCacheID(0ULL),
61 
62  m_l1GtPfAlgoCacheID(0ULL),
63  m_l1GtPfTechCacheID(0ULL),
64 
65  m_physicsDaqPartition(0) {
66  // EDM product in Run Data
67  produces<L1GtTriggerMenuLite, edm::Transition::BeginRun>();
68 }
69 
70 // destructor
72  // empty
73 }
74 
76  // get / update the stable parameters from the EventSetup
77  // local cache & check on cacheIdentifier
78 
79  unsigned long long l1GtStableParCacheID = evSetup.get<L1GtStableParametersRcd>().cacheIdentifier();
80 
81  if (m_l1GtStableParCacheID != l1GtStableParCacheID) {
83  evSetup.get<L1GtStableParametersRcd>().get(l1GtStablePar);
84  m_l1GtStablePar = l1GtStablePar.product();
85 
86  // number of physics triggers
88 
89  // number of technical triggers
91 
92  //
93  m_l1GtStableParCacheID = l1GtStableParCacheID;
94  }
95 
96  // get / update the prescale factors from the EventSetup
97  // local cache & check on cacheIdentifier
98 
99  unsigned long long l1GtPfAlgoCacheID = evSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().cacheIdentifier();
100 
101  if (m_l1GtPfAlgoCacheID != l1GtPfAlgoCacheID) {
103  evSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo);
104  m_l1GtPfAlgo = l1GtPfAlgo.product();
105 
107 
108  m_l1GtPfAlgoCacheID = l1GtPfAlgoCacheID;
109  }
110 
111  unsigned long long l1GtPfTechCacheID = evSetup.get<L1GtPrescaleFactorsTechTrigRcd>().cacheIdentifier();
112 
113  if (m_l1GtPfTechCacheID != l1GtPfTechCacheID) {
115  evSetup.get<L1GtPrescaleFactorsTechTrigRcd>().get(l1GtPfTech);
116  m_l1GtPfTech = l1GtPfTech.product();
117 
119 
120  m_l1GtPfTechCacheID = l1GtPfTechCacheID;
121  }
122 
123  // get / update the trigger mask from the EventSetup
124  // local cache & check on cacheIdentifier
125 
126  unsigned long long l1GtTmAlgoCacheID = evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().cacheIdentifier();
127 
128  if (m_l1GtTmAlgoCacheID != l1GtTmAlgoCacheID) {
130  evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().get(l1GtTmAlgo);
131  m_l1GtTmAlgo = l1GtTmAlgo.product();
132 
134 
135  m_l1GtTmAlgoCacheID = l1GtTmAlgoCacheID;
136  }
137 
138  unsigned long long l1GtTmTechCacheID = evSetup.get<L1GtTriggerMaskTechTrigRcd>().cacheIdentifier();
139 
140  if (m_l1GtTmTechCacheID != l1GtTmTechCacheID) {
142  evSetup.get<L1GtTriggerMaskTechTrigRcd>().get(l1GtTmTech);
143  m_l1GtTmTech = l1GtTmTech.product();
144 
146 
147  m_l1GtTmTechCacheID = l1GtTmTechCacheID;
148  }
149 
150  // get / update the trigger menu from the EventSetup
151  // local cache & check on cacheIdentifier
152 
153  unsigned long long l1GtMenuCacheID = evSetup.get<L1GtTriggerMenuRcd>().cacheIdentifier();
154 
155  if (m_l1GtMenuCacheID != l1GtMenuCacheID) {
157  evSetup.get<L1GtTriggerMenuRcd>().get(l1GtMenu);
158  m_l1GtMenu = l1GtMenu.product();
159 
162 
164 
165  m_l1GtMenuCacheID = l1GtMenuCacheID;
166  }
167 }
168 
169 // member functions
170 
172  // empty
173 }
174 
176  //
177 
178  retrieveL1EventSetup(evSetup);
179 
180  // produce the L1GtTriggerMenuLite
181  std::unique_ptr<L1GtTriggerMenuLite> gtTriggerMenuLite(new L1GtTriggerMenuLite());
182 
183  // lite L1 trigger menu
184 
185  gtTriggerMenuLite->setGtTriggerMenuInterface(m_l1GtMenu->gtTriggerMenuInterface());
186  gtTriggerMenuLite->setGtTriggerMenuName(m_l1GtMenu->gtTriggerMenuName());
187  gtTriggerMenuLite->setGtTriggerMenuImplementation(m_l1GtMenu->gtTriggerMenuImplementation());
188 
189  gtTriggerMenuLite->setGtScaleDbKey(m_l1GtMenu->gtScaleDbKey());
190 
191  //
193  for (CItAlgo itAlgo = m_algorithmMap->begin(); itAlgo != m_algorithmMap->end(); itAlgo++) {
194  unsigned int bitNumber = (itAlgo->second).algoBitNumber();
195  algMap[bitNumber] = itAlgo->first;
196  }
197 
198  gtTriggerMenuLite->setGtAlgorithmMap(algMap);
199 
200  //
202  for (CItAlgo itAlgo = m_algorithmAliasMap->begin(); itAlgo != m_algorithmAliasMap->end(); itAlgo++) {
203  unsigned int bitNumber = (itAlgo->second).algoBitNumber();
204  algAliasMap[bitNumber] = itAlgo->first;
205  }
206 
207  gtTriggerMenuLite->setGtAlgorithmAliasMap(algAliasMap);
208 
209  //
211  for (CItAlgo itAlgo = m_technicalTriggerMap->begin(); itAlgo != m_technicalTriggerMap->end(); itAlgo++) {
212  unsigned int bitNumber = (itAlgo->second).algoBitNumber();
213  techMap[bitNumber] = itAlgo->first;
214  }
215 
216  gtTriggerMenuLite->setGtTechnicalTriggerMap(techMap);
217 
218  // trigger masks
219  std::vector<unsigned int> triggerMaskAlgoTrig(m_numberPhysTriggers, 0);
220  int iBit = -1;
221 
222  for (std::vector<unsigned int>::const_iterator itBit = m_triggerMaskAlgoTrig->begin();
223  itBit != m_triggerMaskAlgoTrig->end();
224  itBit++) {
225  iBit++;
226  triggerMaskAlgoTrig[iBit] = (*itBit) & (1 << m_physicsDaqPartition);
227  }
228  gtTriggerMenuLite->setGtTriggerMaskAlgoTrig(triggerMaskAlgoTrig);
229 
230  //
231  std::vector<unsigned int> triggerMaskTechTrig(m_numberTechnicalTriggers, 0);
232  iBit = -1;
233 
234  for (std::vector<unsigned int>::const_iterator itBit = m_triggerMaskTechTrig->begin();
235  itBit != m_triggerMaskTechTrig->end();
236  itBit++) {
237  iBit++;
238  triggerMaskTechTrig[iBit] = (*itBit) & (1 << m_physicsDaqPartition);
239  }
240  gtTriggerMenuLite->setGtTriggerMaskTechTrig(triggerMaskTechTrig);
241 
242  //
243  gtTriggerMenuLite->setGtPrescaleFactorsAlgoTrig(*m_prescaleFactorsAlgoTrig);
244  gtTriggerMenuLite->setGtPrescaleFactorsTechTrig(*m_prescaleFactorsTechTrig);
245 
246  // print menu, trigger masks and prescale factors
247  if (edm::isDebugEnabled()) {
248  LogDebug("L1GtTriggerMenuLiteProducer") << *gtTriggerMenuLite;
249  }
250 
251  // put records into event
252  iRun.put(std::move(gtTriggerMenuLite));
253 }
254 
256 
257 //
259  // empty now
260 }
261 
262 // static class members
263 
264 //define this as a plug-in
L1GtTriggerMenuLiteProducer::m_l1GtPfAlgoCacheID
unsigned long long m_l1GtPfAlgoCacheID
Definition: L1GtTriggerMenuLiteProducer.h:95
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
L1GtTriggerMenuLiteProducer::m_l1GtPfAlgo
const L1GtPrescaleFactors * m_l1GtPfAlgo
prescale factors
Definition: L1GtTriggerMenuLiteProducer.h:94
L1GtTriggerMenu.h
L1GtTriggerMenu::gtTriggerMenuName
const std::string & gtTriggerMenuName() const
Definition: L1GtTriggerMenu.h:91
MessageLogger.h
L1GtTriggerMaskAlgoTrigRcd.h
L1GtTriggerMask.h
ESHandle.h
L1GtTriggerMenuLiteProducer::m_numberTechnicalTriggers
unsigned int m_numberTechnicalTriggers
number of technical triggers
Definition: L1GtTriggerMenuLiteProducer.h:73
L1GtStableParameters::gtNumberTechnicalTriggers
unsigned int gtNumberTechnicalTriggers() const
get / set the number of technical triggers
Definition: L1GtStableParameters.h:53
L1GtTriggerMenuLiteProducer::m_algorithmAliasMap
const AlgorithmMap * m_algorithmAliasMap
Definition: L1GtTriggerMenuLiteProducer.h:80
L1GtTriggerMenuLiteProducer::m_algorithmMap
const AlgorithmMap * m_algorithmMap
Definition: L1GtTriggerMenuLiteProducer.h:79
L1GtTriggerMenuLiteProducer::m_l1GtTmTechCacheID
unsigned long long m_l1GtTmTechCacheID
Definition: L1GtTriggerMenuLiteProducer.h:88
edm::Run
Definition: Run.h:45
L1GtTriggerMenuLiteProducer::m_technicalTriggerMap
const AlgorithmMap * m_technicalTriggerMap
Definition: L1GtTriggerMenuLiteProducer.h:81
L1GtTriggerMenuRcd.h
L1GtTriggerMenuLiteProducer::m_l1GtMenu
const L1GtTriggerMenu * m_l1GtMenu
Definition: L1GtTriggerMenuLiteProducer.h:76
L1GtTriggerMenuLiteProducer::m_triggerMaskTechTrig
const std::vector< unsigned int > * m_triggerMaskTechTrig
Definition: L1GtTriggerMenuLiteProducer.h:91
L1GtTriggerMenuLiteProducer::endJob
void endJob() override
Definition: L1GtTriggerMenuLiteProducer.cc:258
L1GtPrescaleFactors::gtPrescaleFactors
const std::vector< std::vector< int > > & gtPrescaleFactors() const
get the prescale factors by reference
Definition: L1GtPrescaleFactors.h:45
L1GtTriggerMenu::gtTriggerMenuImplementation
const std::string & gtTriggerMenuImplementation() const
Definition: L1GtTriggerMenu.h:96
L1GtTriggerMaskTechTrigRcd.h
L1GtStableParametersRcd.h
L1GtTriggerMenuLiteProducer::beginRunProduce
void beginRunProduce(edm::Run &, const edm::EventSetup &) final
Definition: L1GtTriggerMenuLiteProducer.cc:175
L1GtTriggerMenuLiteProducer::m_physicsDaqPartition
unsigned int m_physicsDaqPartition
index of physics DAQ partition
Definition: L1GtTriggerMenuLiteProducer.h:105
L1GtTriggerMenuLite.h
L1GtPrescaleFactorsTechTrigRcd
Definition: L1GtPrescaleFactorsTechTrigRcd.h:38
L1GtTriggerMenu::gtScaleDbKey
const std::string & gtScaleDbKey() const
menu associated scale key
Definition: L1GtTriggerMenu.h:101
L1GtTriggerMenuLiteProducer::m_l1GtMenuCacheID
unsigned long long m_l1GtMenuCacheID
Definition: L1GtTriggerMenuLiteProducer.h:77
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::Run::put
void put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Run.h:108
CItAlgo
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
Definition: L1GtTriggerMenuFwd.h:38
L1GtTriggerMenu::gtTriggerMenuInterface
const std::string & gtTriggerMenuInterface() const
get / set the trigger menu names
Definition: L1GtTriggerMenu.h:86
L1GtTriggerMaskTechTrigRcd
Definition: L1GtTriggerMaskTechTrigRcd.h:39
L1GtTriggerMenuRcd
Definition: L1GtTriggerMenuRcd.h:32
Run.h
L1GtTriggerMaskAlgoTrigRcd
Definition: L1GtTriggerMaskAlgoTrigRcd.h:39
edm::ESHandle
Definition: DTSurvey.h:22
L1GtTriggerMenuLiteProducer::m_prescaleFactorsTechTrig
const std::vector< std::vector< int > > * m_prescaleFactorsTechTrig
Definition: L1GtTriggerMenuLiteProducer.h:101
L1GtTriggerMenuLiteProducer::~L1GtTriggerMenuLiteProducer
~L1GtTriggerMenuLiteProducer() override
destructor
Definition: L1GtTriggerMenuLiteProducer.cc:71
L1GtTriggerMenuLiteProducer
Definition: L1GtTriggerMenuLiteProducer.h:42
L1GtTriggerMenuLiteProducer::L1GtTriggerMenuLiteProducer
L1GtTriggerMenuLiteProducer(const edm::ParameterSet &)
constructor(s)
Definition: L1GtTriggerMenuLiteProducer.cc:51
L1GtTriggerMenuLiteProducer::m_l1GtTmAlgoCacheID
unsigned long long m_l1GtTmAlgoCacheID
Definition: L1GtTriggerMenuLiteProducer.h:85
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
MessageDrop.h
edm::ParameterSet
Definition: ParameterSet.h:36
L1GtTriggerMask::gtTriggerMask
const std::vector< unsigned int > & gtTriggerMask() const
get the trigger mask
Definition: L1GtTriggerMask.h:47
L1GtTriggerMenuLiteProducer::m_l1GtTmAlgo
const L1GtTriggerMask * m_l1GtTmAlgo
trigger masks
Definition: L1GtTriggerMenuLiteProducer.h:84
iEvent
int iEvent
Definition: GenABIO.cc:224
L1GtPrescaleFactorsAlgoTrigRcd.h
L1GtTriggerMenu::gtAlgorithmAliasMap
const AlgorithmMap & gtAlgorithmAliasMap() const
get / set the algorithm map (by alias)
Definition: L1GtTriggerMenu.h:192
L1GtStableParameters::gtNumberPhysTriggers
unsigned int gtNumberPhysTriggers() const
get / set the number of physics trigger algorithms
Definition: L1GtStableParameters.h:43
L1GtTriggerMenuLiteProducer::m_triggerMaskAlgoTrig
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
Definition: L1GtTriggerMenuLiteProducer.h:90
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
L1GtStableParametersRcd
Definition: L1GtStableParametersRcd.h:39
InputTag.h
L1GtTriggerMenuLiteProducer::m_l1GtPfTechCacheID
unsigned long long m_l1GtPfTechCacheID
Definition: L1GtTriggerMenuLiteProducer.h:98
L1GtTriggerMenuLite
Definition: L1GtTriggerMenuLite.h:39
L1GtTriggerMenuLiteProducer::produce
void produce(edm::Event &, const edm::EventSetup &) final
Definition: L1GtTriggerMenuLiteProducer.cc:255
eostools.move
def move(src, dest)
Definition: eostools.py:511
L1GtTriggerMenuLiteProducer::m_l1GtStableParCacheID
unsigned long long m_l1GtStableParCacheID
Definition: L1GtTriggerMenuLiteProducer.h:67
L1GtTriggerMenuLiteProducer::m_l1GtStablePar
const L1GtStableParameters * m_l1GtStablePar
cached stuff
Definition: L1GtTriggerMenuLiteProducer.h:66
L1GtTriggerMenuLiteProducer::m_l1GtTmTech
const L1GtTriggerMask * m_l1GtTmTech
Definition: L1GtTriggerMenuLiteProducer.h:87
EventSetup.h
edm::isDebugEnabled
bool isDebugEnabled()
Definition: MessageLogger.cc:71
L1GtTriggerMenuLiteProducer.h
L1TBPTX_cfi.bitNumber
bitNumber
Definition: L1TBPTX_cfi.py:26
L1GtTriggerMenuLiteProducer::m_l1GtPfTech
const L1GtPrescaleFactors * m_l1GtPfTech
Definition: L1GtTriggerMenuLiteProducer.h:97
L1GtTriggerMenuLiteProducer::retrieveL1EventSetup
void retrieveL1EventSetup(const edm::EventSetup &)
Definition: L1GtTriggerMenuLiteProducer.cc:75
ParameterSet.h
L1GtPrescaleFactorsAlgoTrigRcd
Definition: L1GtPrescaleFactorsAlgoTrigRcd.h:38
L1GtTriggerMenuLite::L1TriggerMap
std::map< unsigned int, std::string > L1TriggerMap
map containing the physics algorithms or the technical triggers
Definition: L1GtTriggerMenuLite.h:42
edm::Event
Definition: Event.h:73
L1GtTriggerMenu::gtTechnicalTriggerMap
const AlgorithmMap & gtTechnicalTriggerMap() const
get / set the technical trigger map
Definition: L1GtTriggerMenu.h:197
L1GtTriggerMenuLiteProducer::m_prescaleFactorsAlgoTrig
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
Definition: L1GtTriggerMenuLiteProducer.h:100
L1GtStableParameters.h
L1GtPrescaleFactors.h
L1GtTriggerMenu::gtAlgorithmMap
const AlgorithmMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
Definition: L1GtTriggerMenu.h:187
L1GtTriggerMenuLiteProducer::m_numberPhysTriggers
unsigned int m_numberPhysTriggers
number of physics triggers
Definition: L1GtTriggerMenuLiteProducer.h:70
L1GtTriggerMenuLiteProducer::beginJob
void beginJob() final
Definition: L1GtTriggerMenuLiteProducer.cc:171
L1GtPrescaleFactorsTechTrigRcd.h