CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
cscdqm::EventProcessor Class Reference

Object used to process Events and compute statistics. More...

#include <CSCDQM_EventProcessor.h>

Public Member Functions

 EventProcessor (Configuration *const p_config)
 Constructor. More...
 
void init ()
 Initialize EventProcessor: reading out config information. More...
 
unsigned int maskHWElements (std::vector< std::string > &tokens)
 Mask HW elements from the efficiency calculations. Can be applied on runtime! More...
 
void standbyEfficiencyHistos (HWStandbyType &standby)
 apply standby flags/parameters More...
 
void updateEfficiencyHistos ()
 Update Efficiency MOs. More...
 
void updateFractionHistos ()
 Update Fractional MOs. More...
 
void writeShifterHistograms ()
 
 ~EventProcessor ()
 Destructor. More...
 

Private Member Functions

void calcEMUFractionHisto (const HistoId &result, const HistoId &set, const HistoId &subset)
 Calculate fractional histogram. More...
 
const bool getCSCFromMap (const unsigned int &crateId, const unsigned int &dmbId, unsigned int &cscType, unsigned int &cscPosition) const
 Get CSC type and position from crate and dmb identifiers. More...
 
const bool getCSCHisto (const HistoId &histo, const HwId &crateID, const HwId &dmbSlot, MonitorObject *&me)
 Get CSC (Chamber) Level Monitoring Object. More...
 
const bool getCSCHisto (const HistoId &histo, const HwId &crateID, const HwId &dmbSlot, const HwId &adId, MonitorObject *&me)
 Get CSC (Chamber) Level Monitoring Object with additional identifier. More...
 
const bool getDDUHisto (const HistoId &histo, const HwId &dduID, MonitorObject *&me)
 Get DDU Level Monitoring Object. More...
 
const bool getEMUHisto (const HistoId &histo, MonitorObject *&me)
 Get EMU (Top Level) Monitoring Object. More...
 
const bool getFEDHisto (const HistoId &histo, const HwId &fedID, MonitorObject *&me)
 Get FED Level Monitoring Object. More...
 
const bool getParHisto (const HistoId &histo, MonitorObject *&me)
 Get Parameter Monitoring Object. More...
 
void preProcessEvent ()
 Common Local and Global DQM function to be called before processing Event. More...
 
void processCSC (const CSCEventData &data, const int dduID, const CSCDCCExaminer &binChecker)
 Process Chamber Data and fill MOs. More...
 
void processDDU (const CSCDDUEventData &data, const CSCDCCExaminer &binChecker)
 Process DDU output and fill MOs. More...
 
bool processExaminer (const CSCDCCExaminer &binChecker)
 
bool processExaminer (const CSCDCCExaminer &binChecker, const CSCDCCFormatStatusDigi &digi)
 Fill monitor elements with CSCDCCFormatStatusDigi information. More...
 
void resetEmuEventDisplays ()
 Reset Emu level EventDisplay histograms once per event. More...
 
void setEmuEventDisplayBit (MonitorObject *&mo, const unsigned int x, const unsigned int y, const unsigned int bit)
 Set a single bit in the 3D Histogram (aka EMU level event display). Checks if mo and x != null. More...
 

Private Attributes

uint32_t BXN
 
uint32_t cntALCTs
 Total Number of CFEBs per event from DMB DAV. More...
 
uint32_t cntCFEBs
 Total Number of DMBs per event from DDU Header DAV. More...
 
uint32_t cntDMBs
 
uint32_t cntTMBs
 Total Number of ALCTs per event from DMB DAV. More...
 
Configurationconfig
 
bool EmuEventDisplayWasReset
 
bool fCloseL1As
 Data Format version (2005, 2013) More...
 
std::map< uint32_t, bool > fNotFirstEvent
 
edm::EDGetTokenT< FEDRawDataCollectionfrdtoken
 
uint32_t L1ANumber
 
std::map< uint32_t, uint32_t > L1ANumbers
 
Summary summary
 
uint16_t theFormatVersion
 Total Number of TMBs per event from DMB DAV. More...
 

Detailed Description

Object used to process Events and compute statistics.

Definition at line 99 of file CSCDQM_EventProcessor.h.

Constructor & Destructor Documentation

◆ EventProcessor()

cscdqm::EventProcessor::EventProcessor ( Configuration *const  p_config)

Constructor.

Parameters
p_configPointer to Global Configuration.

Definition at line 27 of file CSCDQM_EventProcessor.cc.

References fCloseL1As.

27  {
28  config = p_config;
29  // fFirstEvent = true;
30  fCloseL1As = true;
31  }
Definition: config.py:1
bool fCloseL1As
Data Format version (2005, 2013)

◆ ~EventProcessor()

cscdqm::EventProcessor::~EventProcessor ( )
inline

Destructor.

Definition at line 116 of file CSCDQM_EventProcessor.h.

116 {}

Member Function Documentation

◆ calcEMUFractionHisto()

void cscdqm::EventProcessor::calcEMUFractionHisto ( const HistoId result,
const HistoId set,
const HistoId subset 
)
private

Calculate fractional histogram.

Parameters
resultHistogram to write results to
setHistogram of the set
subsetHistogram of the subset

Definition at line 86 of file CSCDQM_EventProcessor_updateFracHistos.cc.

References getEMUHisto(), cscdqm::MonitorObject::getTH1Lock(), CommonMethods::lock(), cscdqm::Lock::mutex, mps_fire::result, and cscdqm::MonitorObject::SetMaximum().

Referenced by updateFractionHistos().

86  {
87  MonitorObject *mo = nullptr, *mo1 = nullptr, *mo2 = nullptr;
88 
89  if (getEMUHisto(result, mo) && getEMUHisto(set, mo2) && getEMUHisto(subset, mo1)) {
90  LockType lock(mo->mutex);
91  TH1* th = mo->getTH1Lock();
92  th->Reset();
93  th->Divide(mo1->getTH1(), mo2->getTH1());
94  mo->SetMaximum(1.);
95  }
96  }
const bool getEMUHisto(const HistoId &histo, MonitorObject *&me)
Get EMU (Top Level) Monitoring Object.

◆ getCSCFromMap()

const bool cscdqm::EventProcessor::getCSCFromMap ( const unsigned int &  crateId,
const unsigned int &  dmbId,
unsigned int &  cscType,
unsigned int &  cscPosition 
) const
private

Get CSC type and position from crate and dmb identifiers.

Parameters
crateIdCSC crate identifier
dmbIdCSC DMB identifier
cscTypeCSC Type identifier to return
cscPositionCSC Position identifier to return
Returns
true if parameters where found and filled, false - otherwise

Definition at line 170 of file CSCDQM_EventProcessor.cc.

References CSCDetId::chamber(), CSCDetId::endcap(), cscdqm::Utility::getCSCTypeBin(), cscdqm::Utility::getCSCTypeLabel(), mps_fire::result, CSCDetId::ring(), CSCDetId::station(), AlCaHLTBitMon_QueryRunRegistry::string, and compare::tlabel.

Referenced by processCSC(), and processExaminer().

173  {
174  bool result = false;
175 
176  CSCDetId cid;
177  if (config->fnGetCSCDetId(crateId, dmbId, cid)) {
178  cscPosition = cid.chamber();
179  int iring = cid.ring();
180  int istation = cid.station();
181  int iendcap = cid.endcap();
182  std::string tlabel = cscdqm::Utility::getCSCTypeLabel(iendcap, istation, iring);
184  result = true;
185  }
186 
187  /*
188  if (!result) {
189  LOG_ERROR << "Event #" << config->getNEvents() << ": Invalid CSC=" << CSCHistoDef::getPath(crateId, dmbId);
190  }
191  */
192 
193  return result;
194  }
Definition: config.py:1
static std::string getCSCTypeLabel(int endcap, int station, int ring)
Get CSC label from CSC parameters.
int chamber() const
Definition: CSCDetId.h:62
tlabel
Definition: compare.py:27
static int getCSCTypeBin(const std::string &cstr)
Get CSC y-axis position from chamber string.
int station() const
Definition: CSCDetId.h:79
int endcap() const
Definition: CSCDetId.h:85
int ring() const
Definition: CSCDetId.h:68

◆ getCSCHisto() [1/2]

const bool cscdqm::EventProcessor::getCSCHisto ( const HistoId histo,
const HwId crateID,
const HwId dmbSlot,
MonitorObject *&  me 
)
private

Get CSC (Chamber) Level Monitoring Object.

Parameters
histoMO identification
crateIDChamber Crate identifier
dmbSlotChamber DMB identifier
meMO to return
Returns
true if MO was found, false - otherwise

Definition at line 115 of file CSCDQM_EventProcessor.cc.

References timingPdfMaker::histo, and hlt_dqm_clientPB-live_cfg::me.

Referenced by processCSC(), processExaminer(), and updateFractionHistos().

118  {
119  if (config->fnGetCacheCSCHisto(histo, crateID, dmbSlot, 0, me))
120  return (me != nullptr);
121  CSCHistoDef histoD(histo, crateID, dmbSlot);
122  if (config->fnGetHisto(histoD, me))
123  return (me != nullptr);
124  return false;
125  }
Definition: config.py:1

◆ getCSCHisto() [2/2]

const bool cscdqm::EventProcessor::getCSCHisto ( const HistoId histo,
const HwId crateID,
const HwId dmbSlot,
const HwId adId,
MonitorObject *&  me 
)
private

Get CSC (Chamber) Level Monitoring Object with additional identifier.

Parameters
histoMO identification
crateIDChamber Crate identifier
dmbSlotChamber DMB identifier
adIdAdditional identifier, i.e. Layer number, CLCT number, etc.
meMO to return
Returns
true if MO was found, false - otherwise

Definition at line 137 of file CSCDQM_EventProcessor.cc.

References timingPdfMaker::histo, and hlt_dqm_clientPB-live_cfg::me.

138  {
139  if (config->fnGetCacheCSCHisto(histo, crateID, dmbSlot, adId, me))
140  return (me != nullptr);
141  CSCHistoDef histoD(histo, crateID, dmbSlot, adId);
142  if (config->fnGetHisto(histoD, me))
143  return (me != nullptr);
144  return false;
145  }
Definition: config.py:1

◆ getDDUHisto()

const bool cscdqm::EventProcessor::getDDUHisto ( const HistoId histo,
const HwId dduID,
MonitorObject *&  me 
)
private

Get DDU Level Monitoring Object.

Parameters
histoMO identification
dduIDDDU identifier
meMO to return
Returns
true if MO was found, false - otherwise

Definition at line 98 of file CSCDQM_EventProcessor.cc.

References timingPdfMaker::histo, and hlt_dqm_clientPB-live_cfg::me.

Referenced by processDDU().

98  {
99  if (config->fnGetCacheDDUHisto(histo, dduID, me))
100  return (me != nullptr);
101  DDUHistoDef histoD(histo, dduID);
102  if (config->fnGetHisto(histoD, me))
103  return (me != nullptr);
104  return false;
105  }
Definition: config.py:1

◆ getEMUHisto()

const bool cscdqm::EventProcessor::getEMUHisto ( const HistoId histo,
MonitorObject *&  me 
)
private

Get EMU (Top Level) Monitoring Object.

Parameters
histoMO identification
meMO to return
Returns
true if MO was found, false - otherwise

Definition at line 66 of file CSCDQM_EventProcessor.cc.

References timingPdfMaker::histo, and hlt_dqm_clientPB-live_cfg::me.

Referenced by calcEMUFractionHisto(), processCSC(), processDDU(), processExaminer(), resetEmuEventDisplays(), standbyEfficiencyHistos(), updateEfficiencyHistos(), and writeShifterHistograms().

66  {
67  if (config->fnGetCacheEMUHisto(histo, me))
68  return (me != nullptr);
69  EMUHistoDef histoD(histo);
70  if (config->fnGetHisto(histoD, me))
71  return (me != nullptr);
72  return false;
73  }
Definition: config.py:1

◆ getFEDHisto()

const bool cscdqm::EventProcessor::getFEDHisto ( const HistoId histo,
const HwId fedID,
MonitorObject *&  me 
)
private

Get FED Level Monitoring Object.

Parameters
histoMO identification
fedIDFED identifier
meMO to return
Returns
true if MO was found, false - otherwise

Definition at line 82 of file CSCDQM_EventProcessor.cc.

References timingPdfMaker::histo, and hlt_dqm_clientPB-live_cfg::me.

82  {
83  if (config->fnGetCacheFEDHisto(histo, fedID, me))
84  return (me != nullptr);
85  FEDHistoDef histoD(histo, fedID);
86  if (config->fnGetHisto(histoD, me))
87  return (me != nullptr);
88  return false;
89  }
Definition: config.py:1

◆ getParHisto()

const bool cscdqm::EventProcessor::getParHisto ( const HistoId histo,
MonitorObject *&  me 
)
private

Get Parameter Monitoring Object.

Parameters
histoMO identification
meMO to return
Returns
true if MO was found, false - otherwise

Definition at line 153 of file CSCDQM_EventProcessor.cc.

References timingPdfMaker::histo, and hlt_dqm_clientPB-live_cfg::me.

Referenced by updateEfficiencyHistos().

153  {
154  if (config->fnGetCacheParHisto(histo, me))
155  return (me != nullptr);
156  ParHistoDef histoD(histo);
157  if (config->fnGetHisto(histoD, me))
158  return (me != nullptr);
159  return false;
160  }
Definition: config.py:1

◆ init()

void cscdqm::EventProcessor::init ( void  )

Initialize EventProcessor: reading out config information.

Definition at line 58 of file CSCDQM_EventProcessor.cc.

Referenced by cscdqm::Dispatcher::book().

58 {}

◆ maskHWElements()

unsigned int cscdqm::EventProcessor::maskHWElements ( std::vector< std::string > &  tokens)

Mask HW elements from the efficiency calculations. Can be applied on runtime!

Parameters
tokensString tokens of the HW elements
Returns
elements masked

Definition at line 202 of file CSCDQM_EventProcessor.cc.

References LOG_INFO, cscdqm::Summary::setMaskedHWElements(), and summary.

Referenced by cscdqm::EventProcessorMutex::maskHWElements().

202  {
203  unsigned int masked = summary.setMaskedHWElements(tokens);
204  LOG_INFO << masked << " HW Elements masked";
205  return masked;
206  }
const unsigned int setMaskedHWElements(std::vector< std::string > &tokens)
Read HW element masks (strings), create Address and apply to detector map.
#define LOG_INFO
Definition: CSCDQM_Logger.h:42

◆ preProcessEvent()

void cscdqm::EventProcessor::preProcessEvent ( )
private

Common Local and Global DQM function to be called before processing Event.

Definition at line 26 of file CSCDQM_EventProcessor_processEvent.cc.

References EmuEventDisplayWasReset.

26  {
27  config->incNEvents();
29  }
Definition: config.py:1

◆ processCSC()

void cscdqm::EventProcessor::processCSC ( const CSCEventData data,
const int  dduID,
const CSCDCCExaminer binChecker 
)
private

Process Chamber Data and fill MOs.

Parameters
dataChamber data to process
dduIDDDU identifier

DMB Found





























































































Unpacking of DMB Header and trailer




























































































Unpacking of Chamber Identification number



























































































Efficiency of the chamber


























































































Unpacking L1A number from DMB header

























































































DMB L1A: 8bits (256)
























































































DDU L1A: 24bits























































































Calculate difference between L1A numbers from DDU and DMB






















































































LOG_DEBUG << dmbHeaderL1A << " : DMB L1A - DDU L1A = " << dmb_ddu_l1a_diff;





















































































Unpacking BXN number from DMB header




















































































== DMB BXN: 12bits (4096) call bxn12(), bxn() return 7bits value



















































































== DDU BXN: 12bits (4096)


















































































== Use 6-bit BXN

















































































Calculation difference between BXN numbers from DDU and DMB
















































































dmb_ddu_bxn_diff = (int)(dmbHeaderBXN-(int)(BXN&0x7F)); // For older DMB















































































LOG_DEBUG << dmbHeaderBXN << " : DMB BXN - DDU BXN = " << dmb_ddu_bxn_diff;














































































Unpacking CFEB information from DMB header













































































mo->SetEntries(config->getNEvents());












































































DMB input (7 in total) FIFO stuff goes here











































































DMB input timeout (total 15 bits) goes here










































































Get FEBs Data Available Info









































































Fill Hisogram for FEB DAV Efficiency








































































Fill Hisogram for Different Combinations of FEB DAV Efficiency







































































ALCT Found






































































Summary plot for chambers with detected Run3 ALCT firmware





































































ALCT Run3 firmware revision should be > 5

Set number of ALCT-events to third bin



































































KK


































































h[hname]->SetBinContent(3, ((float)ALCTEvent/(float)(config->getNEvents()) * 100.0));

































































KKend
































































== ALCT2007 L1A: 12bits (4096)































































== ALCT2006 L1A: 4bits (16)






























































== Use 6-bit L1A





























































int alct_dmb_l1a_diff = (int)((dmbHeader->l1a()&0xF)-alctHeader->L1Acc());




























































if (getCSCHisto(h::CSC_DMB_L1A_VS_ALCT_L1A, crateID, dmbID, mo)) mo->Fill(alctHeader->L1Acc(),dmbHeader->l1a());



























































=== ALCT BXN: 12bits (4096)


























































=== Use 6-bit BXN

























































if (getCSCHisto(h::CSC_ALCT_BXN_VS_DMB_BXN, crateID, dmbID, mo)) mo->Fill((int)((alctHeader->BXNCount())), (int)(dmbHeader->bxn()));
























































LOG_DEBUG << "ALCT Trailer Word Count = " << dec << (int)alctTrailer->wordCount();























































Run3 ALCT HMT bits from ALCT data






















































Summary occupancy plot for ANode HMT bits per BX from ALCT





















































TODO: Add support for more than 2 ALCTs




















































ALCT not found



















































ALCT and CLCT coinsidence


















































CLCT Found

















































LOG_WARN << "TMB CRC calc: 0x" << std::hex << data.tmbData().TMBCRCcalc() << " trailer: 0x" << std::hex << data.tmbData().tmbTrailer().crc22();
















































Summary plot for chambers with detected (O)TMB Run3 data format















































Summary plot for chambers with detected enabled (O)TMB Run3 CCLUT mode














































Fill summary GEM VFATs occupancies plots for endcaps

Summary occupancy plot for Anode HMT bits from OTMB

Summary occupancy plot for Cathode HMT bits from OTMB

Correlated LCTs processing

Summary occupancy plot for combined HMT bits sent to MPC

Find matching keyWG from ALCT keyWG list

Set number of CLCT-events to forth bin







































Use 6-bit L1A






































int pattern_clct = (int)((clctsDatas[lct].getPattern()>>1)&0x3);





































pattern_clct = Number of patterns in CLCT




































Last (left) bit is bend. Positive bend = 1, negative bend = 0



































pattern_clct = Number of patterns in CLCT


































Last (left) bit is bend. Positive bend = 1, negative bend = 0

































=VB= Fix to get right hafstrip
































if (norm < 1.0) norm=1;































CLCT not found






























CFEB found





























bool DebugCFEB = false;




























–————B



























–————E


























–————B

























–————E
























CFEB Found























-————B






















-————E





















=VB= Optimizations for faster histogram object access




















=VB= Optimizations for faster histogram object access



















–————B


















SCA Block Occupancy Histograms

















Free SCA Cells
















Number of SCA Blocks Locked by LCTs















Number of SCA Blocks Locked by LCTxL1














–————E













–————B












–————E











continue;










–————B









–————E








–————B







Refactored for performance (VR)






Number of Clusters Histograms





Clusters Charge Histograms




Width of Clusters Histograms



Cluster Duration Histograms


delete ClusterFinder;

--------——E
Fill Hisogram for Different Combinations of FEBs Unpacked vs DAV

Definition at line 81 of file CSCDQM_EventProcessor_processCSC.cc.

