13 #include <boost/cstdint.hpp> 48 desc.
add<
edm::InputTag> (
"MuonInputTag",
edm::InputTag(
""))->setComment(
"InputTag for Global Muon Trigger (required parameter: default value is invalid)");
49 desc.
add<
edm::InputTag> (
"EGammaInputTag",
edm::InputTag(
""))->setComment(
"InputTag for Calo Trigger EGamma (required parameter: default value is invalid)");
50 desc.
add<
edm::InputTag> (
"TauInputTag",
edm::InputTag(
""))->setComment(
"InputTag for Calo Trigger Tau (required parameter: default value is invalid)");
51 desc.
add<
edm::InputTag> (
"JetInputTag",
edm::InputTag(
""))->setComment(
"InputTag for Calo Trigger Jet (required parameter: default value is invalid)");
52 desc.
add<
edm::InputTag> (
"EtSumInputTag",
edm::InputTag(
""))->setComment(
"InputTag for Calo Trigger EtSum (required parameter: default value is invalid)");
53 desc.
add<
edm::InputTag> (
"ExtInputTag",
edm::InputTag(
""))->setComment(
"InputTag for external conditions (not required, but recommend to specify explicitly in config)");
54 desc.
add<
edm::InputTag> (
"AlgoBlkInputTag",
edm::InputTag(
"gtDigis"))->setComment(
"InputTag for unpacked Algblk (required only if GetPrescaleColumnFromData set to true)");
55 desc.
add<
bool> (
"GetPrescaleColumnFromData",
false)->setComment(
"Get prescale column from unpacked GlobalAlgBck. Otherwise use value specified in PrescaleSet");
56 desc.
add<
bool> (
"AlgorithmTriggersUnprescaled",
false)->setComment(
"not required, but recommend to specify explicitly in config");
57 desc.
add<
bool> (
"AlgorithmTriggersUnmasked",
false)->setComment(
"not required, but recommend to specify explicitly in config");
60 desc.
add<
bool> (
"ProduceL1GtDaqRecord",
true);
61 desc.
add<
bool> (
"ProduceL1GtObjectMapRecord",
true);
62 desc.
add<
int> (
"EmulateBxInEvent",1);
63 desc.
add<
int> (
"L1DataBxInEvent",5);
64 desc.
add<
unsigned int> (
"AlternativeNrBxBoardDaq",0);
65 desc.
add<
int> (
"BstLengthBytes",-1);
66 desc.
add<
unsigned int> (
"PrescaleSet",1);
71 descriptions.
add(
"L1TGlobalProducer", desc);
79 m_muInputTag(parSet.getParameter<
edm::InputTag> (
"MuonInputTag")),
80 m_egInputTag(parSet.getParameter<
edm::InputTag> (
"EGammaInputTag")),
81 m_tauInputTag(parSet.getParameter<
edm::InputTag> (
"TauInputTag")),
82 m_jetInputTag(parSet.getParameter<
edm::InputTag> (
"JetInputTag")),
83 m_sumInputTag(parSet.getParameter<
edm::InputTag> (
"EtSumInputTag")),
84 m_extInputTag(parSet.getParameter<
edm::InputTag> (
"ExtInputTag")),
86 m_produceL1GtDaqRecord(parSet.getParameter<
bool> (
"ProduceL1GtDaqRecord")),
87 m_produceL1GtObjectMapRecord(parSet.getParameter<
bool> (
"ProduceL1GtObjectMapRecord")),
89 m_emulateBxInEvent(parSet.getParameter<
int> (
"EmulateBxInEvent")),
90 m_L1DataBxInEvent(parSet.getParameter<
int> (
"L1DataBxInEvent")),
92 m_alternativeNrBxBoardDaq(parSet.getParameter<unsigned
int> (
"AlternativeNrBxBoardDaq")),
93 m_psBstLengthBytes(parSet.getParameter<
int> (
"BstLengthBytes")),
95 m_prescaleSet(parSet.getParameter<unsigned
int> (
"PrescaleSet")),
97 m_algorithmTriggersUnprescaled(parSet.getParameter<
bool> (
"AlgorithmTriggersUnprescaled")),
98 m_algorithmTriggersUnmasked(parSet.getParameter<
bool> (
"AlgorithmTriggersUnmasked")),
100 m_verbosity(parSet.getUntrackedParameter<
int>(
"Verbosity")),
101 m_printL1Menu(parSet.getUntrackedParameter<
bool>(
"PrintL1Menu")),
103 m_getPrescaleColumnFromData(parSet.getParameter<
bool>(
"GetPrescaleColumnFromData")),
104 m_algoblkInputTag(parSet.getParameter<
edm::InputTag>(
"AlgoBlkInputTag"))
120 <<
"\nInput tag for muon collection from uGMT: " <<
m_muInputTag 121 <<
"\nInput tag for calorimeter jet collections from Cal: " <<
m_jetInputTag 132 <<
"\nAlternative for number of BX in GT DAQ record: 0x" << std::hex
147 <<
"\nWARNING: Number of bunch crossing to be emulated rounded to: " 159 <<
"\nWARNING: Number of bunch crossing for incoming L1 Data rounded to: " 168 <<
"\nWARNING: Number of bunch crossing for incoming L1 Data was changed to: " 179 produces<GlobalAlgBlkBxCollection>();
185 produces<GlobalObjectMapRecord>();
190 m_uGtBrd = std::make_unique<GlobalBoard>();
234 std::vector<std::vector<int> > temp_prescaleTable;
236 temp_prescaleTable.push_back(std::vector<int>());
259 unsigned long long l1GtParCacheID =
413 if(m_uGtAlgBlk.
isValid() && !m_uGtAlgBlk->isEmpty(0)) {
414 std::vector<GlobalAlgBlk>::const_iterator algBlk = m_uGtAlgBlk->begin(0);
415 m_prescaleSet=
static_cast<unsigned int>(algBlk->getPreScColumn());
418 edm::LogError(
"L1TGlobalProduce") <<
"Could not find valid algo block. Setting prescale column to 1" << std::endl;
481 bool receiveMu =
true;
482 bool receiveEG =
true;
483 bool receiveTau =
true;
484 bool receiveJet =
true;
485 bool receiveEtSums =
true;
486 bool receiveExt =
true;
518 std::unique_ptr<GlobalAlgBlkBxCollection> uGtAlgRecord(
new GlobalAlgBlkBxCollection(0,minEmulBxInEvent,maxEmulBxInEvent));
521 std::unique_ptr<GlobalObjectMapRecord> gtObjectMapRecord(
531 boost::uint16_t bxCrossHw = 0;
532 if ((bxCross & 0xFFF) == bxCross) {
533 bxCrossHw =
static_cast<boost::uint16_t
> (bxCross);
540 <<
"\nBunch cross number [hex] = " << std::hex << bxCross
541 <<
"\n larger than 12 bits. Set to 0! \n" <<
std::dec 545 LogDebug(
"L1TGlobalProducer") <<
"HW BxCross " << bxCrossHw << std::endl;
551 auto max = (*m_prescaleFactorsAlgoTrig).size()-1;
552 if (pfAlgoSetIndex >
max) {
554 <<
"\nAttempting to access prescale algo set: " <<
m_prescaleSet 555 <<
"\nNumber of prescale algo sets available: 0.." <<
max 556 <<
"Setting former to latter." 558 pfAlgoSetIndex =
max;
561 const std::vector<int>& prescaleFactorsAlgoTrig = (*m_prescaleFactorsAlgoTrig).at(pfAlgoSetIndex);
565 for(
unsigned int iAlgo=0; iAlgo < prescaleFactorsAlgoTrig.size(); iAlgo++ ){
566 unsigned int value = prescaleFactorsAlgoTrig[iAlgo];
567 value = ( value==0 ) ? 0 : 1;
575 LogDebug(
"L1TGlobalProducer") <<
"Size of prescale vector" << prescaleFactorsAlgoTrig.size() << std::endl;
579 m_uGtBrd->receiveCaloObjectData(iEvent,
597 for (
int iBxInEvent = minEmulBxInEvent; iBxInEvent <= maxEmulBxInEvent;
602 <<
"\nL1TGlobalProducer : running GTL for bx = " << iBxInEvent <<
"\n" 619 <<
"\nL1TGlobalProducer : running FDL for bx = " << iBxInEvent <<
"\n" 627 m_numberPhysTriggers,
628 prescaleFactorsAlgoTrig,
630 triggerMaskVetoAlgoTrig,
654 std::ostringstream myCoutStream;
656 for(
int bx=minEmulBxInEvent; bx<maxEmulBxInEvent; bx++) {
659 (uGtAlgRecord->at(bx,0)).
print(myCoutStream);
664 <<
"\n The following L1 GT DAQ readout record was produced:\n" 665 << myCoutStream.str() <<
"\n" 668 myCoutStream.str(
"");
669 myCoutStream.clear();
671 const std::vector<GlobalObjectMap> objMapVec =
672 gtObjectMapRecord->gtObjectMap();
674 for (std::vector<GlobalObjectMap>::const_iterator
675 it = objMapVec.begin(); it != objMapVec.end(); ++it) {
677 (*it).print(myCoutStream);
683 <<
"Test gtObjectMapRecord in L1TGlobalProducer \n\n" << myCoutStream.str() <<
"\n\n" 686 myCoutStream.str(
"");
687 myCoutStream.clear();
edm::InputTag m_jetInputTag
unsigned int m_numberDaqPartitions
edm::InputTag m_algoblkInputTag
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
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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
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
unsigned int numberPhysTriggers() const
get / set the number of physics trigger algorithms
int bunchCrossing() const
edm::LuminosityBlockNumber_t luminosityBlock() 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
~L1TGlobalProducer() override
std::vector< unsigned int > m_initialTriggerMaskAlgoTrig
S & print(S &os, JobReport::InputFile const &f)
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
#define DEFINE_FWK_MODULE(type)
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)
bool m_getPrescaleColumnFromData
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
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetToken m_algoblkInputToken
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
T const * product() const
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
void produce(edm::Event &, const edm::EventSetup &) override