28 #include <boost/cstdint.hpp>
67 m_muInputTag(parSet.getParameter<edm::InputTag> (
"GmtInputTag")),
68 m_caloInputTag(parSet.getParameter<edm::InputTag> (
"caloInputTag")),
70 m_produceL1GtDaqRecord(parSet.getParameter<bool> (
"ProduceL1GtDaqRecord")),
71 m_produceL1GtObjectMapRecord(parSet.getParameter<bool> (
"ProduceL1GtObjectMapRecord")),
73 m_emulateBxInEvent(parSet.getParameter<int> (
"EmulateBxInEvent")),
74 m_L1DataBxInEvent(parSet.getParameter<int> (
"L1DataBxInEvent")),
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")),
81 m_verbosity(parSet.getUntrackedParameter<int>(
"Verbosity", 0)),
91 <<
"\nInput tag for muon collection from GMT: " <<
m_muInputTag
92 <<
"\nInput tag for calorimeter collections from GCT: " <<
m_caloInputTag
104 <<
"\nAlternative for number of BX in GT DAQ record: 0x" << std::hex
121 <<
"\nWARNING: Number of bunch crossing to be emulated rounded to: "
133 <<
"\nWARNING: Number of bunch crossing for incoming L1 Data rounded to: "
142 <<
"\nWARNING: Number of bunch crossing for incoming L1 Data was changed to: "
153 produces<GlobalAlgBlkBxCollection>();
154 produces<GlobalExtBlkBxCollection>();
227 if (m_l1GtParCacheID != l1GtParCacheID) {
234 m_totalBxInEvent = m_l1GtPar->gtTotalBxInEvent();
237 m_activeBoardsGtDaq = m_l1GtPar->gtDaqActiveBoards();
240 m_bstLengthBytes = m_l1GtPar->gtBstLengthBytes();
243 m_l1GtParCacheID = l1GtParCacheID;
248 if (m_emulateBxInEvent < 0) {
249 m_emulateBxInEvent = m_totalBxInEvent;
252 int minEmulBxInEvent = (m_emulateBxInEvent + 1)/2 - m_emulateBxInEvent;
253 int maxEmulBxInEvent = (m_emulateBxInEvent + 1)/2 - 1;
255 int minL1DataBxInEvent = (m_L1DataBxInEvent + 1)/2 - m_L1DataBxInEvent;
256 int maxL1DataBxInEvent = (m_L1DataBxInEvent + 1)/2 - 1;
262 unsigned long long l1GtStableParCacheID =
265 if (m_l1GtStableParCacheID != l1GtStableParCacheID) {
269 m_l1GtStablePar = l1GtStablePar.
product();
272 m_numberPhysTriggers = m_l1GtStablePar->gtNumberPhysTriggers();
275 m_numberDaqPartitions = 8;
278 m_nrL1Mu =
static_cast<int> (m_l1GtStablePar->gtNumberL1Mu());
282 m_nrL1EG =
static_cast<int> (m_l1GtStablePar->gtNumberL1NoIsoEG());
283 m_nrL1Tau=
static_cast<int> (m_l1GtStablePar->gtNumberL1TauJet());
287 m_nrL1Jet =
static_cast<int> (m_l1GtStablePar->gtNumberL1CenJet());
289 m_nrL1JetCounts =
static_cast<int> (m_l1GtStablePar->gtNumberL1JetCounts());
293 m_ifMuEtaNumberBits =
static_cast<int> (m_l1GtStablePar->gtIfMuEtaNumberBits());
294 m_ifCaloEtaNumberBits =
static_cast<int> (m_l1GtStablePar->gtIfCaloEtaNumberBits());
298 m_uGtBrd->init(m_numberPhysTriggers, m_nrL1Mu, m_nrL1EG, m_nrL1Tau, m_nrL1Jet, minL1DataBxInEvent, maxL1DataBxInEvent );
301 m_l1GtStableParCacheID = l1GtStableParCacheID;
404 bool receiveMu =
true;
405 bool receiveEG =
true;
406 bool receiveTau =
true;
407 bool receiveJet =
true;
408 bool receiveEtSums =
true;
449 std::auto_ptr<GlobalAlgBlkBxCollection> uGtAlgRecord(
new GlobalAlgBlkBxCollection(0,minEmulBxInEvent,maxEmulBxInEvent));
450 std::auto_ptr<GlobalExtBlkBxCollection> uGtExtRecord(
new GlobalExtBlkBxCollection(0,minEmulBxInEvent,maxEmulBxInEvent));
453 std::auto_ptr<L1GlobalTriggerObjectMapRecord> gtObjectMapRecord(
463 boost::uint16_t bxCrossHw = 0;
464 if ((bxCross & 0xFFF) == bxCross) {
465 bxCrossHw =
static_cast<boost::uint16_t
> (bxCross);
472 <<
"\nBunch cross number [hex] = " << std::hex << bxCross
473 <<
"\n larger than 12 bits. Set to 0! \n" << std::dec
477 LogDebug(
"l1t|Global") <<
"HW BxCross " << bxCrossHw << std::endl;
573 m_uGtBrd->receiveCaloObjectData(iEvent, m_caloInputTag,
575 receiveTau, m_nrL1Tau,
576 receiveJet, m_nrL1Jet,
579 m_uGtBrd->receiveMuonObjectData(iEvent, m_muInputTag,
580 receiveMu, m_nrL1Mu );
584 for (
int iBxInEvent = minEmulBxInEvent; iBxInEvent <= maxEmulBxInEvent;
589 <<
"\nGtProducer : running GTL for bx = " << iBxInEvent <<
"\n"
594 m_uGtBrd->runGTL(iEvent, evSetup,
595 m_produceL1GtObjectMapRecord, iBxInEvent, gtObjectMapRecord,
596 m_numberPhysTriggers,
606 <<
"\nGtProducer : running FDL for bx = " << iBxInEvent <<
"\n"
611 m_uGtBrd->runFDL(iEvent,
613 m_algorithmTriggersUnprescaled,
614 m_algorithmTriggersUnmasked
620 if (m_produceL1GtDaqRecord) {
625 m_uGtBrd->fillAlgRecord(iBxInEvent, uGtAlgRecord, orbNr, abBx);
626 m_uGtBrd->fillExtRecord(iBxInEvent, uGtExtRecord, orbNr, abBx);
639 if ( m_verbosity && m_isDebugEnabled ) {
641 std::ostringstream myCoutStream;
643 for(
int bx=minEmulBxInEvent; bx<maxEmulBxInEvent; bx++) {
646 (uGtAlgRecord->at(bx,0)).
print(myCoutStream);
647 (uGtExtRecord->at(bx,0)).
print(myCoutStream);
652 <<
"\n The following L1 GT DAQ readout record was produced:\n"
653 << myCoutStream.str() <<
"\n"
656 myCoutStream.str(
"");
657 myCoutStream.clear();
683 if (m_produceL1GtDaqRecord) {
684 iEvent.
put( uGtAlgRecord );
685 iEvent.
put( uGtExtRecord );
BXVector< GlobalExtBlk > GlobalExtBlkBxCollection
void setVerbosity(const int verbosity)
bool m_algorithmTriggersUnprescaled
bool m_produceL1GtObjectMapRecord
logical flag to produce the L1 GT object map record
#define DEFINE_FWK_MODULE(type)
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
int bunchCrossing() const
bool m_writePsbL1GtDaqRecord
logical flag to write the PSB content in the L1 GT DAQ record
int m_L1DataBxInEvent
Bx expected in Data coming to GT.
BXVector< GlobalAlgBlk > GlobalAlgBlkBxCollection
bool m_algorithmTriggersUnmasked
unsigned int m_numberPhysTriggers
number of physics triggers
boost::uint16_t m_activeBoardsGtDaq
active boards in L1 GT DAQ record
unsigned int m_numberDaqPartitions
number of DAQ partitions
int m_totalBxInEvent
total number of Bx's in the event coming from EventSetup
int m_ifCaloEtaNumberBits
unsigned long long m_l1GtParCacheID
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
unsigned int m_alternativeNrBxBoardDaq
unsigned long long m_l1GtStableParCacheID
unsigned long long m_l1GtTmVetoAlgoCacheID
unsigned int m_bstLengthBytes
length of BST record (in bytes) from event setup
unsigned long long m_l1GtBMCacheID
T const * product() const
bool m_produceL1GtDaqRecord
logical flag to produce the L1 GT DAQ readout record
GtProducer(const edm::ParameterSet &)
unsigned long long m_l1GtTmAlgoCacheID
edm::InputTag m_caloInputTag
input tag for calorimeter collections from GCT
edm::InputTag m_muInputTag
input tag for muon collection from GMT
unsigned long long cms_uint64_t
virtual void produce(edm::Event &, const edm::EventSetup &)
int m_psBstLengthBytes
length of BST record (in bytes) from parameter set
int m_verbosity
verbosity level
unsigned long long m_l1GtPfAlgoCacheID