51 m_firstEvLumiSegment(
true),
78 const std::vector<int>& prescaleFactorsAlgoTrig,
79 const std::vector<int>& prescaleFactorsTechTrig,
80 const std::vector<unsigned int>& triggerMaskAlgoTrig,
81 const std::vector<unsigned int>& triggerMaskTechTrig,
82 const std::vector<unsigned int>& triggerMaskVetoAlgoTrig,
83 const std::vector<unsigned int>& triggerMaskVetoTechTrig,
84 const std::vector<L1GtBoard>& boardMaps,
85 const int totalBxInEvent,
87 const unsigned int numberPhysTriggers,
const unsigned int numberTechnicalTriggers,
88 const unsigned int numberDaqPartitions,
91 const int pfAlgoSetIndex,
92 const int pfTechSetIndex)
96 const unsigned int numberPhysTriggersSet =
100 std::bitset<numberPhysTriggersSet> gtlDecisionWord = ptrGTL->
getAlgorithmOR();
105 for (
unsigned int iBit = 0; iBit < numberPhysTriggers; ++iBit) {
107 bool bitValue = gtlDecisionWord.test( iBit );
108 algoDecisionWord[ iBit ] = bitValue;
118 for (
int iBxInEvent = 0; iBxInEvent <= totalBxInEvent; ++iBxInEvent) {
126 for (
int iBxInEvent = 0; iBxInEvent <= totalBxInEvent; ++iBxInEvent) {
138 for (
int iBxInEvent = 0; iBxInEvent <= totalBxInEvent; ++iBxInEvent) {
143 for (
int iBxInEvent = 0; iBxInEvent <= totalBxInEvent; ++iBxInEvent) {
155 int inBxInEvent = totalBxInEvent/2 + iBxInEvent;
157 for (
unsigned int iBit = 0; iBit < numberPhysTriggers; ++iBit) {
159 if (prescaleFactorsAlgoTrig.at(iBit) != 1) {
161 bool bitValue = algoDecisionWord.at( iBit );
169 prescaleFactorsAlgoTrig.at(iBit);
179 algoDecisionWord[iBit] =
false;;
201 for (
unsigned int iBit = 0; iBit < numberTechnicalTriggers; ++iBit) {
203 if (prescaleFactorsTechTrig.at(iBit) != 1) {
205 bool bitValue = techDecisionWord.at( iBit );
213 prescaleFactorsTechTrig.at(iBit);
223 techDecisionWord[iBit] =
false;
241 boost::uint16_t finalOrValue = 0;
243 for (
unsigned int iDaq = 0; iDaq < numberDaqPartitions; ++iDaq) {
245 bool daqPartitionFinalOR =
false;
250 bool vetoTechTrig =
false;
252 for (
unsigned int iBit = 0; iBit < numberTechnicalTriggers; ++iBit) {
254 int triggerMaskVetoTechTrigBit =
255 triggerMaskVetoTechTrig[iBit] & (1 << iDaq);
262 if (triggerMaskVetoTechTrigBit && techDecisionWord[iBit]) {
264 daqPartitionFinalOR =
false;
281 bool algoFinalOr =
false;
283 for (
unsigned int iBit = 0; iBit < numberPhysTriggers; ++iBit) {
285 bool iBitDecision =
false;
287 int triggerMaskAlgoTrigBit = triggerMaskAlgoTrig[iBit] & (1 << iDaq);
294 if (triggerMaskAlgoTrigBit) {
295 iBitDecision =
false;
301 iBitDecision = algoDecisionWord[iBit];
304 algoFinalOr = algoFinalOr || iBitDecision;
310 bool techFinalOr =
false;
312 for (
unsigned int iBit = 0; iBit < numberTechnicalTriggers; ++iBit) {
314 bool iBitDecision =
false;
316 int triggerMaskTechTrigBit = triggerMaskTechTrig[iBit] & (1 << iDaq);
322 if (triggerMaskTechTrigBit) {
324 iBitDecision =
false;
330 iBitDecision = techDecisionWord[iBit];
333 techFinalOr = techFinalOr || iBitDecision;
336 daqPartitionFinalOR = algoFinalOr || techFinalOr;
340 daqPartitionFinalOR =
false;
345 boost::uint16_t daqPartitionFinalORValue =
346 static_cast<boost::uint16_t
>(daqPartitionFinalOR);
348 finalOrValue = finalOrValue | (daqPartitionFinalORValue << iDaq);
355 typedef std::vector<L1GtBoard>::const_iterator CItBoardMaps;
357 itBoard = boardMaps.begin();
358 itBoard != boardMaps.end(); ++itBoard) {
361 if ((itBoard->gtBoardType() ==
FDL)) {
373 boost::uint16_t bxCrossHw = 0;
374 if ((bxCross & 0xFFF) == bxCross) {
375 bxCrossHw =
static_cast<boost::uint16_t
> (bxCross);
381 <<
"\nBunch cross number [hex] = "
382 << std::hex << bxCross
383 <<
"\n larger than 12 bits. Set to 0! \n"
384 << std::dec << std::endl;
392 static_cast<boost::uint32_t>(iEvent.
id().
event()) );
427 const boost::uint16_t& activeBoardsGtDaq,
const int recordLength0,
428 const int recordLength1,
const unsigned int altNrBxBoardDaq,
429 const std::vector<L1GtBoard>& boardMaps,
430 std::auto_ptr<L1GlobalTriggerReadoutRecord>& gtDaqReadoutRecord)
433 typedef std::vector<L1GtBoard>::const_iterator CItBoardMaps;
435 itBoard = boardMaps.begin();
436 itBoard != boardMaps.end(); ++itBoard) {
438 int iPosition = itBoard->gtPositionDaqRecord();
441 int iActiveBit = itBoard->gtBitDaqActiveBoards();
442 bool activeBoard =
false;
443 bool writeBoard =
false;
447 if (iActiveBit >= 0) {
448 activeBoard = activeBoardsGtDaq & ( 1 << iActiveBit );
450 int altNrBxBoard = (altNrBxBoardDaq & ( 1 << iActiveBit )) >> iActiveBit;
452 if (altNrBxBoard == 1) {
453 recLength = recordLength1;
455 recLength = recordLength0;
458 int lowBxInEvent = (recLength + 1)/2 - recLength;
459 int uppBxInEvent = (recLength + 1)/2 - 1;
461 if ((iBxInEvent >= lowBxInEvent) && (iBxInEvent <= uppBxInEvent)) {
467 if (activeBoard && writeBoard && (itBoard->gtBoardType() ==
FDL)) {
483 const boost::uint16_t& activeBoardsGtEvm,
const int recordLength0,
484 const int recordLength1,
const unsigned int altNrBxBoardEvm,
485 const std::vector<L1GtBoard>& boardMaps,
486 std::auto_ptr<L1GlobalTriggerEvmReadoutRecord>& gtEvmReadoutRecord)
489 typedef std::vector<L1GtBoard>::const_iterator CItBoardMaps;
491 itBoard = boardMaps.begin();
492 itBoard != boardMaps.end(); ++itBoard) {
494 int iPosition = itBoard->gtPositionEvmRecord();
497 int iActiveBit = itBoard->gtBitEvmActiveBoards();
498 bool activeBoard =
false;
500 if (iActiveBit >= 0) {
501 activeBoard = activeBoardsGtEvm & (1 << iActiveBit);
504 if (activeBoard && (itBoard->gtBoardType() ==
FDL)) {
EventNumber_t event() const
L1GtFdlWord * m_gtFdlWord
int bunchCrossing() const
edm::LuminosityBlockNumber_t luminosityBlock() const
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)
run the FDL
void fillEvmFdlBlock(const int iBxInEvent, const boost::uint16_t &activeBoardsGtEvm, const int recordLength0, const int recordLength1, const unsigned int altNrBxBoardEvm, const std::vector< L1GtBoard > &boardMaps, std::auto_ptr< L1GlobalTriggerEvmReadoutRecord > >EvmReadoutRecord)
fill the FDL block in the L1 GT EVM record for iBxInEvent
void setBxNr(const boost::uint16_t &bxNrValue)
void setGtDecisionWord(const DecisionWord >DecisionWordValue)
void setLocalBxNr(const boost::uint16_t &localBxNrValue)
void setGtPrescaleFactorIndexAlgo(const boost::uint16_t >PrescaleFactorIndexAlgoValue)
void setGtTechnicalTriggerWord(const TechnicalTriggerWord >TechnicalTriggerWordValue)
const std::vector< bool > * getGtTechnicalTriggers() const
pointer to technical trigger bits
void setEventNr(const boost::uint32_t &eventNrValue)
std::vector< std::vector< int > > m_prescaleCounterAlgoTrig
prescale counters: NumberPhysTriggers counters per bunch cross in event
std::vector< bool > DecisionWord
typedefs
int m_verbosity
verbosity level
void reset()
reset the content of a L1GtFdlWord
void setOrbitNr(const boost::uint32_t &orbitNrValue)
static const unsigned int NumberPhysTriggers
L1GlobalTriggerFDL()
constructor
void setBoardId(const boost::uint16_t &boardIdValue)
set BoardId from a BoardId value
void setLumiSegmentNr(const boost::uint16_t &lumiSegmentNrValue)
virtual ~L1GlobalTriggerFDL()
destructor
const std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > & getAlgorithmOR() const
return algorithm OR decision
bool m_firstEvLumiSegment
void setBxInEvent(const int bxInEventValue)
std::vector< std::vector< int > > m_prescaleCounterTechTrig
prescale counters: technical trigger counters per bunch cross in event
void fillDaqFdlBlock(const int iBxInEvent, const boost::uint16_t &activeBoardsGtDaq, const int recordLength0, const int recordLength1, const unsigned int altNrBxBoardDaq, const std::vector< L1GtBoard > &boardMaps, std::auto_ptr< L1GlobalTriggerReadoutRecord > >DaqReadoutRecord)
fill the FDL block in the L1 GT DAQ record for iBxInEvent
void setGtPrescaleFactorIndexTech(const boost::uint16_t >PrescaleFactorIndexTechValue)
void setFinalOR(const boost::uint16_t &finalORValue)