|
|
Go to the documentation of this file.
89 : m_muGmtInputTag(parSet.getParameter<
edm::
InputTag>(
"GmtInputTag")),
90 m_caloGctInputTag(parSet.getParameter<
edm::
InputTag>(
"GctInputTag")),
91 m_castorInputTag(parSet.getParameter<
edm::
InputTag>(
"CastorInputTag")),
92 m_technicalTriggersInputTags(parSet.getParameter<
std::vector<
edm::
InputTag>>(
"TechnicalTriggersInputTags")),
93 m_produceL1GtDaqRecord(parSet.getParameter<
bool>(
"ProduceL1GtDaqRecord")),
94 m_produceL1GtEvmRecord(parSet.getParameter<
bool>(
"ProduceL1GtEvmRecord")),
95 m_produceL1GtObjectMapRecord(parSet.getParameter<
bool>(
"ProduceL1GtObjectMapRecord")),
96 m_writePsbL1GtDaqRecord(parSet.getParameter<
bool>(
"WritePsbL1GtDaqRecord")),
97 m_readTechnicalTriggerRecords(parSet.getParameter<
bool>(
"ReadTechnicalTriggerRecords")),
98 m_emulateBxInEvent(parSet.getParameter<
int>(
"EmulateBxInEvent")),
99 m_recordLength(parSet.getParameter<
std::vector<
int>>(
"RecordLength")),
100 m_alternativeNrBxBoardDaq(parSet.getParameter<unsigned
int>(
"AlternativeNrBxBoardDaq")),
101 m_alternativeNrBxBoardEvm(parSet.getParameter<unsigned
int>(
"AlternativeNrBxBoardEvm")),
102 m_psBstLengthBytes(parSet.getParameter<
int>(
"BstLengthBytes")),
103 m_algorithmTriggersUnprescaled(parSet.getParameter<
bool>(
"AlgorithmTriggersUnprescaled")),
104 m_algorithmTriggersUnmasked(parSet.getParameter<
bool>(
"AlgorithmTriggersUnmasked")),
105 m_technicalTriggersUnprescaled(parSet.getParameter<
bool>(
"TechnicalTriggersUnprescaled")),
106 m_technicalTriggersUnmasked(parSet.getParameter<
bool>(
"TechnicalTriggersUnmasked")),
107 m_technicalTriggersVetoUnmasked(parSet.getParameter<
bool>(
"TechnicalTriggersVetoUnmasked")),
108 m_verbosity(parSet.getUntrackedParameter<
int>(
"Verbosity", 0)),
113 LogDebug(
"L1GlobalTrigger") << std::endl;
118 <<
"\nInput tag for technical triggers: " << std::endl;
124 LogTrace(
"L1GlobalTrigger") <<
"\n " << (*it) << std::endl;
134 <<
"\nNumber of BXs corresponding to alternative 0: " <<
m_recordLength.at(0)
135 <<
"\nNumber of BXs corresponding to alternative 1: " <<
m_recordLength.at(1) <<
" \n"
152 edm::LogWarning(
"L1GlobalTrigger") <<
"\nWARNING: Number of bunch crossing to be emulated rounded to: "
163 edm::LogWarning(
"L1GlobalTrigger") <<
"\nWARNING: Number of bunch crossing required to be emulated ( "
165 <<
"\n Number of BXs corresponding to alternative 0: "
167 <<
"\n Number of BXs corresponding to alternative 1: "
168 <<
m_recordLength.at(1) <<
"\nEmulating " << requiredRecordLength <<
" BX!"
176 produces<L1GlobalTriggerReadoutRecord>();
180 produces<L1GlobalTriggerEvmReadoutRecord>();
184 produces<L1GlobalTriggerObjectMapRecord>();
340 if ((recordLength0 < 0) || (recordLength1 < 0)) {
351 <<
"[" << minBxInEvent <<
", " << maxBxInEvent <<
"] BX\n"
352 <<
"\nNumber of BX for alternative 0: " << recordLength0
353 <<
"\nNumber of BX for alternative 1: " << recordLength1
354 <<
"\nActive boards in L1 GT DAQ record (hex format) = " << std::hex
357 <<
"\nActive boards in L1 GT EVM record (hex format) = " << std::hex
366 typedef std::vector<L1GtBoard>::const_iterator CItBoardMaps;
467 int daqNrGtfeBoards = 0;
469 int daqNrFdlBoards = 0;
470 int daqNrPsbBoards = 0;
471 int daqNrGmtBoards = 0;
472 int daqNrTcsBoards = 0;
473 int daqNrTimBoards = 0;
476 bool receiveMu =
false;
477 bool receiveNoIsoEG =
false;
478 bool receiveIsoEG =
false;
479 bool receiveCenJet =
false;
480 bool receiveForJet =
false;
481 bool receiveTauJet =
false;
482 bool receiveETM =
false;
483 bool receiveETT =
false;
484 bool receiveHTT =
false;
485 bool receiveHTM =
false;
486 bool receiveJetCounts =
false;
487 bool receiveHfBitCounts =
false;
488 bool receiveHfRingEtSums =
false;
490 bool receiveExternal =
false;
492 bool receiveTechTr =
false;
494 for (CItBoardMaps itBoard = boardMaps.begin(); itBoard != boardMaps.end(); ++itBoard) {
495 int iPosition = itBoard->gtPositionDaqRecord();
497 int iActiveBit = itBoard->gtBitDaqActiveBoards();
498 bool activeBoard =
false;
500 if (iActiveBit >= 0) {
507 if ((iActiveBit < 0) || activeBoard) {
508 switch (itBoard->gtBoardType()) {
523 std::vector<L1GtPsbQuad> quadInPsb = itBoard->gtQuadInPsb();
524 for (std::vector<L1GtPsbQuad>::const_iterator itQuad = quadInPsb.begin(); itQuad != quadInPsb.end();
528 receiveTechTr =
true;
533 receiveNoIsoEG =
true;
543 receiveCenJet =
true;
548 receiveForJet =
true;
553 receiveTauJet =
true;
566 receiveJetCounts =
true;
581 receiveExternal =
true;
586 receiveHfBitCounts =
true;
587 receiveHfRingEtSums =
true;
631 std::unique_ptr<L1GlobalTriggerReadoutRecord> gtDaqReadoutRecord(
635 std::unique_ptr<L1GlobalTriggerEvmReadoutRecord> gtEvmReadoutRecord(
647 int bxCross =
iEvent.bunchCrossing();
648 uint16_t bxCrossHw = 0;
649 if ((bxCross & 0xFFF) == bxCross) {
650 bxCrossHw = static_cast<uint16_t>(bxCross);
654 LogDebug(
"L1GlobalTrigger") <<
"\nBunch cross number [hex] = " << std::hex << bxCross
655 <<
"\n larger than 12 bits. Set to 0! \n"
661 for (CItBoardMaps itBoard = boardMaps.begin(); itBoard != boardMaps.end(); ++itBoard) {
662 int iPosition = itBoard->gtPositionDaqRecord();
664 int iActiveBit = itBoard->gtBitDaqActiveBoards();
665 bool activeBoard =
false;
667 if (iActiveBit >= 0) {
674 if ((iActiveBit < 0) || activeBoard) {
675 switch (itBoard->gtBoardType()) {
679 gtfeWordValue.
setBoardId(itBoard->gtBoardId());
688 gtfeWordValue.
setBxNr(bxCrossHw);
703 gtDaqReadoutRecord->setGtfeWord(gtfeWordValue);
730 int evmNrFdlBoards = 0;
735 int bstLengthBytes = 0;
747 LogTrace(
"L1GlobalTrigger") <<
"\n Length of BST message (in bytes): " << bstLengthBytes <<
"\n" << std::endl;
750 for (CItBoardMaps itBoard = boardMaps.begin(); itBoard != boardMaps.end(); ++itBoard) {
751 int iPosition = itBoard->gtPositionEvmRecord();
753 int iActiveBit = itBoard->gtBitEvmActiveBoards();
754 bool activeBoard =
false;
756 if (iActiveBit >= 0) {
763 if ((iActiveBit < 0) || activeBoard) {
764 switch (itBoard->gtBoardType()) {
768 gtfeWordValue.
setBoardId(itBoard->gtBoardId());
777 gtfeWordValue.
setBxNr(bxCrossHw);
801 uint16_t bstSourceVal = 0xDDDD;
806 gtEvmReadoutRecord->setGtfeWord(gtfeWordValue);
818 tcsWordValue.
setBoardId(itBoard->gtBoardId());
821 tcsWordValue.
setBxNr(bxCrossHw);
823 uint16_t trigType = 0x5;
837 gtEvmReadoutRecord->setTcsWord(tcsWordValue);
859 int pfAlgoSetIndex = 0;
860 const std::vector<int> &prescaleFactorsAlgoTrig = (*m_prescaleFactorsAlgoTrig).at(pfAlgoSetIndex);
862 int pfTechSetIndex = 0;
863 const std::vector<int> &prescaleFactorsTechTrig = (*m_prescaleFactorsTechTrig).at(pfTechSetIndex);
868 for (
int iBxInEvent = minBxInEvent; iBxInEvent <= maxBxInEvent; ++iBxInEvent) {
894 receiveHfRingEtSums);
902 if (receiveExternal) {
914 gtDaqReadoutRecord.get());
935 gtObjectMapRecord.get(),
957 prescaleFactorsAlgoTrig,
958 prescaleFactorsTechTrig,
986 gtDaqReadoutRecord.get());
996 gtEvmReadoutRecord.get());
1024 <<
"\nrequested in configuration, but not found in the event.\n"
1028 gtDaqReadoutRecord->setMuCollectionRefProd(gmtRcHandle);
1033 std::ostringstream myCoutStream;
1034 gtDaqReadoutRecord->print(myCoutStream);
1035 LogTrace(
"L1GlobalTrigger") <<
"\n The following L1 GT DAQ readout record was produced:\n"
1036 << myCoutStream.str() <<
"\n"
1039 myCoutStream.str(
"");
1040 myCoutStream.clear();
1042 gtEvmReadoutRecord->print(myCoutStream);
1043 LogTrace(
"L1GlobalTrigger") <<
"\n The following L1 GT EVM readout record was produced:\n"
1044 << myCoutStream.str() <<
"\n"
1047 myCoutStream.str(
"");
1048 myCoutStream.clear();
1050 const std::vector<L1GlobalTriggerObjectMap> objMapVec = gtObjectMapRecord->gtObjectMap();
1052 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator it = objMapVec.begin(); it != objMapVec.end(); ++it) {
1053 (*it).print(myCoutStream);
1056 LogDebug(
"L1GlobalTrigger") <<
"Test gtObjectMapRecord in L1GlobalTrigger \n\n"
1057 << myCoutStream.str() <<
"\n\n"
1060 myCoutStream.str(
"");
1061 myCoutStream.clear();
T const * product() const
L1GlobalTriggerFDL * m_gtFDL
unsigned int gtNumberL1Mu() const
get / set the number of L1 muons received by GT
unsigned int m_numberPhysTriggers
number of physics triggers
void produce(edm::Event &, const edm::EventSetup &) override
const unsigned int gtBstLengthBytes() const
get / set length of BST message (in bytes) for L1 GT EVM record
L1GlobalTriggerPSB * m_gtPSB
const bool m_algorithmTriggersUnmasked
unsigned int gtNumberTechnicalTriggers() const
get / set the number of technical triggers
unsigned long long m_l1GtPfTechCacheID
const std::vector< int > m_recordLength
void setLuminositySegmentNr(const cms_uint16_t luminositySegmentNrValue)
unsigned int gtNumberL1TauJet() const
get / set the number of L1 tau jets received by GT
void setTotalTriggerNr(cms_uint32_t totalTriggerNrValue)
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
std::vector< unsigned int > m_triggerMaskVetoAlgoTrig
unsigned int gtNumberL1ForJet() const
get / set the number of L1 forward jets received by GT
void setRecordLength(cms_uint16_t recordLengthValue)
unsigned long long m_l1GtStableParCacheID
const std::vector< std::vector< int > > & gtPrescaleFactors() const
get the prescale factors by reference
unsigned long long m_l1GtParCacheID
const int gtTotalBxInEvent() const
get / set the total Bx's in the event
void setRecordLength1(cms_uint16_t recordLengthValue)
unsigned long long m_l1GtTmVetoAlgoCacheID
L1GlobalTrigger(const edm::ParameterSet &)
unsigned long long m_l1GtTmVetoTechCacheID
uint16_t m_activeBoardsGtDaq
active boards in L1 GT DAQ record and in L1 GT EVM record
void init(const int nrL1Mu, const int numberPhysTriggers)
initialize the class (mainly reserve)
uint16_t m_activeBoardsGtEvm
std::vector< unsigned int > m_triggerMaskVetoTechTrig
const edm::InputTag m_muGmtInputTag
input tag for muon collection from GMT
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
unsigned long long m_l1GtBMCacheID
void setGpsTime(const cms_uint64_t)
void setOrbitNr(const cms_uint64_t orbitNrValue)
const L1GtTriggerMask * m_l1GtTmAlgo
trigger masks & veto masks
void receiveTechnicalTriggers(edm::Event &iEvent, const std::vector< edm::InputTag > &technicalTriggersInputTags, const int iBxInEvent, const bool receiveTechTr, const int nrL1TechTr)
receive technical trigger
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
void setTriggerType(const cms_uint16_t triggerTypeValue)
const bool m_writePsbL1GtDaqRecord
logical flag to write the PSB content in the L1 GT DAQ record
const L1GtTriggerMask * m_l1GtTmTech
unsigned int gtNumberL1JetCounts() const
get / set the number of L1 jet counts received by GT
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
#define DEFINE_FWK_MODULE(type)
const L1GtStableParameters * m_l1GtStablePar
cached stuff
unsigned int m_numberTechnicalTriggers
number of technical triggers
unsigned int gtIfCaloEtaNumberBits() const
get / set the number of bits for eta of calorimeter objects
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_produceL1GtDaqRecord
logical flag to produce the L1 GT DAQ readout record
const L1GtPrescaleFactors * m_l1GtPfTech
const edm::InputTag m_castorInputTag
input tag for CASTOR record
const int m_psBstLengthBytes
length of BST record (in bytes) from parameter set
void setActiveBoards(cms_uint16_t activeBoardsValue)
std::vector< unsigned int > m_triggerMaskTechTrig
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
int m_ifCaloEtaNumberBits
void receiveGmtObjectData(edm::Event &, const edm::InputTag &, const int iBxInEvent, const bool receiveMu, const int nrL1Mu)
receive data from Global Muon Trigger
unsigned long long m_l1GtTmTechCacheID
L1GlobalTriggerGTL * m_gtGTL
const std::vector< unsigned int > & gtTriggerMask() const
get the trigger mask
void setVerbosity(const int verbosity)
const bool m_algorithmTriggersUnprescaled
const edm::InputTag m_caloGctInputTag
input tag for calorimeter collections from GCT
const L1GtTriggerMask * m_l1GtTmVetoTech
const L1GtTriggerMask * m_l1GtTmVetoAlgo
const bool m_isDebugEnabled
const L1GtParameters * m_l1GtPar
parameters
std::vector< unsigned int > m_triggerMaskAlgoTrig
unsigned long long m_l1GtPfAlgoCacheID
void setEventNr(const cms_uint32_t eventNrValue)
const unsigned int m_alternativeNrBxBoardEvm
const uint16_t gtDaqActiveBoards() const
get / set the active boards for L1 GT DAQ record
void setVerbosity(const int verbosity)
unsigned int gtNumberPhysTriggers() const
get / set the number of physics trigger algorithms
const int m_verbosity
verbosity level
unsigned int m_bstLengthBytes
length of BST record (in bytes) from event setup
unsigned int gtIfMuEtaNumberBits() const
get / set the number of bits for eta of muon objects
void setVerbosity(const int verbosity)
unsigned int gtNumberL1IsoEG() const
get / set the number of L1 isolated e/gamma objects received by GT
const std::vector< edm::InputTag > m_technicalTriggersInputTags
input tag for technical triggers
const unsigned int m_alternativeNrBxBoardDaq
const bool m_technicalTriggersUnprescaled
void setAltNrBxBoard(cms_uint16_t altNrBxBoardValue)
~L1GlobalTrigger() override
unsigned int gtNumberL1CenJet() const
get / set the number of L1 central jets received by GT
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)
void setBstSource(const cms_uint16_t bstSourceVal)
const bool m_produceL1GtObjectMapRecord
logical flag to produce the L1 GT object map record
void setBxNr(cms_uint16_t bxNrValue)
const bool m_produceL1GtEvmRecord
logical flag to produce the L1 GT EVM readout record
unsigned int m_numberDaqPartitions
number of DAQ partitions
const std::vector< L1GtBoard > & gtBoardMaps() const
get / set / print the L1 GT board map
void setBoardId(cms_uint16_t boardIdValue)
set BoardId from a BoardId value
const std::vector< std::vector< int > > * m_prescaleFactorsTechTrig
const bool m_technicalTriggersVetoUnmasked
const bool m_readTechnicalTriggerRecords
logical flag to read the technical trigger records
void setBoardId(const cms_uint16_t boardIdValue)
set BoardId from a BoardId value
void setBxNr(const cms_uint16_t bxNrValue)
const uint16_t gtEvmActiveBoards() const
get / set the active boards for L1 GT EVM record
const bool m_technicalTriggersUnmasked
int m_totalBxInEvent
total number of Bx's in the event coming from EventSetup
const L1GtPrescaleFactors * m_l1GtPfAlgo
prescale factors
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
unsigned int gtNumberL1NoIsoEG() const
get / set the number of L1 e/gamma objects received by GT
const L1GtBoardMaps * m_l1GtBM
board maps - cache only the record
unsigned long long TimeValue_t
unsigned long long m_l1GtTmAlgoCacheID