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 Attributes
l1t::GtProducer Class Reference

#include <GtProducer.h>

Inheritance diagram for l1t::GtProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

const GtBoardgtBrd () const
 
 GtProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~GtProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

boost::uint16_t m_activeBoardsGtDaq
 active boards in L1 GT DAQ record More...
 
bool m_algorithmTriggersUnmasked
 
bool m_algorithmTriggersUnprescaled
 
unsigned int m_alternativeNrBxBoardDaq
 
unsigned int m_bstLengthBytes
 length of BST record (in bytes) from event setup More...
 
edm::InputTag m_caloInputTag
 input tag for calorimeter collections from GCT More...
 
int m_emulateBxInEvent
 
int m_ifCaloEtaNumberBits
 
int m_ifMuEtaNumberBits
 
bool m_isDebugEnabled
 
int m_L1DataBxInEvent
 Bx expected in Data coming to GT. More...
 
const L1GtBoardMapsm_l1GtBM
 board maps - cache only the record More...
 
unsigned long long m_l1GtBMCacheID
 
const L1GtParametersm_l1GtPar
 parameters More...
 
unsigned long long m_l1GtParCacheID
 
const L1GtPrescaleFactorsm_l1GtPfAlgo
 prescale factors More...
 
unsigned long long m_l1GtPfAlgoCacheID
 
const GlobalStableParametersm_l1GtStablePar
 cached stuff More...
 
unsigned long long m_l1GtStableParCacheID
 
const L1GtTriggerMaskm_l1GtTmAlgo
 trigger masks & veto masks More...
 
unsigned long long m_l1GtTmAlgoCacheID
 
const L1GtTriggerMaskm_l1GtTmVetoAlgo
 
unsigned long long m_l1GtTmVetoAlgoCacheID
 
edm::InputTag m_muInputTag
 input tag for muon collection from GMT More...
 
int m_nrL1EG
 
int m_nrL1Jet
 
int m_nrL1JetCounts
 
int m_nrL1Mu
 
int m_nrL1Tau
 
unsigned int m_numberDaqPartitions
 number of DAQ partitions More...
 
unsigned int m_numberPhysTriggers
 number of physics triggers More...
 
const std::vector< std::vector
< int > > * 
m_prescaleFactorsAlgoTrig
 
bool m_produceL1GtDaqRecord
 logical flag to produce the L1 GT DAQ readout record More...
 
bool m_produceL1GtObjectMapRecord
 logical flag to produce the L1 GT object map record More...
 
int m_psBstLengthBytes
 length of BST record (in bytes) from parameter set More...
 
int m_totalBxInEvent
 total number of Bx's in the event coming from EventSetup More...
 
std::vector< unsigned int > m_triggerMaskAlgoTrig
 
std::vector< unsigned int > m_triggerMaskVetoAlgoTrig
 
GtBoardm_uGtBrd
 
int m_verbosity
 verbosity level More...
 
bool m_writePsbL1GtDaqRecord
 logical flag to write the PSB content in the L1 GT DAQ record More...
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 53 of file GtProducer.h.

Constructor & Destructor Documentation

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

Definition at line 66 of file GtProducer.cc.

References LogDebug, LogTrace, m_activeBoardsGtDaq, m_algorithmTriggersUnmasked, m_algorithmTriggersUnprescaled, m_alternativeNrBxBoardDaq, m_bstLengthBytes, m_caloInputTag, m_emulateBxInEvent, m_ifCaloEtaNumberBits, m_ifMuEtaNumberBits, m_L1DataBxInEvent, m_l1GtBMCacheID, m_l1GtParCacheID, m_l1GtPfAlgoCacheID, m_l1GtStableParCacheID, m_l1GtTmAlgoCacheID, m_l1GtTmVetoAlgoCacheID, m_muInputTag, m_nrL1EG, m_nrL1Jet, m_nrL1JetCounts, m_nrL1Mu, m_nrL1Tau, m_numberDaqPartitions, m_numberPhysTriggers, m_produceL1GtDaqRecord, m_produceL1GtObjectMapRecord, m_psBstLengthBytes, m_totalBxInEvent, m_uGtBrd, m_verbosity, m_writePsbL1GtDaqRecord, and l1t::GtBoard::setVerbosity().

