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 
36 // constructor(s)
38  : m_l1GtStableParCacheID(0ULL),
39  m_numberPhysTriggers(0),
40 
41  m_numberTechnicalTriggers(0),
42 
43  m_l1GtMenuCacheID(0ULL),
44 
45  m_l1GtTmAlgoCacheID(0ULL),
46  m_l1GtTmTechCacheID(0ULL),
47 
48  m_l1GtPfAlgoCacheID(0ULL),
49  m_l1GtPfTechCacheID(0ULL),
50 
51  m_l1GtStableParamToken(esConsumes<L1GtStableParameters, L1GtStableParametersRcd, edm::Transition::BeginRun>()),
52  m_l1GtPfAlgoToken(esConsumes<L1GtPrescaleFactors, L1GtPrescaleFactorsAlgoTrigRcd, edm::Transition::BeginRun>()),
53  m_l1GtPfTechToken(esConsumes<L1GtPrescaleFactors, L1GtPrescaleFactorsTechTrigRcd, edm::Transition::BeginRun>()),
54  m_l1GtTmAlgoToken(esConsumes<L1GtTriggerMask, L1GtTriggerMaskAlgoTrigRcd, edm::Transition::BeginRun>()),
55  m_l1GtTmTechToken(esConsumes<L1GtTriggerMask, L1GtTriggerMaskTechTrigRcd, edm::Transition::BeginRun>()),
56  m_l1GtMenuToken(esConsumes<L1GtTriggerMenu, L1GtTriggerMenuRcd, edm::Transition::BeginRun>()),
57  m_physicsDaqPartition(0) {
58  // EDM product in Run Data
59  produces<L1GtTriggerMenuLite, edm::Transition::BeginRun>();
60 }
61 
62 // destructor
64  // empty
65 }
66 
68  // get / update the stable parameters from the EventSetup
69  // local cache & check on cacheIdentifier
70 
71  unsigned long long l1GtStableParCacheID = evSetup.get<L1GtStableParametersRcd>().cacheIdentifier();
72 
73  if (m_l1GtStableParCacheID != l1GtStableParCacheID) {
75  m_l1GtStablePar = l1GtStablePar.product();
76 
77  // number of physics triggers
79 
80  // number of technical triggers
82 
83  //
84  m_l1GtStableParCacheID = l1GtStableParCacheID;
85  }
86 
87  // get / update the prescale factors from the EventSetup
88  // local cache & check on cacheIdentifier
89 
90  unsigned long long l1GtPfAlgoCacheID = evSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().cacheIdentifier();
91 
92  if (m_l1GtPfAlgoCacheID != l1GtPfAlgoCacheID) {
94  m_l1GtPfAlgo = l1GtPfAlgo.product();
95 
97 
98  m_l1GtPfAlgoCacheID = l1GtPfAlgoCacheID;
99  }
100 
101  unsigned long long l1GtPfTechCacheID = evSetup.get<L1GtPrescaleFactorsTechTrigRcd>().cacheIdentifier();
102 
103  if (m_l1GtPfTechCacheID != l1GtPfTechCacheID) {
105  m_l1GtPfTech = l1GtPfTech.product();
106 
108 
109  m_l1GtPfTechCacheID = l1GtPfTechCacheID;
110  }
111 
112  // get / update the trigger mask from the EventSetup
113  // local cache & check on cacheIdentifier
114 
115  unsigned long long l1GtTmAlgoCacheID = evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().cacheIdentifier();
116 
117  if (m_l1GtTmAlgoCacheID != l1GtTmAlgoCacheID) {
119  m_l1GtTmAlgo = l1GtTmAlgo.product();
120 
122 
123  m_l1GtTmAlgoCacheID = l1GtTmAlgoCacheID;
124  }
125 
126  unsigned long long l1GtTmTechCacheID = evSetup.get<L1GtTriggerMaskTechTrigRcd>().cacheIdentifier();
127 
128  if (m_l1GtTmTechCacheID != l1GtTmTechCacheID) {
130  m_l1GtTmTech = l1GtTmTech.product();
131 
133 
134  m_l1GtTmTechCacheID = l1GtTmTechCacheID;
135  }
136 
137  // get / update the trigger menu from the EventSetup
138  // local cache & check on cacheIdentifier
139 
140  unsigned long long l1GtMenuCacheID = evSetup.get<L1GtTriggerMenuRcd>().cacheIdentifier();
141 
142  if (m_l1GtMenuCacheID != l1GtMenuCacheID) {
144  m_l1GtMenu = l1GtMenu.product();
145 
148 
150 
151  m_l1GtMenuCacheID = l1GtMenuCacheID;
152  }
153 }
154 
155 // member functions
156 
158  // empty
159 }
160 
162  //
163 
164  retrieveL1EventSetup(evSetup);
165 
166  // produce the L1GtTriggerMenuLite
167  std::unique_ptr<L1GtTriggerMenuLite> gtTriggerMenuLite(new L1GtTriggerMenuLite());
168 
169  // lite L1 trigger menu
170 
171  gtTriggerMenuLite->setGtTriggerMenuInterface(m_l1GtMenu->gtTriggerMenuInterface());
172  gtTriggerMenuLite->setGtTriggerMenuName(m_l1GtMenu->gtTriggerMenuName());
173  gtTriggerMenuLite->setGtTriggerMenuImplementation(m_l1GtMenu->gtTriggerMenuImplementation());
174 
175  gtTriggerMenuLite->setGtScaleDbKey(m_l1GtMenu->gtScaleDbKey());
176 
177  //
179  for (CItAlgo itAlgo = m_algorithmMap->begin(); itAlgo != m_algorithmMap->end(); itAlgo++) {
180  unsigned int bitNumber = (itAlgo->second).algoBitNumber();
181  algMap[bitNumber] = itAlgo->first;
182  }
183 
184  gtTriggerMenuLite->setGtAlgorithmMap(algMap);
185 
186  //
188  for (CItAlgo itAlgo = m_algorithmAliasMap->begin(); itAlgo != m_algorithmAliasMap->end(); itAlgo++) {
189  unsigned int bitNumber = (itAlgo->second).algoBitNumber();
190  algAliasMap[bitNumber] = itAlgo->first;
191  }
192 
193  gtTriggerMenuLite->setGtAlgorithmAliasMap(algAliasMap);
194 
195  //
197  for (CItAlgo itAlgo = m_technicalTriggerMap->begin(); itAlgo != m_technicalTriggerMap->end(); itAlgo++) {
198  unsigned int bitNumber = (itAlgo->second).algoBitNumber();
199  techMap[bitNumber] = itAlgo->first;
200  }
201 
202  gtTriggerMenuLite->setGtTechnicalTriggerMap(techMap);
203 
204  // trigger masks
205  std::vector<unsigned int> triggerMaskAlgoTrig(m_numberPhysTriggers, 0);
206  int iBit = -1;
207 
208  for (std::vector<unsigned int>::const_iterator itBit = m_triggerMaskAlgoTrig->begin();
209  itBit != m_triggerMaskAlgoTrig->end();
210  itBit++) {
211  iBit++;
212  triggerMaskAlgoTrig[iBit] = (*itBit) & (1 << m_physicsDaqPartition);
213  }
214  gtTriggerMenuLite->setGtTriggerMaskAlgoTrig(triggerMaskAlgoTrig);
215 
216  //
217  std::vector<unsigned int> triggerMaskTechTrig(m_numberTechnicalTriggers, 0);
218  iBit = -1;
219 
220  for (std::vector<unsigned int>::const_iterator itBit = m_triggerMaskTechTrig->begin();
221  itBit != m_triggerMaskTechTrig->end();
222  itBit++) {
223  iBit++;
224  triggerMaskTechTrig[iBit] = (*itBit) & (1 << m_physicsDaqPartition);
225  }
226  gtTriggerMenuLite->setGtTriggerMaskTechTrig(triggerMaskTechTrig);
227 
228  //
229  gtTriggerMenuLite->setGtPrescaleFactorsAlgoTrig(*m_prescaleFactorsAlgoTrig);
230  gtTriggerMenuLite->setGtPrescaleFactorsTechTrig(*m_prescaleFactorsTechTrig);
231 
232  // print menu, trigger masks and prescale factors
233  if (edm::isDebugEnabled()) {
234  LogDebug("L1GtTriggerMenuLiteProducer") << *gtTriggerMenuLite;
235  }
236 
237  // put records into event
238  iRun.put(std::move(gtTriggerMenuLite));
239 }
240 
242 
243 //
245  // empty now
246 }
247 
248 // static class members
249 
250 //define this as a plug-in
L1GtTriggerMenuLiteProducer::m_l1GtPfAlgoCacheID
unsigned long long m_l1GtPfAlgoCacheID
Definition: L1GtTriggerMenuLiteProducer.h:106
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
L1GtTriggerMenuLiteProducer::m_l1GtPfAlgo
const L1GtPrescaleFactors * m_l1GtPfAlgo
prescale factors
Definition: L1GtTriggerMenuLiteProducer.h:105
L1GtTriggerMenu::gtTriggerMenuName
const std::string & gtTriggerMenuName() const
Definition: L1GtTriggerMenu.h:91
L1GtPrescaleFactors
Definition: L1GtPrescaleFactors.h:32
MessageLogger.h
ESHandle.h
L1GtTriggerMenuLiteProducer::m_numberTechnicalTriggers
unsigned int m_numberTechnicalTriggers
number of technical triggers
Definition: L1GtTriggerMenuLiteProducer.h:84
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:91
L1GtTriggerMenuLiteProducer::m_algorithmMap
const AlgorithmMap * m_algorithmMap
Definition: L1GtTriggerMenuLiteProducer.h:90
L1GtTriggerMenuLiteProducer::m_l1GtTmTechCacheID
unsigned long long m_l1GtTmTechCacheID
Definition: L1GtTriggerMenuLiteProducer.h:99
edm::Run
Definition: Run.h:45
edm
HLT enums.
Definition: AlignableModifier.h:19
L1GtTriggerMenuLiteProducer::m_technicalTriggerMap
const AlgorithmMap * m_technicalTriggerMap
Definition: L1GtTriggerMenuLiteProducer.h:92
L1GtTriggerMenuLiteProducer::m_l1GtMenu
const L1GtTriggerMenu * m_l1GtMenu
Definition: L1GtTriggerMenuLiteProducer.h:87
L1GtTriggerMenuLiteProducer::m_triggerMaskTechTrig
const std::vector< unsigned int > * m_triggerMaskTechTrig
Definition: L1GtTriggerMenuLiteProducer.h:102
L1GtTriggerMenuLiteProducer::endJob
void endJob() override
Definition: L1GtTriggerMenuLiteProducer.cc:244
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
L1GtTriggerMenuLiteProducer::beginRunProduce
void beginRunProduce(edm::Run &, const edm::EventSetup &) final
Definition: L1GtTriggerMenuLiteProducer.cc:161
L1GtTriggerMenuLiteProducer::m_physicsDaqPartition
unsigned int m_physicsDaqPartition
index of physics DAQ partition
Definition: L1GtTriggerMenuLiteProducer.h:124
L1GtTriggerMenuLite.h
L1GtTriggerMenuLiteProducer::m_l1GtTmTechToken
const edm::ESGetToken< L1GtTriggerMask, L1GtTriggerMaskTechTrigRcd > m_l1GtTmTechToken
Definition: L1GtTriggerMenuLiteProducer.h:119
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:88
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
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:109
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:112
L1GtTriggerMenuLiteProducer::~L1GtTriggerMenuLiteProducer
~L1GtTriggerMenuLiteProducer() override
destructor
Definition: L1GtTriggerMenuLiteProducer.cc:63
L1GtTriggerMask
Definition: L1GtTriggerMask.h:33
L1GtStableParameters
Definition: L1GtStableParameters.h:33
L1GtTriggerMenuLiteProducer
Definition: L1GtTriggerMenuLiteProducer.h:53
L1GtTriggerMenuLiteProducer::L1GtTriggerMenuLiteProducer
L1GtTriggerMenuLiteProducer(const edm::ParameterSet &)
constructor(s)
Definition: L1GtTriggerMenuLiteProducer.cc:37
L1GtTriggerMenuLiteProducer::m_l1GtStableParamToken
const edm::ESGetToken< L1GtStableParameters, L1GtStableParametersRcd > m_l1GtStableParamToken
EventSetup Tokens.
Definition: L1GtTriggerMenuLiteProducer.h:115
L1GtTriggerMenuLiteProducer::m_l1GtTmAlgoCacheID
unsigned long long m_l1GtTmAlgoCacheID
Definition: L1GtTriggerMenuLiteProducer.h:96
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
MessageDrop.h
edm::ParameterSet
Definition: ParameterSet.h:47
edm::Transition
Transition
Definition: Transition.h:12
L1GtTriggerMenu
Definition: L1GtTriggerMenu.h:48
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:95
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:148
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:101
edm::EventSetup
Definition: EventSetup.h:57
L1GtStableParametersRcd
Definition: L1GtStableParametersRcd.h:39
InputTag.h
L1GtTriggerMenuLiteProducer::m_l1GtPfTechCacheID
unsigned long long m_l1GtPfTechCacheID
Definition: L1GtTriggerMenuLiteProducer.h:109
L1GtTriggerMenuLite
Definition: L1GtTriggerMenuLite.h:39
L1GtTriggerMenuLiteProducer::produce
void produce(edm::Event &, const edm::EventSetup &) final
Definition: L1GtTriggerMenuLiteProducer.cc:241
eostools.move
def move(src, dest)
Definition: eostools.py:511
L1GtTriggerMenuLiteProducer::m_l1GtStableParCacheID
unsigned long long m_l1GtStableParCacheID
Definition: L1GtTriggerMenuLiteProducer.h:78
L1GtTriggerMenuLiteProducer::m_l1GtStablePar
const L1GtStableParameters * m_l1GtStablePar
cached stuff
Definition: L1GtTriggerMenuLiteProducer.h:77
L1GtTriggerMenuLiteProducer::m_l1GtTmTech
const L1GtTriggerMask * m_l1GtTmTech
Definition: L1GtTriggerMenuLiteProducer.h:98
L1GtTriggerMenuLiteProducer::m_l1GtPfAlgoToken
const edm::ESGetToken< L1GtPrescaleFactors, L1GtPrescaleFactorsAlgoTrigRcd > m_l1GtPfAlgoToken
Definition: L1GtTriggerMenuLiteProducer.h:116
EventSetup.h
L1GtTriggerMenuLiteProducer::m_l1GtTmAlgoToken
const edm::ESGetToken< L1GtTriggerMask, L1GtTriggerMaskAlgoTrigRcd > m_l1GtTmAlgoToken
Definition: L1GtTriggerMenuLiteProducer.h:118
edm::isDebugEnabled
bool isDebugEnabled()
Definition: MessageLogger.cc:12
L1GtTriggerMenuLiteProducer.h
L1TBPTX_cfi.bitNumber
bitNumber
Definition: L1TBPTX_cfi.py:26
L1GtTriggerMenuLiteProducer::m_l1GtPfTech
const L1GtPrescaleFactors * m_l1GtPfTech
Definition: L1GtTriggerMenuLiteProducer.h:108
L1GtTriggerMenuLiteProducer::retrieveL1EventSetup
void retrieveL1EventSetup(const edm::EventSetup &)
Definition: L1GtTriggerMenuLiteProducer.cc:67
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:111
L1GtTriggerMenu::gtAlgorithmMap
const AlgorithmMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
Definition: L1GtTriggerMenu.h:187
L1GtTriggerMenuLiteProducer::m_l1GtMenuToken
const edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > m_l1GtMenuToken
Definition: L1GtTriggerMenuLiteProducer.h:120
L1GtTriggerMenuLiteProducer::m_l1GtPfTechToken
const edm::ESGetToken< L1GtPrescaleFactors, L1GtPrescaleFactorsTechTrigRcd > m_l1GtPfTechToken
Definition: L1GtTriggerMenuLiteProducer.h:117
L1GtTriggerMenuLiteProducer::m_numberPhysTriggers
unsigned int m_numberPhysTriggers
number of physics triggers
Definition: L1GtTriggerMenuLiteProducer.h:81
L1GtTriggerMenuLiteProducer::beginJob
void beginJob() final
Definition: L1GtTriggerMenuLiteProducer.cc:157