108 edm::LogInfo(
"L1TGT") <<
"L1TGT: analyze...." << std::endl;
115 long long int orbitTcs = -1;
116 int orbitEvmFdl = -1;
128 if (!gtEvmReadoutRecord.
isValid()) {
130 <<
"can't find L1GlobalTriggerEvmReadoutRecord";
135 const L1GtfeWord& gtfeEvmWord = gtEvmReadoutRecord->gtfeWord();
136 const L1GtfeExtWord& gtfeEvmExtWord = gtEvmReadoutRecord->gtfeWord();
138 gtfeEvmBx = gtfeEvmWord.
bxNr();
143 const L1TcsWord& tcsWord = gtEvmReadoutRecord->tcsWord();
145 tcsBx = tcsWord.
bxNr();
158 static_cast<double>(tcsWord.
eventNr()) / static_cast<double>(tcsWord.
partTrigNr()));
164 boost::uint16_t momentum = gtfeEvmExtWord.
beamMomentum();
178 edm::LogInfo(
"L1TGT") <<
" check mode = " << beam <<
" momentum " << momentum
179 <<
" int2 " << intensity2 << std::endl;
188 Long64_t delorb = orbitTcs -
preOrb_;
189 Long64_t delgps = gps -
preGps_;
193 freq = ((Double_t)(delorb)) * 3564. / ((Double_t)(delgps));
202 edm::LogInfo(
"L1TGT") <<
" preOrb_ = " << preOrb_ <<
" orbitTcs=" << orbitTcs
203 <<
" delorb=" << delorb << std::hex <<
" preGps_="
204 << preGps_ <<
" gps=" << gps <<
std::dec
205 <<
" delgps=" << delgps <<
" freq=" << freq
219 const L1GtFdlWord& fdlWord = gtEvmReadoutRecord->gtFdlWord();
221 orbitEvmFdl = fdlWord.
orbitNr();
225 if ((orbitTcs >= 0) && (orbitEvmFdl >= 0)) {
227 int diffOrbit =
static_cast<float> (orbitTcs - orbitEvmFdl);
228 edm::LogInfo(
"L1TGT") <<
"\n orbitTcs = " << orbitTcs <<
" orbitEvmFdl = "
229 << orbitEvmFdl <<
" diffOrbit = " << diffOrbit
230 <<
" orbitEvent = " << iEvent.
orbitNumber() << std::endl;
250 }
else if (orbitEvmFdl >= 0) {
261 if ((lsTcs >= 0) && (lsEvmFdl >= 0)) {
263 int diffLs =
static_cast<float> (lsTcs - lsEvmFdl);
264 edm::LogInfo(
"L1TGT") <<
"\n lsTcs = " << lsTcs <<
" lsEvmFdl = " << lsEvmFdl
265 <<
" diffLs = " << diffLs <<
" lsEvent = "
266 << lsNumber << std::endl;
285 }
else if (lsEvmFdl >= 0) {
307 if (!gtReadoutRecord.
isValid()) {
309 <<
"can't find L1GlobalTriggerReadoutRecord";
319 int itrig = (algo->second).algoBitNumber();
327 }
else if (itrig < 64) {
332 }
else if (itrig < 96) {
337 }
else if (itrig < 128) {
347 int itrig = (techTrig->second).algoBitNumber();
356 if(gtReadoutRecord.
isValid()) {
358 unsigned int NmaxL1AlgoBit = gtReadoutRecord->decisionWord().size();
359 unsigned int NmaxL1TechBit = gtReadoutRecord->technicalTriggerWord().size();
361 const DecisionWord dWord = gtReadoutRecord->decisionWord();
362 const TechnicalTriggerWord technicalTriggerWordBeforeMask = gtReadoutRecord->technicalTriggerWord();
364 const std::vector<L1GtFdlWord> &m_gtFdlWord(gtReadoutRecord->gtFdlVector());
366 int minBxInEvent = (numberBxInEvent + 1)/2 - numberBxInEvent;
368 for (
unsigned int iBit = 0; iBit < NmaxL1AlgoBit; ++iBit) {
369 bool accept = dWord[iBit];
380 for (std::vector<L1GtFdlWord>::const_iterator itBx = m_gtFdlWord.begin(); itBx != m_gtFdlWord.end(); ++itBx) {
383 bool accept = dWordBX[iBit];
398 for (
unsigned int iBit = 0; iBit < NmaxL1TechBit; ++iBit) {
399 bool accept = technicalTriggerWordBeforeMask[iBit];
410 for (std::vector<L1GtFdlWord>::const_iterator itBx = m_gtFdlWord.begin();
411 itBx != m_gtFdlWord.end(); ++itBx) {
413 const DecisionWord dWordBX = (*itBx).gtTechnicalTriggerWord();
414 bool accept = dWordBX[iBit];
423 int fdlBx[2] = { -1, -1 };
424 int psbBx[2][7] = { { -1, -1, -1, -1, -1, -1, -1 }, { -1, -1, -1, -1, -1, -1, -1 } };
429 const L1GtfeWord& gtfeWord = gtReadoutRecord->gtfeWord();
430 gtfeBx = gtfeWord.
bxNr();
440 if (gmtReadoutCollection.
isValid()) {
441 gmtBx = gmtReadoutCollection->getRecord().getBxNr();
447 const L1GtFdlWord& fdlWord = gtReadoutRecord->gtFdlWord();
448 fdlBx[0] = fdlWord.
bxNr();
452 const DecisionWord& gtDecisionWord = gtReadoutRecord->decisionWord();
454 gtReadoutRecord->technicalTriggerWord();
457 DecisionWord::const_iterator GTdbitItr;
459 for (GTdbitItr = gtDecisionWord.begin(); GTdbitItr
460 != gtDecisionWord.end(); GTdbitItr++) {
465 DecisionWord::const_iterator GTdbitItr1;
466 for (GTdbitItr1 = gtDecisionWord.begin(); GTdbitItr1
467 != gtDecisionWord.end(); GTdbitItr1++) {
473 TechnicalTriggerWord::const_iterator GTtbitItr1;
474 for (GTtbitItr1 = gtTTWord.begin(); GTtbitItr1
475 != gtTTWord.end(); GTtbitItr1++) {
485 TechnicalTriggerWord::const_iterator GTtbitItr;
487 for (GTtbitItr = gtTTWord.begin(); GTtbitItr != gtTTWord.end(); GTtbitItr++) {
492 TechnicalTriggerWord::const_iterator GTtbitItr1;
493 for (GTtbitItr1 = gtTTWord.begin(); GTtbitItr1
494 != gtTTWord.end(); GTtbitItr1++) {
510 static_cast<float> (pfIndexAlgoTrig));
517 std::pair<int, int> pairLsPfi = std::make_pair(lsNumber,
534 int psbID[7] = { 0xbb09, 0xbb0d, 0xbb0e, 0xbb0f, 0xbb13, 0xbb14, 0xbb15 };
535 for (
int i = 0;
i < 7;
i++) {
536 if (
isActive(gtfeActiveBoards, ibit)) {
537 L1GtPsbWord psbWord = gtReadoutRecord->gtPsbWord(psbID[
i]);
538 psbBx[0][
i] = psbWord.
bxNr();
549 for (
int i = 0; i < 2; i++) {
553 for (
int j = 0;
j < 7;
j++) {
554 for (
int i = 0; i < 2; i++) {
555 if (psbBx[i][
j] > -1)
MonitorElement * m_monL1PrescaleFactorSet
std::map< std::string, bool > l1TechTriggerDecision
MonitorElement * h_L1AlgoBX1
MonitorElement * gpsfreqwide
const cms_uint16_t bxNr() const
get/set bunch cross number of the actual bx
const cms_uint64_t orbitNr() const
get/set orbit number since start of run
MonitorElement * m_monLsNrDiffTcsFdlEvmLs
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< std::pair< int, int > >::const_iterator CItVecPair
const cms_uint64_t gpsTime() const
LHC-BOB-ES-0001 (EDMS 638899)
std::vector< std::pair< int, int > > m_pairLsNumberPfIndex
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
edm::LuminosityBlockNumber_t luminosityBlock() const
const cms_uint16_t luminositySegmentNr() const
get/set luminosity segment number
MonitorElement * BST_intensityBeam1
static const int MaxOrbitNrDiffTcsFdlEvm
MonitorElement * algo_bits_corr
bool verbose_
verbosity switch
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
const cms_uint16_t bstMasterStatus() const
const cms_uint32_t partTrigNr() const
get/set total number of L1A sent since start of the run to this DAQ partition
MonitorElement * BST_beamMode
MonitorElement * BST_MasterStatus
std::map< std::string, bool >::iterator trig_iter
const cms_uint16_t beamMomentum() const
const cms_uint16_t bxNr() const
get/set BxNr - bunch cross number of the actual bx
MonitorElement * BST_intensityBeam2
std::string to_string(const T &t)
const cms_uint16_t bxNr() const
get/set bunch cross number as counted in the TCS chip
MonitorElement * h_L1TechBX
MonitorElement * event_number
MonitorElement * h_L1AlgoBX3
std::vector< bool > DecisionWord
typedefs
static const int MaxLsNrDiffTcsFdlEvm
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > gtEvmSource_
input tag for L1 GT EVM readout record
MonitorElement * orbit_lumi
MonitorElement * h_L1AlgoBX4
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
const cms_uint16_t localBxNr() const
get/set local bunch cross number of the actual bx
MonitorElement * algo_bits_lumi
std::map< std::string, bool > l1TriggerDecision
Container::value_type value_type
const cms_uint16_t activeBoards() const
get/set boards contributing to EVM respectively DAQ record
MonitorElement * m_monLsNrDiffTcsFdlEvm
const cms_uint16_t bxNr() const
get/set bunch cross number as counted in the GTFE board
std::string algoBitToName[128]
const cms_uint32_t totalIntensityBeam2() const
const cms_uint32_t totalIntensityBeam1() const
MonitorElement * algo_bits
MonitorElement * event_type
const cms_uint16_t gtPrescaleFactorIndexAlgo() const
MonitorElement * m_monOrbitNrDiffTcsFdlEvmLs
const cms_uint16_t lumiSegmentNr() const
get/set luminosity segment number of the actual bx
MonitorElement * dbx_module
unsigned long long uint64_t
const cms_uint32_t lhcFillNumber() const
MonitorElement * tt_bits_corr
T const * product() const
bool isActive(int word, int bit)
MonitorElement * gpsfreqlum
int m_nrEvJob
number of events processed
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtSource_L1GT_
input parameters
MonitorElement * h_L1AlgoBX2
const cms_uint16_t triggerType() const
get/set trigger type, identical with event type in CMS header
const cms_uint32_t eventNr() const
get/set event number since last L1 reset generated in TCS chip
const cms_uint32_t setupVersion() const
get/set setup version
MonitorElement * trigger_number
MonitorElement * BST_beamMomentum
MonitorElement * BST_lhcFillNumber
MonitorElement * setupversion_lumi
const cms_uint32_t turnCountNumber() const
MonitorElement * BST_turnCountNumber
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * event_lumi
const cms_uint16_t beamMode() const
MonitorElement * tt_bits_lumi
MonitorElement * trigger_lumi
MonitorElement * evnum_trignum_lumi
const cms_uint32_t orbitNr() const
get/set orbit number
MonitorElement * algo_tt_bits_corr
std::string techBitToName[64]
const cms_uint16_t localBxNr() const
get/set local bunch cross number of the actual bx
MonitorElement * m_monOrbitNrDiffTcsFdlEvm
edm::EDGetTokenT< L1MuGMTReadoutCollection > gtSource_L1MuGMT_