CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
L1GtTriggerMenuLiteProducer Class Reference

#include <L1GtTriggerMenuLiteProducer.h>

Inheritance diagram for L1GtTriggerMenuLiteProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 L1GtTriggerMenuLiteProducer (const edm::ParameterSet &)
 constructor(s) More...
 
virtual ~L1GtTriggerMenuLiteProducer ()
 destructor More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

virtual void beginJob ()
 
void beginRun (edm::Run &, const edm::EventSetup &)
 
virtual void endJob ()
 
void endRun (edm::Run &, const edm::EventSetup &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
void retrieveL1EventSetup (const edm::EventSetup &)
 

Private Attributes

const AlgorithmMapm_algorithmAliasMap
 
const AlgorithmMapm_algorithmMap
 
const L1GtTriggerMenum_l1GtMenu
 
unsigned long long m_l1GtMenuCacheID
 
const L1GtPrescaleFactorsm_l1GtPfAlgo
 prescale factors More...
 
unsigned long long m_l1GtPfAlgoCacheID
 
const L1GtPrescaleFactorsm_l1GtPfTech
 
unsigned long long m_l1GtPfTechCacheID
 
const L1GtStableParametersm_l1GtStablePar
 cached stuff More...
 
unsigned long long m_l1GtStableParCacheID
 
const L1GtTriggerMaskm_l1GtTmAlgo
 trigger masks More...
 
unsigned long long m_l1GtTmAlgoCacheID
 
const L1GtTriggerMaskm_l1GtTmTech
 
unsigned long long m_l1GtTmTechCacheID
 
unsigned int m_numberPhysTriggers
 number of physics triggers More...
 
unsigned int m_numberTechnicalTriggers
 number of technical triggers More...
 
unsigned int m_physicsDaqPartition
 index of physics DAQ partition More...
 
const std::vector< std::vector
< int > > * 
m_prescaleFactorsAlgoTrig
 
const std::vector< std::vector
< int > > * 
m_prescaleFactorsTechTrig
 
const AlgorithmMapm_technicalTriggerMap
 
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
 
const std::vector< unsigned int > * m_triggerMaskTechTrig
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Description: L1GtTriggerMenuLite producer.

Implementation: Read the L1 trigger menu, the trigger masks and the prescale factor sets from event setup and save a lite version (top level menu, trigger masks for physics partition and prescale factor set) in Run Data.

Author
: Vasile Mihai Ghete - HEPHY Vienna

$Date$ $Revision$

Definition at line 44 of file L1GtTriggerMenuLiteProducer.h.

Constructor & Destructor Documentation

L1GtTriggerMenuLiteProducer::L1GtTriggerMenuLiteProducer ( const edm::ParameterSet parSet)
explicit

constructor(s)

Definition at line 53 of file L1GtTriggerMenuLiteProducer.cc.

54  :
56 
58 
59  m_l1GtMenuCacheID(0ULL),
60 
62 
64 
66 
67  // EDM product in Run Data
68  produces<L1GtTriggerMenuLite, edm::InRun>();
69 
70 }
unsigned int m_physicsDaqPartition
index of physics DAQ partition
unsigned int m_numberPhysTriggers
number of physics triggers
unsigned int m_numberTechnicalTriggers
number of technical triggers
L1GtTriggerMenuLiteProducer::~L1GtTriggerMenuLiteProducer ( )
virtual

destructor

Definition at line 73 of file L1GtTriggerMenuLiteProducer.cc.

73  {
74 
75  // empty
76 
77 }

Member Function Documentation

void L1GtTriggerMenuLiteProducer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 197 of file L1GtTriggerMenuLiteProducer.cc.

197  {
198  // empty
199 }
void L1GtTriggerMenuLiteProducer::beginRun ( edm::Run iRun,
const edm::EventSetup evSetup 
)
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 201 of file L1GtTriggerMenuLiteProducer.cc.

References L1GtTriggerMenu::gtScaleDbKey(), L1GtTriggerMenu::gtTriggerMenuImplementation(), L1GtTriggerMenu::gtTriggerMenuInterface(), L1GtTriggerMenu::gtTriggerMenuName(), edm::isDebugEnabled(), LogDebug, m_algorithmAliasMap, m_algorithmMap, m_l1GtMenu, m_numberPhysTriggers, m_numberTechnicalTriggers, m_physicsDaqPartition, m_prescaleFactorsAlgoTrig, m_prescaleFactorsTechTrig, m_technicalTriggerMap, m_triggerMaskAlgoTrig, m_triggerMaskTechTrig, edm::Run::put(), and retrieveL1EventSetup().