66  :
67  m_muInputTag(parSet.getParameter<edm::InputTag> ("GmtInputTag")),
68  m_caloInputTag(parSet.getParameter<edm::InputTag> ("caloInputTag")),
69 
70  m_produceL1GtDaqRecord(parSet.getParameter<bool> ("ProduceL1GtDaqRecord")),
71  m_produceL1GtObjectMapRecord(parSet.getParameter<bool> ("ProduceL1GtObjectMapRecord")),
72 
73  m_emulateBxInEvent(parSet.getParameter<int> ("EmulateBxInEvent")),
74  m_L1DataBxInEvent(parSet.getParameter<int> ("L1DataBxInEvent")),
75 
76  m_alternativeNrBxBoardDaq(parSet.getParameter<unsigned int> ("AlternativeNrBxBoardDaq")),
77  m_psBstLengthBytes(parSet.getParameter<int> ("BstLengthBytes")),
78  m_algorithmTriggersUnprescaled(parSet.getParameter<bool> ("AlgorithmTriggersUnprescaled")),
79  m_algorithmTriggersUnmasked(parSet.getParameter<bool> ("AlgorithmTriggersUnmasked")),
80 
81  m_verbosity(parSet.getUntrackedParameter<int>("Verbosity", 0)),
83 {
84 
85 
86  if (m_verbosity) {
87 
88  LogDebug("l1t|Global") << std::endl;
89 
90  LogTrace("l1t|Global")
91  << "\nInput tag for muon collection from GMT: " << m_muInputTag
92  << "\nInput tag for calorimeter collections from GCT: " << m_caloInputTag
93  << std::endl;
94 
95 
96  LogTrace("l1t|Global")
97  << "\nProduce the L1 GT DAQ readout record: " << m_produceL1GtDaqRecord
98  << "\nProduce the L1 GT Object Map record: " << m_produceL1GtObjectMapRecord
99  << " \n"
100  << "\nWrite Psb content to L1 GT DAQ Record: " << m_writePsbL1GtDaqRecord
101  << " \n"
102  << "\nNumber of BxInEvent to be emulated: " << m_emulateBxInEvent
103  << " \n"
104  << "\nAlternative for number of BX in GT DAQ record: 0x" << std::hex
106  << " \n"
107  << "\nLength of BST message [bytes]: " << m_psBstLengthBytes
108  << "\n"
109  << "\nRun algorithm triggers unprescaled: " << m_algorithmTriggersUnprescaled
110  << "\nRun algorithm triggers unmasked (all enabled): " << m_algorithmTriggersUnmasked
111  << "\n"
112  << std::endl;
113  }
114 
115 
116  if ( ( m_emulateBxInEvent > 0 ) && ( ( m_emulateBxInEvent % 2 ) == 0 )) {
118 
119  if (m_verbosity) {
120  edm::LogWarning("GtProducer")
121  << "\nWARNING: Number of bunch crossing to be emulated rounded to: "
122  << m_emulateBxInEvent << "\n The number must be an odd number!\n"
123  << std::endl;
124  }
125  }
126 
127 
128  if ( ( m_L1DataBxInEvent > 0 ) && ( ( m_L1DataBxInEvent % 2 ) == 0 )) {
130 
131  if (m_verbosity) {
132  edm::LogWarning("GtProducer")
133  << "\nWARNING: Number of bunch crossing for incoming L1 Data rounded to: "
134  << m_L1DataBxInEvent << "\n The number must be an odd number!\n"
135  << std::endl;
136  }
137  } else if( m_L1DataBxInEvent<0) {
138  m_L1DataBxInEvent = 1;
139 
140  if (m_verbosity) {
141  edm::LogWarning("GtProducer")
142  << "\nWARNING: Number of bunch crossing for incoming L1 Data was changed to: "
143  << m_L1DataBxInEvent << "\n The number must be an odd positive number!\n"
144  << std::endl;
145  }
146  }
147 
148 
149 
150 
151  // register products
153  produces<GlobalAlgBlkBxCollection>();
154  produces<GlobalExtBlkBxCollection>();
155  }
156 
157 /* **** Needs Modifying ***
158  if (m_produceL1GtObjectMapRecord) {
159  produces<GtProducerObjectMapRecord>();
160  }
161 */
162 
163 
164  // create new uGt Board
165  m_uGtBrd = new GtBoard();
167 
168  // initialize cached IDs
169 
170  //
171  m_l1GtStableParCacheID = 0ULL;
172 
175 
176  m_nrL1Mu = 0;
177  m_nrL1EG = 0;
178  m_nrL1Tau = 0;
179 
180  m_nrL1Jet = 0;
181 
182 
183  m_nrL1JetCounts = 0;
184 
187 
188  //
189  m_l1GtParCacheID = 0ULL;
190 
191  m_totalBxInEvent = 0;
192 
194  m_bstLengthBytes = 0;
195 
196  //
197  m_l1GtBMCacheID = 0ULL;
198 
199  //
200  m_l1GtPfAlgoCacheID = 0ULL;
201 
202  m_l1GtTmAlgoCacheID = 0ULL;
203 
205 
206 }
#define LogDebug(id)
T getParameter(std::string const &) const
bool isDebugEnabled()
T getUntrackedParameter(std::string const &, T const &) const
void setVerbosity(const int verbosity)
Definition: GtBoard.h:200
bool m_algorithmTriggersUnprescaled
Definition: GtProducer.h:182
bool m_produceL1GtObjectMapRecord
logical flag to produce the L1 GT object map record
Definition: GtProducer.h:158
bool m_writePsbL1GtDaqRecord
logical flag to write the PSB content in the L1 GT DAQ record
Definition: GtProducer.h:161
int m_L1DataBxInEvent
Bx expected in Data coming to GT.
Definition: GtProducer.h:170
bool m_algorithmTriggersUnmasked
Definition: GtProducer.h:186
unsigned int m_numberPhysTriggers
number of physics triggers
Definition: GtProducer.h:78
boost::uint16_t m_activeBoardsGtDaq
active boards in L1 GT DAQ record
Definition: GtProducer.h:108
unsigned int m_numberDaqPartitions
number of DAQ partitions
Definition: GtProducer.h:81
int m_totalBxInEvent
total number of Bx&#39;s in the event coming from EventSetup
Definition: GtProducer.h:105
int m_ifCaloEtaNumberBits
Definition: GtProducer.h:97
unsigned long long m_l1GtParCacheID
Definition: GtProducer.h:102
GtBoard * m_uGtBrd
Definition: GtProducer.h:146
unsigned int m_alternativeNrBxBoardDaq
Definition: GtProducer.h:174
unsigned long long m_l1GtStableParCacheID
Definition: GtProducer.h:75
#define LogTrace(id)
unsigned long long m_l1GtTmVetoAlgoCacheID
Definition: GtProducer.h:132
unsigned int m_bstLengthBytes
length of BST record (in bytes) from event setup
Definition: GtProducer.h:111
unsigned long long m_l1GtBMCacheID
Definition: GtProducer.h:115
int m_ifMuEtaNumberBits
Definition: GtProducer.h:96
bool m_isDebugEnabled
Definition: GtProducer.h:193
bool m_produceL1GtDaqRecord
logical flag to produce the L1 GT DAQ readout record
Definition: GtProducer.h:155
int m_emulateBxInEvent
Definition: GtProducer.h:167
unsigned long long m_l1GtTmAlgoCacheID
Definition: GtProducer.h:129
edm::InputTag m_caloInputTag
input tag for calorimeter collections from GCT
Definition: GtProducer.h:152
edm::InputTag m_muInputTag
input tag for muon collection from GMT
Definition: GtProducer.h:149
int m_psBstLengthBytes
length of BST record (in bytes) from parameter set
Definition: GtProducer.h:177
int m_verbosity
verbosity level
Definition: GtProducer.h:192
unsigned long long m_l1GtPfAlgoCacheID
Definition: GtProducer.h:120
GtProducer::~GtProducer ( )

