12 #include <boost/cstdint.hpp>
47 desc.
add<
edm::InputTag> (
"MuonInputTag",
edm::InputTag(
""))->setComment(
"InputTag for Global Muon Trigger (required parameter: default value is invalid)");
48 desc.
add<
edm::InputTag> (
"EGammaInputTag",
edm::InputTag(
""))->setComment(
"InputTag for Calo Trigger EGamma (required parameter: default value is invalid)");
49 desc.
add<
edm::InputTag> (
"TauInputTag",
edm::InputTag(
""))->setComment(
"InputTag for Calo Trigger Tau (required parameter: default value is invalid)");
50 desc.
add<
edm::InputTag> (
"JetInputTag",
edm::InputTag(
""))->setComment(
"InputTag for Calo Trigger Jet (required parameter: default value is invalid)");
51 desc.
add<
edm::InputTag> (
"EtSumInputTag",
edm::InputTag(
""))->setComment(
"InputTag for Calo Trigger EtSum (required parameter: default value is invalid)");
52 desc.
add<
edm::InputTag> (
"ExtInputTag",
edm::InputTag(
""))->setComment(
"InputTag for external conditions (not required, but recommend to specify explicitly in config)");
53 desc.
add<
bool> (
"AlgorithmTriggersUnprescaled",
false)->setComment(
"not required, but recommend to specify explicitly in config");
54 desc.
add<
bool> (
"AlgorithmTriggersUnmasked",
false)->setComment(
"not required, but recommend to specify explicitly in config");
57 desc.
add<
bool> (
"ProduceL1GtDaqRecord",
true);
58 desc.
add<
bool> (
"ProduceL1GtObjectMapRecord",
true);
59 desc.
add<
int> (
"EmulateBxInEvent",1);
60 desc.
add<
int> (
"L1DataBxInEvent",5);
61 desc.
add<
unsigned int> (
"AlternativeNrBxBoardDaq",0);
62 desc.
add<
int> (
"BstLengthBytes",-1);
63 desc.
add<
unsigned int> (
"PrescaleSet",1);
68 descriptions.
add(
"L1TGlobalProducer", desc);
76 m_muInputTag(parSet.getParameter<edm::
InputTag> (
"MuonInputTag")),
77 m_egInputTag(parSet.getParameter<edm::
InputTag> (
"EGammaInputTag")),
78 m_tauInputTag(parSet.getParameter<edm::
InputTag> (
"TauInputTag")),
79 m_jetInputTag(parSet.getParameter<edm::
InputTag> (
"JetInputTag")),
80 m_sumInputTag(parSet.getParameter<edm::
InputTag> (
"EtSumInputTag")),
81 m_extInputTag(parSet.getParameter<edm::
InputTag> (
"ExtInputTag")),
83 m_produceL1GtDaqRecord(parSet.getParameter<bool> (
"ProduceL1GtDaqRecord")),
84 m_produceL1GtObjectMapRecord(parSet.getParameter<bool> (
"ProduceL1GtObjectMapRecord")),
86 m_emulateBxInEvent(parSet.getParameter<int> (
"EmulateBxInEvent")),
87 m_L1DataBxInEvent(parSet.getParameter<int> (
"L1DataBxInEvent")),
89 m_alternativeNrBxBoardDaq(parSet.getParameter<unsigned int> (
"AlternativeNrBxBoardDaq")),
90 m_psBstLengthBytes(parSet.getParameter<int> (
"BstLengthBytes")),
92 m_prescaleSet(parSet.getParameter<unsigned int> (
"PrescaleSet")),
94 m_algorithmTriggersUnprescaled(parSet.getParameter<bool> (
"AlgorithmTriggersUnprescaled")),
95 m_algorithmTriggersUnmasked(parSet.getParameter<bool> (
"AlgorithmTriggersUnmasked")),
97 m_verbosity(parSet.getUntrackedParameter<int>(
"Verbosity")),
98 m_printL1Menu(parSet.getUntrackedParameter<bool>(
"PrintL1Menu")),
113 <<
"\nInput tag for muon collection from uGMT: " <<
m_muInputTag
114 <<
"\nInput tag for calorimeter jet collections from Cal: " <<
m_jetInputTag
125 <<
"\nAlternative for number of BX in GT DAQ record: 0x" << std::hex
140 <<
"\nWARNING: Number of bunch crossing to be emulated rounded to: "
152 <<
"\nWARNING: Number of bunch crossing for incoming L1 Data rounded to: "
161 <<
"\nWARNING: Number of bunch crossing for incoming L1 Data was changed to: "
172 produces<GlobalAlgBlkBxCollection>();
178 produces<GlobalObjectMapRecord>();
183 m_uGtBrd = std::make_unique<GlobalBoard>();
226 std::vector<std::vector<int> > temp_prescaleTable;
228 temp_prescaleTable.push_back(std::vector<int>());
251 unsigned long long l1GtParCacheID =
457 bool receiveMu =
true;
458 bool receiveEG =
true;
459 bool receiveTau =
true;
460 bool receiveJet =
true;
461 bool receiveEtSums =
true;
462 bool receiveExt =
true;
494 std::unique_ptr<GlobalAlgBlkBxCollection> uGtAlgRecord(
new GlobalAlgBlkBxCollection(0,minEmulBxInEvent,maxEmulBxInEvent));
497 std::unique_ptr<GlobalObjectMapRecord> gtObjectMapRecord(
507 boost::uint16_t bxCrossHw = 0;
508 if ((bxCross & 0xFFF) == bxCross) {
509 bxCrossHw =
static_cast<boost::uint16_t
> (bxCross);
516 <<
"\nBunch cross number [hex] = " << std::hex << bxCross
517 <<
"\n larger than 12 bits. Set to 0! \n" <<
std::dec
521 LogDebug(
"L1TGlobalProducer") <<
"HW BxCross " << bxCrossHw << std::endl;
531 if( pfAlgoSetIndex > (*m_prescaleFactorsAlgoTrig).size()-1 ){
533 <<
"\nAttempting to access prescale algo set: " <<
m_prescaleSet
534 <<
"\nNumber of prescale algo sets available: " << (*m_prescaleFactorsAlgoTrig).size()
535 <<
"Setting former to latter."
538 pfAlgoSetIndex = (*m_prescaleFactorsAlgoTrig).size()-1;
541 const std::vector<int>& prescaleFactorsAlgoTrig = (*m_prescaleFactorsAlgoTrig).at(pfAlgoSetIndex);
545 for(
unsigned int iAlgo=0; iAlgo < prescaleFactorsAlgoTrig.size(); iAlgo++ ){
546 unsigned int value = prescaleFactorsAlgoTrig[iAlgo];
547 value = ( value==0 ) ? 0 : 1;
555 LogDebug(
"L1TGlobalProducer") <<
"Size of prescale vector" << prescaleFactorsAlgoTrig.size() << std::endl;
559 m_uGtBrd->receiveCaloObjectData(iEvent,
577 for (
int iBxInEvent = minEmulBxInEvent; iBxInEvent <= maxEmulBxInEvent;
582 <<
"\nL1TGlobalProducer : running GTL for bx = " << iBxInEvent <<
"\n"
599 <<
"\nL1TGlobalProducer : running FDL for bx = " << iBxInEvent <<
"\n"
607 m_numberPhysTriggers,
608 prescaleFactorsAlgoTrig,
610 triggerMaskVetoAlgoTrig,
634 std::ostringstream myCoutStream;
636 for(
int bx=minEmulBxInEvent; bx<maxEmulBxInEvent; bx++) {
639 (uGtAlgRecord->at(bx,0)).
print(myCoutStream);
644 <<
"\n The following L1 GT DAQ readout record was produced:\n"
645 << myCoutStream.str() <<
"\n"
648 myCoutStream.str(
"");
649 myCoutStream.clear();
651 const std::vector<GlobalObjectMap> objMapVec =
652 gtObjectMapRecord->gtObjectMap();
654 for (std::vector<GlobalObjectMap>::const_iterator
655 it = objMapVec.begin(); it != objMapVec.end(); ++it) {
657 (*it).print(myCoutStream);
663 <<
"Test gtObjectMapRecord in L1TGlobalProducer \n\n" << myCoutStream.str() <<
"\n\n"
666 myCoutStream.str(
"");
667 myCoutStream.clear();
edm::InputTag m_jetInputTag
unsigned int m_numberDaqPartitions
unsigned long long m_l1GtParCacheID
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
unsigned int numberL1Jet() const
get / set the number of L1 jets received by GT
unsigned long long m_l1GtTmVetoAlgoCacheID
const std::vector< std::vector< int > > & prescaleTable() const
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
int m_verbosity
verbosity level
unsigned int numberL1EG() const
get / set the number of L1 e/gamma objects received by GT
uint16_t m_activeBoardsGtDaq
active boards in L1 GT DAQ record
edm::InputTag m_egInputTag
input tag for calorimeter collections from GCT
edm::EDGetTokenT< BXVector< l1t::Tau > > m_tauInputToken
#define DEFINE_FWK_MODULE(type)
bool m_produceL1GtObjectMapRecord
logical flag to produce the L1 GT object map record
int m_totalBxInEvent
total number of Bx's in the event coming from EventSetup
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
unsigned int numberPhysTriggers() const
get / set the number of physics trigger algorithms
int bunchCrossing() const
unsigned int m_numberPhysTriggers
const L1TGlobalParameters * m_l1GtStablePar
cached stuff
edm::EDGetTokenT< BXVector< GlobalExtBlk > > m_extInputToken
BXVector< GlobalAlgBlk > GlobalAlgBlkBxCollection
unsigned long long m_l1GtTmAlgoCacheID
std::vector< unsigned int > m_initialTriggerMaskAlgoTrig
const std::vector< int > * m_triggerMaskVetoAlgoTrig
unsigned int m_alternativeNrBxBoardDaq
edm::InputTag m_sumInputTag
edm::InputTag m_muInputTag
input tag for muon collection from GMT
edm::InputTag m_extInputTag
input tag for external conditions
unsigned long long m_l1GtMenuCacheID
edm::InputTag m_tauInputTag
const std::vector< int > & orderOfChip() const
const std::vector< int > & triggerMaskVeto() const
std::unique_ptr< TriggerMenu > m_l1GtMenu
bool m_algorithmTriggersUnprescaled
std::vector< std::vector< int > > m_initialPrescaleFactorsAlgoTrig
std::vector< int > m_initialTriggerMaskVetoAlgoTrig
bool m_produceL1GtDaqRecord
logical flag to produce the L1 GT DAQ readout record
bool m_algorithmTriggersUnmasked
edm::EDGetTokenT< BXVector< l1t::Muon > > m_muInputToken
unsigned int numberL1Tau() const
get / set the number of L1 tau received by GT
ParameterDescriptionBase * add(U const &iLabel, T const &value)
unsigned int m_prescaleSet
prescale set used
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< BXVector< l1t::EtSum > > m_sumInputToken
int m_L1DataBxInEvent
Bx expected in Data coming to GT.
L1TGlobalProducer(const edm::ParameterSet &)
unsigned long long m_l1GtBMCacheID
int m_ifCaloEtaNumberBits
T const * product() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
unsigned int m_bstLengthBytes
length of BST record (in bytes) from event setup
char data[epos_bytes_allocation]
int totalBxInEvent() const
get / set the number of bx in hardware
const l1t::PrescalesVetosHelper * m_l1GtPrescalesVetoes
prescale factors
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
unsigned long long m_l1GtPfAlgoCacheID
std::unique_ptr< l1t::GlobalBoard > m_uGtBrd
unsigned int numberL1Mu() const
get / set the number of L1 muons received by GT
unsigned int pinsOnChip() const
get / set the number of pins on the GTL condition chips
edm::EDGetTokenT< BXVector< l1t::Jet > > m_jetInputToken
unsigned int numberChips() const
get / set the number of condition chips in GTL
edm::EDGetTokenT< BXVector< l1t::EGamma > > m_egInputToken
virtual void produce(edm::Event &, const edm::EventSetup &) override