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>();
226 std::vector<std::vector<int> > temp_prescaleTable;
228 temp_prescaleTable.push_back(std::vector<int>());
254 unsigned long long l1GtParCacheID =
460 bool receiveMu =
true;
461 bool receiveEG =
true;
462 bool receiveTau =
true;
463 bool receiveJet =
true;
464 bool receiveEtSums =
true;
465 bool receiveExt =
true;
497 std::auto_ptr<GlobalAlgBlkBxCollection> uGtAlgRecord(
new GlobalAlgBlkBxCollection(0,minEmulBxInEvent,maxEmulBxInEvent));
500 std::auto_ptr<GlobalObjectMapRecord> gtObjectMapRecord(
510 boost::uint16_t bxCrossHw = 0;
511 if ((bxCross & 0xFFF) == bxCross) {
512 bxCrossHw =
static_cast<boost::uint16_t
> (bxCross);
519 <<
"\nBunch cross number [hex] = " << std::hex << bxCross
520 <<
"\n larger than 12 bits. Set to 0! \n" <<
std::dec
524 LogDebug(
"L1TGlobalProducer") <<
"HW BxCross " << bxCrossHw << std::endl;
530 auto max = (*m_prescaleFactorsAlgoTrig).size()-1;
531 if (pfAlgoSetIndex >
max) {
533 <<
"\nAttempting to access prescale algo set: " <<
m_prescaleSet
534 <<
"\nNumber of prescale algo sets available: 0.." <<
max
535 <<
"Setting former to latter."
537 pfAlgoSetIndex =
max;
540 const std::vector<int>& prescaleFactorsAlgoTrig = (*m_prescaleFactorsAlgoTrig).at(pfAlgoSetIndex);
544 for(
unsigned int iAlgo=0; iAlgo < prescaleFactorsAlgoTrig.size(); iAlgo++ ){
545 unsigned int value = prescaleFactorsAlgoTrig[iAlgo];
546 value = ( value==0 ) ? 0 : 1;
554 LogDebug(
"L1TGlobalProducer") <<
"Size of prescale vector" << prescaleFactorsAlgoTrig.size() << std::endl;
576 for (
int iBxInEvent = minEmulBxInEvent; iBxInEvent <= maxEmulBxInEvent;
581 <<
"\nL1TGlobalProducer : running GTL for bx = " << iBxInEvent <<
"\n"
598 <<
"\nL1TGlobalProducer : running FDL for bx = " << iBxInEvent <<
"\n"
607 prescaleFactorsAlgoTrig,
609 triggerMaskVetoAlgoTrig,
633 std::ostringstream myCoutStream;
635 for(
int bx=minEmulBxInEvent; bx<maxEmulBxInEvent; bx++) {
638 (uGtAlgRecord->at(bx,0)).
print(myCoutStream);
643 <<
"\n The following L1 GT DAQ readout record was produced:\n"
644 << myCoutStream.str() <<
"\n"
647 myCoutStream.str(
"");
648 myCoutStream.clear();
650 const std::vector<GlobalObjectMap> objMapVec =
651 gtObjectMapRecord->gtObjectMap();
653 for (std::vector<GlobalObjectMap>::const_iterator
654 it = objMapVec.begin(); it != objMapVec.end(); ++it) {
656 (*it).print(myCoutStream);
662 <<
"Test gtObjectMapRecord in L1TGlobalProducer \n\n" << myCoutStream.str() <<
"\n\n"
665 myCoutStream.str(
"");
666 myCoutStream.clear();
674 iEvent.
put( uGtAlgRecord );
679 iEvent.
put( gtObjectMapRecord );
void receiveMuonObjectData(edm::Event &, const edm::EDGetTokenT< BXVector< l1t::Muon > > &, const bool receiveMu, const int nrL1Mu)
edm::InputTag m_jetInputTag
unsigned int m_numberDaqPartitions
unsigned long long m_l1GtParCacheID
unsigned int numberL1Jet() const
get / set the number of L1 jets received by GT
unsigned long long m_l1GtTmVetoAlgoCacheID
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)
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)
void fillAlgRecord(int iBxInEvent, std::auto_ptr< GlobalAlgBlkBxCollection > &uGtAlgRecord, int prescaleSet, int menuUUID, int firmwareUUID)
Fill the Daq Records.
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
const TriggerMenu * m_l1GtMenu
std::vector< unsigned int > m_initialTriggerMaskAlgoTrig
const std::vector< int > * m_triggerMaskVetoAlgoTrig
unsigned int m_alternativeNrBxBoardDaq
edm::InputTag m_sumInputTag
void receiveCaloObjectData(edm::Event &, const edm::EDGetTokenT< BXVector< l1t::EGamma >> &, const edm::EDGetTokenT< BXVector< l1t::Tau >> &, const edm::EDGetTokenT< BXVector< l1t::Jet >> &, const edm::EDGetTokenT< BXVector< l1t::EtSum >> &, 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
void setVerbosity(const int verbosity)
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
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool m_algorithmTriggersUnprescaled
std::vector< std::vector< int > > m_initialPrescaleFactorsAlgoTrig
std::vector< int > m_initialTriggerMaskVetoAlgoTrig
void receiveExternalData(edm::Event &, const edm::EDGetTokenT< BXVector< GlobalExtBlk > > &, const bool receiveExt)
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.
l1t::GlobalBoard * m_uGtBrd
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]
void runFDL(edm::Event &iEvent, const int iBxInEvent, const int totalBxInEvent, const unsigned int numberPhysTriggers, const std::vector< int > &prescaleFactorsAlgoTrig, const std::vector< unsigned int > &triggerMaskAlgoTrig, const std::vector< int > &triggerMaskVetoAlgoTrig, const bool algorithmTriggersUnprescaled, const bool algorithmTriggersUnmasked)
run the uGT FDL (Apply Prescales and Veto)
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
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
void runGTL(edm::Event &iEvent, const edm::EventSetup &evSetup, const TriggerMenu *m_l1GtMenu, const bool produceL1GtObjectMapRecord, const int iBxInEvent, std::auto_ptr< GlobalObjectMapRecord > >ObjectMapRecord, const unsigned int numberPhysTriggers, const int nrL1Mu, const int nrL1EG, const int nrL1Tau, const int nrL1Jet)
run the uGT GTL (Conditions and Algorithms)
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