References a, funct::abs(), CSCCFEBDataWord::adcCounts, CSCCFEBDataWord::adcOverflow, CSCDMBTrailer::alct_empty(), CSCDMBTrailer::alct_endtimeout(), CSCDMBTrailer::alct_full(), CSCDMBTrailer::alct_half(), CSCDMBTrailer::alct_starttimeout(), cscdqm::ALCT_TRIGGERS, CSCALCTHeader::ALCTDigis(), CSCALCTHeader::alctFirmwareRevision(), CSCALCTHeader::alctFirmwareVersion(), CSCTMBHeader::alctHMT(), CSCTMBHeader::ALCTMatchTime(), CSCTMBHeader::ALCTOnly(), CSCALCTHeader::alctShowerDigis(), b, b1, b2, nano_mu_digi_cff::bx, BXN, CSCTMBHeader::Bxn0Diff(), CSCDMBHeader::bxn12(), CSCTMBHeader::Bxn1Diff(), CSCTMBHeader::BXNCount(), CSCALCTHeader::BXNCount(), CSCDMBTrailer::cfeb_empty(), CSCDMBTrailer::cfeb_endtimeout(), CSCDMBTrailer::cfeb_full(), CSCDMBTrailer::cfeb_half(), CSCDMBTrailer::cfeb_starttimeout(), cscdqm::CFEB_TRIGGERS, CSCDMBHeader::cfebActive(), CSCDMBHeader::cfebAvailable(), CSCDMBHeader::cfebMovlp(), CSCDigiToRawAccept::chamberID(), CSCComparatorData::check(), CSCTMBHeader::clct0_ComparatorCode(), CSCTMBHeader::clct0_xky(), CSCTMBHeader::clct1_xky(), cscdqm::CLCT_TRIGGERS, CSCTMBHeader::CLCTDigis(), CSCTMBHeader::clctHMT(), CSCTMBHeader::CLCTOnly(), CSCComparatorData::comparatorDigis(), CSCTMBHeader::CorrelatedLCTDigis(), CSCDMBHeader::crateID(), cscdqm::h::CSC_ALCT1_VS_ALCT0_KEYWG, cscdqm::h::CSC_ALCT_BXN, cscdqm::h::CSC_ALCT_BXN_VS_DMB_BXN, cscdqm::h::CSC_ALCT_DMB_BXN_DIFF, cscdqm::h::CSC_ALCT_DMB_L1A_DIFF, cscdqm::h::CSC_ALCT_L1A, cscdqm::h::CSC_ALCT_LYXX_EFFICIENCY, cscdqm::h::CSC_ALCT_LYXX_RATE, cscdqm::h::CSC_ALCT_MATCH_TIME, cscdqm::h::CSC_ALCT_NUMBER_EFFICIENCY, cscdqm::h::CSC_ALCT_NUMBER_OF_LAYERS_WITH_HITS, cscdqm::h::CSC_ALCT_NUMBER_OF_WIREGROUPS_WITH_HITS, cscdqm::h::CSC_ALCT_NUMBER_RATE, cscdqm::h::CSC_ALCT_WORD_COUNT, cscdqm::h::CSC_ALCTTIME_LYXX, cscdqm::h::CSC_ALCTTIME_LYXX_PROFILE, cscdqm::h::CSC_ALCTXX_BXN, cscdqm::h::CSC_ALCTXX_DTIME, cscdqm::h::CSC_ALCTXX_DTIME_PROFILE, cscdqm::h::CSC_ALCTXX_DTIME_VS_KEYWG, cscdqm::h::CSC_ALCTXX_KEYWG, cscdqm::h::CSC_ALCTXX_PATTERN, cscdqm::h::CSC_ALCTXX_PATTERN_DISTR, cscdqm::h::CSC_ALCTXX_QUALITY, cscdqm::h::CSC_ALCTXX_QUALITY_DISTR, cscdqm::h::CSC_ALCTXX_QUALITY_PROFILE, cscdqm::h::CSC_CFEB_ACTIVE_SAMPLES_VS_STRIP_LYXX, cscdqm::h::CSC_CFEB_ACTIVE_SAMPLES_VS_STRIP_LYXX_PROFILE, cscdqm::h::CSC_CFEB_ACTIVESTRIPS_LYXX, cscdqm::h::CSC_CFEB_AFEB_RAWHITS_TIMEBINS, cscdqm::h::CSC_CFEB_CLUSTER_DURATION_LY_XX, cscdqm::h::CSC_CFEB_CLUSTERS_CHARGE_LY_XX, cscdqm::h::CSC_CFEB_COMPARATORS_TIMESAMPLES, cscdqm::h::CSC_CFEB_NUMBER_OF_CLUSTERS_LY_XX, cscdqm::h::CSC_CFEB_OUT_OFF_RANGE_STRIPS_LYXX, cscdqm::h::CSC_CFEB_PEDESTAL_WITHEMV_SAMPLE_01_LYXX, cscdqm::h::CSC_CFEB_PEDESTAL_WITHRMS_SAMPLE_01_LYXX, cscdqm::h::CSC_CFEB_PEDESTALRMS_SAMPLE_01_LYXX, cscdqm::h::CSC_CFEB_SCA_CELL_PEAK_LY_XX, cscdqm::h::CSC_CFEB_SCA_CELLPEAK_TIME, cscdqm::h::CSC_CFEB_WIDTH_OF_CLUSTERS_LY_XX, cscdqm::h::CSC_CFEBXX_DMB_L1A_DIFF, cscdqm::h::CSC_CFEBXX_FREE_SCA_CELLS, cscdqm::h::CSC_CFEBXX_L1A_SYNC_TIME, cscdqm::h::CSC_CFEBXX_L1A_SYNC_TIME_DMB_DIFF, cscdqm::h::CSC_CFEBXX_L1A_SYNC_TIME_VS_DMB, cscdqm::h::CSC_CFEBXX_LCT_PHASE_VS_L1A_PHASE, cscdqm::h::CSC_CFEBXX_SCA_BLOCK_OCCUPANCY, cscdqm::h::CSC_CFEBXX_SCA_BLOCKS_LOCKED_BY_LCTS, cscdqm::h::CSC_CFEBXX_SCA_BLOCKS_LOCKED_BY_LCTXL1, cscdqm::h::CSC_CLCT0_CLCT1_CLSSIFICATION, cscdqm::h::CSC_CLCT0_CLSSIFICATION, cscdqm::h::CSC_CLCT0_KEYDISTRIP_VS_ALCT0_KEYWIREGROUP, cscdqm::h::CSC_CLCT1_VS_CLCT0_KEY_STRIP, cscdqm::h::CSC_CLCT_BXN, cscdqm::h::CSC_CLCT_BXN_VS_DMB_BXN, cscdqm::h::CSC_CLCT_DMB_BXN_DIFF, cscdqm::h::CSC_CLCT_DMB_L1A_DIFF, cscdqm::h::CSC_CLCT_HALF_STRIP_PATTERN_DISTR, cscdqm::h::CSC_CLCT_L1A, cscdqm::h::CSC_CLCT_LYXX_EFFICIENCY, cscdqm::h::CSC_CLCT_LYXX_RATE, cscdqm::h::CSC_CLCT_NUMBER, cscdqm::h::CSC_CLCT_NUMBER_OF_HALFSTRIPS_WITH_HITS, cscdqm::h::CSC_CLCT_NUMBER_OF_LAYERS_WITH_HITS, cscdqm::h::CSC_CLCT_NUMBER_RATE, cscdqm::h::CSC_CLCT_RUN3_HMT_NHITS, cscdqm::h::CSC_CLCT_RUN3_HMT_NHITS_VS_HMT_BITS, cscdqm::h::CSC_CLCTTIME_LYXX, cscdqm::h::CSC_CLCTTIME_LYXX_PROFILE, cscdqm::h::CSC_CLCTXX_BXN, cscdqm::h::CSC_CLCTXX_COMPARATOR_CODE, cscdqm::h::CSC_CLCTXX_DISTRIP_PATTERN, cscdqm::h::CSC_CLCTXX_DISTRIP_QUALITY, cscdqm::h::CSC_CLCTXX_DISTRIP_QUALITY_PROFILE, cscdqm::h::CSC_CLCTXX_DTIME, cscdqm::h::CSC_CLCTXX_DTIME_PROFILE, cscdqm::h::CSC_CLCTXX_DTIME_VS_DISTRIP, cscdqm::h::CSC_CLCTXX_DTIME_VS_HALF_STRIP, cscdqm::h::CSC_CLCTXX_HALF_STRIP_PATTERN, cscdqm::h::CSC_CLCTXX_HALF_STRIP_QUALITY, cscdqm::h::CSC_CLCTXX_HALF_STRIP_QUALITY_DISTR, cscdqm::h::CSC_CLCTXX_HALF_STRIP_QUALITY_PROFILE, cscdqm::h::CSC_CLCTXX_KEY_EIGHTSTRIP, cscdqm::h::CSC_CLCTXX_KEY_QUARTSTRIP, cscdqm::h::CSC_CLCTXX_KEY_STRIP_TYPE, cscdqm::h::CSC_CLCTXX_KEYDISTRIP, cscdqm::h::CSC_CLCTXX_KEYHALFSTRIP, cscdqm::h::CSC_CLCTXX_RUN3_BEND_VS_SLOPE, cscdqm::h::CSC_CLCTXX_RUN3_TO_RUN2_PATTERN, cscdqm::h::CSC_CORR_LCT0_VS_ALCT0_KEY_WG, cscdqm::h::CSC_CORR_LCT0_VS_CLCT0_KEY_STRIP, cscdqm::h::CSC_CORR_LCT0_VS_LCT1_RUN3_PATTERN, cscdqm::h::CSC_CORR_LCT1_VS_ALCT1_KEY_WG, cscdqm::h::CSC_CORR_LCT1_VS_CLCT1_KEY_STRIP, cscdqm::h::CSC_CORR_LCT_CLCT_COMBINATION, cscdqm::h::CSC_CORR_LCT_RUN3_PATTERN_ID, cscdqm::h::CSC_CORR_LCT_VS_ALCT_DIGI_MATCH, cscdqm::h::CSC_CORR_LCTXX_BEND_VS_SLOPE, cscdqm::h::CSC_CORR_LCTXX_HITS_DISTRIBUTION, cscdqm::h::CSC_CORR_LCTXX_KEY_EIGHTSTRIP, cscdqm::h::CSC_CORR_LCTXX_KEY_HALFSTRIP, cscdqm::h::CSC_CORR_LCTXX_KEY_QUARTSTRIP, cscdqm::h::CSC_CORR_LCTXX_KEY_STRIP_TYPE, cscdqm::h::CSC_CORR_LCTXX_KEY_WG, cscdqm::h::CSC_CORR_LCTXX_RUN3_ME11_QUALITY, cscdqm::h::CSC_CORR_LCTXX_RUN3_QUALITY, cscdqm::h::CSC_CORR_LCTXX_RUN3_TO_RUN2_PATTERN, cscdqm::h::CSC_CSC_EFFICIENCY, cscdqm::h::CSC_CSC_RATE, cscdqm::h::CSC_DMB_BXN_DISTRIB, cscdqm::h::CSC_DMB_BXN_VS_DDU_BXN, cscdqm::h::CSC_DMB_CFEB_ACTIVE, cscdqm::h::CSC_DMB_CFEB_DAV, cscdqm::h::CSC_DMB_CFEB_DAV_MULTIPLICITY, cscdqm::h::CSC_DMB_CFEB_MOVLP, cscdqm::h::CSC_DMB_CFEB_SYNC, cscdqm::h::CSC_DMB_DDU_BXN_DIFF, cscdqm::h::CSC_DMB_DDU_L1A_DIFF, cscdqm::h::CSC_DMB_FEB_COMBINATIONS_DAV_EFFICIENCY, cscdqm::h::CSC_DMB_FEB_COMBINATIONS_DAV_RATE, cscdqm::h::CSC_DMB_FEB_COMBINATIONS_UNPACKED_VS_DAV, cscdqm::h::CSC_DMB_FEB_DAV_EFFICIENCY, cscdqm::h::CSC_DMB_FEB_DAV_RATE, cscdqm::h::CSC_DMB_FEB_TIMEOUTS, cscdqm::h::CSC_DMB_FEB_UNPACKED_VS_DAV, cscdqm::h::CSC_DMB_FIFO_STATS, cscdqm::h::CSC_DMB_L1_PIPE, cscdqm::h::CSC_DMB_L1A_DISTRIB, cscdqm::h::CSC_DMB_L1A_VS_ALCT_L1A, cscdqm::h::CSC_DMB_L1A_VS_CLCT_L1A, cscdqm::h::CSC_DMB_L1A_VS_DDU_L1A, cscdqm::h::CSC_EVENT_DISPLAY_NOXX, cscdqm::h::CSC_GEM_ALCT_MATCH, cscdqm::h::CSC_GEM_CLCT_MATCH, cscdqm::h::CSC_GEM_FIBERS_STATUS, cscdqm::h::CSC_GEM_GEMA_BX_DISTRIBUTION, cscdqm::h::CSC_GEM_GEMA_CLUSTER_SIZE, cscdqm::h::CSC_GEM_GEMA_HITS, cscdqm::h::CSC_GEM_GEMA_HITS_IN_TIME, cscdqm::h::CSC_GEM_GEMA_HITS_IN_TIME_PROFILE, cscdqm::h::CSC_GEM_GEMA_HITS_W_ROLLS, cscdqm::h::CSC_GEM_GEMA_PADS_CLUSTER_SIZE, cscdqm::h::CSC_GEM_GEMA_VFAT_HITS_IN_TIME, cscdqm::h::CSC_GEM_GEMA_VFAT_HITS_IN_TIME_PROFILE, cscdqm::h::CSC_GEM_GEMB_BX_DISTRIBUTION, cscdqm::h::CSC_GEM_GEMB_CLUSTER_SIZE, cscdqm::h::CSC_GEM_GEMB_HITS, cscdqm::h::CSC_GEM_GEMB_HITS_IN_TIME, cscdqm::h::CSC_GEM_GEMB_HITS_IN_TIME_PROFILE, cscdqm::h::CSC_GEM_GEMB_HITS_W_ROLLS, cscdqm::h::CSC_GEM_GEMB_PADS_CLUSTER_SIZE, cscdqm::h::CSC_GEM_GEMB_VFAT_HITS_IN_TIME, cscdqm::h::CSC_GEM_GEMB_VFAT_HITS_IN_TIME_PROFILE, cscdqm::h::CSC_GEM_LCT_SYNC_STATUS, cscdqm::h::CSC_GEM_NUM_CLUSTERS, cscdqm::h::CSC_GEM_NUM_COPADS, cscdqm::h::CSC_GEM_SYNC_STATUS, cscdqm::h::CSC_LCT0_MATCH_BXN_DIFFERENCE, cscdqm::h::CSC_LCT1_MATCH_BXN_DIFFERENCE, cscdqm::h::CSC_LCT_MATCH_STATUS, cscdqm::h::CSC_RUN3_ALCT_HMT_BITS_VS_BX, cscdqm::h::CSC_RUN3_CLCT_ALCT_HMT, cscdqm::h::CSC_RUN3_CLCT_VS_ALCT_HMT_BITS, cscdqm::h::CSC_RUN3_HMT_ALCT_MATCH, cscdqm::h::CSC_RUN3_HMT_COINCIDENCE_MATCH, cscdqm::h::CSC_RUN3_HMT_DISTRIBUTION, cscdqm::h::CSC_RUN3_HMT_HADRONIC_SHOWER, cscdqm::h::CSC_TMB_ALCT_BXN_DIFF, cscdqm::h::CSC_TMB_ALCT_L1A_DIFF, cscdqm::h::CSC_TMB_BXN_VS_ALCT_BXN, cscdqm::h::CSC_TMB_L1A_VS_ALCT_L1A, cscdqm::h::CSC_TMB_WORD_COUNT, data, CSCGEMData::digis(), cscdqm::DMB_EVENTS, CSCDMBTrailer::dmb_l1pipe(), cscdqm::DMB_TRIGGERS, CSCDMBHeader::dmbCfebSync(), CSCDMBHeader::dmbID(), cscdqm::StripClusterFinder::DoAction(), cscdqm::h::EMU_CSC_AFEB_ENDCAP_MINUS_RAWHITS_TIME, cscdqm::h::EMU_CSC_AFEB_ENDCAP_PLUS_RAWHITS_TIME, cscdqm::h::EMU_CSC_AFEB_RAWHITS_TIME_MEAN, cscdqm::h::EMU_CSC_AFEB_RAWHITS_TIME_RMS, cscdqm::h::EMU_CSC_ALCT0_BXN_MEAN, cscdqm::h::EMU_CSC_ALCT0_BXN_RMS, cscdqm::h::EMU_CSC_ALCT0_ENDCAP_MINUS_DTIME, cscdqm::h::EMU_CSC_ALCT0_ENDCAP_PLUS_DTIME, cscdqm::h::EMU_CSC_ALCT0_QUALITY, cscdqm::h::EMU_CSC_ALCT_CLCT_MATCH_MEAN, cscdqm::h::EMU_CSC_ALCT_CLCT_MATCH_RMS, cscdqm::h::EMU_CSC_ALCT_PLANES_WITH_HITS, cscdqm::h::EMU_CSC_ANODE_HMT_ALCT_REPORTING, cscdqm::h::EMU_CSC_ANODE_HMT_REPORTING, cscdqm::h::EMU_CSC_CATHODE_HMT_REPORTING, cscdqm::h::EMU_CSC_CFEB_COMPARATORS_TIME_MEAN, cscdqm::h::EMU_CSC_CFEB_COMPARATORS_TIME_RMS, cscdqm::h::EMU_CSC_CFEB_SCA_CELLPEAK_TIME_MEAN, cscdqm::h::EMU_CSC_CFEB_SCA_CELLPEAK_TIME_RMS, cscdqm::h::EMU_CSC_CLCT0_BXN_MEAN, cscdqm::h::EMU_CSC_CLCT0_BXN_RMS, cscdqm::h::EMU_CSC_CLCT0_QUALITY, cscdqm::h::EMU_CSC_CLCT_PLANES_WITH_HITS, cscdqm::h::EMU_CSC_ENDCAP_MINUS_ALCT_CLCT_MATCH_TIME, cscdqm::h::EMU_CSC_ENDCAP_MINUS_CFEB_COMPARATORS_TIME, cscdqm::h::EMU_CSC_ENDCAP_MINUS_CLCT0_DTIME, cscdqm::h::EMU_CSC_ENDCAP_PLUS_ALCT_CLCT_MATCH_TIME, cscdqm::h::EMU_CSC_ENDCAP_PLUS_CFEB_COMPARATORS_TIME, cscdqm::h::EMU_CSC_ENDCAP_PLUS_CLCT0_DTIME, cscdqm::h::EMU_CSC_L1A_OUT_OF_SYNC, cscdqm::h::EMU_CSC_LCT_HMT_REPORTING, cscdqm::h::EMU_CSC_MINUS_ENDCAP_CFEB_SCA_CELLPEAK_TIME, cscdqm::h::EMU_CSC_PLUS_ENDCAP_CFEB_SCA_CELLPEAK_TIME, cscdqm::h::EMU_CSC_RUN3_ALCT_FORMAT, cscdqm::h::EMU_CSC_TMB_RUN3_CCLUT_MODE, cscdqm::h::EMU_CSC_TMB_RUN3_DATA_FORMAT, cscdqm::h::EMU_CSC_UNPACKED, cscdqm::h::EMU_DMB_L1A_OUT_OF_SYNC, cscdqm::h::EMU_DMB_UNPACKED, cscdqm::h::EMU_EVENT_DISPLAY_ANODE, cscdqm::h::EMU_EVENT_DISPLAY_CATHODE, cscdqm::h::EMU_EVENT_DISPLAY_XY, cscdqm::h::EMU_GEM_MINUS_ENDCAP_VFAT_OCCUPANCY, cscdqm::h::EMU_GEM_PLUS_ENDCAP_VFAT_OCCUPANCY, CSCDetId::endcap(), CSCDCCExaminer::errorsForChamber(), CSCGEMData::etaDigis(), cscdqm::EVENT_DISPLAY_PLOT, fCloseL1As, cscdqm::MonitorObject::Fill(), ntuplemaker::fill, CSCTMBHeader::FirmwareRevision(), CSCTMBHeader::FirmwareVersion(), dqmdumpme::first, nano_mu_digi_cff::float, amcDumpToRaw_cfi::fwVersion, CSCTMBHeader::gem_enabled_fibers(), CSCTMBHeader::gem_sync_dataword(), CSCTMBHeader::gem_timing_dataword(), CSCTMBData::gemData(), CSCCFEBTimeSlice::get_buffer_count(), CSCCFEBTimeSlice::get_l1pipe_empty(), CSCCFEBTimeSlice::get_l1pipe_full(), CSCCFEBTimeSlice::get_lctpipe_count(), CSCCFEBTimeSlice::get_lctpipe_empty(), CSCCFEBTimeSlice::get_lctpipe_full(), CSCCFEBTimeSlice::get_n_free_sca_blocks(), cscdqm::MonitorObject::GetBinContent(), cscdqm::MonitorObject::GetBinError(), cscdqm::StripClusterFinder::getClusters(), getCSCFromMap(), getCSCHisto(), cscdqm::Summary::getDetector(), getEMUHisto(), cscdqm::MonitorObject::GetEntries(), cscdqm::MonitorObject::GetMaximumBin(), cscdqm::CSCHistoDef::getPath(), cscdqm::MonitorObject::getTH1(), cscdqm::MonitorObject::getTH1Lock(), cscdqm::Detector::GlobalChamberIndex(), CSCTMBData::hasGEM(), CSCTMBHeader::hmt_ALCTMatchTime(), CSCTMBHeader::hmt_nhits(), mps_fire::i, hcalRecHitTable_cff::ieta, createfilelist::int, cscdqm::Summary::isChamberStandby(), L1TdeCSCTPG_cfi::isRun3, sistrip::SpyUtilities::isValid(), dqmiolumiharvest::j, dqmdumpme::k, CSCDMBHeader::l1a24(), CSCCFEBSCAControllerWord::l1a_phase, CSCALCTHeader::L1Acc(), CSCTMBHeader::L1ANumber(), L1ANumber, LOG_ERROR, LOG_INFO, LOG_WARN, dqmiodumpmetadata::n, CSCDMBHeader::nalct(), CSCTMBHeader::NCFEBs(), CSCDMBHeader::nclct(), gen::npad, me0TriggerPseudoDigis_cff::nStrips, CSCGEMData::numGEMs(), topSingleLeptonDQM_PU_cfi::pattern, CalibrationSummaryClient_cfi::Pedestal, EcalCondDBWriter_cfi::pedestal, DetId::rawId(), CSCDetId::ring(), CSCTMBHeader::run3_CLCT_patternID(), CSCCFEBSCAControllerWord::sca_blk, CSCCFEBTimeSlice::scaControllerWord(), edm::second(), cscdqm::MonitorObject::SetAxisRange(), cscdqm::MonitorObject::SetBinContent(), cscdqm::MonitorObject::SetBinError(), setEmuEventDisplayBit(), cscdqm::MonitorObject::SetEntries(), cscdqm::MonitorObject::SetNormFactor(), CSCDetId::station(), AlCaHLTBitMon_QueryRunRegistry::string, summary, theFormatVersion, HLT_2024v14_cff::Threshold, cscdqm::timeSample(), cscdqm::timeSlice(), CSCDMBTrailer::tmb_empty(), CSCDMBTrailer::tmb_endtimeout(), CSCDMBTrailer::tmb_full(), CSCDMBTrailer::tmb_half(), CSCDMBTrailer::tmb_starttimeout(), CSCTMBData::tmbHeader(), CSCTMBHeader::TMBMatch(), CSCTMBData::tmbTrailer(), CSCCFEBSCAControllerWord::trig_time, CSCAnodeData::wireDigis(), CSCTMBTrailer::wordCount(), and CSCALCTTrailer::wordCount().

Referenced by processDDU().