Definition at line 209 of file GtProducer.cc.

210 {
211 
212  delete m_uGtBrd;
213 
214 }
GtBoard * m_uGtBrd
Definition: GtProducer.h:146

Member Function Documentation

const GtBoard* l1t::GtProducer::gtBrd ( ) const
inline

Definition at line 64 of file GtProducer.h.

References m_uGtBrd.

65  {
66  return m_uGtBrd;
67  }
GtBoard * m_uGtBrd
Definition: GtProducer.h:146
void GtProducer::produce ( edm::Event iEvent,
const edm::EventSetup evSetup 
)
virtual

length of BST message (in bytes) for L1 GT EVM record

Needs error checking that something exists at this bx.

OUTPUT RECORD if (m_produceL1GtObjectMapRecord) { iEvent.put( gtObjectMapRecord ); }

Implements edm::EDProducer.

Definition at line 219 of file GtProducer.cc.

References edm::EventBase::bunchCrossing(), rpc-layouts::bx, edm::EventSetup::get(), LogDebug, LogTrace, edm::EventBase::orbitNumber(), reco::print(), edm::ESHandle< class >::product(), and edm::Event::put().

220 {
221 
222  // get / update the parameters from the EventSetup
223  // local cache & check on cacheIdentifier
224 
225  unsigned long long l1GtParCacheID = evSetup.get<L1GtParametersRcd>().cacheIdentifier();
226 
227  if (m_l1GtParCacheID != l1GtParCacheID) {
228 
230  evSetup.get< L1GtParametersRcd >().get( l1GtPar );
231  m_l1GtPar = l1GtPar.product();
232 
233  // total number of Bx's in the event coming from EventSetup
235 
236  // active boards in L1 GT DAQ record and in L1 GT EVM record
238 
241 
242 
243  m_l1GtParCacheID = l1GtParCacheID;
244 
245  }
246 
247  // negative value: emulate TotalBxInEvent as given in EventSetup
248  if (m_emulateBxInEvent < 0) {
250  }
251 
252  int minEmulBxInEvent = (m_emulateBxInEvent + 1)/2 - m_emulateBxInEvent;
253  int maxEmulBxInEvent = (m_emulateBxInEvent + 1)/2 - 1;
254 
255  int minL1DataBxInEvent = (m_L1DataBxInEvent + 1)/2 - m_L1DataBxInEvent;
256  int maxL1DataBxInEvent = (m_L1DataBxInEvent + 1)/2 - 1;
257 
258  // process event iEvent
259  // get / update the stable parameters from the EventSetup
260  // local cache & check on cacheIdentifier
261 
262  unsigned long long l1GtStableParCacheID =
263  evSetup.get<L1TGlobalStableParametersRcd>().cacheIdentifier();
264 
265  if (m_l1GtStableParCacheID != l1GtStableParCacheID) {
266 
268  evSetup.get< L1TGlobalStableParametersRcd >().get( l1GtStablePar );
269  m_l1GtStablePar = l1GtStablePar.product();
270 
271  // number of physics triggers
273 
274  // number of DAQ partitions
275  m_numberDaqPartitions = 8; // FIXME add it to stable parameters
276 
277  // number of objects of each type
278  m_nrL1Mu = static_cast<int> (m_l1GtStablePar->gtNumberL1Mu());
279  //m_nrL1Mu = static_cast<int> (8);
280 
281 // ***** Doe we need to change the StablePar class for generic. EG
282  m_nrL1EG = static_cast<int> (m_l1GtStablePar->gtNumberL1NoIsoEG());
283  m_nrL1Tau= static_cast<int> (m_l1GtStablePar->gtNumberL1TauJet());
284 
285 
286 // ********* Do we need to change the StablePar class for generic jet?
287  m_nrL1Jet = static_cast<int> (m_l1GtStablePar->gtNumberL1CenJet());
288 
289  m_nrL1JetCounts = static_cast<int> (m_l1GtStablePar->gtNumberL1JetCounts());
290 
291  // ... the rest of the objects are global
292 
295 
296 
297  // Initialize Board
298  m_uGtBrd->init(m_numberPhysTriggers, m_nrL1Mu, m_nrL1EG, m_nrL1Tau, m_nrL1Jet, minL1DataBxInEvent, maxL1DataBxInEvent );
299 
300  //
301  m_l1GtStableParCacheID = l1GtStableParCacheID;
302 
303  }
304 
305 
306  // get / update the board maps from the EventSetup
307  // local cache & check on cacheIdentifier
308 
309 /* *** Drop L1GtBoard Maps for now
310  typedef std::vector<L1GtBoard>::const_iterator CItBoardMaps;
311 
312  unsigned long long l1GtBMCacheID = evSetup.get<L1GtBoardMapsRcd>().cacheIdentifier();
313 */
314 
315 /* ** Drop board mapping for now
316  if (m_l1GtBMCacheID != l1GtBMCacheID) {
317 
318  edm::ESHandle< L1GtBoardMaps > l1GtBM;
319  evSetup.get< L1GtBoardMapsRcd >().get( l1GtBM );
320  m_l1GtBM = l1GtBM.product();
321 
322  m_l1GtBMCacheID = l1GtBMCacheID;
323 
324  }
325 
326 
327  // TODO need changes in CondFormats to cache the maps
328  const std::vector<L1GtBoard>& boardMaps = m_l1GtBM->gtBoardMaps();
329 */
330  // get / update the prescale factors from the EventSetup
331  // local cache & check on cacheIdentifier
332 
333 
334 /* **** For Now Leave out Prescale Factors ****
335  unsigned long long l1GtPfAlgoCacheID =
336  evSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().cacheIdentifier();
337 
338  if (m_l1GtPfAlgoCacheID != l1GtPfAlgoCacheID) {
339 
340  edm::ESHandle< L1GtPrescaleFactors > l1GtPfAlgo;
341  evSetup.get< L1GtPrescaleFactorsAlgoTrigRcd >().get( l1GtPfAlgo );
342  m_l1GtPfAlgo = l1GtPfAlgo.product();
343 
344  m_prescaleFactorsAlgoTrig = &(m_l1GtPfAlgo->gtPrescaleFactors());
345 
346  m_l1GtPfAlgoCacheID = l1GtPfAlgoCacheID;
347 
348  }
349 */
350 
351 
352  // get / update the trigger mask from the EventSetup
353  // local cache & check on cacheIdentifier
354 
355 
356 /* **** For now Leave out Masks *****
357  unsigned long long l1GtTmAlgoCacheID =
358  evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().cacheIdentifier();
359 
360  if (m_l1GtTmAlgoCacheID != l1GtTmAlgoCacheID) {
361 
362  edm::ESHandle< L1GtTriggerMask > l1GtTmAlgo;
363  evSetup.get< L1GtTriggerMaskAlgoTrigRcd >().get( l1GtTmAlgo );
364  m_l1GtTmAlgo = l1GtTmAlgo.product();
365 
366  m_triggerMaskAlgoTrig = m_l1GtTmAlgo->gtTriggerMask();
367 
368  m_l1GtTmAlgoCacheID = l1GtTmAlgoCacheID;
369 
370  }
371 */
372 
373 
374 
375 /* **** For now Leave out Veto Masks *****
376  unsigned long long l1GtTmVetoAlgoCacheID =
377  evSetup.get<L1GtTriggerMaskVetoAlgoTrigRcd>().cacheIdentifier();
378 
379  if (m_l1GtTmVetoAlgoCacheID != l1GtTmVetoAlgoCacheID) {
380 
381  edm::ESHandle< L1GtTriggerMask > l1GtTmVetoAlgo;
382  evSetup.get< L1GtTriggerMaskVetoAlgoTrigRcd >().get( l1GtTmVetoAlgo );
383  m_l1GtTmVetoAlgo = l1GtTmVetoAlgo.product();
384 
385  m_triggerMaskVetoAlgoTrig = m_l1GtTmVetoAlgo->gtTriggerMask();
386 
387  m_l1GtTmVetoAlgoCacheID = l1GtTmVetoAlgoCacheID;
388 
389  }
390 */
391 
392 
393 
394 // ****** Board Maps Need to be redone....hard code for now ******
395  // loop over blocks in the GT DAQ record receiving data, count them if they are active
396  // all board type are defined in CondFormats/L1TObjects/L1GtFwd
397  // enum L1GtBoardType { GTFE, FDL, PSB, GMT, TCS, TIM };
398  // &
399  // set the active flag for each object type received from GMT and GCT
400  // all objects in the GT system are defined in enum L1GtObject from
401  // DataFormats/L1Trigger/GtProducerReadoutSetupFwd
402 
403  //
404  bool receiveMu = true;
405  bool receiveEG = true;
406  bool receiveTau = true;
407  bool receiveJet = true;
408  bool receiveEtSums = true;
409 
410 /* *** Boards need redefining *****
411  for (CItBoardMaps
412  itBoard = boardMaps.begin();
413  itBoard != boardMaps.end(); ++itBoard) {
414 
415  int iPosition = itBoard->gtPositionDaqRecord();
416  if (iPosition > 0) {
417 
418  int iActiveBit = itBoard->gtBitDaqActiveBoards();
419  bool activeBoard = false;
420 
421  if (iActiveBit >= 0) {
422  activeBoard = m_activeBoardsGtDaq & (1 << iActiveBit);
423  }
424 
425  // use board if: in the record, but not in ActiveBoardsMap (iActiveBit < 0)
426  // in the record and ActiveBoardsMap, and active
427  if ((iActiveBit < 0) || activeBoard) {
428 
429 // ****** Decide what board manipulation (if any we want here)
430 
431  }
432  }
433 
434  }
435 */
436 
437 
438 
439 /* *** No Output Record for Now
440  // produce the GtProducerReadoutRecord now, after we found how many
441  // BxInEvent the record has and how many boards are active
442  std::auto_ptr<GtProducerReadoutRecord> gtDaqReadoutRecord(
443  new GtProducerReadoutRecord(
444  m_emulateBxInEvent, daqNrFdlBoards, daqNrPsbBoards) );
445 
446 */
447 
448  // Produce the Output Records for the GT
449  std::auto_ptr<GlobalAlgBlkBxCollection> uGtAlgRecord( new GlobalAlgBlkBxCollection(0,minEmulBxInEvent,maxEmulBxInEvent));
450  std::auto_ptr<GlobalExtBlkBxCollection> uGtExtRecord( new GlobalExtBlkBxCollection(0,minEmulBxInEvent,maxEmulBxInEvent));
451 
452  // * produce the L1GlobalTriggerObjectMapRecord
453  std::auto_ptr<L1GlobalTriggerObjectMapRecord> gtObjectMapRecord(
455 
456 
457  // fill the boards not depending on the BxInEvent in the L1 GT DAQ record
458  // GMT, PSB and FDL depend on BxInEvent
459 
460  // fill in emulator the same bunch crossing (12 bits - hardwired number of bits...)
461  // and the same local bunch crossing for all boards
462  int bxCross = iEvent.bunchCrossing();
463  boost::uint16_t bxCrossHw = 0;
464  if ((bxCross & 0xFFF) == bxCross) {
465  bxCrossHw = static_cast<boost::uint16_t> (bxCross);
466  }
467  else {
468  bxCrossHw = 0; // Bx number too large, set to 0!
469  if (m_verbosity) {
470 
471  LogDebug("l1t|Global")
472  << "\nBunch cross number [hex] = " << std::hex << bxCross
473  << "\n larger than 12 bits. Set to 0! \n" << std::dec
474  << std::endl;
475  }
476  }
477  LogDebug("l1t|Global") << "HW BxCross " << bxCrossHw << std::endl;
478 
479 /* ** No Record for Now
480  if (m_produceL1GtDaqRecord) {
481 
482  for (CItBoardMaps
483  itBoard = boardMaps.begin();
484  itBoard != boardMaps.end(); ++itBoard) {
485 
486  int iPosition = itBoard->gtPositionDaqRecord();
487  if (iPosition > 0) {
488 
489  int iActiveBit = itBoard->gtBitDaqActiveBoards();
490  bool activeBoard = false;
491 
492  if (iActiveBit >= 0) {
493  activeBoard = m_activeBoardsGtDaq & (1 << iActiveBit);
494  }
495 
496  // use board if: in the record, but not in ActiveBoardsMap (iActiveBit < 0)
497  // in the record and ActiveBoardsMap, and active
498  if ((iActiveBit < 0) || activeBoard) {
499 
500  switch (itBoard->gtBoardType()) {
501 
502  case GTFE: {
503  L1GtfeWord gtfeWordValue;
504 
505  gtfeWordValue.setBoardId( itBoard->gtBoardId() );
506 
507  // cast int to boost::uint16_t
508  // there are normally 3 or 5 BxInEvent
509  gtfeWordValue.setRecordLength(
510  static_cast<boost::uint16_t>(recordLength0));
511 
512  gtfeWordValue.setRecordLength1(
513  static_cast<boost::uint16_t>(recordLength1));
514 
515  // bunch crossing
516  gtfeWordValue.setBxNr(bxCrossHw);
517 
518  // set the list of active boards
519  gtfeWordValue.setActiveBoards(m_activeBoardsGtDaq);
520 
521  // set alternative for number of BX per board
522  gtfeWordValue.setAltNrBxBoard(
523  static_cast<boost::uint16_t> (m_alternativeNrBxBoardDaq));
524 
525  // set the TOTAL_TRIGNR as read from iEvent
526  // TODO check again - PTC stuff
527 
528  gtfeWordValue.setTotalTriggerNr(
529  static_cast<boost::uint32_t>(iEvent.id().event()));
530 
531  // ** fill L1GtfeWord in GT DAQ record
532 
533  gtDaqReadoutRecord->setGtfeWord(gtfeWordValue);
534  }
535 
536  break;
537  case TCS: {
538  // nothing
539  }
540 
541  break;
542  case TIM: {
543  // nothing
544  }
545 
546  break;
547  default: {
548  // do nothing, all blocks are given in GtBoardType enum
549  }
550 
551  break;
552  }
553  }
554  }
555 
556  }
557 
558  }
559 */
560 
561 
562  // get the prescale factor set used in the actual luminosity segment
563 // int pfAlgoSetIndex = 0; // FIXME
564  // comment out for now DMP
565 // const std::vector<int>& prescaleFactorsAlgoTrig =
566 // (*m_prescaleFactorsAlgoTrig).at(pfAlgoSetIndex);
567 
568 // LogDebug("l1t|Global") << "Size of prescale vector" << prescaleFactorsAlgoTrig.size() << std::endl;
569  //
570 
571 
572 // Load the calorimeter input onto the uGt Board
574  receiveEG, m_nrL1EG,
575  receiveTau, m_nrL1Tau,
576  receiveJet, m_nrL1Jet,
577  receiveEtSums );
578 
580  receiveMu, m_nrL1Mu );
581 
582 
583  // loop over BxInEvent
584  for (int iBxInEvent = minEmulBxInEvent; iBxInEvent <= maxEmulBxInEvent;
585  ++iBxInEvent) {
586 
587  // run GTL
588  LogDebug("l1t|Global")
589  << "\nGtProducer : running GTL for bx = " << iBxInEvent << "\n"
590  << std::endl;
591 
592 
593 // Run the GTL for this BX
594  m_uGtBrd->runGTL(iEvent, evSetup,
595  m_produceL1GtObjectMapRecord, iBxInEvent, gtObjectMapRecord,
597  m_nrL1Mu,
598  m_nrL1EG,
599  m_nrL1Tau,
600  m_nrL1Jet,
601  m_nrL1JetCounts );
602 
603 
604  // run FDL
605  LogDebug("l1t|Global")
606  << "\nGtProducer : running FDL for bx = " << iBxInEvent << "\n"
607  << std::endl;
608 
609 
610 // Run the Final Decision Logic for this BX
611  m_uGtBrd->runFDL(iEvent,
612  iBxInEvent,
615  );
616 
617 
618 
619 // Fill in the DAQ Records
621 
622  // These need to be defined elsewhere
623  cms_uint64_t orbNr = iEvent.orbitNumber();
624  int abBx = iEvent.bunchCrossing();
625  m_uGtBrd->fillAlgRecord(iBxInEvent, uGtAlgRecord, orbNr, abBx);
626  m_uGtBrd->fillExtRecord(iBxInEvent, uGtExtRecord, orbNr, abBx);
627  }
628 
629 
630 
631  } //End Loop over Bx
632 
633 
634  // Add explicit reset of Board
635  m_uGtBrd->reset();
636 
637 
638 
639  if ( m_verbosity && m_isDebugEnabled ) {
640 
641  std::ostringstream myCoutStream;
642 
643  for(int bx=minEmulBxInEvent; bx<maxEmulBxInEvent; bx++) {
644 
646  (uGtAlgRecord->at(bx,0)).print(myCoutStream);
647  (uGtExtRecord->at(bx,0)).print(myCoutStream);
648 
649  }
650 
651  LogTrace("l1t|Global")
652  << "\n The following L1 GT DAQ readout record was produced:\n"
653  << myCoutStream.str() << "\n"
654  << std::endl;
655 
656  myCoutStream.str("");
657  myCoutStream.clear();
658 /*
659  const std::vector<L1GlobalTriggerObjectMap> objMapVec =
660  gtObjectMapRecord->gtObjectMap();
661 
662  for (std::vector<L1GlobalTriggerObjectMap>::const_iterator
663  it = objMapVec.begin(); it != objMapVec.end(); ++it) {
664 
665  (*it).print(myCoutStream);
666 
667  }
668 
669 
670  LogDebug("l1t|Global")
671  << "Test gtObjectMapRecord in GtProducer \n\n" << myCoutStream.str() << "\n\n"
672  << std::endl;
673 
674  myCoutStream.str("");
675  myCoutStream.clear();
676 */
677  }
678 
679 
680 
681 
682  // register products
684  iEvent.put( uGtAlgRecord );
685  iEvent.put( uGtExtRecord );
686  }
687 
695 }
#define LogDebug(id)
BXVector< GlobalExtBlk > GlobalExtBlkBxCollection
Definition: GlobalExtBlk.h:30
unsigned int gtIfCaloEtaNumberBits() const
get / set the number of bits for eta of calorimeter objects
bool m_algorithmTriggersUnprescaled
Definition: GtProducer.h:182
unsigned int gtNumberL1NoIsoEG() const
get / set the number of L1 e/gamma objects received by GT
const boost::uint16_t gtDaqActiveBoards() const
get / set the active boards for L1 GT DAQ record
bool m_produceL1GtObjectMapRecord
logical flag to produce the L1 GT object map record
Definition: GtProducer.h:158
const int gtTotalBxInEvent() const
get / set the total Bx&#39;s in the event
void runFDL(edm::Event &iEvent, const int iBxInEvent, const bool algorithmTriggersUnprescaled, const bool algorithmTriggersUnmasked)
run the uGT FDL (Apply Prescales and Veto)
Definition: GtBoard.cc:898
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
Definition: print.cc:8
unsigned int gtNumberL1Mu() const
get / set the number of L1 muons received by GT
const unsigned int gtBstLengthBytes() const
get / set length of BST message (in bytes) for L1 GT EVM record
int bunchCrossing() const
Definition: EventBase.h:62
int m_L1DataBxInEvent
Bx expected in Data coming to GT.
Definition: GtProducer.h:170
BXVector< GlobalAlgBlk > GlobalAlgBlkBxCollection
Definition: GlobalAlgBlk.h:31
bool m_algorithmTriggersUnmasked
Definition: GtProducer.h:186
unsigned int m_numberPhysTriggers
number of physics triggers
Definition: GtProducer.h:78
boost::uint16_t m_activeBoardsGtDaq
active boards in L1 GT DAQ record
Definition: GtProducer.h:108
unsigned int m_numberDaqPartitions
number of DAQ partitions
Definition: GtProducer.h:81
int m_totalBxInEvent
total number of Bx&#39;s in the event coming from EventSetup
Definition: GtProducer.h:105
unsigned int gtNumberL1CenJet() const
get / set the number of L1 central jets received by GT
int m_ifCaloEtaNumberBits
Definition: GtProducer.h:97
const GlobalStableParameters * m_l1GtStablePar
cached stuff
Definition: GtProducer.h:74
unsigned long long m_l1GtParCacheID
Definition: GtProducer.h:102
GtBoard * m_uGtBrd
Definition: GtProducer.h:146
void receiveCaloObjectData(edm::Event &, const edm::InputTag &, const bool receiveEG, const int nrL1EG, const bool receiveTau, const int nrL1Tau, const bool receiveJet, const int nrL1Jet, const bool receiveEtSums)
receive data from Global Muon Trigger
Definition: GtBoard.cc:180
void receiveMuonObjectData(edm::Event &, const edm::InputTag &, const bool receiveMu, const int nrL1Mu)
Definition: GtBoard.cc:339
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
void runGTL(edm::Event &iEvent, const edm::EventSetup &evSetup, const bool produceL1GtObjectMapRecord, const int iBxInEvent, std::auto_ptr< L1GlobalTriggerObjectMapRecord > &gtObjectMapRecord, const unsigned int numberPhysTriggers, const int nrL1Mu, const int nrL1EG, const int nrL1Tau, const int nrL1Jet, const int nrL1JetCounts)
run the uGT GTL (Conditions and Algorithms)
Definition: GtBoard.cc:389
unsigned int gtNumberL1TauJet() const
get / set the number of L1 tau jets received by GT
unsigned int gtIfMuEtaNumberBits() const
get / set the number of bits for eta of muon objects
unsigned long long m_l1GtStableParCacheID
Definition: GtProducer.h:75
int orbitNumber() const
Definition: EventBase.h:63
#define LogTrace(id)
unsigned int gtNumberPhysTriggers() const
get / set the number of physics trigger algorithms
unsigned int m_bstLengthBytes
length of BST record (in bytes) from event setup
Definition: GtProducer.h:111
void reset()
clear uGT
Definition: GtBoard.cc:1051
const L1GtParameters * m_l1GtPar
parameters
Definition: GtProducer.h:101
int m_ifMuEtaNumberBits
Definition: GtProducer.h:96
const T & get() const
Definition: EventSetup.h:55
bool m_isDebugEnabled
Definition: GtProducer.h:193
T const * product() const
Definition: ESHandle.h:62
unsigned int gtNumberL1JetCounts() const
get / set the number of L1 jet counts received by GT
bool m_produceL1GtDaqRecord
logical flag to produce the L1 GT DAQ readout record
Definition: GtProducer.h:155
void init(const int numberPhysTriggers, const int nrL1Mu, const int nrL1EG, const int nrL1Tau, const int nrL1Jet, int bxFirst, int bxLast)
initialize the class (mainly reserve)
Definition: GtBoard.cc:147
string bx
Definition: rpc-layouts.py:13
int m_emulateBxInEvent
Definition: GtProducer.h:167
void fillExtRecord(int iBxInEvent, std::auto_ptr< GlobalExtBlkBxCollection > &uGtExtRecord, cms_uint64_t orbNr, int bxNr)
Definition: GtBoard.cc:1027
edm::InputTag m_caloInputTag
input tag for calorimeter collections from GCT
Definition: GtProducer.h:152
void fillAlgRecord(int iBxInEvent, std::auto_ptr< GlobalAlgBlkBxCollection > &uGtAlgRecord, cms_uint64_t orbNr, int bxNr)
Fill the Daq Records.
Definition: GtBoard.cc:993
edm::InputTag m_muInputTag
input tag for muon collection from GMT
Definition: GtProducer.h:149
unsigned long long cms_uint64_t
Definition: typedefs.h:17
int m_verbosity
verbosity level
Definition: GtProducer.h:192