202  {
203 
204  //
205 
206  retrieveL1EventSetup(evSetup);
207 
208  // produce the L1GtTriggerMenuLite
209  std::auto_ptr<L1GtTriggerMenuLite> gtTriggerMenuLite(new L1GtTriggerMenuLite());
210 
211  // lite L1 trigger menu
212 
213  gtTriggerMenuLite->setGtTriggerMenuInterface(m_l1GtMenu->gtTriggerMenuInterface());
214  gtTriggerMenuLite->setGtTriggerMenuName(m_l1GtMenu->gtTriggerMenuName());
215  gtTriggerMenuLite->setGtTriggerMenuImplementation(m_l1GtMenu->gtTriggerMenuImplementation());
216 
217  gtTriggerMenuLite->setGtScaleDbKey(m_l1GtMenu->gtScaleDbKey());
218 
219  //
221  for (CItAlgo itAlgo = m_algorithmMap->begin(); itAlgo
222  != m_algorithmMap->end(); itAlgo++) {
223 
224  unsigned int bitNumber = (itAlgo->second).algoBitNumber();
225  algMap[bitNumber] = itAlgo->first;
226 
227  }
228 
229  gtTriggerMenuLite->setGtAlgorithmMap(algMap);
230 
231  //
233  for (CItAlgo itAlgo = m_algorithmAliasMap->begin(); itAlgo
234  != m_algorithmAliasMap->end(); itAlgo++) {
235 
236  unsigned int bitNumber = (itAlgo->second).algoBitNumber();
237  algAliasMap[bitNumber] = itAlgo->first;
238 
239  }
240 
241  gtTriggerMenuLite->setGtAlgorithmAliasMap(algAliasMap);
242 
243  //
245  for (CItAlgo itAlgo = m_technicalTriggerMap->begin(); itAlgo
246  != m_technicalTriggerMap->end(); itAlgo++) {
247 
248  unsigned int bitNumber = (itAlgo->second).algoBitNumber();
249  techMap[bitNumber] = itAlgo->first;
250 
251  }
252 
253  gtTriggerMenuLite->setGtTechnicalTriggerMap(techMap);
254 
255  // trigger masks
256  std::vector<unsigned int> triggerMaskAlgoTrig(m_numberPhysTriggers, 0);
257  int iBit = -1;
258 
259  for (std::vector<unsigned int>::const_iterator
260  itBit = m_triggerMaskAlgoTrig->begin();
261  itBit != m_triggerMaskAlgoTrig->end();
262  itBit++) {
263 
264  iBit++;
265  triggerMaskAlgoTrig[iBit] = (*itBit) & (1 << m_physicsDaqPartition);
266  }
267  gtTriggerMenuLite->setGtTriggerMaskAlgoTrig(triggerMaskAlgoTrig);
268 
269  //
270  std::vector<unsigned int> triggerMaskTechTrig(m_numberTechnicalTriggers, 0);
271  iBit = -1;
272 
273  for (std::vector<unsigned int>::const_iterator
274  itBit = m_triggerMaskTechTrig->begin();
275  itBit != m_triggerMaskTechTrig->end();
276  itBit++) {
277 
278  iBit++;
279  triggerMaskTechTrig[iBit] = (*itBit) & (1 << m_physicsDaqPartition);
280  }
281  gtTriggerMenuLite->setGtTriggerMaskTechTrig(triggerMaskTechTrig);
282 
283 
284  //
285  gtTriggerMenuLite->setGtPrescaleFactorsAlgoTrig(*m_prescaleFactorsAlgoTrig);
286  gtTriggerMenuLite->setGtPrescaleFactorsTechTrig(*m_prescaleFactorsTechTrig);
287 
288 
289  // print menu, trigger masks and prescale factors
290  if (edm::isDebugEnabled()) {
291 
292  LogDebug("L1GtTriggerMenuLiteProducer") << *gtTriggerMenuLite;
293 
294  }
295 
296  // put records into event
297  iRun.put(gtTriggerMenuLite);
298 
299 }
#define LogDebug(id)
const std::string & gtTriggerMenuName() const
bool isDebugEnabled()
unsigned int m_physicsDaqPartition
index of physics DAQ partition
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
const std::string & gtTriggerMenuImplementation() const
unsigned int m_numberPhysTriggers
number of physics triggers
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
std::map< unsigned int, std::string > L1TriggerMap
map containing the physics algorithms or the technical triggers
void retrieveL1EventSetup(const edm::EventSetup &)
unsigned int m_numberTechnicalTriggers
number of technical triggers
const std::vector< unsigned int > * m_triggerMaskTechTrig
const std::vector< std::vector< int > > * m_prescaleFactorsTechTrig
const std::string & gtScaleDbKey() const
menu associated scale key
const std::string & gtTriggerMenuInterface() const
get / set the trigger menu names
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
void put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Run.h:81
void L1GtTriggerMenuLiteProducer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 315 of file L1GtTriggerMenuLiteProducer.cc.