81  {
82  config->incNUnpackedCSC();
83 
84  int FEBunpacked = 0;
85  int alct_unpacked = 0;
86  int tmb_unpacked = 0;
87  int cfeb_unpacked = 0;
88 
89  int alct_keywg = -1;
90  int clct_kewdistrip = -1;
91 
92  bool L1A_out_of_sync = false;
93 
94  int nCFEBs = 5;
95 
96  MonitorObject* mo = nullptr;
97 
100  const CSCDMBHeader* dmbHeader = data.dmbHeader();
101  const CSCDMBTrailer* dmbTrailer = data.dmbTrailer();
102  if (!dmbHeader && !dmbTrailer) {
103  LOG_ERROR << "Can not unpack DMB Header or/and Trailer";
104  return;
105  }
106 
107  theFormatVersion = data.getFormatVersion();
108 
110  unsigned int crateID = 0xFF;
111  unsigned int dmbID = 0xF;
112  unsigned int chamberID = 0xFFF;
113 
114  crateID = dmbHeader->crateID();
115  dmbID = dmbHeader->dmbID();
116  chamberID = (((crateID) << 4) + dmbID) & 0xFFF;
117 
118  const std::string cscTag = CSCHistoDef::getPath(crateID, dmbID);
119 
120  unsigned long errors = binChecker.errorsForChamber(chamberID);
121  if ((errors & config->getBINCHECK_MASK()) > 0) {
122  LOG_WARN << "Format Errors " << cscTag << ": 0x" << std::hex << errors << " Skipped CSC Unpacking";
123  return;
124  }
125 
126  unsigned int cscType = 0;
127  unsigned int cscPosition = 0;
128  if (!getCSCFromMap(crateID, dmbID, cscType, cscPosition))
129  return;
130 
131  CSCDetId cid;
132  if (!config->fnGetCSCDetId(crateID, dmbID, cid)) {
133  return;
134  }
135 
136  // Check if ME11 with PostLS1 readout (7 DCFEBs)
137  if ((cscType == 8 || cscType == 9) && theFormatVersion >= 2013)
138  nCFEBs = 7;
139 
140  // Check if in standby!
141  if (summary.isChamberStandby(cid)) {
142  return;
143  }
144 
145  double DMBEvents = 0.0;
146  DMBEvents = config->getChamberCounterValue(DMB_EVENTS, crateID, dmbID);
147 
148  // Get Event display plot number and next plot object
149  uint32_t evDisplNo = config->getChamberCounterValue(EVENT_DISPLAY_PLOT, crateID, dmbID);
150  evDisplNo += 1;
151  if (evDisplNo >= 5) {
152  config->setChamberCounterValue(EVENT_DISPLAY_PLOT, crateID, dmbID, 0);
153  } else {
154  config->setChamberCounterValue(EVENT_DISPLAY_PLOT, crateID, dmbID, evDisplNo);
155  }
156  MonitorObject* mo_EventDisplay = nullptr;
157  if (getCSCHisto(h::CSC_EVENT_DISPLAY_NOXX, crateID, dmbID, evDisplNo, mo_EventDisplay)) {
158  mo_EventDisplay->getTH1Lock()->Reset("");
159  }
160 
161  // Receiving EMU Event displays
162  MonitorObject *mo_Emu_EventDisplay_Anode = nullptr, *mo_Emu_EventDisplay_Cathode = nullptr,
163  *mo_Emu_EventDisplay_XY = nullptr;
164  getEMUHisto(h::EMU_EVENT_DISPLAY_ANODE, mo_Emu_EventDisplay_Anode);
165  getEMUHisto(h::EMU_EVENT_DISPLAY_CATHODE, mo_Emu_EventDisplay_Cathode);
166  getEMUHisto(h::EMU_EVENT_DISPLAY_XY, mo_Emu_EventDisplay_XY);
167 
168  // Global chamber index
169  uint32_t glChamberIndex = 0;
170 
171  if (mo_EventDisplay) {
172  mo_EventDisplay->SetBinContent(1, 1, cid.endcap());
173  mo_EventDisplay->SetBinContent(1, 2, cid.station());
174  mo_EventDisplay->SetBinContent(1, 3, cid.ring());
175  mo_EventDisplay->SetBinContent(1, 4, cscPosition);
176  mo_EventDisplay->SetBinContent(1, 5, crateID);
177  mo_EventDisplay->SetBinContent(1, 6, dmbID);
178  mo_EventDisplay->SetBinContent(1, 7, dmbHeader->l1a24());
179  if (mo_Emu_EventDisplay_Anode || mo_Emu_EventDisplay_Cathode || mo_Emu_EventDisplay_XY) {
180  glChamberIndex = summary.getDetector().GlobalChamberIndex(cid.endcap(), cid.station(), cid.ring(), cscPosition);
181  }
182  }
183 
184  config->copyChamberCounterValue(DMB_EVENTS, DMB_TRIGGERS, crateID, dmbID);
185 
186  if (cscPosition && getEMUHisto(h::EMU_CSC_UNPACKED, mo)) {
187  mo->Fill(cscPosition, cscType);
188  }
189 
191  float DMBEff = float(DMBEvents) / float(config->getNEvents());
192  if (DMBEff > 1.0) {
193  LOG_ERROR << cscTag << " has efficiency " << DMBEff << " which is greater than 1";
194  }
195 
199  int dmbHeaderL1A = dmbHeader->l1a24() % 64;
201  int dmb_ddu_l1a_diff = (int)(dmbHeaderL1A - (int)(L1ANumber % 64));
202  if (dmb_ddu_l1a_diff != 0)
203  L1A_out_of_sync = true;
204 
207  if (getCSCHisto(h::CSC_DMB_L1A_DISTRIB, crateID, dmbID, mo))
208  mo->Fill(dmbHeaderL1A);
209 
210  if (getCSCHisto(h::CSC_DMB_DDU_L1A_DIFF, crateID, dmbID, mo)) {
211  if (dmb_ddu_l1a_diff < -32) {
212  mo->Fill(dmb_ddu_l1a_diff + 64);
213  } else {
214  if (dmb_ddu_l1a_diff >= 32)
215  mo->Fill(dmb_ddu_l1a_diff - 64);
216  else
217  mo->Fill(dmb_ddu_l1a_diff);
218  }
219  mo->SetAxisRange(0.1, 1.1 * (1.0 + mo->GetBinContent(mo->GetMaximumBin())), "Y");
220  }
221 
222  if (getCSCHisto(h::CSC_DMB_L1A_VS_DDU_L1A, crateID, dmbID, mo))
223  mo->Fill((int)(L1ANumber & 0xFF), (int)dmbHeaderL1A);
224 
226  int dmbHeaderBXN = 0;
227  int dmb_ddu_bxn_diff = 0;
228 
233  dmbHeaderBXN = dmbHeader->bxn12();
237  dmb_ddu_bxn_diff = dmbHeaderBXN % 64 - BXN % 64;
239  if (getCSCHisto(h::CSC_DMB_BXN_DISTRIB, crateID, dmbID, mo))
240  mo->Fill((int)(dmbHeader->bxn12()));
241 
242  if (getCSCHisto(h::CSC_DMB_DDU_BXN_DIFF, crateID, dmbID, mo)) {
243  if (dmb_ddu_bxn_diff < -32)
244  mo->Fill(dmb_ddu_bxn_diff + 64);
245  else {
246  if (dmb_ddu_bxn_diff >= 32)
247  mo->Fill(dmb_ddu_bxn_diff - 64);
248  else
249  mo->Fill(dmb_ddu_bxn_diff);
250  }
251  mo->SetAxisRange(0.1, 1.1 * (1.0 + mo->GetBinContent(mo->GetMaximumBin())), "Y");
252  }
253 
254  if (getCSCHisto(h::CSC_DMB_BXN_VS_DDU_BXN, crateID, dmbID, mo))
255  mo->Fill(((int)(BXN)) % 256, ((int)dmbHeaderBXN) % 256);
256 
258  int cfeb_dav = 0;
259  int cfeb_dav_num = 0;
260  int cfeb_movlp = 0;
261  int dmb_cfeb_sync = 0;
262 
263  cfeb_dav = (int)dmbHeader->cfebAvailable();
264  for (int i = 0; i < nCFEBs; i++)
265  cfeb_dav_num += (cfeb_dav >> i) & 0x1;
266  cfeb_movlp = (int)dmbHeader->cfebMovlp();
267  dmb_cfeb_sync = (int)dmbHeader->dmbCfebSync();
268 
269  if (getCSCHisto(h::CSC_DMB_CFEB_DAV, crateID, dmbID, mo)) {
270  for (int i = 0; i < nCFEBs; i++) {
271  int cfeb_present = (cfeb_dav >> i) & 0x1;
272  if (cfeb_present) {
273  mo->Fill(i);
274  }
275  }
276  }
277 
278  if (getCSCHisto(h::CSC_DMB_CFEB_DAV_MULTIPLICITY, crateID, dmbID, mo))
279  mo->Fill(cfeb_dav_num);
280  if (getCSCHisto(h::CSC_DMB_CFEB_MOVLP, crateID, dmbID, mo))
281  mo->Fill(cfeb_movlp);
282  if (getCSCHisto(h::CSC_DMB_CFEB_SYNC, crateID, dmbID, mo))
283  mo->Fill(dmb_cfeb_sync);
284 
285  if (getEMUHisto(h::EMU_DMB_UNPACKED, mo)) {
286  mo->Fill(crateID, dmbID);
288  }
289 
290  if (getCSCHisto(h::CSC_DMB_CFEB_ACTIVE, crateID, dmbID, mo))
291  mo->Fill(dmbHeader->cfebActive()); //KK
292 
293  if (getCSCHisto(h::CSC_DMB_L1_PIPE, crateID, dmbID, mo))
294  mo->Fill(dmbTrailer->dmb_l1pipe());
295 
297  if (getCSCHisto(h::CSC_DMB_FIFO_STATS, crateID, dmbID, mo)) {
298  if (dmbTrailer->tmb_empty() == 1)
299  mo->Fill(1.0, 0.0); //KK
300  if (dmbTrailer->tmb_half() == 0)
301  mo->Fill(1.0, 1.0);
302  if (dmbTrailer->tmb_full() == 1)
303  mo->Fill(1.0, 2.0); //KK
304  if (dmbTrailer->alct_empty() == 1)
305  mo->Fill(0.0, 0.0);
306  if (dmbTrailer->alct_half() == 0)
307  mo->Fill(0.0, 1.0);
308  if (dmbTrailer->alct_full() == 1)
309  mo->Fill(0.0, 2.0); //KK 0->1
310  for (int i = 0; i < nCFEBs; i++) {
311  if ((int)((dmbTrailer->cfeb_empty() >> i) & 0x1) == 1)
312  mo->Fill(i + 2, 0.0);
313  if ((int)((dmbTrailer->cfeb_half() >> i) & 0x1) == 0)
314  mo->Fill(i + 2, 1);
315  if ((int)((dmbTrailer->cfeb_full() >> i) & 0x1) == 1) {
316  mo->Fill(i + 2, 2);
317  }
318  }
319  mo->SetEntries((int)DMBEvents);
320  }
321 
323  if (getCSCHisto(h::CSC_DMB_FEB_TIMEOUTS, crateID, dmbID, mo)) {
324  if ((dmbTrailer->tmb_starttimeout() == 0) && (dmbTrailer->alct_starttimeout() == 0) &&
325  (dmbTrailer->cfeb_starttimeout() == 0) && (dmbTrailer->cfeb_endtimeout() == 0)) {
326  mo->Fill(0.0);
327  } else {
328  if (dmbTrailer->alct_starttimeout())
329  mo->Fill(1);
330  if (dmbTrailer->tmb_starttimeout())
331  mo->Fill(2);
332  if (dmbTrailer->alct_endtimeout())
333  mo->Fill(8); // KK
334  if (dmbTrailer->tmb_endtimeout())
335  mo->Fill(9); // KK
336  }
337  for (int i = 0; i < nCFEBs; i++) {
338  if ((dmbTrailer->cfeb_starttimeout() >> i) & 0x1) {
339  mo->Fill(i + 3);
340  }
341  if ((dmbTrailer->cfeb_endtimeout() >> i) & 0x1) {
342  mo->Fill(i + 10); // KK 8->10
343  }
344  }
345  mo->SetEntries((int)DMBEvents);
346  }
347 
349  int alct_dav = dmbHeader->nalct();
350  int tmb_dav = dmbHeader->nclct();
351  int cfeb_dav2 = 0;
352  for (int i = 0; i < nCFEBs; i++)
353  cfeb_dav2 = cfeb_dav2 + (int)((dmbHeader->cfebAvailable() >> i) & 0x1);
354 
357  if ((alct_dav > 0) && (getCSCHisto(h::CSC_DMB_FEB_DAV_RATE, crateID, dmbID, mo))) {
358  mo->Fill(0.0);
359  float alct_dav_number = mo->GetBinContent(1);
360  if (getCSCHisto(h::CSC_DMB_FEB_DAV_EFFICIENCY, crateID, dmbID, mo)) {
361  mo->SetBinContent(1, ((float)alct_dav_number / (float)(DMBEvents) * 100.0));
362  mo->SetEntries((int)DMBEvents);
363  }
364  }
365 
366  if ((tmb_dav > 0) && (getCSCHisto(h::CSC_DMB_FEB_DAV_RATE, crateID, dmbID, mo))) {
367  mo->Fill(1.0);
368  float tmb_dav_number = mo->GetBinContent(2);
369  if (getCSCHisto(h::CSC_DMB_FEB_DAV_EFFICIENCY, crateID, dmbID, mo)) {
370  mo->SetBinContent(2, ((float)tmb_dav_number / (float)(DMBEvents) * 100.0));
371  mo->SetEntries((int)DMBEvents);
372  }
373  }
374 
375  if ((cfeb_dav2 > 0) && (getCSCHisto(h::CSC_DMB_FEB_DAV_RATE, crateID, dmbID, mo))) {
376  mo->Fill(2.0);
377  float cfeb_dav2_number = mo->GetBinContent(3);
378  if (getCSCHisto(h::CSC_DMB_FEB_DAV_EFFICIENCY, crateID, dmbID, mo)) {
379  mo->SetBinContent(3, ((float)cfeb_dav2_number / (float)(DMBEvents) * 100.0));
380  mo->SetEntries((int)DMBEvents);
381  }
382  }
383 
384  float feb_combination_dav = -1.0;
386  if (getCSCHisto(h::CSC_DMB_FEB_COMBINATIONS_DAV_RATE, crateID, dmbID, mo)) {
387  if (alct_dav == 0 && tmb_dav == 0 && cfeb_dav2 == 0)
388  feb_combination_dav = 0.0; // Nothing
389  if (alct_dav > 0 && tmb_dav == 0 && cfeb_dav2 == 0)
390  feb_combination_dav = 1.0; // ALCT Only
391  if (alct_dav == 0 && tmb_dav > 0 && cfeb_dav2 == 0)
392  feb_combination_dav = 2.0; // TMB Only
393  if (alct_dav == 0 && tmb_dav == 0 && cfeb_dav2 > 0)
394  feb_combination_dav = 3.0; // CFEB Only
395  if (alct_dav == 0 && tmb_dav > 0 && cfeb_dav2 > 0)
396  feb_combination_dav = 4.0; // TMB+CFEB
397  if (alct_dav > 0 && tmb_dav > 0 && cfeb_dav2 == 0)
398  feb_combination_dav = 5.0; // ALCT+TMB
399  if (alct_dav > 0 && tmb_dav == 0 && cfeb_dav2 > 0)
400  feb_combination_dav = 6.0; // ALCT+CFEB
401  if (alct_dav > 0 && tmb_dav > 0 && cfeb_dav2 > 0)
402  feb_combination_dav = 7.0; // ALCT+TMB+CFEB
403  mo->Fill(feb_combination_dav);
404  float feb_combination_dav_number = mo->GetBinContent((int)(feb_combination_dav + 1.0));
405  if (getCSCHisto(h::CSC_DMB_FEB_COMBINATIONS_DAV_EFFICIENCY, crateID, dmbID, mo)) {
406  mo->SetBinContent((int)(feb_combination_dav + 1.0),
407  ((float)feb_combination_dav_number / (float)(DMBEvents) * 100.0));
408  mo->SetEntries((int)DMBEvents);
409  }
410  }
411 
413  if (data.nalct()) {
414  const CSCALCTHeader* alctHeader = data.alctHeader();
415  const CSCALCTTrailer* alctTrailer = data.alctTrailer();
416  const CSCAnodeData* alctData = data.alctData();
417 
418  if (alctHeader && alctTrailer) {
419  int fwVersion = alctHeader->alctFirmwareVersion();
420  int fwRevision = alctHeader->alctFirmwareRevision();
424  if (fwRevision > 5)
425  mo->SetBinContent(cscPosition, cscType + 1, fwRevision);
426  }
427  std::vector<CSCALCTDigi> alctsDatasTmp = alctHeader->ALCTDigis();
428  std::vector<CSCALCTDigi> alctsDatas;
429 
430  for (uint32_t lct = 0; lct < alctsDatasTmp.size(); lct++) {
431  if (alctsDatasTmp[lct].isValid())
432  alctsDatas.push_back(alctsDatasTmp[lct]);
433  }
434 
435  FEBunpacked = FEBunpacked + 1;
436  alct_unpacked = 1;
437 
439  if (getCSCHisto(h::CSC_CSC_RATE, crateID, dmbID, mo)) {
440  mo->Fill(2);
441  uint32_t ALCTEvent = (uint32_t)mo->GetBinContent(3);
442  config->setChamberCounterValue(ALCT_TRIGGERS, crateID, dmbID, ALCTEvent);
443  if (getCSCHisto(h::CSC_CSC_EFFICIENCY, crateID, dmbID, mo)) {
444  if (config->getNEvents() > 0) {
447  mo->SetBinContent(1, ((float)ALCTEvent / (float)(DMBEvents) * 100.0));
449  mo->SetEntries((int)DMBEvents);
450  }
451  }
452  }
453 
454  if ((alct_dav > 0) && (getCSCHisto(h::CSC_DMB_FEB_UNPACKED_VS_DAV, crateID, dmbID, mo))) {
455  mo->Fill(0.0, 0.0);
456  }
457 
460  if (getCSCHisto(h::CSC_ALCT_L1A, crateID, dmbID, mo))
461  mo->Fill((int)(alctHeader->L1Acc()));
462 
464  if (getCSCHisto(h::CSC_ALCT_DMB_L1A_DIFF, crateID, dmbID, mo)) {
466  int alct_dmb_l1a_diff = (int)(alctHeader->L1Acc() % 64 - dmbHeader->l1a24() % 64);
467  if (alct_dmb_l1a_diff != 0)
468  L1A_out_of_sync = true;
469  if (alct_dmb_l1a_diff < -32)
470  mo->Fill(alct_dmb_l1a_diff + 64);
471  else {
472  if (alct_dmb_l1a_diff >= 32)
473  mo->Fill(alct_dmb_l1a_diff - 64);
474  else
475  mo->Fill(alct_dmb_l1a_diff);
476  }
477  mo->SetAxisRange(0.1, 1.1 * (1.0 + mo->GetBinContent(mo->GetMaximumBin())), "Y");
478  }
479 
481  if (getCSCHisto(h::CSC_DMB_L1A_VS_ALCT_L1A, crateID, dmbID, mo))
482  mo->Fill(alctHeader->L1Acc() % 256, dmbHeader->l1a24() % 256);
483 
486  if (getCSCHisto(h::CSC_ALCT_DMB_BXN_DIFF, crateID, dmbID, mo)) {
487  int alct_dmb_bxn_diff = (int)(alctHeader->BXNCount() - dmbHeader->bxn12());
488  if (alct_dmb_bxn_diff > 0)
489  alct_dmb_bxn_diff -= 3564;
490  alct_dmb_bxn_diff %= 32;
491  mo->Fill(alct_dmb_bxn_diff);
492  mo->SetAxisRange(0.1, 1.1 * (1.0 + mo->GetBinContent(mo->GetMaximumBin())), "Y");
493  }
494 
495  if (getCSCHisto(h::CSC_ALCT_BXN, crateID, dmbID, mo))
496  mo->Fill(alctHeader->BXNCount());
497 
499  if (getCSCHisto(h::CSC_ALCT_BXN_VS_DMB_BXN, crateID, dmbID, mo))
500  mo->Fill((int)((alctHeader->BXNCount()) % 256), (int)(dmbHeader->bxn12()) % 256);
501 
502  if (getCSCHisto(h::CSC_ALCT_NUMBER_RATE, crateID, dmbID, mo)) {
503  mo->Fill(alctsDatas.size());
504  int nALCT = (int)mo->GetBinContent((int)(alctsDatas.size() + 1));
505  if (getCSCHisto(h::CSC_ALCT_NUMBER_EFFICIENCY, crateID, dmbID, mo))
506  mo->SetBinContent((int)(alctsDatas.size() + 1), (float)(nALCT) / (float)(DMBEvents) * 100.0);
507  }
508 
509  if (getCSCHisto(h::CSC_ALCT_WORD_COUNT, crateID, dmbID, mo))
510  mo->Fill((int)(alctTrailer->wordCount()));
511 
514  if (alctsDatas.size() == 2) {
515  if (getCSCHisto(h::CSC_ALCT1_VS_ALCT0_KEYWG, crateID, dmbID, mo))
516  mo->Fill(alctsDatas[0].getKeyWG(), alctsDatas[1].getKeyWG());
517  }
518 
520  std::vector<CSCShowerDigi> alctShowers = alctHeader->alctShowerDigis();
521  for (unsigned bx = 0; bx < alctShowers.size(); bx++) {
522  if (getCSCHisto(h::CSC_RUN3_ALCT_HMT_BITS_VS_BX, crateID, dmbID, mo)) {
523  mo->Fill(alctShowers[bx].bitsInTime(), bx);
524  }
527  if (alctShowers[bx].isValid())
528  mo->Fill(cscPosition, cscType);
529  }
530  }
531 
532  MonitorObject* mo_CSC_ALCT0_BXN_mean = nullptr;
533  getEMUHisto(h::EMU_CSC_ALCT0_BXN_MEAN, mo_CSC_ALCT0_BXN_mean);
534 
535  MonitorObject* mo_CSC_ALCT0_BXN_rms = nullptr;
536  getEMUHisto(h::EMU_CSC_ALCT0_BXN_RMS, mo_CSC_ALCT0_BXN_rms);
537 
538  MonitorObject* mo_CSC_Plus_endcap_ALCT0_dTime = nullptr;
539  getEMUHisto(h::EMU_CSC_ALCT0_ENDCAP_PLUS_DTIME, mo_CSC_Plus_endcap_ALCT0_dTime);
540 
541  MonitorObject* mo_CSC_Minus_endcap_ALCT0_dTime = nullptr;
542  getEMUHisto(h::EMU_CSC_ALCT0_ENDCAP_MINUS_DTIME, mo_CSC_Minus_endcap_ALCT0_dTime);
543 
544  for (uint32_t lct = 0; lct < alctsDatas.size(); lct++) {
546  if (lct >= 2)
547  continue;
548 
549  if (getCSCHisto(h::CSC_ALCTXX_KEYWG, crateID, dmbID, lct, mo)) {
550  mo->Fill(alctsDatas[lct].getKeyWG());
551  }
552 
553  if (lct == 0)
554  alct_keywg = alctsDatas[lct].getKeyWG();
555 
556  int alct_dtime = 0;
557  if (fwVersion == 2007) {
558  alct_dtime = alctsDatas[lct].getBX();
559  } else {
560  // Older 2006 Format
561  alct_dtime = (int)(alctsDatas[lct].getBX() - (alctHeader->BXNCount() & 0x1F));
562  }
563 
564  // == Those two summary histos need to be outside of per-chamber CSC_ALCTXX_DTIME histo check.
565  // Otherwise will be empty in Offline DQM
566  if (lct == 0) {
567  if (cid.endcap() == 1) {
568  if (mo_CSC_Plus_endcap_ALCT0_dTime)
569  mo_CSC_Plus_endcap_ALCT0_dTime->Fill(alct_dtime);
570  }
571  if (cid.endcap() == 2) {
572  if (mo_CSC_Minus_endcap_ALCT0_dTime)
573  mo_CSC_Minus_endcap_ALCT0_dTime->Fill(alct_dtime);
574  }
575  }
576 
577  if (getCSCHisto(h::CSC_ALCTXX_DTIME, crateID, dmbID, lct, mo)) {
578  if (alct_dtime < -16) {
579  mo->Fill(alct_dtime + 32);
580  } else {
581  if (alct_dtime >= 16)
582  mo->Fill(alct_dtime - 32);
583  else
584  mo->Fill(alct_dtime);
585  }
586 
587  mo->SetAxisRange(0.1, 1.1 * (1.0 + mo->GetBinContent(mo->GetMaximumBin())), "Y");
588 
589  double dTime_mean = mo->getTH1()->GetMean();
590  double dTime_rms = mo->getTH1()->GetRMS();
591 
592  // == For ALCT0 Fill Summary dTime Histograms
593  if (lct == 0) {
594  if (cscPosition && mo_CSC_ALCT0_BXN_mean) {
595  mo_CSC_ALCT0_BXN_mean->SetBinContent(cscPosition, cscType + 1, dTime_mean);
596  }
597  if (cscPosition && mo_CSC_ALCT0_BXN_rms) {
598  mo_CSC_ALCT0_BXN_rms->SetBinContent(cscPosition, cscType + 1, dTime_rms);
599  }
600  }
601  }
602 
603  if (getCSCHisto(h::CSC_ALCTXX_DTIME_VS_KEYWG, crateID, dmbID, lct, mo)) {
604  if (alct_dtime < -16) {
605  mo->Fill(alctsDatas[lct].getKeyWG(), alct_dtime + 32);
606  } else {
607  if (alct_dtime >= 16)
608  mo->Fill(alctsDatas[lct].getKeyWG(), alct_dtime - 32);
609  else
610  mo->Fill(alctsDatas[lct].getKeyWG(), alct_dtime);
611  }
612  }
613 
614  if (getCSCHisto(h::CSC_ALCTXX_DTIME_PROFILE, crateID, dmbID, lct, mo)) {
615  if (alct_dtime < -16) {
616  mo->Fill(alctsDatas[lct].getKeyWG(), alct_dtime + 32);
617  } else {
618  if (alct_dtime >= 16)
619  mo->Fill(alctsDatas[lct].getKeyWG(), alct_dtime - 32);
620  else
621  mo->Fill(alctsDatas[lct].getKeyWG(), alct_dtime);
622  }
623  }
624 
625  int alct_bxn = alctsDatas[lct].getBX();
626  if (fwVersion == 2007) {
627  alct_bxn = (alct_bxn + alctHeader->BXNCount()) & 0x1F;
628  }
629 
630  if (getCSCHisto(h::CSC_ALCTXX_BXN, crateID, dmbID, lct, mo))
631  mo->Fill(alct_bxn);
632 
633  if (getCSCHisto(h::CSC_ALCTXX_QUALITY, crateID, dmbID, lct, mo))
634  mo->Fill(alctsDatas[lct].getKeyWG(), alctsDatas[lct].getQuality());
635 
636  if (mo_EventDisplay) {
637  mo_EventDisplay->SetBinContent(2, alctsDatas[lct].getKeyWG(), alct_bxn + 1);
638  mo_EventDisplay->SetBinContent(3, alctsDatas[lct].getKeyWG(), alctsDatas[lct].getQuality());
639  }
640 
641  if (getCSCHisto(h::CSC_ALCTXX_QUALITY_DISTR, crateID, dmbID, lct, mo)) {
642  mo->Fill(alctsDatas[lct].getQuality());
643  if (lct == 0) {
644  MonitorObject* mo1 = nullptr;
645  if (cscPosition && getEMUHisto(h::EMU_CSC_ALCT0_QUALITY, mo1)) {
646  mo1->SetBinContent(cscPosition, cscType + 1, mo->getTH1()->GetMean());
647  }
648  }
649  }
650 
651  if (getCSCHisto(h::CSC_ALCTXX_QUALITY_PROFILE, crateID, dmbID, lct, mo))
652  mo->Fill(alctsDatas[lct].getKeyWG(), alctsDatas[lct].getQuality());
653 
654  if (getCSCHisto(h::CSC_ALCTXX_PATTERN, crateID, dmbID, lct, mo)) {
655  int pattern = (alctsDatas[lct].getAccelerator() << 1) + alctsDatas[lct].getCollisionB();
656  int keywg = alctsDatas[lct].getKeyWG();
657  mo->Fill(keywg, pattern);
658  }
659 
660  if (getCSCHisto(h::CSC_ALCTXX_PATTERN_DISTR, crateID, dmbID, lct, mo)) {
661  int pattern = (alctsDatas[lct].getAccelerator() << 1) + alctsDatas[lct].getCollisionB();
662  mo->Fill(pattern);
663  }
664  }
665 
666  int NumberOfLayersWithHitsInALCT = 0;
667  int NumberOfWireGroupsWithHitsInALCT = 0;
668 
669  if (alctData) {
670  MonitorObject* mo_AFEB_RawHits_TimeBins = nullptr;
671  getCSCHisto(h::CSC_CFEB_AFEB_RAWHITS_TIMEBINS, crateID, dmbID, mo_AFEB_RawHits_TimeBins);
672 
673  MonitorObject* mo_CSC_Plus_endcap_AFEB_RawHits_Time = nullptr;
674  getEMUHisto(h::EMU_CSC_AFEB_ENDCAP_PLUS_RAWHITS_TIME, mo_CSC_Plus_endcap_AFEB_RawHits_Time);
675 
676  MonitorObject* mo_CSC_Minus_endcap_AFEB_RawHits_Time = nullptr;
677  getEMUHisto(h::EMU_CSC_AFEB_ENDCAP_MINUS_RAWHITS_TIME, mo_CSC_Minus_endcap_AFEB_RawHits_Time);
678 
679  MonitorObject* mo_CSC_AFEB_RawHits_Time_mean = nullptr;
680  getEMUHisto(h::EMU_CSC_AFEB_RAWHITS_TIME_MEAN, mo_CSC_AFEB_RawHits_Time_mean);
681 
682  MonitorObject* mo_CSC_AFEB_RawHits_Time_rms = nullptr;
683  getEMUHisto(h::EMU_CSC_AFEB_RAWHITS_TIME_RMS, mo_CSC_AFEB_RawHits_Time_rms);
684 
685  for (int nLayer = 1; nLayer <= 6; nLayer++) {
686  int wg_previous = -1;
687  int tbin_previous = -1;
688  bool CheckLayerALCT = true;
689 
690  std::vector<CSCWireDigi> wireDigis = alctData->wireDigis(nLayer);
691  for (std::vector<CSCWireDigi>::iterator wireDigisItr = wireDigis.begin(); wireDigisItr != wireDigis.end();
692  ++wireDigisItr) {
693  int wg = wireDigisItr->getWireGroup();
694  std::vector<int> tbins = wireDigisItr->getTimeBinsOn();
695  int tbin = wireDigisItr->getTimeBin();
696 
697  if (mo_EventDisplay) {
698  mo_EventDisplay->SetBinContent(nLayer + 3, wg - 1, tbin + 1);
699  setEmuEventDisplayBit(mo_Emu_EventDisplay_Anode, glChamberIndex, wg - 1, nLayer - 1);
700  setEmuEventDisplayBit(mo_Emu_EventDisplay_XY, glChamberIndex, wg - 1, nLayer - 1);
701  }
702 
703  if (CheckLayerALCT) {
704  NumberOfLayersWithHitsInALCT = NumberOfLayersWithHitsInALCT + 1;
705  CheckLayerALCT = false;
706  }
707 
708  for (uint32_t n = 0; n < tbins.size(); n++) {
709  tbin = tbins[n];
710  if (wg != wg_previous || (tbin != tbin_previous + 1 && tbin != tbin_previous - 1)) {
711  if (getCSCHisto(h::CSC_ALCTTIME_LYXX, crateID, dmbID, nLayer, mo))
712  mo->Fill(wg - 1, tbin);
713 
714  if (getCSCHisto(h::CSC_ALCTTIME_LYXX_PROFILE, crateID, dmbID, nLayer, mo))
715  mo->Fill(wg - 1, tbin);
716 
717  if (mo_AFEB_RawHits_TimeBins)
718  mo_AFEB_RawHits_TimeBins->Fill(tbin);
719 
720  if (cid.endcap() == 1) {
721  if (mo_CSC_Plus_endcap_AFEB_RawHits_Time)
722  mo_CSC_Plus_endcap_AFEB_RawHits_Time->Fill(tbin);
723  }
724  if (cid.endcap() == 2) {
725  if (mo_CSC_Minus_endcap_AFEB_RawHits_Time)
726  mo_CSC_Minus_endcap_AFEB_RawHits_Time->Fill(tbin);
727  }
728 
729  if (getCSCHisto(h::CSC_ALCT_LYXX_RATE, crateID, dmbID, nLayer, mo)) {
730  mo->Fill(wg - 1);
731  int number_wg = (int)(mo->GetBinContent(wg));
732  Double_t Number_of_entries_ALCT = mo->GetEntries();
733  if (getCSCHisto(h::CSC_ALCT_LYXX_EFFICIENCY, crateID, dmbID, nLayer, mo)) {
734  mo->SetBinContent(wg, ((float)number_wg));
735  if ((Double_t)(DMBEvents) > 0.0) {
736  mo->SetNormFactor(100.0 * Number_of_entries_ALCT / (Double_t)(DMBEvents));
737  } else {
738  mo->SetNormFactor(100.0);
739  }
740  mo->SetEntries((int)DMBEvents);
741  }
742  }
743  }
744  if (wg != wg_previous) {
745  NumberOfWireGroupsWithHitsInALCT = NumberOfWireGroupsWithHitsInALCT + 1;
746  }
747 
748  wg_previous = wg;
749  tbin_previous = tbin;
750  }
751  }
752 
753  // Fill Summary Anode Raw Hits Timing Plots
754  if (mo_AFEB_RawHits_TimeBins) {
755  double rawhits_time_mean = mo_AFEB_RawHits_TimeBins->getTH1()->GetMean();
756  double rawhits_time_rms = mo_AFEB_RawHits_TimeBins->getTH1()->GetRMS();
757 
758  if (cscPosition && mo_CSC_AFEB_RawHits_Time_mean) {
759  mo_CSC_AFEB_RawHits_Time_mean->SetBinContent(cscPosition, cscType + 1, rawhits_time_mean);
760  }
761 
762  if (cscPosition && mo_CSC_AFEB_RawHits_Time_rms) {
763  mo_CSC_AFEB_RawHits_Time_rms->SetBinContent(cscPosition, cscType + 1, rawhits_time_rms);
764  }
765  }
766  }
767 
768  } else {
769  LOG_ERROR << cscTag << " Can not unpack Anode Data";
770  }
771 
772  if (getCSCHisto(h::CSC_ALCT_NUMBER_OF_LAYERS_WITH_HITS, crateID, dmbID, mo)) {
773  mo->Fill(NumberOfLayersWithHitsInALCT);
774  MonitorObject* mo1 = nullptr;
775  if (cscPosition && getEMUHisto(h::EMU_CSC_ALCT_PLANES_WITH_HITS, mo1)) {
776  mo1->SetBinContent(cscPosition, cscType + 1, mo->getTH1()->GetMean());
777  }
778  }
779 
781  mo->Fill(NumberOfWireGroupsWithHitsInALCT);
782 
783  } else {
784  LOG_ERROR << cscTag << " Can not unpack ALCT Header or/and Trailer";
785  }
786  } else {
789  if (getCSCHisto(h::CSC_ALCT_NUMBER_RATE, crateID, dmbID, mo)) {
790  mo->Fill(0);
791  int nALCT = (int)mo->GetBinContent(1);
792  if (getCSCHisto(h::CSC_ALCT_NUMBER_EFFICIENCY, crateID, dmbID, mo))
793  mo->SetBinContent(1, (float)(nALCT) / (float)(DMBEvents) * 100.0);
794  }
795 
796  if ((alct_dav > 0) && (getCSCHisto(h::CSC_DMB_FEB_UNPACKED_VS_DAV, crateID, dmbID, mo))) {
797  mo->Fill(0.0, 1.0);
798  }
799  }
800 
802  if (data.nclct() && data.nalct()) {
803  CSCALCTHeader* alctHeader = data.alctHeader();
804 
805  if (alctHeader) {
806  std::vector<CSCALCTDigi> alctsDatasTmp = alctHeader->ALCTDigis();
807  std::vector<CSCALCTDigi> alctsDatas;
808 
809  for (uint32_t lct = 0; lct < alctsDatasTmp.size(); lct++) {
810  if (alctsDatasTmp[lct].isValid())
811  alctsDatas.push_back(alctsDatasTmp[lct]);
812  }
813 
814  CSCTMBData* tmbData = data.tmbData();
815  if (tmbData) {
816  CSCTMBHeader* tmbHeader = tmbData->tmbHeader();
817  if (tmbHeader) {
818  if (getCSCHisto(h::CSC_TMB_BXN_VS_ALCT_BXN, crateID, dmbID, mo))
819  mo->Fill(((int)(alctHeader->BXNCount())) % 256, ((int)(tmbHeader->BXNCount())) % 256);
820 
821  if (getCSCHisto(h::CSC_TMB_ALCT_BXN_DIFF, crateID, dmbID, mo)) {
822  int clct_alct_bxn_diff = (int)(alctHeader->BXNCount() - tmbHeader->BXNCount());
823  if (clct_alct_bxn_diff < -2048)
824  mo->Fill(clct_alct_bxn_diff + 4096);
825  else {
826  if (clct_alct_bxn_diff > 2048)
827  mo->Fill(clct_alct_bxn_diff - 4096);
828  else
829  mo->Fill(clct_alct_bxn_diff);
830  }
831  mo->SetAxisRange(0.1, 1.1 * (1.0 + mo->GetBinContent(mo->GetMaximumBin())), "Y");
832  }
833 
834  if (getCSCHisto(h::CSC_TMB_L1A_VS_ALCT_L1A, crateID, dmbID, mo))
835  mo->Fill((int)(alctHeader->L1Acc() % 256), (int)(tmbHeader->L1ANumber() % 256));
836 
837  if (getCSCHisto(h::CSC_TMB_ALCT_L1A_DIFF, crateID, dmbID, mo)) {
838  int clct_alct_l1a_diff = (int)(tmbHeader->L1ANumber() - alctHeader->L1Acc());
839  if (clct_alct_l1a_diff < -2048)
840  mo->Fill(clct_alct_l1a_diff + 4096);
841  else {
842  if (clct_alct_l1a_diff > 2048)
843  mo->Fill(clct_alct_l1a_diff - 4096);
844  else
845  mo->Fill(clct_alct_l1a_diff);
846  }
847  mo->SetAxisRange(0.1, 1.1 * (1.0 + mo->GetBinContent(mo->GetMaximumBin())), "Y");
848  }
849  } else {
850  LOG_ERROR << cscTag << " Can not unpack TMB Header";
851  }
852 
853  } else {
854  LOG_ERROR << cscTag << " Can not unpack TMB Data";
855  }
856  } else {
857  LOG_ERROR << cscTag << " Can not unpack ALCT Header";
858  }
859  }
860 
862  if (data.nclct()) {
865  CSCTMBData* tmbData = data.tmbData();
866  if (tmbData) {
867  CSCTMBHeader* tmbHeader = tmbData->tmbHeader();
868  CSCTMBTrailer* tmbTrailer = tmbData->tmbTrailer();
869 
870  if (tmbHeader && tmbTrailer) {
871  bool isRun3_df = false;
872  bool isGEM_df = false;
873  bool isTMB_hybrid_df = false;
874  if (tmbHeader->FirmwareVersion() == 2020) {
875  // revision code major part: 0x0 - Run3 df, 0x1 - is legacy Run2 df
876  if (((tmbHeader->FirmwareRevision() >> 5) & 0xF) == 0x0)
877  isRun3_df = true;
878  if (((tmbHeader->FirmwareRevision() >> 9) & 0xF) == 0x3)
879  isGEM_df = true;
880  if (((tmbHeader->FirmwareRevision() >> 9) & 0xF) == 0x4)
881  isTMB_hybrid_df = true;
883  if ((isTMB_hybrid_df || isRun3_df) && getEMUHisto(h::EMU_CSC_TMB_RUN3_DATA_FORMAT, mo)) {
884  mo->SetBinContent(cscPosition, cscType + 1, 1);
885  }
886  }
887 
888  if (tmbHeader->FirmwareVersion() == 2020) {
889  if (isRun3_df) {
892  if (tmbHeader->clct0_ComparatorCode() > 0)
893  mo->SetBinContent(cscPosition, cscType + 1, 1);
894  }
895 
896  if (isGEM_df) {
897  if (getCSCHisto(h::CSC_GEM_FIBERS_STATUS, crateID, dmbID, mo)) {
898  int gem_fibers = tmbHeader->gem_enabled_fibers();
899  for (unsigned i = 0; i < 4; i++) {
900  if ((gem_fibers >> i) & 0x1)
901  mo->Fill(i);
902  }
903  }
904  uint16_t gem_sync_status = tmbHeader->gem_sync_dataword();
905  if (getCSCHisto(h::CSC_GEM_SYNC_STATUS, crateID, dmbID, mo)) {
906  for (int i = 0; i < 15; i++) {
907  if ((gem_sync_status >> i) & 0x1)
908  mo->Fill(i);
909  }
910  }
911  uint16_t gem_timing_status = tmbHeader->gem_timing_dataword();
912  if (getCSCHisto(h::CSC_GEM_NUM_COPADS, crateID, dmbID, mo)) {
913  // For GEM firmware after rev0. 4-bits num_copad
914  mo->Fill(gem_timing_status & 0xF);
915  }
916 
917  if (tmbData->hasGEM()) {
918  CSCGEMData* gemData = tmbData->gemData();
919  if (gemData != nullptr) {
920  bool isGEM_hits_found = false;
921  std::vector<CSCCorrelatedLCTDigi> corr_lctsDatasTmp = tmbHeader->CorrelatedLCTDigis(cid.rawId());
922  for (int i = 0; i < gemData->numGEMs(); i++) {
923  std::vector<GEMPadDigiCluster> gemDigis = gemData->digis(i);
924  if (getCSCHisto(h::CSC_GEM_NUM_CLUSTERS, crateID, dmbID, mo)) {
925  mo->Fill(gemDigis.size());
926  }
927 
928  if (!gemDigis.empty()) {
929  isGEM_hits_found = true;
930  for (unsigned digi = 0; digi < gemDigis.size(); digi++) {
931  if (gemDigis[digi].isValid()) {
932  std::vector<uint16_t> pads_hits = gemDigis[digi].pads();
933  int hits_timebin = gemDigis[digi].bx();
935  crateID,
936  dmbID,
937  mo)) {
938  mo->Fill(pads_hits.size());
939  }
940  if (!pads_hits.empty()) {
943  crateID,
944  dmbID,
945  mo)) {
946  // int npad = (7 - (pads_hits[0] / 192)) * 192 + pads_hits[0] % 192;
947  int npad = pads_hits[0]; // no eta recode
948  mo->Fill(npad, pads_hits.size());
949  }
950 
951  if (getCSCHisto(
953  crateID,
954  dmbID,
955  mo)) {
956  mo->Fill(hits_timebin);
957  }
958 
960  if ((cid.endcap() == 1) && getEMUHisto(h::EMU_GEM_PLUS_ENDCAP_VFAT_OCCUPANCY, mo)) {
961  int vfat = (pads_hits[0] / 192) + ((pads_hits[0] % 192) / 64) * 8;
962  mo->Fill((cscPosition) * 2 + i - 1, vfat);
963  }
964 
965  if ((cid.endcap() == 2) && getEMUHisto(h::EMU_GEM_MINUS_ENDCAP_VFAT_OCCUPANCY, mo)) {
966  int vfat = (pads_hits[0] / 192) + ((pads_hits[0] % 192) / 64) * 8;
967  mo->Fill((cscPosition) * 2 + i - 1, vfat);
968  }
969 
970  for (unsigned pad = 0; pad < pads_hits.size(); pad++) {
971  // int npad = (7 - (pads_hits[pad] / 192)) * 192 + pads_hits[pad] % 192;
972  int npad = pads_hits[pad]; // no eta recode
973  if (getCSCHisto(
974  ((i == 0) ? h::CSC_GEM_GEMA_HITS : h::CSC_GEM_GEMB_HITS), crateID, dmbID, mo)) {
975  mo->Fill(npad);
976  }
977 
978  if (getCSCHisto(
980  crateID,
981  dmbID,
982  mo)) {
983  mo->Fill(npad, hits_timebin);
984  }
987  crateID,
988  dmbID,
989  mo)) {
990  mo->Fill(npad, hits_timebin);
991  }
992 
995  crateID,
996  dmbID,
997  mo)) {
998  int vfat = (pads_hits[0] / 192) + ((pads_hits[0] % 192) / 64) * 8;
999  mo->Fill(vfat, hits_timebin);
1000  }
1003  crateID,
1004  dmbID,
1005  mo)) {
1006  int vfat = (pads_hits[0] / 192) + ((pads_hits[0] % 192) / 64) * 8;
1007  mo->Fill(vfat, hits_timebin);
1008  }
1009  }
1010  } // pads_hits.size() > 0
1011  }
1012  }
1013  }
1014  for (unsigned ieta = 0; ieta < 8; ieta++) {
1015  std::vector<GEMPadDigiCluster> gemEtaDigis =
1016  gemData->etaDigis(i, ieta, tmbHeader->ALCTMatchTime());
1017  if (!gemEtaDigis.empty()) {
1018  for (unsigned digi = 0; digi < gemEtaDigis.size(); digi++) {
1019  if (gemEtaDigis[digi].isValid()) {
1020  std::vector<uint16_t> pads_hits = gemEtaDigis[digi].pads();
1021  for (unsigned pad = 0; pad < pads_hits.size(); pad++) {
1022  if (getCSCHisto(
1024  crateID,
1025  dmbID,
1026  mo)) {
1027  mo->Fill(pads_hits[pad], 7 - ieta);
1028  }
1029  }
1030  }
1031  }
1032  }
1033  }
1034  }
1035  if (isGEM_hits_found) {
1036  if (getCSCHisto(h::CSC_GEM_ALCT_MATCH, crateID, dmbID, mo)) {
1037  mo->Fill((gem_timing_status >> 12) & 0x7);
1038  }
1039  if (getCSCHisto(h::CSC_GEM_CLCT_MATCH, crateID, dmbID, mo)) {
1040  mo->Fill((gem_timing_status >> 8) & 0xF);
1041  }
1042  }
1043  }
1044  } // OTMB hasGEM
1045  } // isGEM_df
1046 
1049  if (tmbHeader->alctHMT() > 0)
1050  mo->Fill(cscPosition, cscType);
1051  }
1052 
1055  if (tmbHeader->clctHMT() > 0)
1056  mo->Fill(cscPosition, cscType);
1057  }
1058 
1059  if (getCSCHisto(h::CSC_CLCT_RUN3_HMT_NHITS, crateID, dmbID, mo)) {
1060  mo->Fill(tmbHeader->hmt_nhits());
1061  }
1062 
1063  if (getCSCHisto(h::CSC_RUN3_CLCT_ALCT_HMT, crateID, dmbID, mo)) {
1064  mo->Fill(tmbHeader->clctHMT());
1065  mo->Fill(tmbHeader->alctHMT() + 4);
1066  }
1067 
1068  if (getCSCHisto(h::CSC_RUN3_CLCT_VS_ALCT_HMT_BITS, crateID, dmbID, mo)) {
1069  mo->Fill(tmbHeader->clctHMT(), tmbHeader->alctHMT());
1070  }
1071 
1072  if (getCSCHisto(h::CSC_CORR_LCT_RUN3_PATTERN_ID, crateID, dmbID, mo)) {
1073  mo->Fill(tmbHeader->run3_CLCT_patternID());
1074  }
1075  }
1076  /*
1077  LOG_DEBUG << "OTMB dump: " << "CLCT0_ComparatorCode: 0x" << std::hex << tmbHeader->CLCT0_ComparatorCode()
1078  << ", CLCT0_xky: 0x" << std::hex << tmbHeader->CLCT0_xky()
1079  << ", CLCT1_ComparatorCode: 0x" << std::hex << tmbHeader->CLCT1_ComparatorCode()
1080  << ", CLCT1_xky: 0x" << std::hex << tmbHeader->CLCT1_xky()
1081  << ", GEM_sync_dataword: 0x" << std::hex << tmbHeader->GEM_sync_dataword()
1082  << ", GEM_timing_dataword: 0x" << std::hex << tmbHeader->GEM_timing_dataword()
1083  << ",\n HMT_nhits: 0x" << std::hex << tmbHeader->HMT_nhits()
1084  << ", GEM_enabled_fibers: 0x" << std::hex << tmbHeader->GEM_enabled_fibers()
1085  << ", GEM_fifo_tbins: " << std::dec << tmbHeader->GEM_fifo_tbins()
1086  << ", GEM_fifo_pretrig: " << std::dec << tmbHeader->GEM_fifo_pretrig()
1087  << ", GEM_zero_suppression: " << std::dec << tmbHeader->GEM_zero_suppress();
1088 */
1089  }
1090  CSCComparatorData* comparatorData = data.comparatorData();
1091 
1092  std::vector<CSCCLCTDigi> clctsDatasTmp = tmbHeader->CLCTDigis(cid.rawId());
1093  std::vector<CSCCLCTDigi> clctsDatas;
1094 
1095  for (uint32_t lct = 0; lct < clctsDatasTmp.size(); lct++) {
1096  if (clctsDatasTmp[lct].isValid()) {
1097  clctsDatas.push_back(clctsDatasTmp[lct]);
1098  if (clctsDatasTmp[lct].isRun3()) {
1099  if ((lct == 0) && getCSCHisto(h::CSC_CLCTXX_KEY_STRIP_TYPE, crateID, dmbID, lct, mo))
1100  mo->Fill(tmbHeader->clct0_xky());
1101  if ((lct == 1) && getCSCHisto(h::CSC_CLCTXX_KEY_STRIP_TYPE, crateID, dmbID, lct, mo))
1102  mo->Fill(tmbHeader->clct1_xky());
1103  }
1104  }
1105  }
1106 
1107  for (uint32_t lct = 0; lct < clctsDatas.size(); lct++) {
1108  /*
1109  LOG_DEBUG << "CLCT Digis dump: "
1110  << "CLCT" << lct << " isRun3:" << clctsDatasTmp[lct].isRun3()
1111  << ", isValid: " << clctsDatasTmp[lct].isValid()
1112  << ", getCFEB: " << clctsDatasTmp[lct].getCFEB()
1113  << ", getKeyStrip: " << clctsDatasTmp[lct].getKeyStrip()
1114  << ", getFractionalStrip: " << clctsDatasTmp[lct].getFractionalStrip()
1115  << ", getQuartStrip: " << clctsDatasTmp[lct].getQuartStripBit()
1116  << ", getEightStrip: " << clctsDatasTmp[lct].getEightStripBit()
1117  << ",\n getCompCode: 0x" << std::hex << clctsDatasTmp[lct].getCompCode()
1118  << ", getQuality: " << clctsDatasTmp[lct].getQuality() << std::dec
1119  << ", getPattern: " << clctsDatasTmp[lct].getPattern() << std::dec
1120  << ", getBend: " << clctsDatasTmp[lct].getBend() << std::dec
1121  << ", getSlope: " << clctsDatasTmp[lct].getSlope() << std::dec
1122  << ", getFractionalSlope: " << clctsDatasTmp[lct].getFractionalSlope()
1123  << ", getBX: " << clctsDatasTmp[lct].getBX()
1124  << ", getRun3Pattern: 0x" << std::hex << clctsDatasTmp[lct].getRun3Pattern()
1125  << std::dec;
1126 */
1127  if (clctsDatas[lct].isRun3()) {
1128  if (getCSCHisto(h::CSC_CLCTXX_COMPARATOR_CODE, crateID, dmbID, lct, mo)) {
1129  mo->Fill(clctsDatas[lct].getCompCode());
1130  }
1131  if (getCSCHisto(h::CSC_CLCTXX_RUN3_TO_RUN2_PATTERN, crateID, dmbID, lct, mo)) {
1132  int bend = clctsDatas[lct].getSlope() + ((clctsDatas[lct].getBend() & 0x1) << 4);
1133  mo->Fill(bend, clctsDatas[lct].getPattern());
1134  }
1135  if (getCSCHisto(h::CSC_CLCTXX_RUN3_BEND_VS_SLOPE, crateID, dmbID, lct, mo)) {
1136  mo->Fill(clctsDatas[lct].getSlope(), clctsDatas[lct].getBend());
1137  }
1138  }
1139  }
1140 
1142  std::vector<CSCCorrelatedLCTDigi> corr_lctsDatasTmp = tmbHeader->CorrelatedLCTDigis(cid.rawId());
1143  std::vector<CSCCorrelatedLCTDigi> corr_lctsDatas;
1144 
1145  for (uint32_t lct = 0; lct < corr_lctsDatasTmp.size(); lct++) {
1146  if (corr_lctsDatasTmp[lct].isValid()) {
1147  corr_lctsDatas.push_back(corr_lctsDatasTmp[lct]);
1148  }
1149 
1150  if (isGEM_df) {
1151  uint16_t gem_sync_status = tmbHeader->gem_sync_dataword();
1152 
1153  for (unsigned i = lct * 4; i < (lct * 4 + 4); i++) {
1154  if ((gem_sync_status >> i) & 0x1) {
1155  if (corr_lctsDatasTmp[lct].isValid()) {
1156  if (getCSCHisto(h::CSC_GEM_LCT_SYNC_STATUS, crateID, dmbID, mo)) {
1157  mo->Fill(lct, i); // Fill for valid LCT
1158  }
1159  }
1160  }
1161  }
1162  }
1163 
1164  if (getCSCHisto(h::CSC_CORR_LCT_CLCT_COMBINATION, crateID, dmbID, mo)) {
1165  mo->Fill(clctsDatasTmp[lct].isValid() * 2 + lct, corr_lctsDatasTmp[lct].isValid() * 2 + lct);
1166  }
1167 
1168  if (lct == 0) {
1169  if (corr_lctsDatasTmp[lct].isRun3() || isTMB_hybrid_df) {
1172  if (corr_lctsDatasTmp[lct].getHMT() > 0)
1173  mo->Fill(cscPosition, cscType);
1174  }
1175  if (getCSCHisto(h::CSC_RUN3_HMT_DISTRIBUTION, crateID, dmbID, mo)) {
1176  mo->Fill(corr_lctsDatasTmp[lct].getHMT());
1177  }
1178  if (getCSCHisto(h::CSC_CLCT_RUN3_HMT_NHITS_VS_HMT_BITS, crateID, dmbID, mo)) {
1179  mo->Fill(tmbHeader->hmt_nhits(),
1180  (corr_lctsDatasTmp[lct].getHMT() & 0x3)); // in-time Hadronic shower bits
1181  mo->Fill(tmbHeader->hmt_nhits(),
1182  ((corr_lctsDatasTmp[lct].getHMT() >> 2) & 0x3) + 4); // out-of-time Hadronic shower bits
1183  }
1184  if (getCSCHisto(h::CSC_RUN3_HMT_COINCIDENCE_MATCH, crateID, dmbID, mo)) {
1185  if ((corr_lctsDatasTmp[lct].getHMT() > 0) && (corr_lctsDatasTmp[lct].getHMT() <= 0xF)) {
1186  mo->Fill(0); // Run3 HMT is fired
1187  if ((!clctsDatasTmp.empty()) && clctsDatasTmp[lct].isValid()) {
1188  mo->Fill(2); // Run3 HMT+CLCT match
1189  }
1190  if (corr_lctsDatasTmp[lct].isValid()) {
1191  mo->Fill(3); // Run3 HMT+LCT match
1192  }
1193  }
1194  }
1195  if (getCSCHisto(h::CSC_RUN3_HMT_ALCT_MATCH, crateID, dmbID, mo)) {
1196  if ((corr_lctsDatasTmp[lct].getHMT() > 0) && (corr_lctsDatasTmp[lct].getHMT() <= 0xF)) {
1197  mo->Fill(tmbHeader->hmt_ALCTMatchTime());
1198  }
1199  }
1200  if (getCSCHisto(h::CSC_RUN3_HMT_HADRONIC_SHOWER, crateID, dmbID, mo)) {
1201  mo->Fill(corr_lctsDatasTmp[lct].getHMT() & 0x3); // in-time Hadronic shower bits
1202  mo->Fill(((corr_lctsDatasTmp[lct].getHMT() >> 2) & 0x3) + 4); // out-of-time Hadronic shower bits
1203  }
1204  }
1205  }
1206  }
1207 
1208  if (clctsDatasTmp[0].isValid() && corr_lctsDatasTmp[0].isValid() &&
1209  getCSCHisto(h::CSC_CORR_LCT0_VS_CLCT0_KEY_STRIP, crateID, dmbID, mo)) {
1210  mo->Fill(clctsDatasTmp[0].getKeyStrip(), corr_lctsDatasTmp[0].getStrip());
1211  }
1212 
1213  if (clctsDatasTmp[1].isValid() && corr_lctsDatasTmp[1].isValid() &&
1214  getCSCHisto(h::CSC_CORR_LCT1_VS_CLCT1_KEY_STRIP, crateID, dmbID, mo)) {
1215  mo->Fill(clctsDatasTmp[1].getKeyStrip(), corr_lctsDatasTmp[1].getStrip());
1216  }
1217 
1218  if (!corr_lctsDatas.empty()) {
1219  if (corr_lctsDatasTmp[0].isRun3()) {
1220  if (getCSCHisto(h::CSC_CORR_LCT0_VS_LCT1_RUN3_PATTERN, crateID, dmbID, mo)) {
1221  int lct1_pattern = corr_lctsDatasTmp[1].getRun3Pattern();
1222  if (!corr_lctsDatasTmp[1].isValid())
1223  lct1_pattern = -1;
1224  mo->Fill(corr_lctsDatasTmp[0].getRun3Pattern(), lct1_pattern);
1225  }
1226  }
1227  }
1228 
1229  for (uint32_t lct = 0; lct < corr_lctsDatas.size(); lct++) {
1230  /*
1231  LOG_DEBUG << "CorrelatedLCT Digis dump: "
1232  << "CorrLCT" << lct << " isRun3:" << corr_lctsDatasTmp[lct].isRun3()
1233  << ", isValid: " << corr_lctsDatasTmp[lct].isValid()
1234  << ", getStrip: " << corr_lctsDatasTmp[lct].getStrip()
1235  << ", getKeyWG: " << corr_lctsDatasTmp[lct].getKeyWG()
1236  << ", getQuality: " << corr_lctsDatasTmp[lct].getQuality()
1237  << ", getFractionalStrip: " << corr_lctsDatasTmp[lct].getFractionalStrip()
1238  << ", getQuartStrip: " << corr_lctsDatasTmp[lct].getQuartStripBit()
1239  << ", getEightStrip: " << corr_lctsDatasTmp[lct].getEightStripBit()
1240  << ",\n getSlope: " << corr_lctsDatasTmp[lct].getSlope() << std::dec
1241  << ", getBend: " << corr_lctsDatasTmp[lct].getBend()
1242  << ", getBX: " << corr_lctsDatasTmp[lct].getBX()
1243  << ", getPattern: 0x" << std::hex << corr_lctsDatasTmp[lct].getPattern()
1244  << ", getRun3Pattern: 0x" << std::hex << corr_lctsDatasTmp[lct].getRun3Pattern()
1245  // << ", getRun3PatternID: " << std::dec << corr_lctsDatasTmp[lct].getRun3PatternID()
1246  << ", getHMT: " << corr_lctsDatasTmp[lct].getHMT()
1247  << std::dec;
1248 */
1249  if (getCSCHisto(h::CSC_CORR_LCTXX_HITS_DISTRIBUTION, crateID, dmbID, lct, mo)) {
1250  mo->Fill(corr_lctsDatas[lct].getStrip(), corr_lctsDatas[lct].getKeyWG());
1251  }
1252 
1253  if (getCSCHisto(h::CSC_CORR_LCTXX_KEY_WG, crateID, dmbID, lct, mo)) {
1254  mo->Fill(corr_lctsDatas[lct].getKeyWG());
1255  }
1256 
1257  if (getCSCHisto(h::CSC_CORR_LCTXX_KEY_HALFSTRIP, crateID, dmbID, lct, mo)) {
1258  mo->Fill(corr_lctsDatas[lct].getStrip(2));
1259  }
1260 
1261  if (corr_lctsDatas[lct].isRun3()) {
1262  if (getCSCHisto(h::CSC_CORR_LCTXX_KEY_QUARTSTRIP, crateID, dmbID, lct, mo)) {
1263  mo->Fill(corr_lctsDatas[lct].getStrip(4));
1264  }
1265 
1266  if (getCSCHisto(h::CSC_CORR_LCTXX_KEY_EIGHTSTRIP, crateID, dmbID, lct, mo)) {
1267  mo->Fill(corr_lctsDatas[lct].getStrip(8));
1268  }
1269 
1270  if (getCSCHisto(h::CSC_CORR_LCTXX_RUN3_TO_RUN2_PATTERN, crateID, dmbID, lct, mo)) {
1271  int bend = corr_lctsDatas[lct].getSlope() + ((corr_lctsDatas[lct].getBend() & 0x1) << 4);
1272  mo->Fill(bend, corr_lctsDatas[lct].getPattern());
1273  }
1274 
1275  if (getCSCHisto(h::CSC_CORR_LCTXX_BEND_VS_SLOPE, crateID, dmbID, lct, mo)) {
1276  mo->Fill(corr_lctsDatas[lct].getSlope(), corr_lctsDatas[lct].getBend());
1277  }
1278 
1279  if (getCSCHisto(h::CSC_CORR_LCTXX_KEY_STRIP_TYPE, crateID, dmbID, lct, mo)) {
1280  int strip_type =
1281  (corr_lctsDatas[lct].getQuartStripBit() << 1) + (corr_lctsDatas[lct].getEighthStripBit());
1282  mo->Fill(strip_type);
1283  }
1284 
1285  if ((cid.station() == 1) && (cid.ring() == 1)) {
1286  if (getCSCHisto(h::CSC_CORR_LCTXX_RUN3_ME11_QUALITY, crateID, dmbID, lct, mo)) {
1287  mo->Fill(corr_lctsDatas[lct].getQuality());
1288  }
1289  } else {
1290  if (getCSCHisto(h::CSC_CORR_LCTXX_RUN3_QUALITY, crateID, dmbID, lct, mo)) {
1291  mo->Fill(corr_lctsDatas[lct].getQuality());
1292  }
1293  }
1294  }
1295  }
1296 
1297  if (data.nalct()) {
1298  CSCALCTHeader* alctHeader = data.alctHeader();
1299  if (alctHeader) {
1300  std::vector<CSCALCTDigi> alctsDatasTmp = alctHeader->ALCTDigis();
1301  std::vector<CSCALCTDigi> alctsDatas;
1302  std::vector<uint32_t> keyWG_list;
1303  keyWG_list.clear();
1304  for (uint32_t lct = 0; lct < alctsDatasTmp.size(); lct++) {
1305  if (alctsDatasTmp[lct].isValid()) {
1306  alctsDatas.push_back(alctsDatasTmp[lct]);
1307  keyWG_list.push_back(alctsDatasTmp[lct].getKeyWG());
1308  }
1309  }
1310 
1311  if (!alctsDatas.empty() && getCSCHisto(h::CSC_RUN3_HMT_COINCIDENCE_MATCH, crateID, dmbID, mo) &&
1312  corr_lctsDatasTmp[0].isRun3() && (corr_lctsDatasTmp[0].getHMT() > 0) &&
1313  (corr_lctsDatasTmp[0].getHMT() <= 0xF) && alctsDatas[0].isValid()) {
1314  mo->Fill(1); // Run3 HMT+ALCT match
1315  }
1316 
1317  for (uint32_t lct = 0; lct < corr_lctsDatasTmp.size(); lct++) {
1318  if (corr_lctsDatasTmp[lct].isValid()) {
1319  for (uint32_t i = 0; i < keyWG_list.size(); i++) {
1321  if (corr_lctsDatasTmp[lct].getKeyWG() == keyWG_list[i]) {
1322  if ((lct == 0) && getCSCHisto(h::CSC_CORR_LCT0_VS_ALCT0_KEY_WG, crateID, dmbID, mo))
1323  mo->Fill(alctsDatas[i].getKeyWG(), corr_lctsDatasTmp[lct].getKeyWG());
1324  if ((lct == 1) && getCSCHisto(h::CSC_CORR_LCT1_VS_ALCT1_KEY_WG, crateID, dmbID, mo))
1325  mo->Fill(alctsDatas[i].getKeyWG(), corr_lctsDatasTmp[lct].getKeyWG());
1326  if (getCSCHisto(h::CSC_CORR_LCT_VS_ALCT_DIGI_MATCH, crateID, dmbID, mo)) {
1327  mo->Fill(lct, i);
1328  }
1329  continue;
1330  }
1331  }
1332  }
1333  }
1334  }
1335  }
1336 
1337  FEBunpacked = FEBunpacked + 1;
1338  tmb_unpacked = 1;
1339 
1340  if (getCSCHisto(h::CSC_ALCT_MATCH_TIME, crateID, dmbID, mo)) {
1341  mo->Fill(tmbHeader->ALCTMatchTime());
1342  double alct_match_mean = mo->getTH1()->GetMean();
1343  double alct_match_rms = mo->getTH1()->GetRMS();
1344  MonitorObject* mo1 = nullptr;
1345 
1346  if (cid.endcap() == 1) {
1347  if (cscPosition && getEMUHisto(h::EMU_CSC_ENDCAP_PLUS_ALCT_CLCT_MATCH_TIME, mo1)) {
1348  mo1->Fill(tmbHeader->ALCTMatchTime());
1349  }
1350  }
1351 
1352  if (cid.endcap() == 2) {
1353  if (cscPosition && getEMUHisto(h::EMU_CSC_ENDCAP_MINUS_ALCT_CLCT_MATCH_TIME, mo1)) {
1354  mo1->Fill(tmbHeader->ALCTMatchTime());
1355  }
1356  }
1357 
1358  if (cscPosition && getEMUHisto(h::EMU_CSC_ALCT_CLCT_MATCH_MEAN, mo1)) {
1359  mo1->SetBinContent(cscPosition, cscType + 1, alct_match_mean);
1360  }
1361 
1362  if (cscPosition && getEMUHisto(h::EMU_CSC_ALCT_CLCT_MATCH_RMS, mo1)) {
1363  mo1->SetBinContent(cscPosition, cscType + 1, alct_match_rms);
1364  }
1365  }
1366 
1367  if (getCSCHisto(h::CSC_LCT_MATCH_STATUS, crateID, dmbID, mo)) {
1368  if (tmbHeader->CLCTOnly())
1369  mo->Fill(0.0, 0.0);
1370  if (tmbHeader->ALCTOnly())
1371  mo->Fill(0.0, 1.0);
1372  if (tmbHeader->TMBMatch())
1373  mo->Fill(0.0, 2.0);
1374  }
1375 
1376  if (getCSCHisto(h::CSC_LCT0_MATCH_BXN_DIFFERENCE, crateID, dmbID, mo))
1377  mo->Fill(tmbHeader->Bxn0Diff());
1378  if (getCSCHisto(h::CSC_LCT1_MATCH_BXN_DIFFERENCE, crateID, dmbID, mo))
1379  mo->Fill(tmbHeader->Bxn1Diff());
1380 
1381  if ((tmb_dav > 0) && (getCSCHisto(h::CSC_DMB_FEB_UNPACKED_VS_DAV, crateID, dmbID, mo))) {
1382  mo->Fill(1.0, 0.0);
1383  }
1384 
1386  if (getCSCHisto(h::CSC_CSC_RATE, crateID, dmbID, mo)) {
1387  mo->Fill(3);
1388  uint32_t CLCTEvent = (uint32_t)mo->GetBinContent(4);
1389  config->setChamberCounterValue(CLCT_TRIGGERS, crateID, dmbID, CLCTEvent);
1390  if (getCSCHisto(h::CSC_CSC_EFFICIENCY, crateID, dmbID, mo)) {
1391  if (config->getNEvents() > 0) {
1392  mo->SetBinContent(2, ((float)CLCTEvent / (float)(DMBEvents) * 100.0));
1393  mo->SetEntries(DMBEvents);
1394  }
1395  }
1396  }
1397 
1398  if (getCSCHisto(h::CSC_CLCT_L1A, crateID, dmbID, mo))
1399  mo->Fill(tmbHeader->L1ANumber());
1400 
1402  if (getCSCHisto(h::CSC_CLCT_DMB_L1A_DIFF, crateID, dmbID, mo)) {
1403  int clct_dmb_l1a_diff = (int)((tmbHeader->L1ANumber() % 64) - dmbHeader->l1a24() % 64);
1404  if (clct_dmb_l1a_diff != 0)
1405  L1A_out_of_sync = true;
1406  if (clct_dmb_l1a_diff < -32)
1407  mo->Fill(clct_dmb_l1a_diff + 64);
1408  else {
1409  if (clct_dmb_l1a_diff >= 32)
1410  mo->Fill(clct_dmb_l1a_diff - 64);
1411  else
1412  mo->Fill(clct_dmb_l1a_diff);
1413  }
1414  mo->SetAxisRange(0.1, 1.1 * (1.0 + mo->GetBinContent(mo->GetMaximumBin())), "Y");
1415  }
1416 
1417  if (getCSCHisto(h::CSC_DMB_L1A_VS_CLCT_L1A, crateID, dmbID, mo))
1418  mo->Fill(tmbHeader->L1ANumber() % 256, dmbHeader->l1a24() % 256);
1419 
1420  if (getCSCHisto(h::CSC_CLCT_DMB_BXN_DIFF, crateID, dmbID, mo)) {
1421  int clct_dmb_bxn_diff = (int)(tmbHeader->BXNCount() % 64 - dmbHeader->bxn12() % 64);
1422  if (clct_dmb_bxn_diff < -32)
1423  mo->Fill(clct_dmb_bxn_diff + 64);
1424  else {
1425  if (clct_dmb_bxn_diff >= 32)
1426  mo->Fill(clct_dmb_bxn_diff - 64);
1427  else
1428  mo->Fill(clct_dmb_bxn_diff);
1429  }
1430  mo->SetAxisRange(0.1, 1.1 * (1.0 + mo->GetBinContent(mo->GetMaximumBin())), "Y");
1431  }
1432 
1433  if (getCSCHisto(h::CSC_CLCT_BXN, crateID, dmbID, mo))
1434  mo->Fill((int)(tmbHeader->BXNCount()));
1435 
1436  if (getCSCHisto(h::CSC_CLCT_BXN_VS_DMB_BXN, crateID, dmbID, mo))
1437  mo->Fill(tmbHeader->BXNCount() % 256, dmbHeader->bxn12() % 256);
1438 
1439  if (getCSCHisto(h::CSC_CLCT_NUMBER_RATE, crateID, dmbID, mo)) {
1440  mo->Fill(clctsDatas.size());
1441  int nCLCT = (int)mo->GetBinContent((int)(clctsDatas.size() + 1));
1442  if (getCSCHisto(h::CSC_CLCT_NUMBER, crateID, dmbID, mo))
1443  mo->SetBinContent((int)(clctsDatas.size() + 1), (float)(nCLCT) / (float)(DMBEvents) * 100.0);
1444  }
1445 
1446  if (clctsDatas.size() == 1) {
1447  if (getCSCHisto(h::CSC_CLCT0_CLSSIFICATION, crateID, dmbID, mo)) {
1448  if (clctsDatas[0].getStripType())
1449  mo->Fill(0.0);
1450  else
1451  mo->Fill(1.0);
1452  }
1453  }
1454 
1455  if (clctsDatas.size() == 2) {
1456  if (getCSCHisto(h::CSC_CLCT1_VS_CLCT0_KEY_STRIP, crateID, dmbID, mo))
1457  mo->Fill(clctsDatas[0].getKeyStrip(), clctsDatas[1].getKeyStrip());
1458  if (getCSCHisto(h::CSC_CLCT0_CLCT1_CLSSIFICATION, crateID, dmbID, mo)) {
1459  if (clctsDatas[0].getStripType() && clctsDatas[1].getStripType())
1460  mo->Fill(0.0);
1461  if (clctsDatas[0].getStripType() && !clctsDatas[1].getStripType())
1462  mo->Fill(1.0);
1463  if (!clctsDatas[0].getStripType() && clctsDatas[1].getStripType())
1464  mo->Fill(2.0);
1465  if (!clctsDatas[0].getStripType() && !clctsDatas[1].getStripType())
1466  mo->Fill(3.0);
1467  }
1468  }
1469 
1470  if (getCSCHisto(h::CSC_TMB_WORD_COUNT, crateID, dmbID, mo))
1471  mo->Fill((int)(tmbTrailer->wordCount()));
1472 
1473  MonitorObject* mo_CSC_Plus_endcap_CLCT0_dTime = nullptr;
1474  getEMUHisto(h::EMU_CSC_ENDCAP_PLUS_CLCT0_DTIME, mo_CSC_Plus_endcap_CLCT0_dTime);
1475 
1476  MonitorObject* mo_CSC_Minus_endcap_CLCT0_dTime = nullptr;
1477  getEMUHisto(h::EMU_CSC_ENDCAP_MINUS_CLCT0_DTIME, mo_CSC_Minus_endcap_CLCT0_dTime);
1478 
1479  MonitorObject* mo_CSC_CLCT0_BXN_mean = nullptr;
1480  getEMUHisto(h::EMU_CSC_CLCT0_BXN_MEAN, mo_CSC_CLCT0_BXN_mean);
1481 
1482  MonitorObject* mo_CSC_CLCT0_BXN_rms = nullptr;
1483  getEMUHisto(h::EMU_CSC_CLCT0_BXN_RMS, mo_CSC_CLCT0_BXN_rms);
1484 
1485  for (uint32_t lct = 0; lct < clctsDatas.size(); lct++) {
1486  if (getCSCHisto(h::CSC_CLCTXX_BXN, crateID, dmbID, lct, mo))
1487  mo->Fill(clctsDatas[lct].getFullBX() % 64);
1488 
1489  int clct_dtime = clctsDatas[lct].getFullBX() - tmbHeader->BXNCount();
1490  if (clct_dtime > 0) {
1491  clct_dtime -= 3564;
1492  }
1493 
1494  int dTime = clct_dtime;
1495 
1496  if (lct == 0) {
1497  if (cid.endcap() == 1) {
1498  if (mo_CSC_Plus_endcap_CLCT0_dTime)
1499  mo_CSC_Plus_endcap_CLCT0_dTime->Fill(dTime);
1500  }
1501  if (cid.endcap() == 2) {
1502  if (mo_CSC_Minus_endcap_CLCT0_dTime)
1503  mo_CSC_Minus_endcap_CLCT0_dTime->Fill(dTime);
1504  }
1505  }
1506 
1507  if (getCSCHisto(h::CSC_CLCTXX_DTIME, crateID, dmbID, lct, mo)) {
1508  mo->Fill(dTime);
1509  mo->SetAxisRange(0.1, 1.1 * (1.0 + mo->GetBinContent(mo->GetMaximumBin())), "Y");
1510 
1511  double dTime_mean = mo->getTH1()->GetMean();
1512  double dTime_rms = mo->getTH1()->GetRMS();
1513 
1514  // == For CLCT0 Fill Summary dTime Histograms
1515  if (lct == 0) {
1516  if (cscPosition && mo_CSC_CLCT0_BXN_mean) {
1517  mo_CSC_CLCT0_BXN_mean->SetBinContent(cscPosition, cscType + 1, dTime_mean);
1518  }
1519  if (cscPosition && mo_CSC_CLCT0_BXN_rms) {
1520  mo_CSC_CLCT0_BXN_rms->SetBinContent(cscPosition, cscType + 1, dTime_rms);
1521  }
1522  }
1523  }
1524 
1525  /* LOG_DEBUG << "LCT:" << lct << " Type:" << clctsDatas[lct].getStripType()
1526  << " Strip:" << clctsDatas[lct].getKeyStrip();
1527  */
1528 
1529  if (clctsDatas[lct].getStripType()) { // HalfStrip Type
1530 
1531  if (getCSCHisto(h::CSC_CLCTXX_KEYHALFSTRIP, crateID, dmbID, lct, mo))
1532  mo->Fill(clctsDatas[lct].getKeyStrip());
1533 
1534  /* === Run3 CSC-GEM Trigger data format */
1535  if (getCSCHisto(h::CSC_CLCTXX_KEY_QUARTSTRIP, crateID, dmbID, lct, mo))
1536  mo->Fill(clctsDatas[lct].getKeyStrip(4));
1537  if (getCSCHisto(h::CSC_CLCTXX_KEY_EIGHTSTRIP, crateID, dmbID, lct, mo))
1538  mo->Fill(clctsDatas[lct].getKeyStrip(8));
1539  /* === Run3 */
1540 
1541  if (getCSCHisto(h::CSC_CLCTXX_DTIME_VS_HALF_STRIP, crateID, dmbID, lct, mo)) {
1542  mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime);
1543  }
1544 
1545  if (getCSCHisto(h::CSC_CLCTXX_DTIME_PROFILE, crateID, dmbID, lct, mo)) {
1546  mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime);
1547  }
1548 
1549  if (getCSCHisto(h::CSC_CLCTXX_HALF_STRIP_PATTERN, crateID, dmbID, lct, mo)) {
1550  int pattern_clct = clctsDatas[lct].getPattern();
1554  double tbin = -1;
1555 
1556  switch (pattern_clct) {
1557  case 0:
1558  tbin = 0.;
1559  break;
1560  case 1:
1561  tbin = 1.;
1562  break;
1563  case 2:
1564  tbin = 2.;
1565  break;
1566  case 3:
1567  tbin = 10.;
1568  break;
1569  case 4:
1570  tbin = 3.;
1571  break;
1572  case 5:
1573  tbin = 9.;
1574  break;
1575  case 6:
1576  tbin = 4.;
1577  break;
1578  case 7:
1579  tbin = 8.;
1580  break;
1581  case 8:
1582  tbin = 5.;
1583  break;
1584  case 9:
1585  tbin = 7.;
1586  break;
1587  case 10:
1588  tbin = 6.;
1589  break;
1590  }
1591 
1592  if (tbin >= 0)
1593  mo->Fill(clctsDatas[lct].getKeyStrip(), tbin);
1594 
1595  MonitorObject* mo1 = nullptr;
1596  if (getCSCHisto(h::CSC_CLCT_HALF_STRIP_PATTERN_DISTR, crateID, dmbID, lct, mo1))
1597  mo1->Fill(tbin);
1598  }
1599 
1600  if (getCSCHisto(h::CSC_CLCTXX_HALF_STRIP_QUALITY, crateID, dmbID, lct, mo))
1601  mo->Fill((int)(clctsDatas[lct].getKeyStrip()), (int)(clctsDatas[lct].getQuality()));
1602 
1603  if (mo_EventDisplay) {
1604  mo_EventDisplay->SetBinContent(10, clctsDatas[lct].getKeyStrip(), clct_dtime);
1605  mo_EventDisplay->SetBinContent(11, clctsDatas[lct].getKeyStrip(), clctsDatas[lct].getQuality());
1606  }
1607 
1608  if (getCSCHisto(h::CSC_CLCTXX_HALF_STRIP_QUALITY_DISTR, crateID, dmbID, lct, mo)) {
1609  mo->Fill((int)(clctsDatas[lct].getQuality()));
1610  if (lct == 0) {
1611  MonitorObject* mo1 = nullptr;
1612  if (cscPosition && getEMUHisto(h::EMU_CSC_CLCT0_QUALITY, mo1)) {
1613  mo1->SetBinContent(cscPosition, cscType + 1, mo->getTH1()->GetMean());
1614  }
1615  }
1616  }
1617 
1618  if (getCSCHisto(h::CSC_CLCTXX_HALF_STRIP_QUALITY_PROFILE, crateID, dmbID, lct, mo))
1619  mo->Fill((int)(clctsDatas[lct].getKeyStrip()), (int)(clctsDatas[lct].getQuality()));
1620 
1621  } else { // DiStrip Type
1622 
1623  LOG_INFO << "Entering block!";
1624 
1625  if (getCSCHisto(h::CSC_CLCTXX_KEYDISTRIP, crateID, dmbID, lct, mo))
1626  mo->Fill(clctsDatas[lct].getKeyStrip());
1627  else
1628  LOG_ERROR << "Not found h::CSC_CLCTXX_KEYDISTRIP = " << h::CSC_CLCTXX_KEYDISTRIP;
1629 
1630  if (lct == 0)
1631  clct_kewdistrip = clctsDatas[lct].getKeyStrip();
1632 
1633  if (getCSCHisto(h::CSC_CLCTXX_DTIME_VS_DISTRIP, crateID, dmbID, lct, mo)) {
1634  mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime);
1635  }
1636 
1637  if (getCSCHisto(h::CSC_CLCTXX_DISTRIP_PATTERN, crateID, dmbID, lct, mo)) {
1638  int pattern_clct = (int)((clctsDatas[lct].getPattern() >> 1) & 0x3);
1641  if (pattern_clct == 1)
1642  mo->Fill(clctsDatas[lct].getKeyStrip(), 7.0);
1643  if (pattern_clct == 3)
1644  mo->Fill(clctsDatas[lct].getKeyStrip(), 6.0);
1645  if (pattern_clct == 5)
1646  mo->Fill(clctsDatas[lct].getKeyStrip(), 5.0);
1647  if (pattern_clct == 7)
1648  mo->Fill(clctsDatas[lct].getKeyStrip(), 4.0);
1649  if (pattern_clct == 6)
1650  mo->Fill(clctsDatas[lct].getKeyStrip(), 3.0);
1651  if (pattern_clct == 4)
1652  mo->Fill(clctsDatas[lct].getKeyStrip(), 2.0);
1653  if (pattern_clct == 2)
1654  mo->Fill(clctsDatas[lct].getKeyStrip(), 1.0);
1655  if (pattern_clct == 0)
1656  mo->Fill(clctsDatas[lct].getKeyStrip(), 0.0);
1657  }
1658 
1659  if (getCSCHisto(h::CSC_CLCTXX_DISTRIP_QUALITY, crateID, dmbID, lct, mo))
1660  mo->Fill((int)(clctsDatas[lct].getKeyStrip()), (int)(clctsDatas[lct].getQuality()));
1661 
1662  if (getCSCHisto(h::CSC_CLCTXX_DISTRIP_QUALITY_PROFILE, crateID, dmbID, lct, mo))
1663  mo->Fill((int)(clctsDatas[lct].getKeyStrip()), (int)(clctsDatas[lct].getQuality()));
1664  }
1665  }
1666 
1667  int N_CFEBs = tmbHeader->NCFEBs();
1668  int NumberOfLayersWithHitsInCLCT = 0;
1669  int NumberOfHalfStripsWithHitsInCLCT = 0;
1670 
1671  if (comparatorData && comparatorData->check()) {
1672  MonitorObject* mo_CFEB_Comparators_TimeSamples = nullptr;
1673  getCSCHisto(h::CSC_CFEB_COMPARATORS_TIMESAMPLES, crateID, dmbID, mo_CFEB_Comparators_TimeSamples);
1674 
1675  MonitorObject* mo_CSC_Plus_endcap_CFEB_Comparators_Time = nullptr;
1676  getEMUHisto(h::EMU_CSC_ENDCAP_PLUS_CFEB_COMPARATORS_TIME, mo_CSC_Plus_endcap_CFEB_Comparators_Time);
1677 
1678  MonitorObject* mo_CSC_Minus_endcap_CFEB_Comparators_Time = nullptr;
1679  getEMUHisto(h::EMU_CSC_ENDCAP_MINUS_CFEB_COMPARATORS_TIME, mo_CSC_Minus_endcap_CFEB_Comparators_Time);
1680 
1681  MonitorObject* mo_CSC_CFEB_Comparators_Time_mean = nullptr;
1682  getEMUHisto(h::EMU_CSC_CFEB_COMPARATORS_TIME_MEAN, mo_CSC_CFEB_Comparators_Time_mean);
1683 
1684  MonitorObject* mo_CSC_CFEB_Comparators_Time_rms = nullptr;
1685  getEMUHisto(h::EMU_CSC_CFEB_COMPARATORS_TIME_RMS, mo_CSC_CFEB_Comparators_Time_rms);
1686 
1687  for (int nCFEB = 0; nCFEB < N_CFEBs; ++nCFEB) {
1688  for (int nLayer = 1; nLayer <= 6; nLayer++) {
1689  int hstrip_previous = -1;
1690  int tbin_clct_previous = -1;
1691  bool CheckLayerCLCT = true;
1692 
1693  std::vector<CSCComparatorDigi> compOutData = comparatorData->comparatorDigis(nLayer, nCFEB);
1694 
1695  for (std::vector<CSCComparatorDigi>::iterator compOutDataItr = compOutData.begin();
1696  compOutDataItr != compOutData.end();
1697  ++compOutDataItr) {
1699  int hstrip = 2 * (compOutDataItr->getStrip() - 1) + compOutDataItr->getComparator();
1700  std::vector<int> tbins_clct = compOutDataItr->getTimeBinsOn();
1701  int tbin_clct = (int)compOutDataItr->getTimeBin();
1702 
1703  if (mo_EventDisplay) {
1704  mo_EventDisplay->SetBinContent(nLayer + 11, hstrip, tbin_clct + 1);
1705  setEmuEventDisplayBit(mo_Emu_EventDisplay_Anode, glChamberIndex, 160 + hstrip, nLayer - 1);
1706  setEmuEventDisplayBit(mo_Emu_EventDisplay_XY, glChamberIndex, 160 + hstrip, nLayer - 1);
1707  }
1708 
1709  if (CheckLayerCLCT) {
1710  NumberOfLayersWithHitsInCLCT = NumberOfLayersWithHitsInCLCT + 1;
1711  CheckLayerCLCT = false;
1712  }
1713 
1714  for (uint32_t n = 0; n < tbins_clct.size(); n++) {
1715  tbin_clct = tbins_clct[n];
1716  if (hstrip != hstrip_previous ||
1717  (tbin_clct != tbin_clct_previous + 1 && tbin_clct != tbin_clct_previous - 1)) {
1718  if (getCSCHisto(h::CSC_CLCTTIME_LYXX, crateID, dmbID, nLayer, mo))
1719  mo->Fill(hstrip, tbin_clct);
1720 
1721  if (mo_CFEB_Comparators_TimeSamples)
1722  mo_CFEB_Comparators_TimeSamples->Fill(tbin_clct);
1723 
1724  if (cid.endcap() == 1) {
1725  if (mo_CSC_Plus_endcap_CFEB_Comparators_Time)
1726  mo_CSC_Plus_endcap_CFEB_Comparators_Time->Fill(tbin_clct);
1727  }
1728 
1729  if (cid.endcap() == 2) {
1730  if (mo_CSC_Minus_endcap_CFEB_Comparators_Time)
1731  mo_CSC_Minus_endcap_CFEB_Comparators_Time->Fill(tbin_clct);
1732  }
1733 
1734  if (getCSCHisto(h::CSC_CLCTTIME_LYXX_PROFILE, crateID, dmbID, nLayer, mo))
1735  mo->Fill(hstrip, tbin_clct);
1736 
1737  if (getCSCHisto(h::CSC_CLCT_LYXX_RATE, crateID, dmbID, nLayer, mo)) {
1738  mo->Fill(hstrip);
1739 
1740  double number_hstrip = mo->GetBinContent(hstrip + 1);
1741  double Number_of_entries_CLCT = mo->GetEntries();
1742 
1743  if (getCSCHisto(h::CSC_CLCT_LYXX_EFFICIENCY, crateID, dmbID, nLayer, mo)) {
1744  mo->SetBinContent(hstrip + 1, number_hstrip);
1745  if (DMBEvents > 0) {
1746  double norm = (100.0 * Number_of_entries_CLCT) / ((double)(DMBEvents));
1748  mo->SetNormFactor(norm);
1749  } else {
1750  mo->SetNormFactor(100.0);
1751  }
1752  mo->SetEntries(DMBEvents);
1753  }
1754  }
1755  }
1756 
1757  if (hstrip != hstrip_previous) {
1758  NumberOfHalfStripsWithHitsInCLCT = NumberOfHalfStripsWithHitsInCLCT + 1;
1759  }
1760  hstrip_previous = hstrip;
1761  tbin_clct_previous = tbin_clct;
1762  }
1763  }
1764  }
1765  }
1766 
1767  if (mo_CFEB_Comparators_TimeSamples) {
1768  double comps_time_mean = mo_CFEB_Comparators_TimeSamples->getTH1()->GetMean();
1769  double comps_time_rms = mo_CFEB_Comparators_TimeSamples->getTH1()->GetRMS();
1770 
1771  if (cscPosition && mo_CSC_CFEB_Comparators_Time_mean) {
1772  mo_CSC_CFEB_Comparators_Time_mean->SetBinContent(cscPosition, cscType + 1, comps_time_mean);
1773  }
1774  if (cscPosition && mo_CSC_CFEB_Comparators_Time_rms) {
1775  mo_CSC_CFEB_Comparators_Time_rms->SetBinContent(cscPosition, cscType + 1, comps_time_rms);
1776  }
1777  }
1778 
1779  } else {
1780  LOG_ERROR << cscTag << " Can not unpack CLCT Data";
1781  }
1782 
1783  if (getCSCHisto(h::CSC_CLCT_NUMBER_OF_LAYERS_WITH_HITS, crateID, dmbID, mo)) {
1784  mo->Fill(NumberOfLayersWithHitsInCLCT);
1785  MonitorObject* mo1 = nullptr;
1786  if (cscPosition && getEMUHisto(h::EMU_CSC_CLCT_PLANES_WITH_HITS, mo1)) {
1787  mo1->SetBinContent(cscPosition, cscType + 1, mo->getTH1()->GetMean());
1788  }
1789  }
1790 
1792  mo->Fill(NumberOfHalfStripsWithHitsInCLCT);
1793  } else {
1794  LOG_ERROR << cscTag << " Can not unpack TMB Header or/and Trailer";
1795  }
1796  } else {
1797  LOG_ERROR << cscTag << " Can not unpack TMB Data";
1798  }
1799 
1800  } else {
1803  if (getCSCHisto(h::CSC_CLCT_NUMBER_RATE, crateID, dmbID, mo)) {
1804  mo->Fill(0);
1805  int nCLCT = (int)mo->GetBinContent(1);
1806  if (getCSCHisto(h::CSC_CLCT_NUMBER, crateID, dmbID, mo))
1807  mo->SetBinContent(1, (float)(nCLCT) / (float)(DMBEvents) * 100.0);
1808  }
1809  if ((tmb_dav > 0) && (getCSCHisto(h::CSC_DMB_FEB_UNPACKED_VS_DAV, crateID, dmbID, mo))) {
1810  mo->Fill(1.0, 1.0);
1811  }
1812  }
1813 
1815  int NumberOfUnpackedCFEBs = 0;
1816  const int N_CFEBs = nCFEBs, N_Samples = 16, N_Layers = 6, N_Strips = 16, nStrips = nCFEBs * N_Strips;
1817  int ADC = 0, OutOffRange, Threshold = 30;
1819  int Pedestal[N_CFEBs][6][16];
1820  memset(Pedestal, 0, sizeof(Pedestal));
1821 #ifdef __clang__
1822  std::vector<std::array<std::array<std::pair<int, int>, 6>, 16>> CellPeak(N_CFEBs);
1823  std::fill(CellPeak.begin(), CellPeak.end(), std::array<std::array<std::pair<int, int>, 6>, 16>{});
1824 #else
1825  std::pair<int, int> CellPeak[N_CFEBs][6][16];
1826  memset(CellPeak, 0, sizeof(CellPeak));
1827 #endif
1828  bool CheckCFEB = true;
1830  float Clus_Sum_Charge;
1831  int TrigTime, L1APhase, UnpackedTrigTime, LCTPhase, SCA_BLK, NmbTimeSamples;
1832  int FreeCells, LCT_Pipe_Empty, LCT_Pipe_Full, LCT_Pipe_Count, L1_Pipe_Empty, L1_Pipe_Full, Buffer_Count;
1835  bool CheckThresholdStripInTheLayer[6][nStrips];
1836  for (int i = 0; i < 6; i++) {
1837  for (int j = 0; j < nStrips; j++)
1838  CheckThresholdStripInTheLayer[i][j] = true;
1839  }
1840 
1841  bool CheckOutOffRangeStripInTheLayer[6][nStrips];
1842  for (int i = 0; i < 6; i++) {
1843  for (int j = 0; j < nStrips; j++)
1844  CheckOutOffRangeStripInTheLayer[i][j] = true;
1845  }
1846 
1848  float cscdata[N_CFEBs * 16][N_Samples][N_Layers];
1849  int SCABlockData[N_CFEBs * 16][N_Samples][N_Layers];
1850  memset(cscdata, 0, sizeof(cscdata));
1851  memset(SCABlockData, 0, sizeof(SCABlockData));
1854  char hbuf[255];
1855  memset(hbuf, 0, sizeof(hbuf));
1856 
1857  MonitorObject* mo_CFEB_SCA_CellPeak_Time = nullptr;
1858  getCSCHisto(h::CSC_CFEB_SCA_CELLPEAK_TIME, crateID, dmbID, mo_CFEB_SCA_CellPeak_Time);
1859 
1860  MonitorObject* mo_CSC_Plus_endcap_CFEB_SCA_CellPeak_Time = nullptr;
1861  getEMUHisto(h::EMU_CSC_PLUS_ENDCAP_CFEB_SCA_CELLPEAK_TIME, mo_CSC_Plus_endcap_CFEB_SCA_CellPeak_Time);
1862 
1863  MonitorObject* mo_CSC_Minus_endcap_CFEB_SCA_CellPeak_Time = nullptr;
1864  getEMUHisto(h::EMU_CSC_MINUS_ENDCAP_CFEB_SCA_CELLPEAK_TIME, mo_CSC_Minus_endcap_CFEB_SCA_CellPeak_Time);
1865 
1866  MonitorObject* mo_CSC_CFEB_SCA_CellPeak_Time_mean = nullptr;
1867  getEMUHisto(h::EMU_CSC_CFEB_SCA_CELLPEAK_TIME_MEAN, mo_CSC_CFEB_SCA_CellPeak_Time_mean);
1868 
1869  MonitorObject* mo_CSC_CFEB_SCA_CellPeak_Time_rms = nullptr;
1870  getEMUHisto(h::EMU_CSC_CFEB_SCA_CELLPEAK_TIME_RMS, mo_CSC_CFEB_SCA_CellPeak_Time_rms);
1871 
1872  for (int nCFEB = 0; nCFEB < N_CFEBs; ++nCFEB) {
1873  // cfebData[nCFEB] = data.cfebData(nCFEB);
1874  if (data.cfebData(nCFEB) != nullptr) {
1875  if (!data.cfebData(nCFEB)->check())
1876  continue;
1877 
1879  FEBunpacked = FEBunpacked + 1; // Increment number of unpacked FED
1880  NumberOfUnpackedCFEBs = NumberOfUnpackedCFEBs + 1; // Increment number of unpaked CFEB
1881  cfeb_unpacked = 1;
1882  if (CheckCFEB == true) {
1883  if (getCSCHisto(h::CSC_CSC_RATE, crateID, dmbID, mo)) {
1884  mo->Fill(4);
1885  uint32_t CFEBEvent = (uint32_t)mo->GetBinContent(5);
1886  config->setChamberCounterValue(CFEB_TRIGGERS, crateID, dmbID, CFEBEvent);
1887  if (getCSCHisto(h::CSC_CSC_EFFICIENCY, crateID, dmbID, mo)) {
1888  if (config->getNEvents() > 0) {
1889  mo->SetBinContent(3, ((float)CFEBEvent / (float)(DMBEvents) * 100.0));
1890  mo->SetEntries((int)DMBEvents);
1891  }
1892  }
1893  }
1894 
1895  if ((cfeb_dav2 > 0) && (getCSCHisto(h::CSC_DMB_FEB_UNPACKED_VS_DAV, crateID, dmbID, mo))) {
1896  mo->Fill(2.0, 0.0);
1897  }
1898  CheckCFEB = false;
1899  }
1901  NmbTimeSamples = (data.cfebData(nCFEB))->nTimeSamples();
1905  MonitorObject* mo_CFEB_SCA_Block_Occupancy = nullptr;
1906  getCSCHisto(h::CSC_CFEBXX_SCA_BLOCK_OCCUPANCY, crateID, dmbID, nCFEB + 1, mo_CFEB_SCA_Block_Occupancy);
1907  MonitorObject* mo_CFEB_Free_SCA_Cells = nullptr;
1908  getCSCHisto(h::CSC_CFEBXX_FREE_SCA_CELLS, crateID, dmbID, nCFEB + 1, mo_CFEB_Free_SCA_Cells);
1909  MonitorObject* mo_CFEB_SCA_Blocks_Locked_by_LCTs = nullptr;
1910  getCSCHisto(
1911  h::CSC_CFEBXX_SCA_BLOCKS_LOCKED_BY_LCTS, crateID, dmbID, nCFEB + 1, mo_CFEB_SCA_Blocks_Locked_by_LCTs);
1912  MonitorObject* mo_CFEB_SCA_Blocks_Locked_by_LCTxL1 = nullptr;
1913  getCSCHisto(
1914  h::CSC_CFEBXX_SCA_BLOCKS_LOCKED_BY_LCTXL1, crateID, dmbID, nCFEB + 1, mo_CFEB_SCA_Blocks_Locked_by_LCTxL1);
1915  MonitorObject* mo_CFEB_DMB_L1A_diff = nullptr;
1916  getCSCHisto(h::CSC_CFEBXX_DMB_L1A_DIFF, crateID, dmbID, nCFEB + 1, mo_CFEB_DMB_L1A_diff);
1917 
1918  for (int nLayer = 1; nLayer <= N_Layers; ++nLayer) {
1920  MonitorObject* mo_CFEB_Out_Off_Range_Strips = nullptr;
1921  getCSCHisto(h::CSC_CFEB_OUT_OFF_RANGE_STRIPS_LYXX, crateID, dmbID, nLayer, mo_CFEB_Out_Off_Range_Strips);
1922  MonitorObject* mo_CFEB_Active_Samples_vs_Strip = nullptr;
1923  getCSCHisto(
1924  h::CSC_CFEB_ACTIVE_SAMPLES_VS_STRIP_LYXX, crateID, dmbID, nLayer, mo_CFEB_Active_Samples_vs_Strip);
1925  MonitorObject* mo_CFEB_Active_Samples_vs_Strip_Profile = nullptr;
1927  crateID,
1928  dmbID,
1929  nLayer,
1930  mo_CFEB_Active_Samples_vs_Strip_Profile);
1931  MonitorObject* mo_CFEB_ActiveStrips = nullptr;
1932  getCSCHisto(h::CSC_CFEB_ACTIVESTRIPS_LYXX, crateID, dmbID, nLayer, mo_CFEB_ActiveStrips);
1933  MonitorObject* mo_CFEB_SCA_Cell_Peak = nullptr;
1934  getCSCHisto(h::CSC_CFEB_SCA_CELL_PEAK_LY_XX, crateID, dmbID, nLayer, mo_CFEB_SCA_Cell_Peak);
1935 
1936  MonitorObject* mo_CFEB_Pedestal_withEMV_Sample = nullptr;
1937  getCSCHisto(
1938  h::CSC_CFEB_PEDESTAL_WITHEMV_SAMPLE_01_LYXX, crateID, dmbID, nLayer, mo_CFEB_Pedestal_withEMV_Sample);
1939  MonitorObject* mo_CFEB_Pedestal_withRMS_Sample = nullptr;
1940  getCSCHisto(
1941  h::CSC_CFEB_PEDESTAL_WITHRMS_SAMPLE_01_LYXX, crateID, dmbID, nLayer, mo_CFEB_Pedestal_withRMS_Sample);
1942  MonitorObject* mo_CFEB_PedestalRMS_Sample = nullptr;
1943  getCSCHisto(h::CSC_CFEB_PEDESTALRMS_SAMPLE_01_LYXX, crateID, dmbID, nLayer, mo_CFEB_PedestalRMS_Sample);
1944 
1945  for (int nSample = 0; nSample < NmbTimeSamples; ++nSample) {
1946  if (timeSlice(data, nCFEB, nSample) == nullptr) {
1947  LOG_WARN << "CFEB" << nCFEB << " nSample: " << nSample << " - B-Word";
1948  continue;
1949  }
1950 
1951  if (mo_CFEB_DMB_L1A_diff && !fCloseL1As) {
1952  int cfeb_dmb_l1a_diff =
1953  (int)((timeSlice(data, nCFEB, nSample)->get_L1A_number()) - dmbHeader->l1a24() % 64);
1954  if (cfeb_dmb_l1a_diff != 0) {
1955  L1A_out_of_sync = true;
1956  }
1957  if (cfeb_dmb_l1a_diff < -32)
1958  mo->Fill(cfeb_dmb_l1a_diff + 64);
1959  else {
1960  if (cfeb_dmb_l1a_diff >= 32)
1961  mo->Fill(cfeb_dmb_l1a_diff - 64);
1962  else
1963  mo_CFEB_DMB_L1A_diff->Fill(cfeb_dmb_l1a_diff);
1964  }
1965  mo_CFEB_DMB_L1A_diff->SetAxisRange(
1966  0.1, 1.1 * (1.0 + mo_CFEB_DMB_L1A_diff->GetBinContent(mo_CFEB_DMB_L1A_diff->GetMaximumBin())), "Y");
1967  }
1968 
1970  FreeCells = timeSlice(data, nCFEB, nSample)->get_n_free_sca_blocks();
1971  LCT_Pipe_Empty = timeSlice(data, nCFEB, nSample)->get_lctpipe_empty();
1972  LCT_Pipe_Full = timeSlice(data, nCFEB, nSample)->get_lctpipe_full();
1973  LCT_Pipe_Count = timeSlice(data, nCFEB, nSample)->get_lctpipe_count();
1974  L1_Pipe_Empty = timeSlice(data, nCFEB, nSample)->get_l1pipe_empty();
1975  L1_Pipe_Full = timeSlice(data, nCFEB, nSample)->get_l1pipe_full();
1976  Buffer_Count = timeSlice(data, nCFEB, nSample)->get_buffer_count();
1977 
1978  SCA_BLK = (int)(timeSlice(data, nCFEB, nSample)->scaControllerWord(nLayer).sca_blk);
1979 
1980  for (int nStrip = 0; nStrip < N_Strips; ++nStrip) {
1981  SCABlockData[nCFEB * 16 + nStrip][nSample][nLayer - 1] = SCA_BLK;
1982  }
1983 
1985  if (mo_CFEB_SCA_Block_Occupancy)
1986  mo_CFEB_SCA_Block_Occupancy->Fill(SCA_BLK);
1987 
1989  if (mo_CFEB_Free_SCA_Cells) {
1990  if (timeSlice(data, nCFEB, nSample)->scaControllerWord(nLayer).sca_full == 1)
1991  mo_CFEB_Free_SCA_Cells->Fill(-1);
1992  mo_CFEB_Free_SCA_Cells->Fill(FreeCells);
1993  }
1994 
1996  if (mo_CFEB_SCA_Blocks_Locked_by_LCTs) {
1997  if (LCT_Pipe_Empty == 1)
1998  mo_CFEB_SCA_Blocks_Locked_by_LCTs->Fill(-0.5);
1999  if (LCT_Pipe_Full == 1)
2000  mo_CFEB_SCA_Blocks_Locked_by_LCTs->Fill(16.5);
2001  mo_CFEB_SCA_Blocks_Locked_by_LCTs->Fill(LCT_Pipe_Count);
2002  }
2003 
2005  if (mo_CFEB_SCA_Blocks_Locked_by_LCTxL1) {
2006  if (L1_Pipe_Empty == 1)
2007  mo_CFEB_SCA_Blocks_Locked_by_LCTxL1->Fill(-0.5);
2008  if (L1_Pipe_Full == 1)
2009  mo_CFEB_SCA_Blocks_Locked_by_LCTxL1->Fill(31.5);
2010  mo_CFEB_SCA_Blocks_Locked_by_LCTxL1->Fill(Buffer_Count);
2011  }
2012 
2014  if (nSample == 0 && nLayer == 1) {
2015  TrigTime = (int)(timeSlice(data, nCFEB, nSample)->scaControllerWord(nLayer).trig_time);
2016  int k = 1;
2017  while (((TrigTime >> (k - 1)) & 0x1) != 1 && k <= 8) {
2018  k = k + 1;
2019  }
2020  L1APhase = (int)((timeSlice(data, nCFEB, nSample)->scaControllerWord(nLayer).l1a_phase) & 0x1);
2021  UnpackedTrigTime = ((k << 1) & 0xE) + L1APhase;
2022 
2023  if (getCSCHisto(h::CSC_CFEBXX_L1A_SYNC_TIME, crateID, dmbID, nCFEB + 1, mo))
2024  mo->Fill((int)UnpackedTrigTime);
2025  LCTPhase = (int)((timeSlice(data, nCFEB, nSample)->scaControllerWord(nLayer).lct_phase) & 0x1);
2026 
2027  if (getCSCHisto(h::CSC_CFEBXX_LCT_PHASE_VS_L1A_PHASE, crateID, dmbID, nCFEB + 1, mo))
2028  mo->Fill(LCTPhase, L1APhase);
2029 
2030  if (getCSCHisto(h::CSC_CFEBXX_L1A_SYNC_TIME_VS_DMB, crateID, dmbID, nCFEB + 1, mo))
2031  mo->Fill((int)(dmbHeader->dmbCfebSync()), (int)UnpackedTrigTime);
2032 
2033  if (getCSCHisto(h::CSC_CFEBXX_L1A_SYNC_TIME_DMB_DIFF, crateID, dmbID, nCFEB + 1, mo)) {
2034  int cfeb_dmb_L1A_sync_time = (int)(dmbHeader->dmbCfebSync()) - (int)UnpackedTrigTime;
2035  if (cfeb_dmb_L1A_sync_time < -8)
2036  mo->Fill(cfeb_dmb_L1A_sync_time + 16);
2037  else {
2038  if (cfeb_dmb_L1A_sync_time >= 8)
2039  mo->Fill(cfeb_dmb_L1A_sync_time - 16);
2040  else
2041  mo->Fill(cfeb_dmb_L1A_sync_time);
2042  }
2043  mo->SetAxisRange(0.1, 1.1 * (1.0 + mo->GetBinContent(mo->GetMaximumBin())), "Y");
2044  }
2045  }
2046 
2047  for (int nStrip = 1; nStrip <= N_Strips; ++nStrip) {
2048  ADC = (int)((timeSample(data, nCFEB, nSample, nLayer, nStrip)->adcCounts) & 0xFFF);
2049  OutOffRange = (int)((timeSample(data, nCFEB, nSample, nLayer, nStrip)->adcOverflow) & 0x1);
2050 
2051  if (nSample == 0) { // nSample == 0
2052  CellPeak[nCFEB][nLayer - 1][nStrip - 1] = std::make_pair(nSample, ADC);
2053  Pedestal[nCFEB][nLayer - 1][nStrip - 1] = ADC;
2054  }
2055 
2056  if (OutOffRange == 1 && CheckOutOffRangeStripInTheLayer[nLayer - 1][nCFEB * 16 + nStrip - 1] == true) {
2057  if (mo_CFEB_Out_Off_Range_Strips)
2058  mo_CFEB_Out_Off_Range_Strips->Fill((int)(nCFEB * 16 + nStrip - 1));
2059  CheckOutOffRangeStripInTheLayer[nLayer - 1][nCFEB * 16 + nStrip - 1] = false;
2060  }
2061  if (ADC - Pedestal[nCFEB][nLayer - 1][nStrip - 1] > Threshold && OutOffRange != 1) {
2062  if (mo_CFEB_Active_Samples_vs_Strip)
2063  mo_CFEB_Active_Samples_vs_Strip->Fill((int)(nCFEB * 16 + nStrip - 1), nSample);
2064 
2065  if (mo_CFEB_Active_Samples_vs_Strip_Profile)
2066  mo_CFEB_Active_Samples_vs_Strip_Profile->Fill((int)(nCFEB * 16 + nStrip - 1), nSample);
2067 
2068  if (CheckThresholdStripInTheLayer[nLayer - 1][nCFEB * 16 + nStrip - 1] == true) {
2069  if (mo_CFEB_ActiveStrips)
2070  mo_CFEB_ActiveStrips->Fill((int)(nCFEB * 16 + nStrip));
2071  CheckThresholdStripInTheLayer[nLayer - 1][nCFEB * 16 + nStrip - 1] = false;
2072  }
2074  if (ADC - Pedestal[nCFEB][nLayer - 1][nStrip - 1] > Threshold) {
2075  cscdata[nCFEB * 16 + nStrip - 1][nSample][nLayer - 1] = ADC - Pedestal[nCFEB][nLayer - 1][nStrip - 1];
2076  }
2078  if (ADC > CellPeak[nCFEB][nLayer - 1][nStrip - 1].second) {
2079  CellPeak[nCFEB][nLayer - 1][nStrip - 1].first = nSample;
2080  CellPeak[nCFEB][nLayer - 1][nStrip - 1].second = ADC;
2081  }
2082  }
2085  if (nSample == 1) {
2086  int channel_threshold = 40;
2087  if (std::abs(ADC - Pedestal[nCFEB][nLayer - 1][nStrip - 1]) < channel_threshold) {
2088  if (mo_CFEB_Pedestal_withEMV_Sample)
2089  mo_CFEB_Pedestal_withEMV_Sample->Fill((int)(nCFEB * 16 + nStrip - 1),
2090  Pedestal[nCFEB][nLayer - 1][nStrip - 1]);
2091 
2092  if (mo_CFEB_Pedestal_withRMS_Sample) {
2093  mo_CFEB_Pedestal_withRMS_Sample->Fill((int)(nCFEB * 16 + nStrip - 1),
2094  Pedestal[nCFEB][nLayer - 1][nStrip - 1]);
2095 
2096  if (mo_CFEB_PedestalRMS_Sample) {
2097  mo_CFEB_PedestalRMS_Sample->SetBinContent(
2098  nCFEB * 16 + nStrip - 1, mo_CFEB_Pedestal_withRMS_Sample->GetBinError(nCFEB * 16 + nStrip));
2099  mo_CFEB_PedestalRMS_Sample->SetBinError(nCFEB * 16 + nStrip - 1, 0.00000000001);
2100  }
2101  }
2102  }
2103  Pedestal[nCFEB][nLayer - 1][nStrip - 1] += ADC;
2104  Pedestal[nCFEB][nLayer - 1][nStrip - 1] /= 2;
2105  }
2107  }
2108  }
2109 
2110  for (int nStrip = 1; nStrip <= N_Strips; ++nStrip) {
2111  if (mo_CFEB_SCA_Cell_Peak && CellPeak[nCFEB][nLayer - 1][nStrip - 1].first) {
2112  mo_CFEB_SCA_Cell_Peak->Fill((int)(nCFEB * 16 + nStrip - 1),
2113  CellPeak[nCFEB][nLayer - 1][nStrip - 1].first);
2114  if (mo_CFEB_SCA_CellPeak_Time) {
2115  mo_CFEB_SCA_CellPeak_Time->Fill(CellPeak[nCFEB][nLayer - 1][nStrip - 1].first);
2116  }
2117 
2118  if (mo_EventDisplay) {
2119  int peak_sample = CellPeak[nCFEB][nLayer - 1][nStrip - 1].first;
2120  int peak_adc = CellPeak[nCFEB][nLayer - 1][nStrip - 1].second;
2121  int pedestal = Pedestal[nCFEB][nLayer - 1][nStrip - 1];
2122  int peak_sca_charge = peak_adc - pedestal;
2123 
2124  if (peak_adc - pedestal > Threshold) {
2125  if (peak_sample >= 1) {
2126  peak_sca_charge +=
2127  ((timeSample(data, nCFEB, peak_sample - 1, nLayer, nStrip)->adcCounts) & 0xFFF) - pedestal;
2128  }
2129  if (peak_sample < NmbTimeSamples - 1) {
2130  peak_sca_charge +=
2131  ((timeSample(data, nCFEB, peak_sample + 1, nLayer, nStrip)->adcCounts) & 0xFFF) - pedestal;
2132  }
2133  mo_EventDisplay->SetBinContent(nLayer + 17, nCFEB * 16 + nStrip - 1, peak_sca_charge);
2135  mo_Emu_EventDisplay_Cathode, glChamberIndex, nCFEB * 16 + nStrip - 1, nLayer - 1);
2136  }
2137  }
2138 
2139  if (cid.endcap() == 1) {
2140  if (mo_CSC_Plus_endcap_CFEB_SCA_CellPeak_Time)
2141  mo_CSC_Plus_endcap_CFEB_SCA_CellPeak_Time->Fill(CellPeak[nCFEB][nLayer - 1][nStrip - 1].first);
2142  }
2143  if (cid.endcap() == 2) {
2144  if (mo_CSC_Minus_endcap_CFEB_SCA_CellPeak_Time)
2145  mo_CSC_Minus_endcap_CFEB_SCA_CellPeak_Time->Fill(CellPeak[nCFEB][nLayer - 1][nStrip - 1].first);
2146  }
2147  }
2148  }
2149  }
2150  }
2151  }
2152 
2153  // Fill Summary CFEB Raw Hits Timing Plots
2154  if (mo_CFEB_SCA_CellPeak_Time) {
2155  double cellpeak_time_mean = mo_CFEB_SCA_CellPeak_Time->getTH1()->GetMean();
2156  double cellpeak_time_rms = mo_CFEB_SCA_CellPeak_Time->getTH1()->GetRMS();
2157  if (cscPosition && mo_CSC_CFEB_SCA_CellPeak_Time_mean) {
2158  mo_CSC_CFEB_SCA_CellPeak_Time_mean->SetBinContent(cscPosition, cscType + 1, cellpeak_time_mean);
2159  }
2160  if (cscPosition && mo_CSC_CFEB_SCA_CellPeak_Time_rms) {
2161  mo_CSC_CFEB_SCA_CellPeak_Time_rms->SetBinContent(cscPosition, cscType + 1, cellpeak_time_rms);
2162  }
2163  }
2164 
2167  const int a = N_CFEBs * N_Strips;
2168  const int b = a * N_Samples;
2169  float Cathodes[b * N_Layers];
2170  for (int i = 0; i < N_Layers; ++i) {
2171  const int b1 = i * b;
2172  for (int j = 0; j < a; ++j) {
2173  const int b2 = b1 + j;
2174  for (int k = 0; k < N_Samples; ++k) {
2175  Cathodes[b2 + a * k] = cscdata[j][k][i];
2176  }
2177  }
2178  }
2179 
2180  std::vector<StripCluster> Clus;
2181  Clus.clear();
2182  StripClusterFinder ClusterFinder(N_Layers, N_Samples, N_CFEBs, N_Strips);
2183 
2184  for (int nLayer = 1; nLayer <= N_Layers; ++nLayer) {
2185  ClusterFinder.DoAction(nLayer - 1, Cathodes);
2186  Clus = ClusterFinder.getClusters();
2187 
2189  if (getCSCHisto(h::CSC_CFEB_NUMBER_OF_CLUSTERS_LY_XX, crateID, dmbID, nLayer, mo)) {
2190  mo->Fill(Clus.size());
2191  }
2192 
2193  for (uint32_t u = 0; u < Clus.size(); u++) {
2194  Clus_Sum_Charge = 0.0;
2195  for (uint32_t k = 0; k < Clus[u].ClusterPulseMapHeight.size(); k++) {
2196  for (int n = Clus[u].LFTBNDTime; n < Clus[u].IRTBNDTime; n++) {
2197  Clus_Sum_Charge = Clus_Sum_Charge + Clus[u].ClusterPulseMapHeight[k].height_[n];
2198  }
2199  }
2200 
2202  if (getCSCHisto(h::CSC_CFEB_CLUSTERS_CHARGE_LY_XX, crateID, dmbID, nLayer, mo)) {
2203  mo->Fill(Clus_Sum_Charge);
2204  }
2205 
2207  if (getCSCHisto(h::CSC_CFEB_WIDTH_OF_CLUSTERS_LY_XX, crateID, dmbID, nLayer, mo)) {
2208  mo->Fill(Clus[u].IRTBNDStrip - Clus[u].LFTBNDStrip + 1);
2209  }
2210 
2212  if (getCSCHisto(h::CSC_CFEB_CLUSTER_DURATION_LY_XX, crateID, dmbID, nLayer, mo)) {
2213  mo->Fill(Clus[u].IRTBNDTime - Clus[u].LFTBNDTime + 1);
2214  }
2215  }
2216 
2217  Clus.clear();
2218 
2220  }
2221 
2225  if (getCSCHisto(h::CSC_DMB_FEB_COMBINATIONS_UNPACKED_VS_DAV, crateID, dmbID, mo)) {
2226  float feb_combination_unpacked = -1.0;
2227  if (alct_unpacked == 0 && tmb_unpacked == 0 && cfeb_unpacked == 0)
2228  feb_combination_unpacked = 0.0;
2229  if (alct_unpacked > 0 && tmb_unpacked == 0 && cfeb_unpacked == 0)
2230  feb_combination_unpacked = 1.0;
2231  if (alct_unpacked == 0 && tmb_unpacked > 0 && cfeb_unpacked == 0)
2232  feb_combination_unpacked = 2.0;
2233  if (alct_unpacked == 0 && tmb_unpacked == 0 && cfeb_unpacked > 0)
2234  feb_combination_unpacked = 3.0;
2235  if (alct_unpacked > 0 && tmb_unpacked > 0 && cfeb_unpacked == 0)
2236  feb_combination_unpacked = 4.0;
2237  if (alct_unpacked > 0 && tmb_unpacked == 0 && cfeb_unpacked > 0)
2238  feb_combination_unpacked = 5.0;
2239  if (alct_unpacked == 0 && tmb_unpacked > 0 && cfeb_unpacked > 0)
2240  feb_combination_unpacked = 6.0;
2241  if (alct_unpacked > 0 && tmb_unpacked > 0 && cfeb_unpacked > 0)
2242  feb_combination_unpacked = 7.0;
2243  mo->Fill(feb_combination_dav, feb_combination_unpacked);
2244  }
2245 
2246  if ((clct_kewdistrip > -1 && alct_keywg > -1) &&
2248  mo->Fill(alct_keywg, clct_kewdistrip);
2249  }
2250 
2251  if (L1A_out_of_sync && cscPosition && getEMUHisto(h::EMU_CSC_L1A_OUT_OF_SYNC, mo)) {
2252  mo->Fill(cscPosition, cscType);
2253  }
2254 
2255  if (L1A_out_of_sync && getEMUHisto(h::EMU_DMB_L1A_OUT_OF_SYNC, mo)) {
2256  mo->Fill(crateID, dmbID);
2257  }
2258  }
CSCTMBTrailer * tmbTrailer()
Definition: CSCTMBData.h:51
uint16_t CLCTOnly() const
Definition: CSCTMBHeader.h:46
unsigned cfeb_full() const
Definition: CSCDMBTrailer.h:52
unsigned dmbCfebSync() const
Definition: CSCDMBHeader.h:45
CSCGEMData * gemData()
Definition: CSCTMBData.cc:409
unsigned tmb_starttimeout() const
Definition: CSCDMBTrailer.h:36
unsigned int GlobalChamberIndex(unsigned int side, unsigned int station, unsigned int ring, unsigned int chamber) const
Return global chamber index on his geometric location.
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
unsigned alct_endtimeout() const
Definition: CSCDMBTrailer.h:31
#define LOG_INFO
Definition: CSCDQM_Logger.h:42
unsigned short adcOverflow
ExaminerStatusType errorsForChamber(CSCIdType chamber) const
unsigned nalct() const
Definition: CSCDMBHeader.h:42
unsigned cfeb_starttimeout() const
Definition: CSCDMBTrailer.h:37
const bool getCSCFromMap(const unsigned int &crateId, const unsigned int &dmbId, unsigned int &cscType, unsigned int &cscPosition) const
Get CSC type and position from crate and dmb identifiers.
uint16_t clct1_xky() const
Definition: CSCTMBHeader.h:82
uint16_t alctHMT() const
Definition: CSCTMBHeader.h:85
int FirmwareRevision() const
Definition: CSCTMBHeader.h:41
uint16_t Bxn0Diff() const
Definition: CSCTMBHeader.h:50
uint16_t gem_timing_dataword() const
Definition: CSCTMBHeader.h:92
Definition: config.py:1
unsigned cfebMovlp() const
Definition: CSCDMBHeader.h:44
CSCCFEBSCAControllerWord scaControllerWord(int layer) const
unpacked from the controller words for each channel in the layer
void setEmuEventDisplayBit(MonitorObject *&mo, const unsigned int x, const unsigned int y, const unsigned int bit)
Set a single bit in the 3D Histogram (aka EMU level event display). Checks if mo and x != null...
unsigned cfeb_empty() const
Definition: CSCDMBTrailer.h:44
unsigned tmb_empty() const
Definition: CSCDMBTrailer.h:43
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
std::vector< GEMPadDigiCluster > etaDigis(int gem_chamber, int eta, int correctionToALCTbx) const
Definition: CSCGEMData.cc:148
const bool getCSCHisto(const HistoId &histo, const HwId &crateID, const HwId &dmbSlot, MonitorObject *&me)
Get CSC (Chamber) Level Monitoring Object.
uint16_t L1ANumber() const
Definition: CSCTMBHeader.h:53
uint16_t ALCTOnly() const
Definition: CSCTMBHeader.h:47
U second(std::pair< T, U > const &p)
unsigned cfeb_endtimeout() const
Definition: CSCDMBTrailer.h:33
std::vector< GEMPadDigiCluster > digis(int gem_chamber) const
Definition: CSCGEMData.cc:67
uint16_t clct0_ComparatorCode() const
== Run 3 CSC-GEM Trigger Format
Definition: CSCTMBHeader.h:79
uint16_t ALCTMatchTime() const
Definition: CSCTMBHeader.h:44
uint16_t hmt_ALCTMatchTime() const
Definition: CSCTMBHeader.h:84
uint16_t BXNCount() const
Definition: CSCTMBHeader.h:43
int wordCount() const
unsigned alct_half() const
Definition: CSCDMBTrailer.h:46
unsigned alct_empty() const
Definition: CSCDMBTrailer.h:42
unsigned short int L1Acc() const
Definition: CSCALCTHeader.h:98
unsigned get_l1pipe_empty() const
std::vector< CSCWireDigi > wireDigis(int layer) const
input layer is from 1 to 6
Definition: CSCAnodeData.h:21
CSCDetId chamberID(const CSCDetId &cscDetId)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
unsigned get_n_free_sca_blocks() const
unsigned tmb_endtimeout() const
Definition: CSCDMBTrailer.h:32
const std::string getPath() const override
Get path part of the histogram (used only for DDUs and CSCs)
unsigned tmb_full() const
Definition: CSCDMBTrailer.h:51
bias2_t b2[25]
Definition: b2.h:9
bool isChamberStandby(unsigned int side, unsigned int station, unsigned int ring, unsigned int chamber) const
Check if chamber is in standby?
int FirmwareVersion() const
Definition: CSCTMBHeader.h:40
unsigned short int BXNCount() const
Definition: CSCALCTHeader.h:62
std::vector< CSCCLCTDigi > CLCTDigis(uint32_t idlayer)
returns CLCT digis
Definition: CSCTMBHeader.h:102
unsigned dmbID() const
Definition: CSCDMBHeader.h:36
unsigned nclct() const
Definition: CSCDMBHeader.h:43
int station() const
Definition: CSCDetId.h:79
unsigned short int alctFirmwareVersion() const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const Detector getDetector() const
unsigned crateID() const
Definition: CSCDMBHeader.h:35
unsigned tmb_half() const
Definition: CSCDMBTrailer.h:47
uint16_t NCFEBs() const
Definition: CSCTMBHeader.h:69
int numGEMs() const
Definition: CSCGEMData.h:22
double b
Definition: hdecay.h:120
int endcap() const
Definition: CSCDetId.h:85
unsigned get_lctpipe_full() const
CSCCFEBTimeSlice const *const timeSlice(T const &data, int nCFEB, int nSample)
uint16_t TMBMatch() const
Definition: CSCTMBHeader.h:48
#define LOG_WARN
Definition: CSCDQM_Logger.h:41
CSCTMBHeader * tmbHeader()
Definition: CSCTMBData.h:40
unsigned l1a24() const
Definition: CSCDMBHeader.h:40
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
std::vector< CSCALCTDigi > ALCTDigis() const
CSCCFEBDataWord const *const timeSample(T const &data, int nCFEB, int nSample, int nLayer, int nStrip)
double a
Definition: hdecay.h:121
unsigned cfeb_half() const
Definition: CSCDMBTrailer.h:48
uint16_t run3_CLCT_patternID() const
Definition: CSCTMBHeader.h:93
unsigned get_l1pipe_full() const
uint16_t Bxn1Diff() const
Definition: CSCTMBHeader.h:51
bool hasGEM() const
Definition: CSCTMBData.h:55
bool fCloseL1As
Data Format version (2005, 2013)
unsigned get_lctpipe_count() const
unsigned short int alctFirmwareRevision() const
unsigned alct_starttimeout() const
Definition: CSCDMBTrailer.h:35
std::vector< CSCComparatorDigi > comparatorDigis(int layer)
layers count from one
unsigned get_buffer_count() const
Definition: errors.py:1
uint16_t theFormatVersion
Total Number of TMBs per event from DMB DAV.
int wordCount() const
unsigned dmb_l1pipe() const
Definition: CSCDMBTrailer.h:40
unsigned short adcCounts
int ring() const
Definition: CSCDetId.h:68
unsigned alct_full() const
Definition: CSCDMBTrailer.h:50
const bool getEMUHisto(const HistoId &histo, MonitorObject *&me)
Get EMU (Top Level) Monitoring Object.
unsigned bxn12() const
Definition: CSCDMBHeader.h:38
std::vector< CSCCorrelatedLCTDigi > CorrelatedLCTDigis(uint32_t idlayer) const
returns CorrelatedLCT digis
Definition: CSCTMBHeader.h:105
unsigned get_lctpipe_empty() const
uint16_t gem_enabled_fibers() const
Definition: CSCTMBHeader.h:87
std::vector< CSCShowerDigi > alctShowerDigis() const
bool cfebAvailable(unsigned icfeb)
Definition: CSCDMBHeader.h:21
uint16_t clct0_xky() const
Definition: CSCTMBHeader.h:81
uint16_t hmt_nhits() const
Definition: CSCTMBHeader.h:83
uint16_t clctHMT() const
Definition: CSCTMBHeader.h:86
#define LOG_ERROR
Definition: CSCDQM_Logger.h:40
static constexpr float b1
struct ADC ADC
unsigned cfebActive() const
Definition: CSCDMBHeader.h:34
uint16_t gem_sync_dataword() const
Definition: CSCTMBHeader.h:91