Member Data Documentation

boost::uint16_t l1t::GtProducer::m_activeBoardsGtDaq
private

active boards in L1 GT DAQ record

Definition at line 108 of file GtProducer.h.

Referenced by GtProducer().

bool l1t::GtProducer::m_algorithmTriggersUnmasked
private

if true, unmasked - all enabled (all trigger masks set to 0) will overwrite the event setup

Definition at line 186 of file GtProducer.h.

Referenced by GtProducer().

bool l1t::GtProducer::m_algorithmTriggersUnprescaled
private

run algorithm triggers if true, unprescaled (all prescale factors 1) will overwrite the event setup

Definition at line 182 of file GtProducer.h.

Referenced by GtProducer().

unsigned int l1t::GtProducer::m_alternativeNrBxBoardDaq
private

alternative for number of BX per active board in GT DAQ record: 0 or 1 the position is identical with the active board bit

Definition at line 174 of file GtProducer.h.

Referenced by GtProducer().

unsigned int l1t::GtProducer::m_bstLengthBytes
private

length of BST record (in bytes) from event setup

Definition at line 111 of file GtProducer.h.

Referenced by GtProducer().

edm::InputTag l1t::GtProducer::m_caloInputTag
private

input tag for calorimeter collections from GCT

Definition at line 152 of file GtProducer.h.

