67 : m_muGmtInputTag(parSet.getParameter<
edm::
InputTag>(
"GmtInputTag")),
68 m_caloGctInputTag(parSet.getParameter<
edm::
InputTag>(
"GctInputTag")),
69 m_castorInputTag(parSet.getParameter<
edm::
InputTag>(
"CastorInputTag")),
70 m_technicalTriggersInputTags(parSet.getParameter<
std::
vector<
edm::
InputTag>>(
"TechnicalTriggersInputTags")),
71 m_produceL1GtDaqRecord(parSet.getParameter<
bool>(
"ProduceL1GtDaqRecord")),
72 m_produceL1GtEvmRecord(parSet.getParameter<
bool>(
"ProduceL1GtEvmRecord")),
73 m_produceL1GtObjectMapRecord(parSet.getParameter<
bool>(
"ProduceL1GtObjectMapRecord")),
74 m_writePsbL1GtDaqRecord(parSet.getParameter<
bool>(
"WritePsbL1GtDaqRecord")),
75 m_readTechnicalTriggerRecords(parSet.getParameter<
bool>(
"ReadTechnicalTriggerRecords")),
76 m_emulateBxInEvent(parSet.getParameter<
int>(
"EmulateBxInEvent")),
77 m_recordLength(parSet.getParameter<
std::
vector<
int>>(
"RecordLength")),
78 m_alternativeNrBxBoardDaq(parSet.getParameter<unsigned
int>(
"AlternativeNrBxBoardDaq")),
79 m_alternativeNrBxBoardEvm(parSet.getParameter<unsigned
int>(
"AlternativeNrBxBoardEvm")),
80 m_psBstLengthBytes(parSet.getParameter<
int>(
"BstLengthBytes")),
81 m_algorithmTriggersUnprescaled(parSet.getParameter<
bool>(
"AlgorithmTriggersUnprescaled")),
82 m_algorithmTriggersUnmasked(parSet.getParameter<
bool>(
"AlgorithmTriggersUnmasked")),
83 m_technicalTriggersUnprescaled(parSet.getParameter<
bool>(
"TechnicalTriggersUnprescaled")),
84 m_technicalTriggersUnmasked(parSet.getParameter<
bool>(
"TechnicalTriggersUnmasked")),
85 m_technicalTriggersVetoUnmasked(parSet.getParameter<
bool>(
"TechnicalTriggersVetoUnmasked")),
86 m_verbosity(parSet.getUntrackedParameter<
int>(
"Verbosity", 0)),
98 LogDebug(
"L1GlobalTrigger") << std::endl;
103 <<
"\nInput tag for technical triggers: " << std::endl;
109 LogTrace(
"L1GlobalTrigger") <<
"\n " << (*it) << std::endl;
119 <<
"\nNumber of BXs corresponding to alternative 0: " <<
m_recordLength.at(0)
120 <<
"\nNumber of BXs corresponding to alternative 1: " <<
m_recordLength.at(1) <<
" \n" 137 edm::LogWarning(
"L1GlobalTrigger") <<
"\nWARNING: Number of bunch crossing to be emulated rounded to: " 148 edm::LogWarning(
"L1GlobalTrigger") <<
"\nWARNING: Number of bunch crossing required to be emulated ( " 150 <<
"\n Number of BXs corresponding to alternative 0: " 152 <<
"\n Number of BXs corresponding to alternative 1: " 153 <<
m_recordLength.at(1) <<
"\nEmulating " << requiredRecordLength <<
" BX!" 161 produces<L1GlobalTriggerReadoutRecord>();
165 produces<L1GlobalTriggerEvmReadoutRecord>();
169 produces<L1GlobalTriggerObjectMapRecord>();
323 if ((recordLength0 < 0) || (recordLength1 < 0)) {
334 <<
"[" << minBxInEvent <<
", " << maxBxInEvent <<
"] BX\n" 335 <<
"\nNumber of BX for alternative 0: " << recordLength0
336 <<
"\nNumber of BX for alternative 1: " << recordLength1
337 <<
"\nActive boards in L1 GT DAQ record (hex format) = " << std::hex
340 <<
"\nActive boards in L1 GT EVM record (hex format) = " << std::hex
349 typedef std::vector<L1GtBoard>::const_iterator CItBoardMaps;
443 int daqNrFdlBoards = 0;
444 int daqNrPsbBoards = 0;
447 bool receiveMu =
false;
448 bool receiveNoIsoEG =
false;
449 bool receiveIsoEG =
false;
450 bool receiveCenJet =
false;
451 bool receiveForJet =
false;
452 bool receiveTauJet =
false;
453 bool receiveETM =
false;
454 bool receiveETT =
false;
455 bool receiveHTT =
false;
456 bool receiveHTM =
false;
457 bool receiveJetCounts =
false;
458 bool receiveHfBitCounts =
false;
459 bool receiveHfRingEtSums =
false;
461 bool receiveExternal =
false;
463 bool receiveTechTr =
false;
465 for (CItBoardMaps itBoard = boardMaps.begin(); itBoard != boardMaps.end(); ++itBoard) {
466 int iPosition = itBoard->gtPositionDaqRecord();
468 int iActiveBit = itBoard->gtBitDaqActiveBoards();
469 bool activeBoard =
false;
471 if (iActiveBit >= 0) {
478 if ((iActiveBit < 0) || activeBoard) {
479 switch (itBoard->gtBoardType()) {
489 std::vector<L1GtPsbQuad> quadInPsb = itBoard->gtQuadInPsb();
490 for (std::vector<L1GtPsbQuad>::const_iterator itQuad = quadInPsb.begin(); itQuad != quadInPsb.end();
494 receiveTechTr =
true;
499 receiveNoIsoEG =
true;
509 receiveCenJet =
true;
514 receiveForJet =
true;
519 receiveTauJet =
true;
532 receiveJetCounts =
true;
547 receiveExternal =
true;
552 receiveHfBitCounts =
true;
553 receiveHfRingEtSums =
true;
581 std::unique_ptr<L1GlobalTriggerReadoutRecord> gtDaqReadoutRecord(
585 std::unique_ptr<L1GlobalTriggerEvmReadoutRecord> gtEvmReadoutRecord(
597 int bxCross =
iEvent.bunchCrossing();
598 uint16_t bxCrossHw = 0;
599 if ((bxCross & 0xFFF) == bxCross) {
600 bxCrossHw =
static_cast<uint16_t
>(bxCross);
604 LogDebug(
"L1GlobalTrigger") <<
"\nBunch cross number [hex] = " << std::hex << bxCross
605 <<
"\n larger than 12 bits. Set to 0! \n" 611 for (CItBoardMaps itBoard = boardMaps.begin(); itBoard != boardMaps.end(); ++itBoard) {
612 int iPosition = itBoard->gtPositionDaqRecord();
614 int iActiveBit = itBoard->gtBitDaqActiveBoards();
615 bool activeBoard =
false;
617 if (iActiveBit >= 0) {
624 if ((iActiveBit < 0) || activeBoard) {
625 switch (itBoard->gtBoardType()) {
629 gtfeWordValue.
setBoardId(itBoard->gtBoardId());
638 gtfeWordValue.
setBxNr(bxCrossHw);
653 gtDaqReadoutRecord->setGtfeWord(gtfeWordValue);
680 int evmNrFdlBoards = 0;
685 int bstLengthBytes = 0;
697 LogTrace(
"L1GlobalTrigger") <<
"\n Length of BST message (in bytes): " << bstLengthBytes <<
"\n" << std::endl;
700 for (CItBoardMaps itBoard = boardMaps.begin(); itBoard != boardMaps.end(); ++itBoard) {
701 int iPosition = itBoard->gtPositionEvmRecord();
703 int iActiveBit = itBoard->gtBitEvmActiveBoards();
704 bool activeBoard =
false;
706 if (iActiveBit >= 0) {
713 if ((iActiveBit < 0) || activeBoard) {
714 switch (itBoard->gtBoardType()) {
718 gtfeWordValue.
setBoardId(itBoard->gtBoardId());
727 gtfeWordValue.
setBxNr(bxCrossHw);
751 uint16_t bstSourceVal = 0xDDDD;
756 gtEvmReadoutRecord->setGtfeWord(gtfeWordValue);
768 tcsWordValue.
setBoardId(itBoard->gtBoardId());
771 tcsWordValue.
setBxNr(bxCrossHw);
773 uint16_t trigType = 0x5;
787 gtEvmReadoutRecord->setTcsWord(tcsWordValue);
809 int pfAlgoSetIndex = 0;
810 const std::vector<int> &prescaleFactorsAlgoTrig = (*m_prescaleFactorsAlgoTrig).at(pfAlgoSetIndex);
812 int pfTechSetIndex = 0;
813 const std::vector<int> &prescaleFactorsTechTrig = (*m_prescaleFactorsTechTrig).at(pfTechSetIndex);
818 for (
int iBxInEvent = minBxInEvent; iBxInEvent <= maxBxInEvent; ++iBxInEvent) {
844 receiveHfRingEtSums);
852 if (receiveExternal) {
864 gtDaqReadoutRecord.get());
885 gtObjectMapRecord.get(),
907 prescaleFactorsAlgoTrig,
908 prescaleFactorsTechTrig,
936 gtDaqReadoutRecord.get());
946 gtEvmReadoutRecord.get());
974 <<
"\nrequested in configuration, but not found in the event.\n" 978 gtDaqReadoutRecord->setMuCollectionRefProd(gmtRcHandle);
983 std::ostringstream myCoutStream;
984 gtDaqReadoutRecord->print(myCoutStream);
985 LogTrace(
"L1GlobalTrigger") <<
"\n The following L1 GT DAQ readout record was produced:\n" 986 << myCoutStream.str() <<
"\n" 989 myCoutStream.str(
"");
990 myCoutStream.clear();
992 gtEvmReadoutRecord->print(myCoutStream);
993 LogTrace(
"L1GlobalTrigger") <<
"\n The following L1 GT EVM readout record was produced:\n" 994 << myCoutStream.str() <<
"\n" 997 myCoutStream.str(
"");
998 myCoutStream.clear();
1000 const std::vector<L1GlobalTriggerObjectMap> objMapVec = gtObjectMapRecord->gtObjectMap();
1002 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator
it = objMapVec.begin();
it != objMapVec.end(); ++
it) {
1003 (*it).print(myCoutStream);
1006 LogDebug(
"L1GlobalTrigger") <<
"Test gtObjectMapRecord in L1GlobalTrigger \n\n" 1007 << myCoutStream.str() <<
"\n\n" 1010 myCoutStream.str(
"");
1011 myCoutStream.clear();
const std::vector< edm::InputTag > m_technicalTriggersInputTags
input tag for technical triggers
const std::vector< unsigned int > & gtTriggerMask() const
get the trigger mask
const L1GtTriggerMask * m_l1GtTmVetoTech
void init(const int nrL1Mu, const int numberPhysTriggers)
initialize the class (mainly reserve)
const L1GtTriggerMask * m_l1GtTmVetoAlgo
unsigned int gtIfCaloEtaNumberBits() const
get / set the number of bits for eta of calorimeter objects
const std::vector< int > m_recordLength
unsigned long long m_l1GtParCacheID
const L1GtStableParameters * m_l1GtStablePar
cached stuff
const int gtTotalBxInEvent() const
get / set the total Bx's in the event
std::vector< unsigned int > m_triggerMaskVetoAlgoTrig
void setBxNr(cms_uint16_t bxNrValue)
const edm::InputTag m_caloGctInputTag
input tag for calorimeter collections from GCT
void setBstSource(const cms_uint16_t bstSourceVal)
unsigned int gtNumberL1JetCounts() const
get / set the number of L1 jet counts received by GT
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
const bool m_readTechnicalTriggerRecords
logical flag to read the technical trigger records
std::vector< unsigned int > m_triggerMaskAlgoTrig
void setBxNr(const cms_uint16_t bxNrValue)
edm::ESGetToken< L1GtTriggerMask, L1GtTriggerMaskAlgoTrigRcd > m_l1GtTmAlgoToken
unsigned int gtNumberL1NoIsoEG() const
get / set the number of L1 e/gamma objects received by GT
const bool m_technicalTriggersVetoUnmasked
void receiveGctObjectData(edm::Event &iEvent, const edm::InputTag &caloGctInputTag, const int iBxInEvent, const bool receiveNoIsoEG, const int nrL1NoIsoEG, const bool receiveIsoEG, const int nrL1IsoEG, const bool receiveCenJet, const int nrL1CenJet, const bool receiveForJet, const int nrL1ForJet, const bool receiveTauJet, const int nrL1TauJet, const bool receiveETM, const bool receiveETT, const bool receiveHTT, const bool receiveHTM, const bool receiveJetCounts, const bool receiveHfBitCounts, const bool receiveHfRingEtSums)
receive Global Calorimeter Trigger objects
const bool m_produceL1GtObjectMapRecord
logical flag to produce the L1 GT object map record
edm::ESGetToken< L1GtTriggerMask, L1GtTriggerMaskVetoAlgoTrigRcd > m_l1GtTmVetoAlgoToken
const uint16_t gtEvmActiveBoards() const
get / set the active boards for L1 GT EVM record
const bool m_writePsbL1GtDaqRecord
logical flag to write the PSB content in the L1 GT DAQ record
unsigned long long m_l1GtStableParCacheID
void setRecordLength(cms_uint16_t recordLengthValue)
const bool m_produceL1GtDaqRecord
logical flag to produce the L1 GT DAQ readout record
void setLuminositySegmentNr(const cms_uint16_t luminositySegmentNrValue)
const L1GtPrescaleFactors * m_l1GtPfAlgo
prescale factors
void fillPsbBlock(edm::Event &iEvent, const uint16_t &activeBoardsGtDaq, const int recordLength0, const int recordLength1, const unsigned int altNrBxBoardDaq, const std::vector< L1GtBoard > &boardMaps, const int iBxInEvent, L1GlobalTriggerReadoutRecord *gtDaqReadoutRecord)
fill the content of active PSB boards
unsigned int m_numberPhysTriggers
number of physics triggers
const std::vector< std::vector< int > > & gtPrescaleFactors() const
get the prescale factors by reference
L1GlobalTrigger(const edm::ParameterSet &)
L1GlobalTriggerGTL * m_gtGTL
unsigned int m_bstLengthBytes
length of BST record (in bytes) from event setup
const std::vector< std::vector< int > > * m_prescaleFactorsTechTrig
std::vector< unsigned int > m_triggerMaskVetoTechTrig
const bool m_produceL1GtEvmRecord
logical flag to produce the L1 GT EVM readout record
edm::ESGetToken< L1GtTriggerMask, L1GtTriggerMaskTechTrigRcd > m_l1GtTmTechToken
edm::ESGetToken< L1GtParameters, L1GtParametersRcd > m_l1GtParToken
const uint16_t gtDaqActiveBoards() const
get / set the active boards for L1 GT DAQ record
const bool m_algorithmTriggersUnmasked
void setAltNrBxBoard(cms_uint16_t altNrBxBoardValue)
void setTotalTriggerNr(cms_uint32_t totalTriggerNrValue)
T const * product() const
const L1GtTriggerMask * m_l1GtTmTech
const bool m_technicalTriggersUnmasked
void setVerbosity(const int verbosity)
void setVerbosity(const int verbosity)
unsigned int gtNumberL1IsoEG() const
get / set the number of L1 isolated e/gamma objects received by GT
unsigned int gtNumberL1TauJet() const
get / set the number of L1 tau jets received by GT
unsigned long long m_l1GtPfTechCacheID
void receiveTechnicalTriggers(edm::Event &iEvent, const std::vector< edm::InputTag > &technicalTriggersInputTags, const int iBxInEvent, const bool receiveTechTr, const int nrL1TechTr)
receive technical trigger
unsigned int gtNumberL1ForJet() const
get / set the number of L1 forward jets received by GT
void fillDaqFdlBlock(const int iBxInEvent, const uint16_t &activeBoardsGtDaq, const int recordLength0, const int recordLength1, const unsigned int altNrBxBoardDaq, const std::vector< L1GtBoard > &boardMaps, L1GlobalTriggerReadoutRecord *gtDaqReadoutRecord)
fill the FDL block in the L1 GT DAQ record for iBxInEvent
const unsigned int m_alternativeNrBxBoardEvm
edm::ESGetToken< L1GtBoardMaps, L1GtBoardMapsRcd > m_l1GtBMToken
unsigned int gtNumberL1CenJet() const
get / set the number of L1 central jets received by GT
L1GlobalTriggerFDL * m_gtFDL
const bool m_algorithmTriggersUnprescaled
const bool m_isDebugEnabled
void fillEvmFdlBlock(const int iBxInEvent, const uint16_t &activeBoardsGtEvm, const int recordLength0, const int recordLength1, const unsigned int altNrBxBoardEvm, const std::vector< L1GtBoard > &boardMaps, L1GlobalTriggerEvmReadoutRecord *gtEvmReadoutRecord)
fill the FDL block in the L1 GT EVM record for iBxInEvent
const L1GtParameters * m_l1GtPar
parameters
std::vector< unsigned int > m_triggerMaskTechTrig
void run(edm::Event &iEvent, const edm::EventSetup &evSetup, const L1GlobalTriggerPSB *ptrGtPSB, const bool produceL1GtObjectMapRecord, const int iBxInEvent, L1GlobalTriggerObjectMapRecord *gtObjectMapRecord, const unsigned int numberPhysTriggers, const int nrL1Mu, const int nrL1NoIsoEG, const int nrL1IsoEG, const int nrL1CenJet, const int nrL1ForJet, const int nrL1TauJet, const int nrL1JetCounts, const int ifMuEtaNumberBits, const int ifCaloEtaNumberBits)
run the GTL
#define DEFINE_FWK_MODULE(type)
const L1GtPrescaleFactors * m_l1GtPfTech
unsigned long long m_l1GtTmAlgoCacheID
void setRecordLength1(cms_uint16_t recordLengthValue)
const std::vector< L1GtBoard > & gtBoardMaps() const
get / set / print the L1 GT board map
unsigned long long TimeValue_t
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const int m_verbosity
verbosity level
void setBoardId(cms_uint16_t boardIdValue)
set BoardId from a BoardId value
void setBoardId(const cms_uint16_t boardIdValue)
set BoardId from a BoardId value
~L1GlobalTrigger() override
const L1GtTriggerMask * m_l1GtTmAlgo
trigger masks & veto masks
void produce(edm::Event &, const edm::EventSetup &) override
unsigned int gtNumberL1Mu() const
get / set the number of L1 muons received by GT
void setActiveBoards(cms_uint16_t activeBoardsValue)
edm::ESGetToken< L1GtStableParameters, L1GtStableParametersRcd > m_l1GtStableParToken
EventSetup Tokens.
unsigned long long m_l1GtTmVetoTechCacheID
void receiveGmtObjectData(edm::Event &, const edm::InputTag &, const int iBxInEvent, const bool receiveMu, const int nrL1Mu)
receive data from Global Muon Trigger
uint16_t m_activeBoardsGtDaq
active boards in L1 GT DAQ record and in L1 GT EVM record
unsigned long long m_l1GtBMCacheID
L1GlobalTriggerPSB * m_gtPSB
const edm::InputTag m_muGmtInputTag
input tag for muon collection from GMT
edm::ESGetToken< L1GtPrescaleFactors, L1GtPrescaleFactorsTechTrigRcd > m_l1GtPfTechToken
int m_ifCaloEtaNumberBits
const bool m_technicalTriggersUnprescaled
const int m_psBstLengthBytes
length of BST record (in bytes) from parameter set
void run(edm::Event &iEvent, const std::vector< int > &prescaleFactorsAlgoTrig, const std::vector< int > &prescaleFactorsTechTrig, const std::vector< unsigned int > &triggerMaskAlgoTrig, const std::vector< unsigned int > &triggerMaskTechTrig, const std::vector< unsigned int > &triggerMaskVetoAlgoTrig, const std::vector< unsigned int > &triggerMaskVetoTechTrig, const std::vector< L1GtBoard > &boardMaps, const int totalBxInEvent, const int iBxInEvent, const unsigned int numberPhysTriggers, const unsigned int numberTechnicalTriggers, const unsigned int numberDaqPartitions, const L1GlobalTriggerGTL *ptrGTL, const L1GlobalTriggerPSB *ptrPSB, const int pfAlgoSetIndex, const int pfTechSetIndex, const bool algorithmTriggersUnprescaled, const bool algorithmTriggersUnmasked, const bool technicalTriggersUnprescaled, const bool technicalTriggersUnmasked, const bool technicalTriggersVetoUnmasked)
run the FDL
uint16_t m_activeBoardsGtEvm
const unsigned int m_alternativeNrBxBoardDaq
void setGpsTime(const cms_uint64_t)
void setTriggerType(const cms_uint16_t triggerTypeValue)
edm::ESGetToken< L1GtPrescaleFactors, L1GtPrescaleFactorsAlgoTrigRcd > m_l1GtPfAlgoToken
int m_totalBxInEvent
total number of Bx's in the event coming from EventSetup
unsigned int gtNumberTechnicalTriggers() const
get / set the number of technical triggers
unsigned int m_numberTechnicalTriggers
number of technical triggers
Log< level::Warning, false > LogWarning
void setEventNr(const cms_uint32_t eventNrValue)
void setVerbosity(const int verbosity)
const L1GtBoardMaps * m_l1GtBM
board maps - cache only the record
unsigned long long m_l1GtTmTechCacheID
unsigned int m_numberDaqPartitions
number of DAQ partitions
unsigned int gtIfMuEtaNumberBits() const
get / set the number of bits for eta of muon objects
void init(const int nrL1NoIsoEG, const int nrL1IsoEG, const int nrL1CenJet, const int nrL1ForJet, const int nrL1TauJet, const int numberTechnicalTriggers)
initialize the class (mainly reserve)
const unsigned int gtBstLengthBytes() const
get / set length of BST message (in bytes) for L1 GT EVM record
const edm::InputTag m_castorInputTag
input tag for CASTOR record
void setOrbitNr(const cms_uint64_t orbitNrValue)
unsigned long long m_l1GtTmVetoAlgoCacheID
edm::ESGetToken< L1GtTriggerMask, L1GtTriggerMaskVetoTechTrigRcd > m_l1GtTmVetoTechToken
unsigned long long m_l1GtPfAlgoCacheID
unsigned int gtNumberPhysTriggers() const
get / set the number of physics trigger algorithms