◆ processDDU()

void cscdqm::EventProcessor::processDDU ( const CSCDDUEventData dduData,
const CSCDCCExaminer binChecker 
)
private

Process DDU output and fill MOs.

Parameters
dduDataDDU object to process

LOG4CPLUS_WARN(logger_,eTag << "Skipped because of DDU Trailer check failed.");

















New CSC readout without DCCs. CMS CSC DDU ID range 830-869

Only 8bits are significant; format of DDU id is Dxx















DDU word counter














LOG4CPLUS_DEBUG(logger_,dduTag << " Trailer Word (64 bits) Count = " << std::dec << trl_word_count);













if (fCloseL1As) LOG4CPLUS_DEBUG(logger_,eTag << " Close L1As bit is set");












DDU Header bunch crossing number (BXN)











LOG4CPLUS_WARN(logger_,dduTag << " DDU Header BXN Number = " << std::dec << BXN);










L1A number from DDU Header









LOG4CPLUS_DEBUG(logger_,dduTag << " Header L1A Number = " << std::dec << L1ANumber);








Handle 24-bit L1A roll-over maximum value case







== Occupancy and number of DMB (CSC) with Data available (DAV) in header of particular DDU






== Number of active DMB (CSC) in header of particular DDU





LOG4CPLUS_DEBUG(logger_,dduTag << " Header DMB DAV = 0x" << std::hex << dmb_dav_header);