Referenced by GtProducer().

int l1t::GtProducer::m_emulateBxInEvent
private

number of "bunch crossing in the event" (BxInEvent) to be emulated symmetric around L1Accept (BxInEvent = 0): 1 (BxInEvent = 0); 3 (F 0 1) (standard record); 5 (E F 0 1 2) (debug record) even numbers (except 0) "rounded" to the nearest lower odd number

Definition at line 167 of file GtProducer.h.

Referenced by GtProducer().

int l1t::GtProducer::m_ifCaloEtaNumberBits
private

Definition at line 97 of file GtProducer.h.

Referenced by GtProducer().

int l1t::GtProducer::m_ifMuEtaNumberBits
private

Definition at line 96 of file GtProducer.h.

Referenced by GtProducer().

bool l1t::GtProducer::m_isDebugEnabled
private

Definition at line 193 of file GtProducer.h.

int l1t::GtProducer::m_L1DataBxInEvent
private

Bx expected in Data coming to GT.

Definition at line 170 of file GtProducer.h.

Referenced by GtProducer().

const L1GtBoardMaps* l1t::GtProducer::m_l1GtBM
private

board maps - cache only the record

Definition at line 114 of file GtProducer.h.

unsigned long long l1t::GtProducer::m_l1GtBMCacheID
private