315  {
316 
317  // empty now
318 }
void L1GtTriggerMenuLiteProducer::endRun ( edm::Run iRun,
const edm::EventSetup evSetup 
)
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 307 of file L1GtTriggerMenuLiteProducer.cc.

308  {
309 
310  // empty
311 
312 }
void L1GtTriggerMenuLiteProducer::produce ( edm::Event iEvent,
const edm::EventSetup evSetup 
)
privatevirtual
void L1GtTriggerMenuLiteProducer::retrieveL1EventSetup ( const edm::EventSetup evSetup)
private

retrieve all the relevant L1 trigger event setup records and cache them to improve the speed

Definition at line 79 of file L1GtTriggerMenuLiteProducer.cc.

References edm::EventSetup::get(), L1GtTriggerMenu::gtAlgorithmAliasMap(), L1GtTriggerMenu::gtAlgorithmMap(), L1GtStableParameters::gtNumberPhysTriggers(), L1GtStableParameters::gtNumberTechnicalTriggers(), L1GtPrescaleFactors::gtPrescaleFactors(), L1GtTriggerMenu::gtTechnicalTriggerMap(), L1GtTriggerMask::gtTriggerMask(), m_algorithmAliasMap, m_algorithmMap, m_l1GtMenu, m_l1GtMenuCacheID, m_l1GtPfAlgo, m_l1GtPfAlgoCacheID, m_l1GtPfTech, m_l1GtPfTechCacheID, m_l1GtStablePar, m_l1GtStableParCacheID, m_l1GtTmAlgo, m_l1GtTmAlgoCacheID, m_l1GtTmTech, m_l1GtTmTechCacheID, m_numberPhysTriggers, m_numberTechnicalTriggers, m_prescaleFactorsAlgoTrig, m_prescaleFactorsTechTrig, m_technicalTriggerMap, m_triggerMaskAlgoTrig, m_triggerMaskTechTrig, and edm::ESHandle< class >::product().

Referenced by beginRun().