LOG4CPLUS_DEBUG(logger_,dduTag << " Header Number of Active DMB = " << std::dec << dmb_active_header);



Check binary Error status at DDU Trailer


LOG4CPLUS_DEBUG(logger_,dduTag << " Trailer Error Status = 0x" << std::hex << trl_errorstat);

  Check DDU Output Path status in DDU Header

uint32_t ddu_output_path_status = dduHeader.output_path_status(); if (getEMUHisto(h::EMU_ALL_DDUS_OUTPUT_PATH_STATUS, mo)) { if (ddu_output_path_status) { mo->Fill(dduID, 1); // Any Error for (int i = 0; i < 16; i++) { if ((ddu_output_path_status >> i) & 0x1) { mo->Fill(dduID, i + 2); // Fill Summary Histo } } } else { mo->Fill(dduID, 0); // No Errors } }

uint32_t nCSCs = 0;

/** Unpack all found CSC
First event per DDU

Definition at line 27 of file CSCDQM_EventProcessor_processDDU.cc.

References BXN, CSCDDUHeader::bxnum(), CSCDDUTrailer::check(), CSCDDUEventData::cscData(), cscdqm::h::DDU_BUFFER_SIZE, cscdqm::h::DDU_BXN, cscdqm::h::DDU_CSC_ERRORS, cscdqm::h::DDU_CSC_ERRORS_RATE, cscdqm::h::DDU_CSC_WARNINGS, cscdqm::h::DDU_CSC_WARNINGS_RATE, cscdqm::h::DDU_DMB_ACTIVE_HEADER_COUNT, cscdqm::h::DDU_DMB_CONNECTED_INPUTS, cscdqm::h::DDU_DMB_CONNECTED_INPUTS_RATE, cscdqm::h::DDU_DMB_DAV_HEADER_COUNT_VS_DMB_ACTIVE_HEADER_COUNT, cscdqm::h::DDU_DMB_DAV_HEADER_OCCUPANCY, cscdqm::h::DDU_DMB_DAV_HEADER_OCCUPANCY_RATE, cscdqm::h::DDU_DMB_UNPACKED_VS_DAV, cscdqm::h::DDU_L1A_INCREMENT, cscdqm::h::DDU_TRAILER_ERRORSTAT_FREQUENCY, cscdqm::h::DDU_TRAILER_ERRORSTAT_RATE, cscdqm::h::DDU_TRAILER_ERRORSTAT_TABLE, cscdqm::h::DDU_WORD_COUNT, CSCDDUHeader::dmb_dav(), CSCDDUTrailer::dmb_full(), CSCDDUTrailer::dmb_warn(), cscdqm::h::EMU_ALL_DDUS_AVERAGE_EVENT_SIZE, cscdqm::h::EMU_ALL_DDUS_AVERAGE_INPUTS_WITH_DATA, cscdqm::h::EMU_ALL_DDUS_AVERAGE_LIVE_INPUTS, cscdqm::h::EMU_ALL_DDUS_EVENT_SIZE, cscdqm::h::EMU_ALL_DDUS_IN_READOUT, cscdqm::h::EMU_ALL_DDUS_INPUTS_ERRORS, cscdqm::h::EMU_ALL_DDUS_INPUTS_WARNINGS, cscdqm::h::EMU_ALL_DDUS_INPUTS_WITH_DATA, cscdqm::h::EMU_ALL_DDUS_L1A_INCREMENT, cscdqm::h::EMU_ALL_DDUS_LIVE_INPUTS, cscdqm::h::EMU_ALL_DDUS_OUTPUT_PATH_STATUS, cscdqm::h::EMU_ALL_DDUS_TRAILER_ERRORS, cscdqm::h::EMU_DDU_BXN, CSCDDUTrailer::errorstat(), fCloseL1As, cscdqm::MonitorObject::Fill(), fNotFirstEvent, cscdqm::MonitorObject::GetBinContent(), getDDUHisto(), getEMUHisto(), cscdqm::DDUHistoDef::getPath(), cscdqm::Utility::getRUIfromDDUId(), CSCDDUEventData::header(), mps_fire::i, createfilelist::int, L1ANumber, L1ANumbers, CSCDDUHeader::live_cscs(), LOG_WARN, CSCDDUHeader::lvl1num(), FEDNumbering::MAXCSCDDUFEDID, FEDNumbering::MINCSCDDUFEDID, CSCDDUHeader::ncsc(), CSCDDUHeader::output_path_status(), processCSC(), CSCDDUTrailer::reserved(), cscdqm::MonitorObject::SetBinContent(), cscdqm::MonitorObject::SetEntries(), CSCDDUEventData::sizeInWords(), CSCDDUHeader::source_id(), AlCaHLTBitMon_QueryRunRegistry::string, CSCDDUEventData::trailer(), and CSCDDUTrailer::wordcount().

27  {
28  CSCDDUHeader dduHeader = dduData.header();
29  CSCDDUTrailer dduTrailer = dduData.trailer();
30  if (!dduTrailer.check()) {
32  return;
33  }
34 
35  int dduID = dduHeader.source_id();
36 
37  if ((dduID >= FEDNumbering::MINCSCDDUFEDID) &&
38  (dduID <= FEDNumbering::MAXCSCDDUFEDID))
39  {
40  // dduID -= (FEDNumbering::MINCSCDDUFEDID - 1); /// TODO: Can require DDU-RUI remapping for actual system
41  dduID = cscdqm::Utility::getRUIfromDDUId(dduHeader.source_id());
42  if (dduID < 0) {
43  LOG_WARN << "DDU source ID (" << dduHeader.source_id() << ") is out of valid range. Remapping to DDU ID 1.";
44  dduID = 1;
45  }
46  } else {
48  dduID = dduID & 0xFF;
49  }
50 
51  MonitorObject* mo = nullptr;
52 
54  mo->Fill(dduID);
55  }
56 
57  std::string dduTag = DDUHistoDef::getPath(dduID);
58 
59  uint32_t dduEvtSize = dduData.sizeInWords() * 2;
60 
61  // if (dduEvtSize > 48)
62  {
64  int trl_word_count = 0;
65  trl_word_count = dduTrailer.wordcount();
66 
67  if (getDDUHisto(h::DDU_BUFFER_SIZE, dduID, mo))
68  mo->Fill(dduEvtSize);
69 
70  if (getDDUHisto(h::DDU_WORD_COUNT, dduID, mo))
71  mo->Fill(trl_word_count);
72 
75  if (trl_word_count > 0) {
77  mo->Fill(dduID, log10((double)trl_word_count));
78  }
79  }
80 
82  mo->Fill(dduID, trl_word_count);
83  }
84  }
85 
86  fCloseL1As = dduTrailer.reserved() & 0x1; // Get status if Close L1As bit
90  BXN = dduHeader.bxnum();
92  if (getEMUHisto(h::EMU_DDU_BXN, mo))
93  mo->Fill(BXN);
94  if (getDDUHisto(h::DDU_BXN, dduID, mo))
95  mo->Fill(BXN);
96 
98  int L1ANumber_previous_event = L1ANumbers[dduID];
99  L1ANumbers[dduID] = (int)(dduHeader.lvl1num());
100  L1ANumber = L1ANumbers[dduID];
102  int L1A_inc = L1ANumber - L1ANumber_previous_event;
103 
105  if (L1A_inc < 0)
106  L1A_inc = 0xFFFFFF + L1A_inc;
107 
108  // if (!fFirstEvent) {
109  if (fNotFirstEvent[dduID]) {
110  if (getDDUHisto(h::DDU_L1A_INCREMENT, dduID, mo))
111  mo->Fill(L1A_inc);
113  if (L1A_inc > 100000) {
114  L1A_inc = 19;
115  } else if (L1A_inc > 30000) {
116  L1A_inc = 18;
117  } else if (L1A_inc > 10000) {
118  L1A_inc = 17;
119  } else if (L1A_inc > 3000) {
120  L1A_inc = 16;
121  } else if (L1A_inc > 1000) {
122  L1A_inc = 15;
123  } else if (L1A_inc > 300) {
124  L1A_inc = 14;
125  } else if (L1A_inc > 100) {
126  L1A_inc = 13;
127  } else if (L1A_inc > 30) {
128  L1A_inc = 12;
129  } else if (L1A_inc > 10) {
130  L1A_inc = 11;
131  }
132  mo->Fill(dduID, L1A_inc);
133  }
134  }
135 
137  int dmb_dav_header = 0;
138  int dmb_dav_header_cnt = 0;
139 
140  int ddu_connected_inputs = 0;
141  int ddu_connected_inputs_cnt = 0;
142 
143  int csc_error_state = 0;
144  int csc_warning_state = 0;
145 
147  int dmb_active_header = 0;
148 
149  dmb_dav_header = dduHeader.dmb_dav();
150  dmb_active_header = (int)(dduHeader.ncsc() & 0xF);
151  csc_error_state = dduTrailer.dmb_full() & 0x7FFF; // Only 15 inputs for DDU
152  csc_warning_state = dduTrailer.dmb_warn() & 0x7FFF; // Only 15 inputs for DDU
153  ddu_connected_inputs = dduHeader.live_cscs();
154 
158  double freq = 0;
159  for (int i = 0; i < 15; ++i) {
160  if ((dmb_dav_header >> i) & 0x1) {
161  dmb_dav_header_cnt++;
163  mo->Fill(i + 1);
164  freq = (100.0 * mo->GetBinContent(i + 1)) / config->getNEvents();
166  mo->SetBinContent(i + 1, freq);
167  }
169  mo->Fill(dduID, i);
170  }
171  }
172 
173  if ((ddu_connected_inputs >> i) & 0x1) {
174  ddu_connected_inputs_cnt++;
176  mo->Fill(i + 1);
177  freq = (100.0 * mo->GetBinContent(i + 1)) / config->getNEvents();
179  mo->SetBinContent(i + 1, freq);
180  }
182  mo->Fill(dduID, i);
183  }
184  }
185 
186  if ((csc_error_state >> i) & 0x1) {
187  if (getDDUHisto(h::DDU_CSC_ERRORS_RATE, dduID, mo)) {
188  mo->Fill(i + 1);
189  freq = (100.0 * mo->GetBinContent(i + 1)) / config->getNEvents();
190  if (getDDUHisto(h::DDU_CSC_ERRORS, dduID, mo))
191  mo->SetBinContent(i + 1, freq);
192  }
194  mo->Fill(dduID, i + 2);
195  }
196  }
197 
198  if ((csc_warning_state >> i) & 0x1) {
199  if (getDDUHisto(h::DDU_CSC_WARNINGS_RATE, dduID, mo)) {
200  mo->Fill(i + 1);
201  freq = (100.0 * mo->GetBinContent(i + 1)) / config->getNEvents();
202  if (getDDUHisto(h::DDU_CSC_WARNINGS, dduID, mo))
203  mo->SetBinContent(i + 1, freq);
204  }
206  mo->Fill(dduID, i + 2);
207  }
208  }
209  }
210 
212  mo->Fill(dduID, ddu_connected_inputs_cnt);
213  }
214 
215  // if (dduEvtSize > 48)
216  {
218  mo->Fill(dduID, dmb_dav_header_cnt);
219  }
220  }
221 
223  if (csc_error_state > 0) {
224  mo->Fill(dduID, 1); // Any Input
225  } else {
226  mo->Fill(dduID, 0); // No errors
227  }
228  }
229 
231  if (csc_warning_state > 0) {
232  mo->Fill(dduID, 1); // Any Input
233  } else {
234  mo->Fill(dduID, 0); // No errors
235  }
236  }
237 
239  mo->SetEntries(config->getNEvents());
241  mo->SetEntries(config->getNEvents());
242  if (getDDUHisto(h::DDU_CSC_ERRORS, dduID, mo))
243  mo->SetEntries(config->getNEvents());
244  if (getDDUHisto(h::DDU_CSC_WARNINGS, dduID, mo))
245  mo->SetEntries(config->getNEvents());
247  mo->Fill(dmb_active_header);
249  mo->Fill(dmb_active_header, dmb_dav_header_cnt);
250 
252  uint32_t trl_errorstat = dduTrailer.errorstat();
253  if (dmb_dav_header_cnt == 0)
254  trl_errorstat &= ~0x20000000; // Ignore No Good DMB CRC bit of no DMB is present
256  for (int i = 0; i < 32; i++) {
257  if ((trl_errorstat >> i) & 0x1) {
258  if (getDDUHisto(h::DDU_TRAILER_ERRORSTAT_RATE, dduID, mo)) {
259  mo->Fill(i);
260  double freq = (100.0 * mo->GetBinContent(i + 1)) / config->getNEvents();
262  mo->SetBinContent(i + 1, freq);
263  }
265  mo->Fill(0., i);
266  }
267  }
269  if (trl_errorstat) {
270  mo->Fill(dduID, 1); // Any Error
271  for (int i = 0; i < 32; i++) {
272  if ((trl_errorstat >> i) & 0x1) {
273  mo->Fill(dduID, i + 2);
274  }
275  }
276  } else {
277  mo->Fill(dduID, 0); // No Errors
278  }
279  }
280 
282  mo->SetEntries(config->getNEvents());
284  mo->SetEntries(config->getNEvents());
285 
287  uint32_t ddu_output_path_status = dduHeader.output_path_status();
289  if (ddu_output_path_status) {
290  mo->Fill(dduID, 1); // Any Error
291  for (int i = 0; i < 16; i++) {
292  if ((ddu_output_path_status >> i) & 0x1) {
293  mo->Fill(dduID, i + 2); // Fill Summary Histo
294  }
295  }
296  } else {
297  mo->Fill(dduID, 0); // No Errors
298  }
299  }
300 
301  uint32_t nCSCs = 0;
302 
304  if (config->getPROCESS_CSC()) {
305  std::vector<CSCEventData> chamberDatas;
306  chamberDatas.clear();
307  chamberDatas = dduData.cscData();
308 
309  nCSCs = chamberDatas.size();
310 
311  for (uint32_t i = 0; i < nCSCs; i++) {
312  processCSC(chamberDatas[i], dduID, binChecker);
313  }
314  }
315 
316  if (getDDUHisto(h::DDU_DMB_UNPACKED_VS_DAV, dduID, mo))
317  mo->Fill(dmb_active_header, nCSCs);
318 
319  // fFirstEvent = false;
320 
322  fNotFirstEvent[dduID] = true;
323  }
unsigned dmb_full() const
Definition: CSCDDUTrailer.h:42
int bxnum() const
Definition: CSCDDUHeader.h:23
unsigned reserved() const
Definition: CSCDDUTrailer.h:43
const bool getDDUHisto(const HistoId &histo, const HwId &dduID, MonitorObject *&me)
Get DDU Level Monitoring Object.
static int getRUIfromDDUId(unsigned ddu_id)
Get RUI Number from DDU source ID for post LS1 configuration.
void processCSC(const CSCEventData &data, const int dduID, const CSCDCCExaminer &binChecker)
Process Chamber Data and fill MOs.
std::map< uint32_t, uint32_t > L1ANumbers
Definition: config.py:1
int sizeInWords() const
int output_path_status() const
Definition: CSCDDUHeader.h:30
int source_id() const
Definition: CSCDDUHeader.h:22
unsigned wordcount() const
Definition: CSCDDUTrailer.h:37
const std::vector< CSCEventData > & cscData() const
accessor to data
const std::string getPath() const override
Get path part of the histogram (used only for DDUs and CSCs)
int ncsc() const
Definition: CSCDDUHeader.h:26
CSCDDUHeader header() const
int live_cscs() const
Definition: CSCDDUHeader.h:29
bool check() const
Definition: CSCDDUTrailer.h:25
#define LOG_WARN
Definition: CSCDQM_Logger.h:41
int dmb_dav() const
Definition: CSCDDUHeader.h:27
bool fCloseL1As
Data Format version (2005, 2013)
int lvl1num() const
Definition: CSCDDUHeader.h:24
unsigned dmb_warn() const
Definition: CSCDDUTrailer.h:41
std::map< uint32_t, bool > fNotFirstEvent
const bool getEMUHisto(const HistoId &histo, MonitorObject *&me)
Get EMU (Top Level) Monitoring Object.
unsigned errorstat() const
Definition: CSCDDUTrailer.h:36
CSCDDUTrailer trailer() const

◆ processExaminer() [1/2]

bool cscdqm::EventProcessor::processExaminer ( const CSCDCCExaminer binChecker)
private

◆ processExaminer() [2/2]

bool cscdqm::EventProcessor::processExaminer ( const CSCDCCExaminer binChecker,
const CSCDCCFormatStatusDigi digi 
)
private

Fill monitor elements with CSCDCCFormatStatusDigi information.

Returns
true if this buffer (event) was accepted by Examiner else otherwise

New CSC readout without DCCs. CMS CSC DDU ID range 830-869

Check and fill CSC Payload information






Update counters





Get FEBs Data Available Info




Increment total number of CFEBs, ALCTs, TMBs



Fill Histogram for FEB DAV Efficiency


Fill Histogram for Different Combinations of FEB DAV Efficiency

Check and fill CSC Data Flow Problems
Check and fill CSC Format Errors

Definition at line 27 of file CSCDQM_EventProcessor_processExaminer.cc.

References cscdqm::BAD_EVENTS, triggerObjects_cff::bit, CSCDigiToRawAccept::chamberID(), cntALCTs, cntCFEBs, cntDMBs, cntTMBs, cscdqm::h::CSC_ACTUAL_DMB_CFEB_DAV_FREQUENCY, cscdqm::h::CSC_ACTUAL_DMB_CFEB_DAV_MULTIPLICITY_FREQUENCY, cscdqm::h::CSC_ACTUAL_DMB_CFEB_DAV_MULTIPLICITY_RATE, cscdqm::h::CSC_ACTUAL_DMB_CFEB_DAV_RATE, cscdqm::h::CSC_ACTUAL_DMB_FEB_COMBINATIONS_DAV_FREQUENCY, cscdqm::h::CSC_ACTUAL_DMB_FEB_COMBINATIONS_DAV_RATE, cscdqm::h::CSC_ACTUAL_DMB_FEB_DAV_FREQUENCY, cscdqm::h::CSC_ACTUAL_DMB_FEB_DAV_RATE, cscdqm::h::CSC_BINCHECK_DATAFLOW_PROBLEMS_TABLE, cscdqm::h::CSC_BINCHECK_ERRORSTAT_TABLE, cscdqm::h::CSC_DMB_CFEB_ACTIVE_VS_DAV, cscdqm::h::CSC_DMB_CFEB_DAV, cscdqm::h::CSC_DMB_CFEB_DAV_MULTIPLICITY, cscdqm::h::CSC_DMB_CFEB_DAV_MULTIPLICITY_UNPACKING_INEFFICIENCY, cscdqm::h::CSC_DMB_CFEB_DAV_UNPACKING_INEFFICIENCY, cscdqm::h::CSC_DMB_FEB_COMBINATIONS_DAV_RATE, cscdqm::h::CSC_DMB_FEB_COMBINATIONS_DAV_UNPACKING_INEFFICIENCY, cscdqm::h::CSC_DMB_FEB_DAV_RATE, cscdqm::h::CSC_DMB_FEB_DAV_UNPACKING_INEFFICIENCY, cscdqm::DMB_EVENTS, cscdqm::DMB_TRIGGERS, cscdqm::h::EMU_ALL_DDUS_FORMAT_ERRORS, cscdqm::h::EMU_CSC_DMB_INPUT_FIFO_FULL, cscdqm::h::EMU_CSC_DMB_INPUT_TIMEOUT, cscdqm::h::EMU_CSC_FORMAT_ERRORS, cscdqm::h::EMU_CSC_FORMAT_WARNINGS, cscdqm::h::EMU_CSC_REPORTING, cscdqm::h::EMU_CSC_UNPACKED_WITH_ERRORS, cscdqm::h::EMU_CSC_WO_ALCT, cscdqm::h::EMU_CSC_WO_CFEB, cscdqm::h::EMU_CSC_WO_CLCT, cscdqm::h::EMU_DMB_FORMAT_ERRORS, cscdqm::h::EMU_DMB_FORMAT_WARNINGS, cscdqm::h::EMU_DMB_INPUT_FIFO_FULL, cscdqm::h::EMU_DMB_INPUT_TIMEOUT, cscdqm::h::EMU_DMB_REPORTING, cscdqm::h::EMU_DMB_UNPACKED_WITH_ERRORS, cscdqm::h::EMU_DMB_WO_ALCT, cscdqm::h::EMU_DMB_WO_CFEB, cscdqm::h::EMU_DMB_WO_CLCT, cscdqm::MonitorObject::Fill(), cscdqm::MonitorObject::GetBinContent(), CSCDCCFormatStatusDigi::getCSCErrors(), getCSCFromMap(), getCSCHisto(), CSCDCCFormatStatusDigi::getCSCPayload(), CSCDCCFormatStatusDigi::getCSCStatus(), CSCDCCFormatStatusDigi::getDDUErrors(), CSCDCCFormatStatusDigi::getDDUSummaryErrors(), getEMUHisto(), CSCDCCFormatStatusDigi::getListOfDDUs(), cscdqm::Utility::getRUIfromDDUId(), mps_fire::i, LOG_WARN, FEDNumbering::MAXCSCDDUFEDID, FEDNumbering::MINCSCDDUFEDID, CSCDCCFormatStatusDigi::nextCSCWithError(), CSCDCCFormatStatusDigi::nextCSCWithPayload(), CSCDCCFormatStatusDigi::nextCSCWithStatus(), CSCDCCExaminer::nSTATUSES, jetsAK4_Puppi_cff::payload, cscdqm::MonitorObject::SetBinContent(), cscdqm::MonitorObject::SetEntries(), and cscdqm::MonitorObject::SetMaximum().

27  {
28  bool eventAccepted = true;
29  MonitorObject* mo = nullptr;
30 
31  uint32_t binErrorStatus = digi.getDDUSummaryErrors();
32 
34  const std::set<DDUIdType> DDUs = digi.getListOfDDUs();
35  for (std::set<DDUIdType>::const_iterator ddu_itr = DDUs.begin(); ddu_itr != DDUs.end(); ++ddu_itr) {
36  ExaminerStatusType errs = digi.getDDUErrors(*ddu_itr);
37  int dduID = (*ddu_itr) & 0xFF;
38  if (((*ddu_itr) >= FEDNumbering::MINCSCDDUFEDID) &&
39  ((*ddu_itr) <=
41  {
42  // dduID = (*ddu_itr) - FEDNumbering::MINCSCDDUFEDID + 1; /// TODO: Can require DDU-RUI remapping for actual system
43  dduID = cscdqm::Utility::getRUIfromDDUId((*ddu_itr));
44  if (dduID < 0) {
45  LOG_WARN << "DDU source ID (" << (*ddu_itr) << ") is out of valid range. Remapping to DDU ID 1.";
46  dduID = 1;
47  }
48  }
49  if (errs != 0) {
50  for (int i = 0; i < 29; i++) {
51  if ((errs >> i) & 0x1) {
52  mo->Fill(dduID, i + 1);
53  }
54  }
55  } else {
56  mo->Fill(dduID, 0);
57  }
58  }
59  }
60 
61  // =VB= We want to use DCC level check mask as in CSCDCCUnpacker and not DDU mask
62  // Otherwise whole DCC event could be skipped because of a single chamber error
63  unsigned long dccBinCheckMask = 0x06080016;
64  // if ((binErrorStatus & config->getDDU_BINCHECK_MASK()) > 0) {
65  if ((binErrorStatus & dccBinCheckMask) > 0) {
66  eventAccepted = false;
67  }
68 
69  if (binErrorStatus != 0) {
70  config->incNEventsBad();
71  }
72 
75  {
76  uint32_t i = 0;
77  CSCIdType chamberID = 0;
78  while (digi.nextCSCWithPayload(i, chamberID)) {
79  int crateID = (chamberID >> 4) & 0xFF;
80  int dmbSlot = chamberID & 0xF;
81 
82  if (crateID == 255) {
83  continue;
84  }
85  if ((crateID > 60) || (dmbSlot > 10) || (crateID <= 0) || (dmbSlot <= 0)) {
86  continue;
87  }
88 
89  // Check if in standby!
90  {
91  CSCDetId cid;
92  if (!config->fnGetCSCDetId(crateID, dmbSlot, cid)) {
93  continue;
94  }
95  }
96 
98  config->incChamberCounter(DMB_EVENTS, crateID, dmbSlot);
99  long DMBEvents = config->getChamberCounterValue(DMB_EVENTS, crateID, dmbSlot);
100  config->copyChamberCounterValue(DMB_EVENTS, DMB_TRIGGERS, crateID, dmbSlot);
101  cntDMBs++;
102 
104  mo->Fill(crateID, dmbSlot);
105  }
106 
107  unsigned int cscType = 0;
108  unsigned int cscPosition = 0;
109  if (!getCSCFromMap(crateID, dmbSlot, cscType, cscPosition))
110  continue;
111 
112  if (cscPosition && getEMUHisto(h::EMU_CSC_REPORTING, mo)) {
113  mo->Fill(cscPosition, cscType);
114  }
115 
117  long payload = digi.getCSCPayload(chamberID);
118  int cfeb_dav = (payload >> 7) & 0x7F;
119  int cfeb_active = payload & 0x1F;
120  cfeb_active |= ((payload >> 14) & 0x03) << 5;
121  int alct_dav = (payload >> 5) & 0x1;
122  int tmb_dav = (payload >> 6) & 0x1;
123  int cfeb_dav_num = 0;
124 
125  if (alct_dav == 0) {
126  if (cscPosition && getEMUHisto(h::EMU_CSC_WO_ALCT, mo)) {
127  mo->Fill(cscPosition, cscType);
128  }
129  if (getEMUHisto(h::EMU_DMB_WO_ALCT, mo)) {
130  mo->Fill(crateID, dmbSlot);
131  }
132  }
133 
134  if (tmb_dav == 0) {
135  if (cscPosition && getEMUHisto(h::EMU_CSC_WO_CLCT, mo)) {
136  mo->Fill(cscPosition, cscType);
137  }
138  if (getEMUHisto(h::EMU_DMB_WO_CLCT, mo)) {
139  mo->Fill(crateID, dmbSlot);
140  }
141  }
142 
143  if (cfeb_dav == 0) {
144  if (cscPosition && getEMUHisto(h::EMU_CSC_WO_CFEB, mo)) {
145  mo->Fill(cscPosition, cscType);
146  }
147  if (getEMUHisto(h::EMU_DMB_WO_CFEB, mo)) {
148  mo->Fill(crateID, dmbSlot);
149  }
150  }
151 
153  for (int i = 0; i < 7; i++) {
154  if ((cfeb_dav >> i) & 0x1)
155  cntCFEBs++;
156  }
157 
158  if (alct_dav > 0) {
159  cntALCTs++;
160  }
161 
162  if (tmb_dav > 0) {
163  cntTMBs++;
164  }
165 
166  MonitorObject *mof = nullptr, *mo1 = nullptr, *mo2 = nullptr;
167  if (getCSCHisto(h::CSC_ACTUAL_DMB_CFEB_DAV_RATE, crateID, dmbSlot, mo) &&
168  getCSCHisto(h::CSC_ACTUAL_DMB_CFEB_DAV_FREQUENCY, crateID, dmbSlot, mof)) {
169  if (getCSCHisto(h::CSC_DMB_CFEB_DAV_UNPACKING_INEFFICIENCY, crateID, dmbSlot, mo1) &&
170  getCSCHisto(h::CSC_DMB_CFEB_DAV, crateID, dmbSlot, mo2)) {
171  for (int i = 1; i <= 7; i++) {
172  double actual_dav_num = mo->GetBinContent(i);
173  double unpacked_dav_num = mo2->GetBinContent(i);
174  if (actual_dav_num) {
175  mo1->SetBinContent(i, 1, 100. * (1 - unpacked_dav_num / actual_dav_num));
176  }
177  mo1->SetEntries((int)DMBEvents);
178  }
179  }
180  for (int i = 0; i < 7; i++) {
181  int cfeb_present = (cfeb_dav >> i) & 0x1;
182  cfeb_dav_num += cfeb_present;
183  if (cfeb_present) {
184  mo->Fill(i);
185  }
186  float cfeb_entries = mo->GetBinContent(i + 1);
187  mof->SetBinContent(i + 1, ((float)cfeb_entries / (float)(DMBEvents)*100.0));
188  }
189  mof->SetEntries((int)DMBEvents);
190  }
191 
192  if (getCSCHisto(h::CSC_ACTUAL_DMB_CFEB_DAV_MULTIPLICITY_RATE, crateID, dmbSlot, mo) &&
194  for (unsigned short i = 1; i < 7; i++) {
195  float cfeb_entries = mo->GetBinContent(i);
196  mof->SetBinContent(i, ((float)cfeb_entries / (float)(DMBEvents)*100.0));
197  }
198  mof->SetEntries((int)DMBEvents);
199 
201  getCSCHisto(h::CSC_DMB_CFEB_DAV_MULTIPLICITY, crateID, dmbSlot, mo2)) {
202  for (unsigned short i = 1; i < 9; i++) {
203  float actual_dav_num = mo->GetBinContent(i);
204  float unpacked_dav_num = mo2->GetBinContent(i);
205  if (actual_dav_num) {
206  mo1->SetBinContent(i, 1, 100. * (1 - unpacked_dav_num / actual_dav_num));
207  }
208  mo1->SetEntries((int)DMBEvents);
209  }
210  }
211  mo->Fill(cfeb_dav_num);
212  }
213 
214  if (getCSCHisto(h::CSC_DMB_CFEB_ACTIVE_VS_DAV, crateID, dmbSlot, mo))
215  mo->Fill(cfeb_dav, cfeb_active);
216 
218  if (getCSCHisto(h::CSC_ACTUAL_DMB_FEB_DAV_RATE, crateID, dmbSlot, mo)) {
219  if (getCSCHisto(h::CSC_ACTUAL_DMB_FEB_DAV_FREQUENCY, crateID, dmbSlot, mo1)) {
220  for (int i = 1; i < 4; i++) {
221  float dav_num = mo->GetBinContent(i);
222  mo1->SetBinContent(i, ((float)dav_num / (float)(DMBEvents)*100.0));
223  }
224  mo1->SetEntries((int)DMBEvents);
225 
226  if (getCSCHisto(h::CSC_DMB_FEB_DAV_UNPACKING_INEFFICIENCY, crateID, dmbSlot, mof) &&
227  getCSCHisto(h::CSC_DMB_FEB_DAV_RATE, crateID, dmbSlot, mo2)) {
228  for (int i = 1; i < 4; i++) {
229  float actual_dav_num = mo->GetBinContent(i);
230  float unpacked_dav_num = mo2->GetBinContent(i);
231  if (actual_dav_num) {
232  mof->SetBinContent(i, 1, 100. * (1 - unpacked_dav_num / actual_dav_num));
233  }
234  mof->SetEntries((int)DMBEvents);
235  mof->SetMaximum(100.0);
236  }
237  }
238  }
239 
240  if (alct_dav > 0) {
241  mo->Fill(0.0);
242  }
243  if (tmb_dav > 0) {
244  mo->Fill(1.0);
245  }
246  if (cfeb_dav > 0) {
247  mo->Fill(2.0);
248  }
249  }
250 
251  float feb_combination_dav = -1.0;
253  if (getCSCHisto(h::CSC_ACTUAL_DMB_FEB_COMBINATIONS_DAV_RATE, crateID, dmbSlot, mo)) {
254  if (alct_dav == 0 && tmb_dav == 0 && cfeb_dav == 0)
255  feb_combination_dav = 0.0; // Nothing
256  if (alct_dav > 0 && tmb_dav == 0 && cfeb_dav == 0)
257  feb_combination_dav = 1.0; // ALCT Only
258  if (alct_dav == 0 && tmb_dav > 0 && cfeb_dav == 0)
259  feb_combination_dav = 2.0; // TMB Only
260  if (alct_dav == 0 && tmb_dav == 0 && cfeb_dav > 0)
261  feb_combination_dav = 3.0; // CFEB Only
262  if (alct_dav == 0 && tmb_dav > 0 && cfeb_dav > 0)
263  feb_combination_dav = 4.0; // TMB+CFEB
264  if (alct_dav > 0 && tmb_dav > 0 && cfeb_dav == 0)
265  feb_combination_dav = 5.0; // ALCT+TMB
266  if (alct_dav > 0 && tmb_dav == 0 && cfeb_dav > 0)
267  feb_combination_dav = 6.0; // ALCT+CFEB
268  if (alct_dav > 0 && tmb_dav > 0 && cfeb_dav > 0)
269  feb_combination_dav = 7.0; // ALCT+TMB+CFEB
270  // mo->Fill(feb_combination_dav);
271 
273  for (int i = 1; i < 9; i++) {
274  float feb_combination_dav_number = mo->GetBinContent(i);
275  mo1->SetBinContent(i, ((float)feb_combination_dav_number / (float)(DMBEvents)*100.0));
276  }
277  mo1->SetEntries(DMBEvents);
278 
280  getCSCHisto(h::CSC_DMB_FEB_COMBINATIONS_DAV_RATE, crateID, dmbSlot, mo2)) {
281  for (int i = 1; i < 9; i++) {
282  float actual_dav_num = mo->GetBinContent(i);
283  float unpacked_dav_num = mo2->GetBinContent(i);
284  if (actual_dav_num) {
285  mof->SetBinContent(i, 1, 100. * (1 - unpacked_dav_num / actual_dav_num));
286  }
287  mof->SetEntries((int)DMBEvents);
288  mof->SetMaximum(100.0);
289  }
290  }
291  }
292  mo->Fill(feb_combination_dav);
293  }
294  }
295  }
296 
299  {
300  uint32_t i = 0;
301  CSCIdType chamberID = 0;
302  while (digi.nextCSCWithStatus(i, chamberID)) {
303  unsigned int crateID = (chamberID >> 4) & 0xFF;
304  unsigned int dmbSlot = chamberID & 0xF;
305  ExaminerStatusType chStatus = digi.getCSCStatus(chamberID);
306 
307  if (crateID == 255) {
308  continue;
309  }
310  if ((crateID > 60) || (dmbSlot > 10) || (crateID <= 0) || (dmbSlot <= 0)) {
311  continue;
312  }
313 
314  // Check if in standby!
315  {
316  CSCDetId cid;
317  if (!config->fnGetCSCDetId(crateID, dmbSlot, cid)) {
318  continue;
319  }
320  }
321 
322  unsigned int cscType = 0;
323  unsigned int cscPosition = 0;
324  if (!getCSCFromMap(crateID, dmbSlot, cscType, cscPosition))
325  continue;
326 
327  if (getCSCHisto(h::CSC_BINCHECK_DATAFLOW_PROBLEMS_TABLE, crateID, dmbSlot, mo)) {
328  for (int bit = 0; bit < binChecker.nSTATUSES; bit++) {
329  if (chStatus & (1 << bit)) {
330  mo->Fill(0., bit);
331  }
332  }
333  mo->SetEntries(config->getChamberCounterValue(DMB_EVENTS, crateID, dmbSlot));
334  }
335 
336  int anyInputFull = chStatus & 0x3F;
337  if (anyInputFull) {
338  if (cscPosition && getEMUHisto(h::EMU_CSC_DMB_INPUT_FIFO_FULL, mo)) {
339  mo->Fill(cscPosition, cscType);
340  }
342  mo->Fill(crateID, dmbSlot);
343  }
344  }
345 
346  int anyInputTO = (chStatus >> 7) & 0x3FFF;
347  if (anyInputTO) {
348  if (cscPosition && getEMUHisto(h::EMU_CSC_DMB_INPUT_TIMEOUT, mo)) {
349  mo->Fill(cscPosition, cscType);
350  }
352  mo->Fill(crateID, dmbSlot);
353  }
354  }
355 
356  if (digi.getCSCStatus(chamberID) & (1 << 22)) {
358  mo->Fill(crateID, dmbSlot);
359  }
360 
361  if (cscPosition && getEMUHisto(h::EMU_CSC_FORMAT_WARNINGS, mo)) {
362  mo->Fill(cscPosition, cscType);
363  }
364  }
365  }
366  }
367 
370  {
371  uint32_t i = 0;
372  CSCIdType chamberID = 0;
373  while (digi.nextCSCWithError(i, chamberID)) {
374  const unsigned int crateID = (chamberID >> 4) & 0xFF;
375  const unsigned int dmbSlot = chamberID & 0xF;
376  const ExaminerStatusType chErr = digi.getCSCErrors(chamberID);
377 
378  if ((crateID == 255) || (chErr & 0x80)) {
379  continue; // = Skip chamber detection if DMB header is missing (Error code 6)
380  }
381  if ((crateID > 60) || (dmbSlot > 10) || (crateID <= 0) || (dmbSlot <= 0)) {
382  continue;
383  }
384 
385  // Check if in standby!
386  {
387  CSCDetId cid;
388  if (!config->fnGetCSCDetId(crateID, dmbSlot, cid)) {
389  continue;
390  }
391  }
392 
393  if ((chErr & config->getBINCHECK_MASK()) != 0) {
394  config->incChamberCounter(BAD_EVENTS, crateID, dmbSlot);
395  }
396 
397  bool isCSCError = false;
398  bool fillBC = getCSCHisto(h::CSC_BINCHECK_ERRORSTAT_TABLE, crateID, dmbSlot, mo);
399 
400  for (int bit = 5; bit < 24; bit++) {
401  if (chErr & (1 << bit)) {
402  isCSCError = true;
403  if (fillBC) {
404  mo->Fill(0., bit - 5);
405  } else {
406  break;
407  }
408  }
409 
410  if (fillBC) {
411  mo->SetEntries(config->getChamberCounterValue(DMB_EVENTS, crateID, dmbSlot));
412  }
413  }
414 
415  if (isCSCError) {
417  mo->Fill(crateID, dmbSlot);
418  }
419 
420  if (eventAccepted && getEMUHisto(h::EMU_DMB_UNPACKED_WITH_ERRORS, mo)) {
421  mo->Fill(crateID, dmbSlot);
422  }
423 
424  unsigned int cscType = 0;
425  unsigned int cscPosition = 0;
426  if (!getCSCFromMap(crateID, dmbSlot, cscType, cscPosition))
427  continue;
428 
429  if (cscPosition && getEMUHisto(h::EMU_CSC_FORMAT_ERRORS, mo)) {
430  mo->Fill(cscPosition, cscType);
431  }
432 
433  if (eventAccepted && cscPosition && getEMUHisto(h::EMU_CSC_UNPACKED_WITH_ERRORS, mo)) {
434  mo->Fill(cscPosition, cscType);
435  }
436  }
437  }
438  }
439 
440  return eventAccepted;
441  }
const uint16_t nSTATUSES
uint32_t cntCFEBs
Total Number of DMBs per event from DDU Header DAV.
ExaminerStatusType getDDUErrors(const DDUIdType DDUId) const
int32_t CSCIdType
const bool getCSCFromMap(const unsigned int &crateId, const unsigned int &dmbId, unsigned int &cscType, unsigned int &cscPosition) const
Get CSC type and position from crate and dmb identifiers.
std::set< DDUIdType > getListOfDDUs() const
static int getRUIfromDDUId(unsigned ddu_id)
Get RUI Number from DDU source ID for post LS1 configuration.
Definition: config.py:1
bool nextCSCWithError(uint32_t &iterator, CSCIdType &CSCId) const
CSC with error iteration procedure. Usage: unsigned int i = 0; CSCIdType cscId; while (c...
const bool getCSCHisto(const HistoId &histo, const HwId &crateID, const HwId &dmbSlot, MonitorObject *&me)
Get CSC (Chamber) Level Monitoring Object.
uint32_t cntTMBs
Total Number of ALCTs per event from DMB DAV.
uint32_t cntALCTs
Total Number of CFEBs per event from DMB DAV.
ExaminerStatusType getCSCErrors(const CSCIdType CSCId) const
bool nextCSCWithStatus(uint32_t &iterator, CSCIdType &CSCId) const
CSC with status iteration procedure.
CSCDetId chamberID(const CSCDetId &cscDetId)
ExaminerStatusType getCSCStatus(const CSCIdType CSCId) const
bool nextCSCWithPayload(uint32_t &iterator, CSCIdType &CSCId) const
CSC with payload iteration procedure.
uint32_t ExaminerStatusType
#define LOG_WARN
Definition: CSCDQM_Logger.h:41
ExaminerStatusType getCSCPayload(const CSCIdType CSCId) const
const bool getEMUHisto(const HistoId &histo, MonitorObject *&me)
Get EMU (Top Level) Monitoring Object.
ExaminerStatusType getDDUSummaryErrors() const

◆ resetEmuEventDisplays()

void cscdqm::EventProcessor::resetEmuEventDisplays ( )
private

Reset Emu level EventDisplay histograms once per event.

Definition at line 56 of file CSCDQM_EventProcessor_processCSC.cc.

References cscdqm::h::EMU_EVENT_DISPLAY_ANODE, cscdqm::h::EMU_EVENT_DISPLAY_CATHODE, cscdqm::h::EMU_EVENT_DISPLAY_XY, EmuEventDisplayWasReset, getEMUHisto(), and cscdqm::MonitorObject::getTH1Lock().

Referenced by setEmuEventDisplayBit().

56  {
58  // Reseting EMU level Event displays
59  MonitorObject* mo = nullptr;
61  mo->getTH1Lock()->Reset("");
62  }
63 
65  mo->getTH1Lock()->Reset("");
66  }
67 
69  mo->getTH1Lock()->Reset("");
70  }
71 
73  }
74  }
const bool getEMUHisto(const HistoId &histo, MonitorObject *&me)
Get EMU (Top Level) Monitoring Object.

◆ setEmuEventDisplayBit()

void cscdqm::EventProcessor::setEmuEventDisplayBit ( MonitorObject *&  mo,
const unsigned int  x,
const unsigned int  y,
const unsigned int  bit 
)
private

Set a single bit in the 3D Histogram (aka EMU level event display). Checks if mo and x != null.

Parameters
eventNumbernumber of event
moHistogram
xX bin number
yY bin number
bitbit number to set

Definition at line 41 of file CSCDQM_EventProcessor_processCSC.cc.

References triggerObjects_cff::bit, nanoDQM_cfi::bitset, cscdqm::MonitorObject::GetBinContent(), createfilelist::int, resetEmuEventDisplays(), cscdqm::MonitorObject::SetBinContent(), and x.

Referenced by processCSC().

44  {
45  if (mo && x) {
47  int bitset = (int)mo->GetBinContent(x, y);
48  bitset |= 1 << bit;
49  mo->SetBinContent(x, y, bitset);
50  }
51  }
void resetEmuEventDisplays()
Reset Emu level EventDisplay histograms once per event.

◆ standbyEfficiencyHistos()

void cscdqm::EventProcessor::standbyEfficiencyHistos ( HWStandbyType standby)

apply standby flags/parameters

Parameters
standbystandby flags

Definition at line 349 of file CSCDQM_EventProcessor_updateEffHistos.cc.

References cscdqm::AddressMask::cfeb, cscdqm::AddressMask::chamber, cscdqm::h::EMU_CSC_STANDBY, getEMUHisto(), cscdqm::AddressMask::hv, cscdqm::AddressMask::layer, CommonMethods::lock(), cscdqm::Address::mask, hlt_dqm_clientPB-live_cfg::me, cscdqm::HWStandbyType::MeM, cscdqm::HWStandbyType::MeP, cscdqm::AddressMask::ring, cscdqm::Summary::SetValue(), cscdqm::AddressMask::side, cscdqm::Address::side, cscdqm::STANDBY, cscdqm::AddressMask::station, summary, createJobs::tmp, cscdqm::WAS_ON, and cscdqm::Summary::WriteChamberState().

Referenced by cscdqm::EventProcessorMutex::processStandby().

349  {
350  Address adr;
351  bzero(&adr, sizeof(Address));
352  adr.mask.side = true;
353  adr.mask.station = adr.mask.ring = adr.mask.chamber = adr.mask.layer = adr.mask.cfeb = adr.mask.hv = false;
354 
355  adr.side = 1;
356  summary.SetValue(adr, STANDBY, (standby.MeP ? 1 : 0));
357  if (!standby.MeP) {
358  summary.SetValue(adr, WAS_ON);
359  }
360 
361  adr.side = 2;
362  summary.SetValue(adr, STANDBY, (standby.MeM ? 1 : 0));
363  if (!standby.MeM) {
364  summary.SetValue(adr, WAS_ON);
365  }
366 
367  MonitorObject* me = nullptr;
369  LockType lock(me->mutex);
370  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
371 
372  // All standby
373  summary.WriteChamberState(tmp, 0x1000, 5);
374 
375  // Temporary in standby (was ON)
376  summary.WriteChamberState(tmp, 0x3000, 1, false);
377  }
378  }
HW element in standby mode.
Data with CFEB BWORDS.
void WriteChamberState(TH2 *&h2, const int mask, const int value=1, const bool reset=true, const bool op_any=false) const
Write State information to chamber histogram.
void SetValue(const HWStatusBit bit, const int value=1)
SetValue for the whole of detector.
tmp
align.sh
Definition: createJobs.py:716
const bool getEMUHisto(const HistoId &histo, MonitorObject *&me)
Get EMU (Top Level) Monitoring Object.

◆ updateEfficiencyHistos()

void cscdqm::EventProcessor::updateEfficiencyHistos ( )

Update Efficiency MOs.

Get CSC Reporting reference histogram


If reference for CSC_Reporting is defined - use it Else - do it flat way

Write summary information

Looping via addresses (scope: side->station->ring) and filling in HW efficiencies

Definition at line 26 of file CSCDQM_EventProcessor_updateEffHistos.cc.

References cscdqm::AddressMask::cfeb, cscdqm::CFEB_BWORDS, cscdqm::AddressMask::chamber, cscdqm::h::EMU_CSC_DMB_INPUT_FIFO_FULL, cscdqm::h::EMU_CSC_DMB_INPUT_TIMEOUT, cscdqm::h::EMU_CSC_FORMAT_ERRORS, cscdqm::h::EMU_CSC_FORMAT_WARNINGS, cscdqm::h::EMU_CSC_L1A_OUT_OF_SYNC, cscdqm::h::EMU_CSC_REPORTING, cscdqm::h::EMU_CSC_WO_ALCT, cscdqm::h::EMU_CSC_WO_CFEB, cscdqm::h::EMU_CSC_WO_CLCT, cscdqm::h::EMU_PHYSICS_EMU, cscdqm::h::EMU_PHYSICS_ME1, cscdqm::h::EMU_PHYSICS_ME2, cscdqm::h::EMU_PHYSICS_ME3, cscdqm::h::EMU_PHYSICS_ME4, submitPVResolutionJobs::err, cscdqm::FIFOFULL_ERR, cscdqm::FORMAT_ERR, cscdqm::Summary::getDetector(), cscdqm::Summary::GetEfficiencyHW(), getEMUHisto(), getParHisto(), cscdqm::AddressMask::hv, cscdqm::INPUTTO_ERR, cscdqm::L1SYNC_ERR, cscdqm::AddressMask::layer, CommonMethods::lock(), cscdqm::Address::mask, hlt_dqm_clientPB-live_cfg::me, hlt_dqm_clientPB-live_cfg::me1, N_SIDES, N_STATIONS, cscdqm::NODATA_ALCT, cscdqm::NODATA_CFEB, cscdqm::NODATA_CLCT, cscdqm::Detector::NumberOfChambers(), cscdqm::Detector::NumberOfRings(), cscdqm::h::PAR_CSC_SIDEMINUS, cscdqm::h::PAR_CSC_SIDEMINUS_STATION01, cscdqm::h::PAR_CSC_SIDEMINUS_STATION01_RING01, cscdqm::h::PAR_CSC_SIDEMINUS_STATION01_RING02, cscdqm::h::PAR_CSC_SIDEMINUS_STATION01_RING03, cscdqm::h::PAR_CSC_SIDEMINUS_STATION02, cscdqm::h::PAR_CSC_SIDEMINUS_STATION02_RING01, cscdqm::h::PAR_CSC_SIDEMINUS_STATION02_RING02, cscdqm::h::PAR_CSC_SIDEMINUS_STATION03, cscdqm::h::PAR_CSC_SIDEMINUS_STATION03_RING01, cscdqm::h::PAR_CSC_SIDEMINUS_STATION03_RING02, cscdqm::h::PAR_CSC_SIDEMINUS_STATION04, cscdqm::h::PAR_CSC_SIDEMINUS_STATION04_RING01, cscdqm::h::PAR_CSC_SIDEMINUS_STATION04_RING02, cscdqm::h::PAR_CSC_SIDEPLUS, cscdqm::h::PAR_CSC_SIDEPLUS_STATION01, cscdqm::h::PAR_CSC_SIDEPLUS_STATION01_RING01, cscdqm::h::PAR_CSC_SIDEPLUS_STATION01_RING02, cscdqm::h::PAR_CSC_SIDEPLUS_STATION01_RING03, cscdqm::h::PAR_CSC_SIDEPLUS_STATION02, cscdqm::h::PAR_CSC_SIDEPLUS_STATION02_RING01, cscdqm::h::PAR_CSC_SIDEPLUS_STATION02_RING02, cscdqm::h::PAR_CSC_SIDEPLUS_STATION03, cscdqm::h::PAR_CSC_SIDEPLUS_STATION03_RING01, cscdqm::h::PAR_CSC_SIDEPLUS_STATION03_RING02, cscdqm::h::PAR_CSC_SIDEPLUS_STATION04, cscdqm::h::PAR_CSC_SIDEPLUS_STATION04_RING01, cscdqm::h::PAR_CSC_SIDEPLUS_STATION04_RING02, cscdqm::h::PAR_REPORT_SUMMARY, cscdqm::Summary::ReadErrorChambers(), cscdqm::Summary::ReadReportingChambers(), cscdqm::Summary::ReadReportingChambersRef(), cuy::rep, cscdqm::AddressMask::ring, cscdqm::Address::ring, cscdqm::AddressMask::side, cscdqm::Address::side, cscdqm::AddressMask::station, cscdqm::Address::station, summary, createJobs::tmp, cscdqm::Summary::Write(), cscdqm::Summary::WriteMap(), and writeShifterHistograms().

Referenced by cscdqm::EventProcessorMutex::updateFractionAndEfficiencyHistos().

26  {
27  MonitorObject *me = nullptr, *me1 = nullptr;
28 
29  if (config->getNEvents() > 0) {
31  const TH2* rep = dynamic_cast<const TH2*>(me->getTH1());
32 
34  const TObject* tobj = me->getRefRootObject();
35 
39  if (tobj) {
40  const TH2* ref = dynamic_cast<const TH2*>(tobj);
42  ref,
43  config->getEFF_COLD_THRESHOLD(),
44  config->getEFF_COLD_SIGFAIL(),
45  config->getEFF_HOT_THRESHOLD(),
46  config->getEFF_HOT_SIGFAIL());
47  } else {
49  }
50 
52  const TH2* err = dynamic_cast<const TH2*>(me1->getTH1());
53  summary.ReadErrorChambers(rep, err, FORMAT_ERR, config->getEFF_ERR_THRESHOLD(), config->getEFF_ERR_SIGFAIL());
54  }
55 
57  const TH2* err = dynamic_cast<const TH2*>(me1->getTH1());
58  summary.ReadErrorChambers(rep, err, L1SYNC_ERR, config->getEFF_ERR_THRESHOLD(), config->getEFF_ERR_SIGFAIL());
59  }
60 
62  const TH2* err = dynamic_cast<const TH2*>(me1->getTH1());
64  rep, err, FIFOFULL_ERR, config->getEFF_ERR_THRESHOLD(), config->getEFF_ERR_SIGFAIL());
65  }
66 
68  const TH2* err = dynamic_cast<const TH2*>(me1->getTH1());
70  rep, err, INPUTTO_ERR, config->getEFF_ERR_THRESHOLD(), config->getEFF_ERR_SIGFAIL());
71  }
72 
74  const TH2* err = dynamic_cast<const TH2*>(me1->getTH1());
76  rep, err, NODATA_ALCT, config->getEFF_NODATA_THRESHOLD(), config->getEFF_NODATA_SIGFAIL());
77  }
78 
80  const TH2* err = dynamic_cast<const TH2*>(me1->getTH1());
82  rep, err, NODATA_CLCT, config->getEFF_NODATA_THRESHOLD(), config->getEFF_NODATA_SIGFAIL());
83  }
84 
86  const TH2* err = dynamic_cast<const TH2*>(me1->getTH1());
88  rep, err, NODATA_CFEB, config->getEFF_NODATA_THRESHOLD(), config->getEFF_NODATA_SIGFAIL());
89  }
90 
92  const TH2* err = dynamic_cast<const TH2*>(me1->getTH1());
94  rep, err, CFEB_BWORDS, config->getEFF_NODATA_THRESHOLD(), config->getEFF_NODATA_SIGFAIL());
95  }
96  }
97 
99 
105  LockType lock(me->mutex);
106  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
107  summary.Write(tmp, 1);
108  }
109 
111  LockType lock(me->mutex);
112  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
113  summary.Write(tmp, 2);
114  }
115 
117  LockType lock(me->mutex);
118  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
119  summary.Write(tmp, 3);
120  }
121 
123  LockType lock(me->mutex);
124  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
125  summary.Write(tmp, 4);
126  }
127 
129  LockType lock(me->mutex);
130  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
132  }
133  }
134 
139  if (config->getPROCESS_EFF_PARAMETERS()) {
140  { // Compute DQM information parameters
141 
142  Address adr;
143  bzero(&adr, sizeof(Address));
144  adr.mask.side = adr.mask.station = adr.mask.ring = true;
145  adr.mask.chamber = adr.mask.layer = adr.mask.cfeb = adr.mask.hv = false;
146 
147  double e_detector = 0.0, e_side = 0.0, e_station = 0.0, e_ring = 0.0;
148  uint32_t e_detector_ch = 0, e_side_ch = 0, e_station_ch = 0;
149 
164 
165  bool calc = (config->getNEvents() > 0);
166 
167  if (!calc) {
168  e_detector = e_side = e_station = e_ring = -1.0;
169  }
170 
171  unsigned int parameter = 0;
172  for (adr.side = 1; adr.side <= N_SIDES; adr.side++) {
173  if (calc) {
174  e_side = 0.0;
175  e_side_ch = 0;
176  }
177 
178  adr.mask.station = true;
179  for (adr.station = 1; adr.station <= N_STATIONS; adr.station++) {
180  if (calc) {
181  e_station = 0.0;
182  e_station_ch = 0;
183  }
184 
185  adr.mask.ring = true;
186  for (adr.ring = 1; adr.ring <= summary.getDetector().NumberOfRings(adr.station); adr.ring++) {
187  if (calc) {
188  e_ring = summary.GetEfficiencyHW(adr);
189  uint32_t ch = summary.getDetector().NumberOfChambers(adr.station, adr.ring);
190  e_station += (e_ring * ch);
191  e_station_ch += ch;
192  }
193 
194  if (summary.getDetector().NumberOfRings(adr.station) > 1) {
196  me->Fill(e_ring);
197  }
198  }
199 
200  adr.mask.ring = false;
201  if (calc) {
202  e_side += e_station;
203  e_side_ch += e_station_ch;
204  e_station = e_station / e_station_ch;
205  }
206 
208  me->Fill(e_station);
209  }
210 
211  adr.mask.station = false;
212  if (calc) {
213  e_detector += e_side;
214  e_detector_ch += e_side_ch;
215  e_side = e_side / e_side_ch;
216  }
217 
219  me->Fill(e_side);
220  }
221 
222  if (calc) {
223  e_detector = e_detector / e_detector_ch;
224  }
225 
227  me->Fill(e_detector);
228  }
229  }
230  }
void ReadReportingChambers(const TH2 *&h2, const double threshold=1.0)
Read Reporting Chamber histogram and fill in detector map.
const double GetEfficiencyHW() const
Get efficiency of the whole detector.
void Write(TH2 *&h2, const unsigned int station) const
Write detector map to H1 histogram (linear data) for the selected adr.station.
HW element is cold comparing with reference histogram.
Definition: config.py:1
Format errors.
unsigned int HistoId
void ReadReportingChambersRef(const TH2 *&h2, const TH2 *&refh2, const double cold_coef=0.1, const double cold_Sfail=5.0, const double hot_coef=2.0, const double hot_Sfail=5.0)
Read Reporting Chamber histogram and fill in detector map based on reference histogram.
const bool getParHisto(const HistoId &histo, MonitorObject *&me)
Get Parameter Monitoring Object.
void WriteMap(TH2 *&h2)
Write PhysicsReady Map to H2 histogram.
const unsigned int NumberOfRings(const unsigned int station) const
Returns the number of rings for the given station.
rep
Definition: cuy.py:1189
#define N_STATIONS
No CFEB data.
DMB Input timeout error.
const unsigned int NumberOfChambers(const unsigned int station, const unsigned int ring) const
Returns the number of chambers for the given station and ring.
void ReadErrorChambers(const TH2 *&evs, const TH2 *&err, const HWStatusBit bit, const double eps_max=0.1, const double Sfail=5.0)
Read Error data for Chambers.
L1A out of sync errors.
#define N_SIDES
const Detector getDetector() const
DMB FIFO full error.
No CLCT data.
tmp
align.sh
Definition: createJobs.py:716
const bool getEMUHisto(const HistoId &histo, MonitorObject *&me)
Get EMU (Top Level) Monitoring Object.
No ALCT data.

◆ updateFractionHistos()

void cscdqm::EventProcessor::updateFractionHistos ( )

Update Fractional MOs.

Definition at line 26 of file CSCDQM_EventProcessor_updateFracHistos.cc.

References calcEMUFractionHisto(), cscdqm::h::CSC_BINCHECK_DATAFLOW_PROBLEMS_FREQUENCY, cscdqm::h::CSC_BINCHECK_DATAFLOW_PROBLEMS_TABLE, cscdqm::h::CSC_BINCHECK_ERRORS_FREQUENCY, cscdqm::h::CSC_BINCHECK_ERRORSTAT_TABLE, cscdqm::DMB_EVENTS, cscdqm::h::EMU_CSC_DMB_INPUT_FIFO_FULL, cscdqm::h::EMU_CSC_DMB_INPUT_FIFO_FULL_FRACT, cscdqm::h::EMU_CSC_DMB_INPUT_TIMEOUT, cscdqm::h::EMU_CSC_DMB_INPUT_TIMEOUT_FRACT, cscdqm::h::EMU_CSC_FORMAT_ERRORS, cscdqm::h::EMU_CSC_FORMAT_ERRORS_FRACT, cscdqm::h::EMU_CSC_FORMAT_WARNINGS, cscdqm::h::EMU_CSC_FORMAT_WARNINGS_FRACT, cscdqm::h::EMU_CSC_L1A_OUT_OF_SYNC, cscdqm::h::EMU_CSC_L1A_OUT_OF_SYNC_FRACT, cscdqm::h::EMU_CSC_REPORTING, cscdqm::h::EMU_CSC_UNPACKED, cscdqm::h::EMU_CSC_UNPACKED_FRACT, cscdqm::h::EMU_CSC_WO_ALCT, cscdqm::h::EMU_CSC_WO_ALCT_FRACT, cscdqm::h::EMU_CSC_WO_CFEB, cscdqm::h::EMU_CSC_WO_CFEB_FRACT, cscdqm::h::EMU_CSC_WO_CLCT, cscdqm::h::EMU_CSC_WO_CLCT_FRACT, cscdqm::h::EMU_DMB_FORMAT_ERRORS, cscdqm::h::EMU_DMB_FORMAT_ERRORS_FRACT, cscdqm::h::EMU_DMB_FORMAT_WARNINGS, cscdqm::h::EMU_DMB_FORMAT_WARNINGS_FRACT, cscdqm::h::EMU_DMB_INPUT_FIFO_FULL, cscdqm::h::EMU_DMB_INPUT_FIFO_FULL_FRACT, cscdqm::h::EMU_DMB_INPUT_TIMEOUT, cscdqm::h::EMU_DMB_INPUT_TIMEOUT_FRACT, cscdqm::h::EMU_DMB_L1A_OUT_OF_SYNC, cscdqm::h::EMU_DMB_L1A_OUT_OF_SYNC_FRACT, cscdqm::h::EMU_DMB_REPORTING, cscdqm::h::EMU_DMB_UNPACKED, cscdqm::h::EMU_DMB_UNPACKED_FRACT, cscdqm::h::EMU_DMB_WO_ALCT, cscdqm::h::EMU_DMB_WO_ALCT_FRACT, cscdqm::h::EMU_DMB_WO_CFEB, cscdqm::h::EMU_DMB_WO_CFEB_FRACT, cscdqm::h::EMU_DMB_WO_CLCT, cscdqm::h::EMU_DMB_WO_CLCT_FRACT, cscdqm::h::EMU_FED_DDU_L1A_MISMATCH, cscdqm::h::EMU_FED_DDU_L1A_MISMATCH_FRACT, cscdqm::h::EMU_FED_DDU_L1A_MISMATCH_WITH_CSC_DATA, cscdqm::h::EMU_FED_DDU_L1A_MISMATCH_WITH_CSC_DATA_FRACT, cscdqm::h::EMU_FED_ENTRIES, getCSCHisto(), cscdqm::MonitorObject::getTH1(), CommonMethods::lock(), and cscdqm::MonitorObject::SetEntries().

Referenced by cscdqm::EventProcessorMutex::updateFractionAndEfficiencyHistos().

26  {
48 
49  unsigned int iter = 0, crateId = 0, dmbId = 0;
50  MonitorObject *mo = nullptr, *mof = nullptr;
51  while (config->fnNextBookedCSC(iter, crateId, dmbId)) {
52  uint32_t dmbEvents = config->getChamberCounterValue(DMB_EVENTS, crateId, dmbId);
53 
54  if (getCSCHisto(h::CSC_BINCHECK_DATAFLOW_PROBLEMS_TABLE, crateId, dmbId, mo) &&
56  LockType lock(mof->mutex);
57  TH1* th = mof->getTH1Lock();
58  th->Reset();
59  th->Add(mo->getTH1());
60  th->Scale(1. / dmbEvents);
61  mof->SetMaximum(1.);
62  mof->SetEntries(dmbEvents);
63  mo->SetEntries(dmbEvents);
64  }
65 
66  if (getCSCHisto(h::CSC_BINCHECK_ERRORSTAT_TABLE, crateId, dmbId, mo) &&
67  getCSCHisto(h::CSC_BINCHECK_ERRORS_FREQUENCY, crateId, dmbId, mof)) {
68  LockType lock(mof->mutex);
69  TH1* th = mof->getTH1Lock();
70  th->Reset();
71  th->Add(mo->getTH1());
72  th->Scale(1. / dmbEvents);
73  mof->SetMaximum(1.);
74  mof->SetEntries(dmbEvents);
75  mo->SetEntries(dmbEvents);
76  }
77  }
78  }
Definition: config.py:1
const bool getCSCHisto(const HistoId &histo, const HwId &crateID, const HwId &dmbSlot, MonitorObject *&me)
Get CSC (Chamber) Level Monitoring Object.
void calcEMUFractionHisto(const HistoId &result, const HistoId &set, const HistoId &subset)
Calculate fractional histogram.

◆ writeShifterHistograms()

void cscdqm::EventProcessor::writeShifterHistograms ( )

Definition at line 232 of file CSCDQM_EventProcessor_updateEffHistos.cc.

References dqmd_manager::COLOR_BLUE, dqmd_manager::COLOR_GREEN, dqmd_manager::COLOR_RED, cscdqm::h::EMU_CSC_STATS_CFEB_BWORDS, cscdqm::h::EMU_CSC_STATS_FIFOFULL_ERR, cscdqm::h::EMU_CSC_STATS_FORMAT_ERR, cscdqm::h::EMU_CSC_STATS_INPUTTO_ERR, cscdqm::h::EMU_CSC_STATS_L1SYNC_ERR, cscdqm::h::EMU_CSC_STATS_OCCUPANCY, cscdqm::h::EMU_CSC_STATS_SUMMARY, cscdqm::h::EMU_CSC_STATS_WO_ALCT, cscdqm::h::EMU_CSC_STATS_WO_CFEB, cscdqm::h::EMU_CSC_STATS_WO_CLCT, getEMUHisto(), HWSTATUSERRORBITS, CommonMethods::lock(), hlt_dqm_clientPB-live_cfg::me, summary, createJobs::tmp, and cscdqm::Summary::WriteChamberState().

Referenced by cscdqm::EventProcessorMutex::processStandby(), and updateEfficiencyHistos().

232  {
233  MonitorObject* me = nullptr;
234 
235  //const int COLOR_WHITE = 0;
236  const int COLOR_GREEN = 1;
237  const int COLOR_RED = 2;
238  const int COLOR_BLUE = 3;
239  const int COLOR_GREY = 4;
240  const int COLOR_STANDBY = 5;
241 
243  LockType lock(me->mutex);
244  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
245  if (!config->getIN_FULL_STANDBY()) {
246  summary.WriteChamberState(tmp, 0x1, COLOR_GREEN, true, false);
248  }
249  summary.WriteChamberState(tmp, 0x1000, COLOR_STANDBY, false);
250  summary.WriteChamberState(tmp, 0x2, COLOR_GREY, false);
251  }
252 
254  LockType lock(me->mutex);
255  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
256  if (!config->getIN_FULL_STANDBY()) {
257  summary.WriteChamberState(tmp, 0x4, COLOR_RED, true, false);
258  summary.WriteChamberState(tmp, 0x8, COLOR_BLUE, false, false);
259  }
260  summary.WriteChamberState(tmp, 0x1000, COLOR_STANDBY, false);
261  summary.WriteChamberState(tmp, 0x2, COLOR_GREY, false, false);
262  }
263 
265  LockType lock(me->mutex);
266  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
267  if (!config->getIN_FULL_STANDBY()) {
268  summary.WriteChamberState(tmp, 0x10, COLOR_RED, true, false);
269  }
270  summary.WriteChamberState(tmp, 0x1000, COLOR_STANDBY, false);
271  summary.WriteChamberState(tmp, 0x2, COLOR_GREY, false, false);
272  }
273 
275  LockType lock(me->mutex);
276  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
277  if (!config->getIN_FULL_STANDBY()) {
278  summary.WriteChamberState(tmp, 0x20, COLOR_RED, true, false);
279  }
280  summary.WriteChamberState(tmp, 0x1000, COLOR_STANDBY, false);
281  summary.WriteChamberState(tmp, 0x2, COLOR_GREY, false, false);
282  }
283 
285  LockType lock(me->mutex);
286  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
287  if (!config->getIN_FULL_STANDBY()) {
288  summary.WriteChamberState(tmp, 0x40, COLOR_RED, true, false);
289  }
290  summary.WriteChamberState(tmp, 0x1000, COLOR_STANDBY, false);
291  summary.WriteChamberState(tmp, 0x2, COLOR_GREY, false, false);
292  }
293 
295  LockType lock(me->mutex);
296  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
297  if (!config->getIN_FULL_STANDBY()) {
298  summary.WriteChamberState(tmp, 0x80, COLOR_RED, true, false);
299  }
300  summary.WriteChamberState(tmp, 0x1000, COLOR_STANDBY, false);
301  summary.WriteChamberState(tmp, 0x2, COLOR_GREY, false, false);
302  }
303 
305  LockType lock(me->mutex);
306  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
307  if (!config->getIN_FULL_STANDBY()) {
308  summary.WriteChamberState(tmp, 0x100, COLOR_RED, true, false);
309  }
310  summary.WriteChamberState(tmp, 0x1000, COLOR_STANDBY, false);
311  summary.WriteChamberState(tmp, 0x2, COLOR_GREY, false, false);
312  }
313 
315  LockType lock(me->mutex);
316  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
317  if (!config->getIN_FULL_STANDBY()) {
318  summary.WriteChamberState(tmp, 0x200, COLOR_RED, true, false);
319  }
320  summary.WriteChamberState(tmp, 0x1000, COLOR_STANDBY, false);
321  summary.WriteChamberState(tmp, 0x2, COLOR_GREY, false, false);
322  }
323 
325  LockType lock(me->mutex);
326  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
327  if (!config->getIN_FULL_STANDBY()) {
328  summary.WriteChamberState(tmp, 0x400, COLOR_RED, true, false);
329  }
330  summary.WriteChamberState(tmp, 0x1000, COLOR_STANDBY, false);
331  summary.WriteChamberState(tmp, 0x2, COLOR_GREY, false, false);
332  }
333 
335  LockType lock(me->mutex);
336  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
337  if (!config->getIN_FULL_STANDBY()) {
338  summary.WriteChamberState(tmp, 0x800, COLOR_RED, true, false);
339  }
340  summary.WriteChamberState(tmp, 0x1000, COLOR_STANDBY, false);
341  summary.WriteChamberState(tmp, 0x2, COLOR_GREY, false, false);
342  }
343  }
#define HWSTATUSERRORBITS
Definition: config.py:1
void WriteChamberState(TH2 *&h2, const int mask, const int value=1, const bool reset=true, const bool op_any=false) const
Write State information to chamber histogram.
tmp
align.sh
Definition: createJobs.py:716
const bool getEMUHisto(const HistoId &histo, MonitorObject *&me)
Get EMU (Top Level) Monitoring Object.

Member Data Documentation

◆ BXN

uint32_t cscdqm::EventProcessor::BXN
private

Definition at line 160 of file CSCDQM_EventProcessor.h.

Referenced by processCSC(), and processDDU().

◆ cntALCTs

uint32_t cscdqm::EventProcessor::cntALCTs
private

Total Number of CFEBs per event from DMB DAV.

Definition at line 163 of file CSCDQM_EventProcessor.h.

Referenced by processExaminer().

◆ cntCFEBs

uint32_t cscdqm::EventProcessor::cntCFEBs
private

Total Number of DMBs per event from DDU Header DAV.

Definition at line 162 of file CSCDQM_EventProcessor.h.

Referenced by processExaminer().

◆ cntDMBs

uint32_t cscdqm::EventProcessor::cntDMBs
private

Definition at line 161 of file CSCDQM_EventProcessor.h.

Referenced by processExaminer().

◆ cntTMBs

uint32_t cscdqm::EventProcessor::cntTMBs
private

Total Number of ALCTs per event from DMB DAV.

Definition at line 164 of file CSCDQM_EventProcessor.h.

Referenced by processExaminer().

◆ config

Configuration* cscdqm::EventProcessor::config
private

◆ EmuEventDisplayWasReset

bool cscdqm::EventProcessor::EmuEventDisplayWasReset
private

Definition at line 170 of file CSCDQM_EventProcessor.h.

Referenced by preProcessEvent(), and resetEmuEventDisplays().

◆ fCloseL1As

bool cscdqm::EventProcessor::fCloseL1As
private

Data Format version (2005, 2013)

Definition at line 169 of file CSCDQM_EventProcessor.h.

Referenced by EventProcessor(), processCSC(), and processDDU().

◆ fNotFirstEvent

std::map<uint32_t, bool> cscdqm::EventProcessor::fNotFirstEvent
private

Definition at line 158 of file CSCDQM_EventProcessor.h.

Referenced by processDDU().

◆ frdtoken

edm::EDGetTokenT<FEDRawDataCollection> cscdqm::EventProcessor::frdtoken
private

Definition at line 173 of file CSCDQM_EventProcessor.h.

◆ L1ANumber

uint32_t cscdqm::EventProcessor::L1ANumber
private

Definition at line 159 of file CSCDQM_EventProcessor.h.

Referenced by processCSC(), and processDDU().

◆ L1ANumbers

std::map<uint32_t, uint32_t> cscdqm::EventProcessor::L1ANumbers
private

Definition at line 157 of file CSCDQM_EventProcessor.h.

Referenced by processDDU().

◆ summary

Summary cscdqm::EventProcessor::summary
private

Detector efficiency manipulation object

Definition at line 155 of file CSCDQM_EventProcessor.h.

Referenced by maskHWElements(), processCSC(), standbyEfficiencyHistos(), updateEfficiencyHistos(), and writeShifterHistograms().

◆ theFormatVersion

uint16_t cscdqm::EventProcessor::theFormatVersion
private

Total Number of TMBs per event from DMB DAV.

Definition at line 166 of file CSCDQM_EventProcessor.h.

Referenced by processCSC().