Definition at line 115 of file GtProducer.h.

Referenced by GtProducer().

const L1GtParameters* l1t::GtProducer::m_l1GtPar
private

parameters

Definition at line 101 of file GtProducer.h.

unsigned long long l1t::GtProducer::m_l1GtParCacheID
private

Definition at line 102 of file GtProducer.h.

Referenced by GtProducer().

const L1GtPrescaleFactors* l1t::GtProducer::m_l1GtPfAlgo
private

prescale factors

Definition at line 119 of file GtProducer.h.

unsigned long long l1t::GtProducer::m_l1GtPfAlgoCacheID
private

Definition at line 120 of file GtProducer.h.

Referenced by GtProducer().

const GlobalStableParameters* l1t::GtProducer::m_l1GtStablePar
private

cached stuff

stable parameters

Definition at line 74 of file GtProducer.h.

unsigned long long l1t::GtProducer::m_l1GtStableParCacheID
private

Definition at line 75 of file GtProducer.h.

Referenced by GtProducer().

const L1GtTriggerMask* l1t::GtProducer::m_l1GtTmAlgo
private

trigger masks & veto masks

Definition at line 128 of file GtProducer.h.

unsigned long long l1t::GtProducer::m_l1GtTmAlgoCacheID
private

Definition at line 129 of file GtProducer.h.