79  {
80 
81  // get / update the stable parameters from the EventSetup
82  // local cache & check on cacheIdentifier
83 
84  unsigned long long l1GtStableParCacheID =
85  evSetup.get<L1GtStableParametersRcd>().cacheIdentifier();
86 
87  if (m_l1GtStableParCacheID != l1GtStableParCacheID) {
88 
90  evSetup.get<L1GtStableParametersRcd>().get(l1GtStablePar);
91  m_l1GtStablePar = l1GtStablePar.product();
92 
93  // number of physics triggers
95 
96  // number of technical triggers
99 
100  //
101  m_l1GtStableParCacheID = l1GtStableParCacheID;
102 
103  }
104 
105  // get / update the prescale factors from the EventSetup
106  // local cache & check on cacheIdentifier
107 
108  unsigned long long l1GtPfAlgoCacheID =
109  evSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().cacheIdentifier();
110 
111  if (m_l1GtPfAlgoCacheID != l1GtPfAlgoCacheID) {
112 
114  evSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo);
115  m_l1GtPfAlgo = l1GtPfAlgo.product();
116 
118 
119  m_l1GtPfAlgoCacheID = l1GtPfAlgoCacheID;
120 
121  }
122 
123  unsigned long long l1GtPfTechCacheID = evSetup.get<
124  L1GtPrescaleFactorsTechTrigRcd>().cacheIdentifier();
125 
126  if (m_l1GtPfTechCacheID != l1GtPfTechCacheID) {
127 
129  evSetup.get<L1GtPrescaleFactorsTechTrigRcd>().get(l1GtPfTech);
130  m_l1GtPfTech = l1GtPfTech.product();
131 
133 
134  m_l1GtPfTechCacheID = l1GtPfTechCacheID;
135 
136  }
137 
138  // get / update the trigger mask from the EventSetup
139  // local cache & check on cacheIdentifier
140 
141  unsigned long long l1GtTmAlgoCacheID =
142  evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().cacheIdentifier();
143 
144  if (m_l1GtTmAlgoCacheID != l1GtTmAlgoCacheID) {
145 
147  evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().get(l1GtTmAlgo);
148  m_l1GtTmAlgo = l1GtTmAlgo.product();
149 
151 
152  m_l1GtTmAlgoCacheID = l1GtTmAlgoCacheID;
153 
154  }
155 
156  unsigned long long l1GtTmTechCacheID =
157  evSetup.get<L1GtTriggerMaskTechTrigRcd>().cacheIdentifier();
158 
159  if (m_l1GtTmTechCacheID != l1GtTmTechCacheID) {
160 
162  evSetup.get<L1GtTriggerMaskTechTrigRcd>().get(l1GtTmTech);
163  m_l1GtTmTech = l1GtTmTech.product();
164 
166 
167  m_l1GtTmTechCacheID = l1GtTmTechCacheID;
168 
169  }
170 
171 
172  // get / update the trigger menu from the EventSetup
173  // local cache & check on cacheIdentifier
174 
175  unsigned long long l1GtMenuCacheID =
176  evSetup.get<L1GtTriggerMenuRcd>().cacheIdentifier();
177 
178  if (m_l1GtMenuCacheID != l1GtMenuCacheID) {
179 
181  evSetup.get<L1GtTriggerMenuRcd>().get(l1GtMenu);
182  m_l1GtMenu = l1GtMenu.product();
183 
186 
188 
189  m_l1GtMenuCacheID = l1GtMenuCacheID;
190 
191  }
192 
193 }
const L1GtPrescaleFactors * m_l1GtPfTech
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
unsigned int m_numberPhysTriggers
number of physics triggers
unsigned int gtNumberTechnicalTriggers() const
get / set the number of technical triggers
unsigned int gtNumberPhysTriggers() const
get / set the number of physics trigger algorithms
unsigned int m_numberTechnicalTriggers
number of technical triggers
const std::vector< unsigned int > & gtTriggerMask() const
get the trigger mask
const std::vector< unsigned int > * m_triggerMaskTechTrig
const std::vector< std::vector< int > > * m_prescaleFactorsTechTrig
const L1GtPrescaleFactors * m_l1GtPfAlgo
prescale factors
const std::vector< std::vector< int > > & gtPrescaleFactors() const
get the prescale factors by reference
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
const AlgorithmMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
const L1GtStableParameters * m_l1GtStablePar
cached stuff
const AlgorithmMap & gtTechnicalTriggerMap() const
get / set the technical trigger map
const L1GtTriggerMask * m_l1GtTmAlgo
trigger masks
const AlgorithmMap & gtAlgorithmAliasMap() const
get / set the algorithm map (by alias)

Member Data Documentation

const AlgorithmMap* L1GtTriggerMenuLiteProducer::m_algorithmAliasMap
private

Definition at line 88 of file L1GtTriggerMenuLiteProducer.h.

Referenced by beginRun(), and retrieveL1EventSetup().

const AlgorithmMap* L1GtTriggerMenuLiteProducer::m_algorithmMap
private

Definition at line 87 of file L1GtTriggerMenuLiteProducer.h.

Referenced by beginRun(), and retrieveL1EventSetup().

const L1GtTriggerMenu* L1GtTriggerMenuLiteProducer::m_l1GtMenu
private

Definition at line 84 of file L1GtTriggerMenuLiteProducer.h.

Referenced by beginRun(), and retrieveL1EventSetup().

unsigned long long L1GtTriggerMenuLiteProducer::m_l1GtMenuCacheID
private

Definition at line 85 of file L1GtTriggerMenuLiteProducer.h.

Referenced by retrieveL1EventSetup().

const L1GtPrescaleFactors* L1GtTriggerMenuLiteProducer::m_l1GtPfAlgo
private