Referenced by GtProducer().

const L1GtTriggerMask* l1t::GtProducer::m_l1GtTmVetoAlgo
private

Definition at line 131 of file GtProducer.h.

unsigned long long l1t::GtProducer::m_l1GtTmVetoAlgoCacheID
private

Definition at line 132 of file GtProducer.h.

Referenced by GtProducer().

edm::InputTag l1t::GtProducer::m_muInputTag
private

input tag for muon collection from GMT

Definition at line 149 of file GtProducer.h.

Referenced by GtProducer().

int l1t::GtProducer::m_nrL1EG
private

Definition at line 86 of file GtProducer.h.

Referenced by GtProducer().

int l1t::GtProducer::m_nrL1Jet
private

Definition at line 89 of file GtProducer.h.

Referenced by GtProducer().

int l1t::GtProducer::m_nrL1JetCounts
private

Definition at line 92 of file GtProducer.h.

Referenced by GtProducer().

int l1t::GtProducer::m_nrL1Mu
private

number of objects of each type { Mu, NoIsoEG, IsoEG, Jet, Tau, ETM, ETT, HTT, JetCounts };

Definition at line 85 of file GtProducer.h.

Referenced by GtProducer().

int l1t::GtProducer::m_nrL1Tau
private

Definition at line 87 of file GtProducer.h.