prescale factors

Definition at line 102 of file L1GtTriggerMenuLiteProducer.h.

Referenced by retrieveL1EventSetup().

unsigned long long L1GtTriggerMenuLiteProducer::m_l1GtPfAlgoCacheID
private

Definition at line 103 of file L1GtTriggerMenuLiteProducer.h.

Referenced by retrieveL1EventSetup().

const L1GtPrescaleFactors* L1GtTriggerMenuLiteProducer::m_l1GtPfTech
private

Definition at line 105 of file L1GtTriggerMenuLiteProducer.h.

Referenced by retrieveL1EventSetup().

unsigned long long L1GtTriggerMenuLiteProducer::m_l1GtPfTechCacheID
private

Definition at line 106 of file L1GtTriggerMenuLiteProducer.h.

Referenced by retrieveL1EventSetup().

const L1GtStableParameters* L1GtTriggerMenuLiteProducer::m_l1GtStablePar
private

cached stuff

stable parameters

Definition at line 74 of file L1GtTriggerMenuLiteProducer.h.

Referenced by retrieveL1EventSetup().

unsigned long long L1GtTriggerMenuLiteProducer::m_l1GtStableParCacheID
private

Definition at line 75 of file L1GtTriggerMenuLiteProducer.h.

Referenced by retrieveL1EventSetup().

const L1GtTriggerMask* L1GtTriggerMenuLiteProducer::m_l1GtTmAlgo
private

trigger masks

Definition at line 92 of file L1GtTriggerMenuLiteProducer.h.

Referenced by retrieveL1EventSetup().

unsigned long long L1GtTriggerMenuLiteProducer::m_l1GtTmAlgoCacheID
private

Definition at line 93 of file L1GtTriggerMenuLiteProducer.h.

Referenced by retrieveL1EventSetup().

const L1GtTriggerMask* L1GtTriggerMenuLiteProducer::m_l1GtTmTech
private

Definition at line 95 of file L1GtTriggerMenuLiteProducer.h.

Referenced by retrieveL1EventSetup().

unsigned long long L1GtTriggerMenuLiteProducer::m_l1GtTmTechCacheID
private

Definition at line 96 of file L1GtTriggerMenuLiteProducer.h.

Referenced by retrieveL1EventSetup().

unsigned int L1GtTriggerMenuLiteProducer::m_numberPhysTriggers
private

number of physics triggers

Definition at line 78 of file L1GtTriggerMenuLiteProducer.h.

Referenced by beginRun(), and retrieveL1EventSetup().

unsigned int L1GtTriggerMenuLiteProducer::m_numberTechnicalTriggers
private

number of technical triggers

Definition at line 81 of file L1GtTriggerMenuLiteProducer.h.

Referenced by beginRun(), and retrieveL1EventSetup().

unsigned int L1GtTriggerMenuLiteProducer::m_physicsDaqPartition
private

index of physics DAQ partition

Definition at line 114 of file L1GtTriggerMenuLiteProducer.h.

Referenced by beginRun().

const std::vector<std::vector<int> >* L1GtTriggerMenuLiteProducer::m_prescaleFactorsAlgoTrig
private

Definition at line 108 of file L1GtTriggerMenuLiteProducer.h.

Referenced by beginRun(), and retrieveL1EventSetup().

const std::vector<std::vector<int> >* L1GtTriggerMenuLiteProducer::m_prescaleFactorsTechTrig
private

Definition at line 109 of file L1GtTriggerMenuLiteProducer.h.

Referenced by beginRun(), and retrieveL1EventSetup().

const AlgorithmMap* L1GtTriggerMenuLiteProducer::m_technicalTriggerMap
private

Definition at line 89 of file L1GtTriggerMenuLiteProducer.h.

Referenced by beginRun(), and retrieveL1EventSetup().

const std::vector<unsigned int>* L1GtTriggerMenuLiteProducer::m_triggerMaskAlgoTrig
private

Definition at line 98 of file L1GtTriggerMenuLiteProducer.h.

Referenced by beginRun(), and retrieveL1EventSetup().

const std::vector<unsigned int>* L1GtTriggerMenuLiteProducer::m_triggerMaskTechTrig
private

Definition at line 99 of file L1GtTriggerMenuLiteProducer.h.

Referenced by beginRun(), and retrieveL1EventSetup().