Referenced by GtProducer().

unsigned int l1t::GtProducer::m_numberDaqPartitions
private

number of DAQ partitions

Definition at line 81 of file GtProducer.h.

Referenced by GtProducer().

unsigned int l1t::GtProducer::m_numberPhysTriggers
private

number of physics triggers

Definition at line 78 of file GtProducer.h.

Referenced by GtProducer().

const std::vector<std::vector<int> >* l1t::GtProducer::m_prescaleFactorsAlgoTrig
private

Definition at line 124 of file GtProducer.h.

bool l1t::GtProducer::m_produceL1GtDaqRecord
private

logical flag to produce the L1 GT DAQ readout record

Definition at line 155 of file GtProducer.h.

Referenced by GtProducer().

bool l1t::GtProducer::m_produceL1GtObjectMapRecord
private

logical flag to produce the L1 GT object map record

Definition at line 158 of file GtProducer.h.

Referenced by GtProducer().

int l1t::GtProducer::m_psBstLengthBytes
private

length of BST record (in bytes) from parameter set

Definition at line 177 of file GtProducer.h.

Referenced by GtProducer().

int l1t::GtProducer::m_totalBxInEvent
private

total number of Bx's in the event coming from EventSetup

Definition at line 105 of file GtProducer.h.

Referenced by GtProducer().

std::vector<unsigned int> l1t::GtProducer::m_triggerMaskAlgoTrig
private

Definition at line 135 of file GtProducer.h.

std::vector<unsigned int> l1t::GtProducer::m_triggerMaskVetoAlgoTrig
private

Definition at line 137 of file GtProducer.h.

GtBoard* l1t::GtProducer::m_uGtBrd
private

Definition at line 146 of file GtProducer.h.

Referenced by gtBrd(), and GtProducer().

int l1t::GtProducer::m_verbosity
private

verbosity level

Definition at line 192 of file GtProducer.h.

Referenced by GtProducer().

bool l1t::GtProducer::m_writePsbL1GtDaqRecord
private

logical flag to write the PSB content in the L1 GT DAQ record

Definition at line 161 of file GtProducer.h.

Referenced by GtProducer().