CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
< FEDRawDataCollection
frdtoken
 
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

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

Constructor.

Parameters
p_configPointer to Global Configuration.

Definition at line 27 of file CSCDQM_EventProcessor.cc.

References config, and fCloseL1As.

27  {
28  config = p_config;
29  // fFirstEvent = true;
30  fCloseL1As = true;
31  }
bool fCloseL1As
Data Format version (2005, 2013)
cscdqm::EventProcessor::~EventProcessor ( )
inline

Destructor.

Definition at line 116 of file CSCDQM_EventProcessor.h.

116 {}

Member Function Documentation

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, 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  }
tuple result
Definition: mps_fire.py:311
const bool getEMUHisto(const HistoId &histo, MonitorObject *&me)
Get EMU (Top Level) Monitoring Object.
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(), config, CSCDetId::endcap(), cscdqm::Configuration::fnGetCSCDetId, 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);
183  cscType = cscdqm::Utility::getCSCTypeBin(tlabel);
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  }
int chamber() const
Definition: CSCDetId.h:62
std::function< bool(const unsigned int, const unsigned int, CSCDetId &)> fnGetCSCDetId
string tlabel
Definition: compare.py:27
tuple result
Definition: mps_fire.py:311
int endcap() const
Definition: CSCDetId.h:85
static std::string getCSCTypeLabel(int endcap, int station, int ring)
Get CSC label from CSC parameters.
static int getCSCTypeBin(const std::string &cstr)
Get CSC y-axis position from chamber string.
int ring() const
Definition: CSCDetId.h:68
int station() const
Definition: CSCDetId.h:79
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 config, cscdqm::Configuration::fnGetCacheCSCHisto, and cscdqm::Configuration::fnGetHisto.

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  }
std::function< bool(const HistoId id, const HwId &id1, const HwId &id2, const HwId &id3, MonitorObject *&mo)> fnGetCacheCSCHisto
std::function< bool(const HistoDef &histoT, MonitorObject *&)> fnGetHisto
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 config, cscdqm::Configuration::fnGetCacheCSCHisto, and cscdqm::Configuration::fnGetHisto.

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  }
std::function< bool(const HistoId id, const HwId &id1, const HwId &id2, const HwId &id3, MonitorObject *&mo)> fnGetCacheCSCHisto
std::function< bool(const HistoDef &histoT, MonitorObject *&)> fnGetHisto
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 config, cscdqm::Configuration::fnGetCacheDDUHisto, and cscdqm::Configuration::fnGetHisto.

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  }
std::function< bool(const HistoId id, const HwId &id1, MonitorObject *&mo)> fnGetCacheDDUHisto
std::function< bool(const HistoDef &histoT, MonitorObject *&)> fnGetHisto
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 config, cscdqm::Configuration::fnGetCacheEMUHisto, and cscdqm::Configuration::fnGetHisto.

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

66  {
68  return (me != nullptr);
69  EMUHistoDef histoD(histo);
70  if (config->fnGetHisto(histoD, me))
71  return (me != nullptr);
72  return false;
73  }
std::function< bool(const HistoDef &histoT, MonitorObject *&)> fnGetHisto
std::function< bool(const HistoId id, MonitorObject *&mo)> fnGetCacheEMUHisto
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 config, cscdqm::Configuration::fnGetCacheFEDHisto, and cscdqm::Configuration::fnGetHisto.

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  }
std::function< bool(const HistoDef &histoT, MonitorObject *&)> fnGetHisto
std::function< bool(const HistoId id, const HwId &id1, MonitorObject *&mo)> fnGetCacheFEDHisto
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 config, cscdqm::Configuration::fnGetCacheParHisto, and cscdqm::Configuration::fnGetHisto.

Referenced by updateEfficiencyHistos().

153  {
155  return (me != nullptr);
156  ParHistoDef histoD(histo);
157  if (config->fnGetHisto(histoD, me))
158  return (me != nullptr);
159  return false;
160  }
std::function< bool(const HistoId id, MonitorObject *&mo)> fnGetCacheParHisto
std::function< bool(const HistoDef &histoT, MonitorObject *&)> fnGetHisto
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 {}
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
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 config, EmuEventDisplayWasReset, and cscdqm::Configuration::incNEvents().

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, CSCEventData::alctData(), CSCALCTHeader::ALCTDigis(), CSCALCTHeader::alctFirmwareRevision(), CSCALCTHeader::alctFirmwareVersion(), CSCEventData::alctHeader(), CSCTMBHeader::alctHMT(), CSCTMBHeader::ALCTMatchTime(), CSCTMBHeader::ALCTOnly(), CSCALCTHeader::alctShowerDigis(), CSCEventData::alctTrailer(), b, b1, b2, makePileupJSON::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(), CSCEventData::cfebData(), CSCDMBHeader::cfebMovlp(), CSCDigiToRawAccept::chamberID(), CSCCFEBData::check(), CSCComparatorData::check(), CSCTMBHeader::clct0_ComparatorCode(), CSCTMBHeader::clct0_xky(), CSCTMBHeader::clct1_xky(), cscdqm::CLCT_TRIGGERS, CSCTMBHeader::CLCTDigis(), CSCTMBHeader::clctHMT(), CSCTMBHeader::CLCTOnly(), CSCEventData::comparatorData(), CSCComparatorData::comparatorDigis(), config, cscdqm::Configuration::copyChamberCounterValue(), 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, CSCGEMData::digis(), cscdqm::DMB_EVENTS, CSCDMBTrailer::dmb_l1pipe(), cscdqm::DMB_TRIGGERS, CSCDMBHeader::dmbCfebSync(), CSCEventData::dmbHeader(), CSCDMBHeader::dmbID(), CSCEventData::dmbTrailer(), 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(), PVValHelper::fill(), CSCTMBHeader::FirmwareRevision(), CSCTMBHeader::FirmwareVersion(), first, cscdqm::Configuration::fnGetCSCDetId, stage2BMTFBufferRaw_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::Configuration::getChamberCounterValue(), cscdqm::StripClusterFinder::getClusters(), getCSCFromMap(), getCSCHisto(), cscdqm::Summary::getDetector(), getEMUHisto(), cscdqm::MonitorObject::GetEntries(), CSCEventData::getFormatVersion(), cscdqm::MonitorObject::GetMaximumBin(), cscdqm::Configuration::getNEvents(), cscdqm::CSCHistoDef::getPath(), cscdqm::MonitorObject::getTH1(), cscdqm::MonitorObject::getTH1Lock(), cscdqm::Detector::GlobalChamberIndex(), CSCTMBData::hasGEM(), CSCTMBHeader::hmt_ALCTMatchTime(), CSCTMBHeader::hmt_nhits(), mps_fire::i, cscdqm::Configuration::incNUnpackedCSC(), cscdqm::Summary::isChamberStandby(), L1TdeCSCTPG_cfi::isRun3, sistrip::SpyUtilities::isValid(), dqmiolumiharvest::j, isotrackApplyRegressor::k, CSCDMBHeader::l1a24(), CSCCFEBSCAControllerWord::l1a_phase, CSCALCTHeader::L1Acc(), CSCTMBHeader::L1ANumber(), L1ANumber, LOG_ERROR, LOG_INFO, LOG_WARN, dqmiodumpmetadata::n, CSCDMBHeader::nalct(), CSCEventData::nalct(), CSCTMBHeader::NCFEBs(), CSCDMBHeader::nclct(), CSCEventData::nclct(), gen::npad, me0TriggerPseudoDigis_cff::nStrips, CSCGEMData::numGEMs(), 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(), cscdqm::Configuration::setChamberCounterValue(), setEmuEventDisplayBit(), cscdqm::MonitorObject::SetEntries(), cscdqm::MonitorObject::SetNormFactor(), CSCDetId::station(), AlCaHLTBitMon_QueryRunRegistry::string, summary, theFormatVersion, cscdqm::timeSample(), cscdqm::timeSlice(), CSCDMBTrailer::tmb_empty(), CSCDMBTrailer::tmb_endtimeout(), CSCDMBTrailer::tmb_full(), CSCDMBTrailer::tmb_half(), CSCDMBTrailer::tmb_starttimeout(), CSCEventData::tmbData(), CSCTMBData::tmbHeader(), CSCTMBHeader::TMBMatch(), CSCTMBData::tmbTrailer(), CSCCFEBSCAControllerWord::trig_time, CSCAnodeData::wireDigis(), CSCTMBTrailer::wordCount(), and CSCALCTTrailer::wordCount().

Referenced by processDDU().

81  {
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 
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 
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  int fwVersion = alctHeader->alctFirmwareVersion();
416  int fwRevision = alctHeader->alctFirmwareRevision();
417  const CSCALCTTrailer* alctTrailer = data.alctTrailer();
418  const CSCAnodeData* alctData = data.alctData();
419 
420  if (alctHeader && alctTrailer) {
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 = gemData->etaDigis(i, ieta);
1016  if (!gemEtaDigis.empty()) {
1017  for (unsigned digi = 0; digi < gemEtaDigis.size(); digi++) {
1018  if (gemEtaDigis[digi].isValid()) {
1019  std::vector<uint16_t> pads_hits = gemEtaDigis[digi].pads();
1020  for (unsigned pad = 0; pad < pads_hits.size(); pad++) {
1021  if (getCSCHisto(
1023  crateID,
1024  dmbID,
1025  mo)) {
1026  mo->Fill(pads_hits[pad], 7 - ieta);
1027  }
1028  }
1029  }
1030  }
1031  }
1032  }
1033  }
1034  if (isGEM_hits_found) {
1035  if (getCSCHisto(h::CSC_GEM_ALCT_MATCH, crateID, dmbID, mo)) {
1036  mo->Fill((gem_timing_status >> 12) & 0x7);
1037  }
1038  if (getCSCHisto(h::CSC_GEM_CLCT_MATCH, crateID, dmbID, mo)) {
1039  mo->Fill((gem_timing_status >> 8) & 0xF);
1040  }
1041  }
1042  }
1043  } // OTMB hasGEM
1044  } // isGEM_df
1045 
1048  if (tmbHeader->alctHMT() > 0)
1049  mo->Fill(cscPosition, cscType);
1050  }
1051 
1054  if (tmbHeader->clctHMT() > 0)
1055  mo->Fill(cscPosition, cscType);
1056  }
1057 
1058  if (getCSCHisto(h::CSC_CLCT_RUN3_HMT_NHITS, crateID, dmbID, mo)) {
1059  mo->Fill(tmbHeader->hmt_nhits());
1060  }
1061 
1062  if (getCSCHisto(h::CSC_RUN3_CLCT_ALCT_HMT, crateID, dmbID, mo)) {
1063  mo->Fill(tmbHeader->clctHMT());
1064  mo->Fill(tmbHeader->alctHMT() + 4);
1065  }
1066 
1067  if (getCSCHisto(h::CSC_RUN3_CLCT_VS_ALCT_HMT_BITS, crateID, dmbID, mo)) {
1068  mo->Fill(tmbHeader->clctHMT(), tmbHeader->alctHMT());
1069  }
1070 
1071  if (getCSCHisto(h::CSC_CORR_LCT_RUN3_PATTERN_ID, crateID, dmbID, mo)) {
1072  mo->Fill(tmbHeader->run3_CLCT_patternID());
1073  }
1074  }
1075  /*
1076  LOG_DEBUG << "OTMB dump: " << "CLCT0_ComparatorCode: 0x" << std::hex << tmbHeader->CLCT0_ComparatorCode()
1077  << ", CLCT0_xky: 0x" << std::hex << tmbHeader->CLCT0_xky()
1078  << ", CLCT1_ComparatorCode: 0x" << std::hex << tmbHeader->CLCT1_ComparatorCode()
1079  << ", CLCT1_xky: 0x" << std::hex << tmbHeader->CLCT1_xky()
1080  << ", GEM_sync_dataword: 0x" << std::hex << tmbHeader->GEM_sync_dataword()
1081  << ", GEM_timing_dataword: 0x" << std::hex << tmbHeader->GEM_timing_dataword()
1082  << ",\n HMT_nhits: 0x" << std::hex << tmbHeader->HMT_nhits()
1083  << ", GEM_enabled_fibers: 0x" << std::hex << tmbHeader->GEM_enabled_fibers()
1084  << ", GEM_fifo_tbins: " << std::dec << tmbHeader->GEM_fifo_tbins()
1085  << ", GEM_fifo_pretrig: " << std::dec << tmbHeader->GEM_fifo_pretrig()
1086  << ", GEM_zero_suppression: " << std::dec << tmbHeader->GEM_zero_suppress();
1087 */
1088  }
1089  CSCComparatorData* comparatorData = data.comparatorData();
1090 
1091  std::vector<CSCCLCTDigi> clctsDatasTmp = tmbHeader->CLCTDigis(cid.rawId());
1092  std::vector<CSCCLCTDigi> clctsDatas;
1093 
1094  for (uint32_t lct = 0; lct < clctsDatasTmp.size(); lct++) {
1095  if (clctsDatasTmp[lct].isValid()) {
1096  clctsDatas.push_back(clctsDatasTmp[lct]);
1097  if (clctsDatasTmp[lct].isRun3()) {
1098  if ((lct == 0) && getCSCHisto(h::CSC_CLCTXX_KEY_STRIP_TYPE, crateID, dmbID, lct, mo))
1099  mo->Fill(tmbHeader->clct0_xky());
1100  if ((lct == 1) && getCSCHisto(h::CSC_CLCTXX_KEY_STRIP_TYPE, crateID, dmbID, lct, mo))
1101  mo->Fill(tmbHeader->clct1_xky());
1102  }
1103  }
1104  }
1105 
1106  for (uint32_t lct = 0; lct < clctsDatas.size(); lct++) {
1107  /*
1108  LOG_DEBUG << "CLCT Digis dump: "
1109  << "CLCT" << lct << " isRun3:" << clctsDatasTmp[lct].isRun3()
1110  << ", isValid: " << clctsDatasTmp[lct].isValid()
1111  << ", getCFEB: " << clctsDatasTmp[lct].getCFEB()
1112  << ", getKeyStrip: " << clctsDatasTmp[lct].getKeyStrip()
1113  << ", getFractionalStrip: " << clctsDatasTmp[lct].getFractionalStrip()
1114  << ", getQuartStrip: " << clctsDatasTmp[lct].getQuartStripBit()
1115  << ", getEightStrip: " << clctsDatasTmp[lct].getEightStripBit()
1116  << ",\n getCompCode: 0x" << std::hex << clctsDatasTmp[lct].getCompCode()
1117  << ", getQuality: " << clctsDatasTmp[lct].getQuality() << std::dec
1118  << ", getPattern: " << clctsDatasTmp[lct].getPattern() << std::dec
1119  << ", getBend: " << clctsDatasTmp[lct].getBend() << std::dec
1120  << ", getSlope: " << clctsDatasTmp[lct].getSlope() << std::dec
1121  << ", getFractionalSlope: " << clctsDatasTmp[lct].getFractionalSlope()
1122  << ", getBX: " << clctsDatasTmp[lct].getBX()
1123  << ", getRun3Pattern: 0x" << std::hex << clctsDatasTmp[lct].getRun3Pattern()
1124  << std::dec;
1125 */
1126  if (clctsDatas[lct].isRun3()) {
1127  if (getCSCHisto(h::CSC_CLCTXX_COMPARATOR_CODE, crateID, dmbID, lct, mo)) {
1128  mo->Fill(clctsDatas[lct].getCompCode());
1129  }
1130  if (getCSCHisto(h::CSC_CLCTXX_RUN3_TO_RUN2_PATTERN, crateID, dmbID, lct, mo)) {
1131  int bend = clctsDatas[lct].getSlope() + ((clctsDatas[lct].getBend() & 0x1) << 4);
1132  mo->Fill(bend, clctsDatas[lct].getPattern());
1133  }
1134  if (getCSCHisto(h::CSC_CLCTXX_RUN3_BEND_VS_SLOPE, crateID, dmbID, lct, mo)) {
1135  mo->Fill(clctsDatas[lct].getSlope(), clctsDatas[lct].getBend());
1136  }
1137  }
1138  }
1139 
1141  std::vector<CSCCorrelatedLCTDigi> corr_lctsDatasTmp = tmbHeader->CorrelatedLCTDigis(cid.rawId());
1142  std::vector<CSCCorrelatedLCTDigi> corr_lctsDatas;
1143 
1144  for (uint32_t lct = 0; lct < corr_lctsDatasTmp.size(); lct++) {
1145  if (corr_lctsDatasTmp[lct].isValid()) {
1146  corr_lctsDatas.push_back(corr_lctsDatasTmp[lct]);
1147  }
1148 
1149  if (isGEM_df) {
1150  uint16_t gem_sync_status = tmbHeader->gem_sync_dataword();
1151 
1152  for (unsigned i = lct * 4; i < (lct * 4 + 4); i++) {
1153  if ((gem_sync_status >> i) & 0x1) {
1154  if (corr_lctsDatasTmp[lct].isValid()) {
1155  if (getCSCHisto(h::CSC_GEM_LCT_SYNC_STATUS, crateID, dmbID, mo)) {
1156  mo->Fill(lct, i); // Fill for valid LCT
1157  }
1158  }
1159  }
1160  }
1161  }
1162 
1163  if (getCSCHisto(h::CSC_CORR_LCT_CLCT_COMBINATION, crateID, dmbID, mo)) {
1164  mo->Fill(clctsDatasTmp[lct].isValid() * 2 + lct, corr_lctsDatasTmp[lct].isValid() * 2 + lct);
1165  }
1166 
1167  if (lct == 0) {
1168  if (corr_lctsDatasTmp[lct].isRun3() || isTMB_hybrid_df) {
1171  if (corr_lctsDatasTmp[lct].getHMT() > 0)
1172  mo->Fill(cscPosition, cscType);
1173  }
1174  if (getCSCHisto(h::CSC_RUN3_HMT_DISTRIBUTION, crateID, dmbID, mo)) {
1175  mo->Fill(corr_lctsDatasTmp[lct].getHMT());
1176  }
1177  if (getCSCHisto(h::CSC_CLCT_RUN3_HMT_NHITS_VS_HMT_BITS, crateID, dmbID, mo)) {
1178  mo->Fill(tmbHeader->hmt_nhits(),
1179  (corr_lctsDatasTmp[lct].getHMT() & 0x3)); // in-time Hadronic shower bits
1180  mo->Fill(tmbHeader->hmt_nhits(),
1181  ((corr_lctsDatasTmp[lct].getHMT() >> 2) & 0x3) + 4); // out-of-time Hadronic shower bits
1182  }
1183  if (getCSCHisto(h::CSC_RUN3_HMT_COINCIDENCE_MATCH, crateID, dmbID, mo)) {
1184  if ((corr_lctsDatasTmp[lct].getHMT() > 0) && (corr_lctsDatasTmp[lct].getHMT() <= 0xF)) {
1185  mo->Fill(0); // Run3 HMT is fired
1186  if ((!clctsDatasTmp.empty()) && clctsDatasTmp[lct].isValid()) {
1187  mo->Fill(2); // Run3 HMT+CLCT match
1188  }
1189  if (corr_lctsDatasTmp[lct].isValid()) {
1190  mo->Fill(3); // Run3 HMT+LCT match
1191  }
1192  }
1193  }
1194  if (getCSCHisto(h::CSC_RUN3_HMT_ALCT_MATCH, crateID, dmbID, mo)) {
1195  if ((corr_lctsDatasTmp[lct].getHMT() > 0) && (corr_lctsDatasTmp[lct].getHMT() <= 0xF)) {
1196  mo->Fill(tmbHeader->hmt_ALCTMatchTime());
1197  }
1198  }
1199  if (getCSCHisto(h::CSC_RUN3_HMT_HADRONIC_SHOWER, crateID, dmbID, mo)) {
1200  mo->Fill(corr_lctsDatasTmp[lct].getHMT() & 0x3); // in-time Hadronic shower bits
1201  mo->Fill(((corr_lctsDatasTmp[lct].getHMT() >> 2) & 0x3) + 4); // out-of-time Hadronic shower bits
1202  }
1203  }
1204  }
1205  }
1206 
1207  if (clctsDatasTmp[0].isValid() && corr_lctsDatasTmp[0].isValid() &&
1208  getCSCHisto(h::CSC_CORR_LCT0_VS_CLCT0_KEY_STRIP, crateID, dmbID, mo)) {
1209  mo->Fill(clctsDatasTmp[0].getKeyStrip(), corr_lctsDatasTmp[0].getStrip());
1210  }
1211 
1212  if (clctsDatasTmp[1].isValid() && corr_lctsDatasTmp[1].isValid() &&
1213  getCSCHisto(h::CSC_CORR_LCT1_VS_CLCT1_KEY_STRIP, crateID, dmbID, mo)) {
1214  mo->Fill(clctsDatasTmp[1].getKeyStrip(), corr_lctsDatasTmp[1].getStrip());
1215  }
1216 
1217  if (!corr_lctsDatas.empty()) {
1218  if (corr_lctsDatasTmp[0].isRun3()) {
1219  if (getCSCHisto(h::CSC_CORR_LCT0_VS_LCT1_RUN3_PATTERN, crateID, dmbID, mo)) {
1220  int lct1_pattern = corr_lctsDatasTmp[1].getRun3Pattern();
1221  if (!corr_lctsDatasTmp[1].isValid())
1222  lct1_pattern = -1;
1223  mo->Fill(corr_lctsDatasTmp[0].getRun3Pattern(), lct1_pattern);
1224  }
1225  }
1226  }
1227 
1228  for (uint32_t lct = 0; lct < corr_lctsDatas.size(); lct++) {
1229  /*
1230  LOG_DEBUG << "CorrelatedLCT Digis dump: "
1231  << "CorrLCT" << lct << " isRun3:" << corr_lctsDatasTmp[lct].isRun3()
1232  << ", isValid: " << corr_lctsDatasTmp[lct].isValid()
1233  << ", getStrip: " << corr_lctsDatasTmp[lct].getStrip()
1234  << ", getKeyWG: " << corr_lctsDatasTmp[lct].getKeyWG()
1235  << ", getQuality: " << corr_lctsDatasTmp[lct].getQuality()
1236  << ", getFractionalStrip: " << corr_lctsDatasTmp[lct].getFractionalStrip()
1237  << ", getQuartStrip: " << corr_lctsDatasTmp[lct].getQuartStripBit()
1238  << ", getEightStrip: " << corr_lctsDatasTmp[lct].getEightStripBit()
1239  << ",\n getSlope: " << corr_lctsDatasTmp[lct].getSlope() << std::dec
1240  << ", getBend: " << corr_lctsDatasTmp[lct].getBend()
1241  << ", getBX: " << corr_lctsDatasTmp[lct].getBX()
1242  << ", getPattern: 0x" << std::hex << corr_lctsDatasTmp[lct].getPattern()
1243  << ", getRun3Pattern: 0x" << std::hex << corr_lctsDatasTmp[lct].getRun3Pattern()
1244  // << ", getRun3PatternID: " << std::dec << corr_lctsDatasTmp[lct].getRun3PatternID()
1245  << ", getHMT: " << corr_lctsDatasTmp[lct].getHMT()
1246  << std::dec;
1247 */
1248  if (getCSCHisto(h::CSC_CORR_LCTXX_HITS_DISTRIBUTION, crateID, dmbID, lct, mo)) {
1249  mo->Fill(corr_lctsDatas[lct].getStrip(), corr_lctsDatas[lct].getKeyWG());
1250  }
1251 
1252  if (getCSCHisto(h::CSC_CORR_LCTXX_KEY_WG, crateID, dmbID, lct, mo)) {
1253  mo->Fill(corr_lctsDatas[lct].getKeyWG());
1254  }
1255 
1256  if (getCSCHisto(h::CSC_CORR_LCTXX_KEY_HALFSTRIP, crateID, dmbID, lct, mo)) {
1257  mo->Fill(corr_lctsDatas[lct].getStrip(2));
1258  }
1259 
1260  if (corr_lctsDatas[lct].isRun3()) {
1261  if (getCSCHisto(h::CSC_CORR_LCTXX_KEY_QUARTSTRIP, crateID, dmbID, lct, mo)) {
1262  mo->Fill(corr_lctsDatas[lct].getStrip(4));
1263  }
1264 
1265  if (getCSCHisto(h::CSC_CORR_LCTXX_KEY_EIGHTSTRIP, crateID, dmbID, lct, mo)) {
1266  mo->Fill(corr_lctsDatas[lct].getStrip(8));
1267  }
1268 
1269  if (getCSCHisto(h::CSC_CORR_LCTXX_RUN3_TO_RUN2_PATTERN, crateID, dmbID, lct, mo)) {
1270  int bend = corr_lctsDatas[lct].getSlope() + ((corr_lctsDatas[lct].getBend() & 0x1) << 4);
1271  mo->Fill(bend, corr_lctsDatas[lct].getPattern());
1272  }
1273 
1274  if (getCSCHisto(h::CSC_CORR_LCTXX_BEND_VS_SLOPE, crateID, dmbID, lct, mo)) {
1275  mo->Fill(corr_lctsDatas[lct].getSlope(), corr_lctsDatas[lct].getBend());
1276  }
1277 
1278  if (getCSCHisto(h::CSC_CORR_LCTXX_KEY_STRIP_TYPE, crateID, dmbID, lct, mo)) {
1279  int strip_type =
1280  (corr_lctsDatas[lct].getQuartStripBit() << 1) + (corr_lctsDatas[lct].getEighthStripBit());
1281  mo->Fill(strip_type);
1282  }
1283 
1284  if ((cid.station() == 1) && (cid.ring() == 1)) {
1285  if (getCSCHisto(h::CSC_CORR_LCTXX_RUN3_ME11_QUALITY, crateID, dmbID, lct, mo)) {
1286  mo->Fill(corr_lctsDatas[lct].getQuality());
1287  }
1288  } else {
1289  if (getCSCHisto(h::CSC_CORR_LCTXX_RUN3_QUALITY, crateID, dmbID, lct, mo)) {
1290  mo->Fill(corr_lctsDatas[lct].getQuality());
1291  }
1292  }
1293  }
1294  }
1295 
1296  if (data.nalct()) {
1297  CSCALCTHeader* alctHeader = data.alctHeader();
1298  if (alctHeader) {
1299  std::vector<CSCALCTDigi> alctsDatasTmp = alctHeader->ALCTDigis();
1300  std::vector<CSCALCTDigi> alctsDatas;
1301  std::vector<uint32_t> keyWG_list;
1302  keyWG_list.clear();
1303  for (uint32_t lct = 0; lct < alctsDatasTmp.size(); lct++) {
1304  if (alctsDatasTmp[lct].isValid()) {
1305  alctsDatas.push_back(alctsDatasTmp[lct]);
1306  keyWG_list.push_back(alctsDatasTmp[lct].getKeyWG());
1307  }
1308  }
1309 
1310  if (!alctsDatas.empty() && getCSCHisto(h::CSC_RUN3_HMT_COINCIDENCE_MATCH, crateID, dmbID, mo) &&
1311  corr_lctsDatasTmp[0].isRun3() && (corr_lctsDatasTmp[0].getHMT() > 0) &&
1312  (corr_lctsDatasTmp[0].getHMT() <= 0xF) && alctsDatas[0].isValid()) {
1313  mo->Fill(1); // Run3 HMT+ALCT match
1314  }
1315 
1316  for (uint32_t lct = 0; lct < corr_lctsDatasTmp.size(); lct++) {
1317  if (corr_lctsDatasTmp[lct].isValid()) {
1318  for (uint32_t i = 0; i < keyWG_list.size(); i++) {
1320  if (corr_lctsDatasTmp[lct].getKeyWG() == keyWG_list[i]) {
1321  if ((lct == 0) && getCSCHisto(h::CSC_CORR_LCT0_VS_ALCT0_KEY_WG, crateID, dmbID, mo))
1322  mo->Fill(alctsDatas[i].getKeyWG(), corr_lctsDatasTmp[lct].getKeyWG());
1323  if ((lct == 1) && getCSCHisto(h::CSC_CORR_LCT1_VS_ALCT1_KEY_WG, crateID, dmbID, mo))
1324  mo->Fill(alctsDatas[i].getKeyWG(), corr_lctsDatasTmp[lct].getKeyWG());
1325  if (getCSCHisto(h::CSC_CORR_LCT_VS_ALCT_DIGI_MATCH, crateID, dmbID, mo)) {
1326  mo->Fill(lct, i);
1327  }
1328  continue;
1329  }
1330  }
1331  }
1332  }
1333  }
1334  }
1335 
1336  FEBunpacked = FEBunpacked + 1;
1337  tmb_unpacked = 1;
1338 
1339  if (getCSCHisto(h::CSC_ALCT_MATCH_TIME, crateID, dmbID, mo)) {
1340  mo->Fill(tmbHeader->ALCTMatchTime());
1341  double alct_match_mean = mo->getTH1()->GetMean();
1342  double alct_match_rms = mo->getTH1()->GetRMS();
1343  MonitorObject* mo1 = nullptr;
1344 
1345  if (cid.endcap() == 1) {
1346  if (cscPosition && getEMUHisto(h::EMU_CSC_ENDCAP_PLUS_ALCT_CLCT_MATCH_TIME, mo1)) {
1347  mo1->Fill(tmbHeader->ALCTMatchTime());
1348  }
1349  }
1350 
1351  if (cid.endcap() == 2) {
1352  if (cscPosition && getEMUHisto(h::EMU_CSC_ENDCAP_MINUS_ALCT_CLCT_MATCH_TIME, mo1)) {
1353  mo1->Fill(tmbHeader->ALCTMatchTime());
1354  }
1355  }
1356 
1357  if (cscPosition && getEMUHisto(h::EMU_CSC_ALCT_CLCT_MATCH_MEAN, mo1)) {
1358  mo1->SetBinContent(cscPosition, cscType + 1, alct_match_mean);
1359  }
1360 
1361  if (cscPosition && getEMUHisto(h::EMU_CSC_ALCT_CLCT_MATCH_RMS, mo1)) {
1362  mo1->SetBinContent(cscPosition, cscType + 1, alct_match_rms);
1363  }
1364  }
1365 
1366  if (getCSCHisto(h::CSC_LCT_MATCH_STATUS, crateID, dmbID, mo)) {
1367  if (tmbHeader->CLCTOnly())
1368  mo->Fill(0.0, 0.0);
1369  if (tmbHeader->ALCTOnly())
1370  mo->Fill(0.0, 1.0);
1371  if (tmbHeader->TMBMatch())
1372  mo->Fill(0.0, 2.0);
1373  }
1374 
1375  if (getCSCHisto(h::CSC_LCT0_MATCH_BXN_DIFFERENCE, crateID, dmbID, mo))
1376  mo->Fill(tmbHeader->Bxn0Diff());
1377  if (getCSCHisto(h::CSC_LCT1_MATCH_BXN_DIFFERENCE, crateID, dmbID, mo))
1378  mo->Fill(tmbHeader->Bxn1Diff());
1379 
1380  if ((tmb_dav > 0) && (getCSCHisto(h::CSC_DMB_FEB_UNPACKED_VS_DAV, crateID, dmbID, mo))) {
1381  mo->Fill(1.0, 0.0);
1382  }
1383 
1385  if (getCSCHisto(h::CSC_CSC_RATE, crateID, dmbID, mo)) {
1386  mo->Fill(3);
1387  uint32_t CLCTEvent = (uint32_t)mo->GetBinContent(4);
1388  config->setChamberCounterValue(CLCT_TRIGGERS, crateID, dmbID, CLCTEvent);
1389  if (getCSCHisto(h::CSC_CSC_EFFICIENCY, crateID, dmbID, mo)) {
1390  if (config->getNEvents() > 0) {
1391  mo->SetBinContent(2, ((float)CLCTEvent / (float)(DMBEvents)*100.0));
1392  mo->SetEntries(DMBEvents);
1393  }
1394  }
1395  }
1396 
1397  if (getCSCHisto(h::CSC_CLCT_L1A, crateID, dmbID, mo))
1398  mo->Fill(tmbHeader->L1ANumber());
1399 
1401  if (getCSCHisto(h::CSC_CLCT_DMB_L1A_DIFF, crateID, dmbID, mo)) {
1402  int clct_dmb_l1a_diff = (int)((tmbHeader->L1ANumber() % 64) - dmbHeader->l1a24() % 64);
1403  if (clct_dmb_l1a_diff != 0)
1404  L1A_out_of_sync = true;
1405  if (clct_dmb_l1a_diff < -32)
1406  mo->Fill(clct_dmb_l1a_diff + 64);
1407  else {
1408  if (clct_dmb_l1a_diff >= 32)
1409  mo->Fill(clct_dmb_l1a_diff - 64);
1410  else
1411  mo->Fill(clct_dmb_l1a_diff);
1412  }
1413  mo->SetAxisRange(0.1, 1.1 * (1.0 + mo->GetBinContent(mo->GetMaximumBin())), "Y");
1414  }
1415 
1416  if (getCSCHisto(h::CSC_DMB_L1A_VS_CLCT_L1A, crateID, dmbID, mo))
1417  mo->Fill(tmbHeader->L1ANumber() % 256, dmbHeader->l1a24() % 256);
1418 
1419  if (getCSCHisto(h::CSC_CLCT_DMB_BXN_DIFF, crateID, dmbID, mo)) {
1420  int clct_dmb_bxn_diff = (int)(tmbHeader->BXNCount() % 64 - dmbHeader->bxn12() % 64);
1421  if (clct_dmb_bxn_diff < -32)
1422  mo->Fill(clct_dmb_bxn_diff + 64);
1423  else {
1424  if (clct_dmb_bxn_diff >= 32)
1425  mo->Fill(clct_dmb_bxn_diff - 64);
1426  else
1427  mo->Fill(clct_dmb_bxn_diff);
1428  }
1429  mo->SetAxisRange(0.1, 1.1 * (1.0 + mo->GetBinContent(mo->GetMaximumBin())), "Y");
1430  }
1431 
1432  if (getCSCHisto(h::CSC_CLCT_BXN, crateID, dmbID, mo))
1433  mo->Fill((int)(tmbHeader->BXNCount()));
1434 
1435  if (getCSCHisto(h::CSC_CLCT_BXN_VS_DMB_BXN, crateID, dmbID, mo))
1436  mo->Fill(tmbHeader->BXNCount() % 256, dmbHeader->bxn12() % 256);
1437 
1438  if (getCSCHisto(h::CSC_CLCT_NUMBER_RATE, crateID, dmbID, mo)) {
1439  mo->Fill(clctsDatas.size());
1440  int nCLCT = (int)mo->GetBinContent((int)(clctsDatas.size() + 1));
1441  if (getCSCHisto(h::CSC_CLCT_NUMBER, crateID, dmbID, mo))
1442  mo->SetBinContent((int)(clctsDatas.size() + 1), (float)(nCLCT) / (float)(DMBEvents)*100.0);
1443  }
1444 
1445  if (clctsDatas.size() == 1) {
1446  if (getCSCHisto(h::CSC_CLCT0_CLSSIFICATION, crateID, dmbID, mo)) {
1447  if (clctsDatas[0].getStripType())
1448  mo->Fill(0.0);
1449  else
1450  mo->Fill(1.0);
1451  }
1452  }
1453 
1454  if (clctsDatas.size() == 2) {
1455  if (getCSCHisto(h::CSC_CLCT1_VS_CLCT0_KEY_STRIP, crateID, dmbID, mo))
1456  mo->Fill(clctsDatas[0].getKeyStrip(), clctsDatas[1].getKeyStrip());
1457  if (getCSCHisto(h::CSC_CLCT0_CLCT1_CLSSIFICATION, crateID, dmbID, mo)) {
1458  if (clctsDatas[0].getStripType() && clctsDatas[1].getStripType())
1459  mo->Fill(0.0);
1460  if (clctsDatas[0].getStripType() && !clctsDatas[1].getStripType())
1461  mo->Fill(1.0);
1462  if (!clctsDatas[0].getStripType() && clctsDatas[1].getStripType())
1463  mo->Fill(2.0);
1464  if (!clctsDatas[0].getStripType() && !clctsDatas[1].getStripType())
1465  mo->Fill(3.0);
1466  }
1467  }
1468 
1469  if (getCSCHisto(h::CSC_TMB_WORD_COUNT, crateID, dmbID, mo))
1470  mo->Fill((int)(tmbTrailer->wordCount()));
1471 
1472  MonitorObject* mo_CSC_Plus_endcap_CLCT0_dTime = nullptr;
1473  getEMUHisto(h::EMU_CSC_ENDCAP_PLUS_CLCT0_DTIME, mo_CSC_Plus_endcap_CLCT0_dTime);
1474 
1475  MonitorObject* mo_CSC_Minus_endcap_CLCT0_dTime = nullptr;
1476  getEMUHisto(h::EMU_CSC_ENDCAP_MINUS_CLCT0_DTIME, mo_CSC_Minus_endcap_CLCT0_dTime);
1477 
1478  MonitorObject* mo_CSC_CLCT0_BXN_mean = nullptr;
1479  getEMUHisto(h::EMU_CSC_CLCT0_BXN_MEAN, mo_CSC_CLCT0_BXN_mean);
1480 
1481  MonitorObject* mo_CSC_CLCT0_BXN_rms = nullptr;
1482  getEMUHisto(h::EMU_CSC_CLCT0_BXN_RMS, mo_CSC_CLCT0_BXN_rms);
1483 
1484  for (uint32_t lct = 0; lct < clctsDatas.size(); lct++) {
1485  if (getCSCHisto(h::CSC_CLCTXX_BXN, crateID, dmbID, lct, mo))
1486  mo->Fill(clctsDatas[lct].getFullBX() % 64);
1487 
1488  int clct_dtime = clctsDatas[lct].getFullBX() - tmbHeader->BXNCount();
1489  if (clct_dtime > 0) {
1490  clct_dtime -= 3564;
1491  }
1492 
1493  int dTime = clct_dtime;
1494 
1495  if (lct == 0) {
1496  if (cid.endcap() == 1) {
1497  if (mo_CSC_Plus_endcap_CLCT0_dTime)
1498  mo_CSC_Plus_endcap_CLCT0_dTime->Fill(dTime);
1499  }
1500  if (cid.endcap() == 2) {
1501  if (mo_CSC_Minus_endcap_CLCT0_dTime)
1502  mo_CSC_Minus_endcap_CLCT0_dTime->Fill(dTime);
1503  }
1504  }
1505 
1506  if (getCSCHisto(h::CSC_CLCTXX_DTIME, crateID, dmbID, lct, mo)) {
1507  mo->Fill(dTime);
1508  mo->SetAxisRange(0.1, 1.1 * (1.0 + mo->GetBinContent(mo->GetMaximumBin())), "Y");
1509 
1510  double dTime_mean = mo->getTH1()->GetMean();
1511  double dTime_rms = mo->getTH1()->GetRMS();
1512 
1513  // == For CLCT0 Fill Summary dTime Histograms
1514  if (lct == 0) {
1515  if (cscPosition && mo_CSC_CLCT0_BXN_mean) {
1516  mo_CSC_CLCT0_BXN_mean->SetBinContent(cscPosition, cscType + 1, dTime_mean);
1517  }
1518  if (cscPosition && mo_CSC_CLCT0_BXN_rms) {
1519  mo_CSC_CLCT0_BXN_rms->SetBinContent(cscPosition, cscType + 1, dTime_rms);
1520  }
1521  }
1522  }
1523 
1524  /* LOG_DEBUG << "LCT:" << lct << " Type:" << clctsDatas[lct].getStripType()
1525  << " Strip:" << clctsDatas[lct].getKeyStrip();
1526  */
1527 
1528  if (clctsDatas[lct].getStripType()) { // HalfStrip Type
1529 
1530  if (getCSCHisto(h::CSC_CLCTXX_KEYHALFSTRIP, crateID, dmbID, lct, mo))
1531  mo->Fill(clctsDatas[lct].getKeyStrip());
1532 
1533  /* === Run3 CSC-GEM Trigger data format */
1534  if (getCSCHisto(h::CSC_CLCTXX_KEY_QUARTSTRIP, crateID, dmbID, lct, mo))
1535  mo->Fill(clctsDatas[lct].getKeyStrip(4));
1536  if (getCSCHisto(h::CSC_CLCTXX_KEY_EIGHTSTRIP, crateID, dmbID, lct, mo))
1537  mo->Fill(clctsDatas[lct].getKeyStrip(8));
1538  /* === Run3 */
1539 
1540  if (getCSCHisto(h::CSC_CLCTXX_DTIME_VS_HALF_STRIP, crateID, dmbID, lct, mo)) {
1541  mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime);
1542  }
1543 
1544  if (getCSCHisto(h::CSC_CLCTXX_DTIME_PROFILE, crateID, dmbID, lct, mo)) {
1545  mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime);
1546  }
1547 
1548  if (getCSCHisto(h::CSC_CLCTXX_HALF_STRIP_PATTERN, crateID, dmbID, lct, mo)) {
1549  int pattern_clct = clctsDatas[lct].getPattern();
1553  double tbin = -1;
1554 
1555  switch (pattern_clct) {
1556  case 0:
1557  tbin = 0.;
1558  break;
1559  case 1:
1560  tbin = 1.;
1561  break;
1562  case 2:
1563  tbin = 2.;
1564  break;
1565  case 3:
1566  tbin = 10.;
1567  break;
1568  case 4:
1569  tbin = 3.;
1570  break;
1571  case 5:
1572  tbin = 9.;
1573  break;
1574  case 6:
1575  tbin = 4.;
1576  break;
1577  case 7:
1578  tbin = 8.;
1579  break;
1580  case 8:
1581  tbin = 5.;
1582  break;
1583  case 9:
1584  tbin = 7.;
1585  break;
1586  case 10:
1587  tbin = 6.;
1588  break;
1589  }
1590 
1591  if (tbin >= 0)
1592  mo->Fill(clctsDatas[lct].getKeyStrip(), tbin);
1593 
1594  MonitorObject* mo1 = nullptr;
1595  if (getCSCHisto(h::CSC_CLCT_HALF_STRIP_PATTERN_DISTR, crateID, dmbID, lct, mo1))
1596  mo1->Fill(tbin);
1597  }
1598 
1599  if (getCSCHisto(h::CSC_CLCTXX_HALF_STRIP_QUALITY, crateID, dmbID, lct, mo))
1600  mo->Fill((int)(clctsDatas[lct].getKeyStrip()), (int)(clctsDatas[lct].getQuality()));
1601 
1602  if (mo_EventDisplay) {
1603  mo_EventDisplay->SetBinContent(10, clctsDatas[lct].getKeyStrip(), clct_dtime);
1604  mo_EventDisplay->SetBinContent(11, clctsDatas[lct].getKeyStrip(), clctsDatas[lct].getQuality());
1605  }
1606 
1607  if (getCSCHisto(h::CSC_CLCTXX_HALF_STRIP_QUALITY_DISTR, crateID, dmbID, lct, mo)) {
1608  mo->Fill((int)(clctsDatas[lct].getQuality()));
1609  if (lct == 0) {
1610  MonitorObject* mo1 = nullptr;
1611  if (cscPosition && getEMUHisto(h::EMU_CSC_CLCT0_QUALITY, mo1)) {
1612  mo1->SetBinContent(cscPosition, cscType + 1, mo->getTH1()->GetMean());
1613  }
1614  }
1615  }
1616 
1617  if (getCSCHisto(h::CSC_CLCTXX_HALF_STRIP_QUALITY_PROFILE, crateID, dmbID, lct, mo))
1618  mo->Fill((int)(clctsDatas[lct].getKeyStrip()), (int)(clctsDatas[lct].getQuality()));
1619 
1620  } else { // DiStrip Type
1621 
1622  LOG_INFO << "Entering block!";
1623 
1624  if (getCSCHisto(h::CSC_CLCTXX_KEYDISTRIP, crateID, dmbID, lct, mo))
1625  mo->Fill(clctsDatas[lct].getKeyStrip());
1626  else
1627  LOG_ERROR << "Not found h::CSC_CLCTXX_KEYDISTRIP = " << h::CSC_CLCTXX_KEYDISTRIP;
1628 
1629  if (lct == 0)
1630  clct_kewdistrip = clctsDatas[lct].getKeyStrip();
1631 
1632  if (getCSCHisto(h::CSC_CLCTXX_DTIME_VS_DISTRIP, crateID, dmbID, lct, mo)) {
1633  mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime);
1634  }
1635 
1636  if (getCSCHisto(h::CSC_CLCTXX_DISTRIP_PATTERN, crateID, dmbID, lct, mo)) {
1637  int pattern_clct = (int)((clctsDatas[lct].getPattern() >> 1) & 0x3);
1640  if (pattern_clct == 1)
1641  mo->Fill(clctsDatas[lct].getKeyStrip(), 7.0);
1642  if (pattern_clct == 3)
1643  mo->Fill(clctsDatas[lct].getKeyStrip(), 6.0);
1644  if (pattern_clct == 5)
1645  mo->Fill(clctsDatas[lct].getKeyStrip(), 5.0);
1646  if (pattern_clct == 7)
1647  mo->Fill(clctsDatas[lct].getKeyStrip(), 4.0);
1648  if (pattern_clct == 6)
1649  mo->Fill(clctsDatas[lct].getKeyStrip(), 3.0);
1650  if (pattern_clct == 4)
1651  mo->Fill(clctsDatas[lct].getKeyStrip(), 2.0);
1652  if (pattern_clct == 2)
1653  mo->Fill(clctsDatas[lct].getKeyStrip(), 1.0);
1654  if (pattern_clct == 0)
1655  mo->Fill(clctsDatas[lct].getKeyStrip(), 0.0);
1656  }
1657 
1658  if (getCSCHisto(h::CSC_CLCTXX_DISTRIP_QUALITY, crateID, dmbID, lct, mo))
1659  mo->Fill((int)(clctsDatas[lct].getKeyStrip()), (int)(clctsDatas[lct].getQuality()));
1660 
1661  if (getCSCHisto(h::CSC_CLCTXX_DISTRIP_QUALITY_PROFILE, crateID, dmbID, lct, mo))
1662  mo->Fill((int)(clctsDatas[lct].getKeyStrip()), (int)(clctsDatas[lct].getQuality()));
1663  }
1664  }
1665 
1666  int N_CFEBs = tmbHeader->NCFEBs();
1667  int NumberOfLayersWithHitsInCLCT = 0;
1668  int NumberOfHalfStripsWithHitsInCLCT = 0;
1669 
1670  if (comparatorData && comparatorData->check()) {
1671  MonitorObject* mo_CFEB_Comparators_TimeSamples = nullptr;
1672  getCSCHisto(h::CSC_CFEB_COMPARATORS_TIMESAMPLES, crateID, dmbID, mo_CFEB_Comparators_TimeSamples);
1673 
1674  MonitorObject* mo_CSC_Plus_endcap_CFEB_Comparators_Time = nullptr;
1675  getEMUHisto(h::EMU_CSC_ENDCAP_PLUS_CFEB_COMPARATORS_TIME, mo_CSC_Plus_endcap_CFEB_Comparators_Time);
1676 
1677  MonitorObject* mo_CSC_Minus_endcap_CFEB_Comparators_Time = nullptr;
1678  getEMUHisto(h::EMU_CSC_ENDCAP_MINUS_CFEB_COMPARATORS_TIME, mo_CSC_Minus_endcap_CFEB_Comparators_Time);
1679 
1680  MonitorObject* mo_CSC_CFEB_Comparators_Time_mean = nullptr;
1681  getEMUHisto(h::EMU_CSC_CFEB_COMPARATORS_TIME_MEAN, mo_CSC_CFEB_Comparators_Time_mean);
1682 
1683  MonitorObject* mo_CSC_CFEB_Comparators_Time_rms = nullptr;
1684  getEMUHisto(h::EMU_CSC_CFEB_COMPARATORS_TIME_RMS, mo_CSC_CFEB_Comparators_Time_rms);
1685 
1686  for (int nCFEB = 0; nCFEB < N_CFEBs; ++nCFEB) {
1687  for (int nLayer = 1; nLayer <= 6; nLayer++) {
1688  int hstrip_previous = -1;
1689  int tbin_clct_previous = -1;
1690  bool CheckLayerCLCT = true;
1691 
1692  std::vector<CSCComparatorDigi> compOutData = comparatorData->comparatorDigis(nLayer, nCFEB);
1693 
1694  for (std::vector<CSCComparatorDigi>::iterator compOutDataItr = compOutData.begin();
1695  compOutDataItr != compOutData.end();
1696  ++compOutDataItr) {
1698  int hstrip = 2 * (compOutDataItr->getStrip() - 1) + compOutDataItr->getComparator();
1699  std::vector<int> tbins_clct = compOutDataItr->getTimeBinsOn();
1700  int tbin_clct = (int)compOutDataItr->getTimeBin();
1701 
1702  if (mo_EventDisplay) {
1703  mo_EventDisplay->SetBinContent(nLayer + 11, hstrip, tbin_clct + 1);
1704  setEmuEventDisplayBit(mo_Emu_EventDisplay_Anode, glChamberIndex, 160 + hstrip, nLayer - 1);
1705  setEmuEventDisplayBit(mo_Emu_EventDisplay_XY, glChamberIndex, 160 + hstrip, nLayer - 1);
1706  }
1707 
1708  if (CheckLayerCLCT) {
1709  NumberOfLayersWithHitsInCLCT = NumberOfLayersWithHitsInCLCT + 1;
1710  CheckLayerCLCT = false;
1711  }
1712 
1713  for (uint32_t n = 0; n < tbins_clct.size(); n++) {
1714  tbin_clct = tbins_clct[n];
1715  if (hstrip != hstrip_previous ||
1716  (tbin_clct != tbin_clct_previous + 1 && tbin_clct != tbin_clct_previous - 1)) {
1717  if (getCSCHisto(h::CSC_CLCTTIME_LYXX, crateID, dmbID, nLayer, mo))
1718  mo->Fill(hstrip, tbin_clct);
1719 
1720  if (mo_CFEB_Comparators_TimeSamples)
1721  mo_CFEB_Comparators_TimeSamples->Fill(tbin_clct);
1722 
1723  if (cid.endcap() == 1) {
1724  if (mo_CSC_Plus_endcap_CFEB_Comparators_Time)
1725  mo_CSC_Plus_endcap_CFEB_Comparators_Time->Fill(tbin_clct);
1726  }
1727 
1728  if (cid.endcap() == 2) {
1729  if (mo_CSC_Minus_endcap_CFEB_Comparators_Time)
1730  mo_CSC_Minus_endcap_CFEB_Comparators_Time->Fill(tbin_clct);
1731  }
1732 
1733  if (getCSCHisto(h::CSC_CLCTTIME_LYXX_PROFILE, crateID, dmbID, nLayer, mo))
1734  mo->Fill(hstrip, tbin_clct);
1735 
1736  if (getCSCHisto(h::CSC_CLCT_LYXX_RATE, crateID, dmbID, nLayer, mo)) {
1737  mo->Fill(hstrip);
1738 
1739  double number_hstrip = mo->GetBinContent(hstrip + 1);
1740  double Number_of_entries_CLCT = mo->GetEntries();
1741 
1742  if (getCSCHisto(h::CSC_CLCT_LYXX_EFFICIENCY, crateID, dmbID, nLayer, mo)) {
1743  mo->SetBinContent(hstrip + 1, number_hstrip);
1744  if (DMBEvents > 0) {
1745  double norm = (100.0 * Number_of_entries_CLCT) / ((double)(DMBEvents));
1747  mo->SetNormFactor(norm);
1748  } else {
1749  mo->SetNormFactor(100.0);
1750  }
1751  mo->SetEntries(DMBEvents);
1752  }
1753  }
1754  }
1755 
1756  if (hstrip != hstrip_previous) {
1757  NumberOfHalfStripsWithHitsInCLCT = NumberOfHalfStripsWithHitsInCLCT + 1;
1758  }
1759  hstrip_previous = hstrip;
1760  tbin_clct_previous = tbin_clct;
1761  }
1762  }
1763  }
1764  }
1765 
1766  if (mo_CFEB_Comparators_TimeSamples) {
1767  double comps_time_mean = mo_CFEB_Comparators_TimeSamples->getTH1()->GetMean();
1768  double comps_time_rms = mo_CFEB_Comparators_TimeSamples->getTH1()->GetRMS();
1769 
1770  if (cscPosition && mo_CSC_CFEB_Comparators_Time_mean) {
1771  mo_CSC_CFEB_Comparators_Time_mean->SetBinContent(cscPosition, cscType + 1, comps_time_mean);
1772  }
1773  if (cscPosition && mo_CSC_CFEB_Comparators_Time_rms) {
1774  mo_CSC_CFEB_Comparators_Time_rms->SetBinContent(cscPosition, cscType + 1, comps_time_rms);
1775  }
1776  }
1777 
1778  } else {
1779  LOG_ERROR << cscTag << " Can not unpack CLCT Data";
1780  }
1781 
1782  if (getCSCHisto(h::CSC_CLCT_NUMBER_OF_LAYERS_WITH_HITS, crateID, dmbID, mo)) {
1783  mo->Fill(NumberOfLayersWithHitsInCLCT);
1784  MonitorObject* mo1 = nullptr;
1785  if (cscPosition && getEMUHisto(h::EMU_CSC_CLCT_PLANES_WITH_HITS, mo1)) {
1786  mo1->SetBinContent(cscPosition, cscType + 1, mo->getTH1()->GetMean());
1787  }
1788  }
1789 
1791  mo->Fill(NumberOfHalfStripsWithHitsInCLCT);
1792  } else {
1793  LOG_ERROR << cscTag << " Can not unpack TMB Header or/and Trailer";
1794  }
1795  } else {
1796  LOG_ERROR << cscTag << " Can not unpack TMB Data";
1797  }
1798 
1799  } else {
1802  if (getCSCHisto(h::CSC_CLCT_NUMBER_RATE, crateID, dmbID, mo)) {
1803  mo->Fill(0);
1804  int nCLCT = (int)mo->GetBinContent(1);
1805  if (getCSCHisto(h::CSC_CLCT_NUMBER, crateID, dmbID, mo))
1806  mo->SetBinContent(1, (float)(nCLCT) / (float)(DMBEvents)*100.0);
1807  }
1808  if ((tmb_dav > 0) && (getCSCHisto(h::CSC_DMB_FEB_UNPACKED_VS_DAV, crateID, dmbID, mo))) {
1809  mo->Fill(1.0, 1.0);
1810  }
1811  }
1812 
1814  int NumberOfUnpackedCFEBs = 0;
1815  const int N_CFEBs = nCFEBs, N_Samples = 16, N_Layers = 6, N_Strips = 16, nStrips = nCFEBs * N_Strips;
1816  int ADC = 0, OutOffRange, Threshold = 30;
1818  int Pedestal[N_CFEBs][6][16];
1819  memset(Pedestal, 0, sizeof(Pedestal));
1820 #ifdef __clang__
1821  std::vector<std::array<std::array<std::pair<int, int>, 6>, 16>> CellPeak(N_CFEBs);
1822  std::fill(CellPeak.begin(), CellPeak.end(), std::array<std::array<std::pair<int, int>, 6>, 16>{});
1823 #else
1824  std::pair<int, int> CellPeak[N_CFEBs][6][16];
1825  memset(CellPeak, 0, sizeof(CellPeak));
1826 #endif
1827  bool CheckCFEB = true;
1829  float Clus_Sum_Charge;
1830  int TrigTime, L1APhase, UnpackedTrigTime, LCTPhase, SCA_BLK, NmbTimeSamples;
1831  int FreeCells, LCT_Pipe_Empty, LCT_Pipe_Full, LCT_Pipe_Count, L1_Pipe_Empty, L1_Pipe_Full, Buffer_Count;
1834  bool CheckThresholdStripInTheLayer[6][nStrips];
1835  for (int i = 0; i < 6; i++) {
1836  for (int j = 0; j < nStrips; j++)
1837  CheckThresholdStripInTheLayer[i][j] = true;
1838  }
1839 
1840  bool CheckOutOffRangeStripInTheLayer[6][nStrips];
1841  for (int i = 0; i < 6; i++) {
1842  for (int j = 0; j < nStrips; j++)
1843  CheckOutOffRangeStripInTheLayer[i][j] = true;
1844  }
1845 
1847  float cscdata[N_CFEBs * 16][N_Samples][N_Layers];
1848  int SCABlockData[N_CFEBs * 16][N_Samples][N_Layers];
1849  memset(cscdata, 0, sizeof(cscdata));
1850  memset(SCABlockData, 0, sizeof(SCABlockData));
1853  char hbuf[255];
1854  memset(hbuf, 0, sizeof(hbuf));
1855 
1856  MonitorObject* mo_CFEB_SCA_CellPeak_Time = nullptr;
1857  getCSCHisto(h::CSC_CFEB_SCA_CELLPEAK_TIME, crateID, dmbID, mo_CFEB_SCA_CellPeak_Time);
1858 
1859  MonitorObject* mo_CSC_Plus_endcap_CFEB_SCA_CellPeak_Time = nullptr;
1860  getEMUHisto(h::EMU_CSC_PLUS_ENDCAP_CFEB_SCA_CELLPEAK_TIME, mo_CSC_Plus_endcap_CFEB_SCA_CellPeak_Time);
1861 
1862  MonitorObject* mo_CSC_Minus_endcap_CFEB_SCA_CellPeak_Time = nullptr;
1863  getEMUHisto(h::EMU_CSC_MINUS_ENDCAP_CFEB_SCA_CELLPEAK_TIME, mo_CSC_Minus_endcap_CFEB_SCA_CellPeak_Time);
1864 
1865  MonitorObject* mo_CSC_CFEB_SCA_CellPeak_Time_mean = nullptr;
1866  getEMUHisto(h::EMU_CSC_CFEB_SCA_CELLPEAK_TIME_MEAN, mo_CSC_CFEB_SCA_CellPeak_Time_mean);
1867 
1868  MonitorObject* mo_CSC_CFEB_SCA_CellPeak_Time_rms = nullptr;
1869  getEMUHisto(h::EMU_CSC_CFEB_SCA_CELLPEAK_TIME_RMS, mo_CSC_CFEB_SCA_CellPeak_Time_rms);
1870 
1871  for (int nCFEB = 0; nCFEB < N_CFEBs; ++nCFEB) {
1872  // cfebData[nCFEB] = data.cfebData(nCFEB);
1873  if (data.cfebData(nCFEB) != nullptr) {
1874  if (!data.cfebData(nCFEB)->check())
1875  continue;
1876 
1878  FEBunpacked = FEBunpacked + 1; // Increment number of unpacked FED
1879  NumberOfUnpackedCFEBs = NumberOfUnpackedCFEBs + 1; // Increment number of unpaked CFEB
1880  cfeb_unpacked = 1;
1881  if (CheckCFEB == true) {
1882  if (getCSCHisto(h::CSC_CSC_RATE, crateID, dmbID, mo)) {
1883  mo->Fill(4);
1884  uint32_t CFEBEvent = (uint32_t)mo->GetBinContent(5);
1885  config->setChamberCounterValue(CFEB_TRIGGERS, crateID, dmbID, CFEBEvent);
1886  if (getCSCHisto(h::CSC_CSC_EFFICIENCY, crateID, dmbID, mo)) {
1887  if (config->getNEvents() > 0) {
1888  mo->SetBinContent(3, ((float)CFEBEvent / (float)(DMBEvents)*100.0));
1889  mo->SetEntries((int)DMBEvents);
1890  }
1891  }
1892  }
1893 
1894  if ((cfeb_dav2 > 0) && (getCSCHisto(h::CSC_DMB_FEB_UNPACKED_VS_DAV, crateID, dmbID, mo))) {
1895  mo->Fill(2.0, 0.0);
1896  }
1897  CheckCFEB = false;
1898  }
1900  NmbTimeSamples = (data.cfebData(nCFEB))->nTimeSamples();
1904  MonitorObject* mo_CFEB_SCA_Block_Occupancy = nullptr;
1905  getCSCHisto(h::CSC_CFEBXX_SCA_BLOCK_OCCUPANCY, crateID, dmbID, nCFEB + 1, mo_CFEB_SCA_Block_Occupancy);
1906  MonitorObject* mo_CFEB_Free_SCA_Cells = nullptr;
1907  getCSCHisto(h::CSC_CFEBXX_FREE_SCA_CELLS, crateID, dmbID, nCFEB + 1, mo_CFEB_Free_SCA_Cells);
1908  MonitorObject* mo_CFEB_SCA_Blocks_Locked_by_LCTs = nullptr;
1909  getCSCHisto(
1910  h::CSC_CFEBXX_SCA_BLOCKS_LOCKED_BY_LCTS, crateID, dmbID, nCFEB + 1, mo_CFEB_SCA_Blocks_Locked_by_LCTs);
1911  MonitorObject* mo_CFEB_SCA_Blocks_Locked_by_LCTxL1 = nullptr;
1912  getCSCHisto(
1913  h::CSC_CFEBXX_SCA_BLOCKS_LOCKED_BY_LCTXL1, crateID, dmbID, nCFEB + 1, mo_CFEB_SCA_Blocks_Locked_by_LCTxL1);
1914  MonitorObject* mo_CFEB_DMB_L1A_diff = nullptr;
1915  getCSCHisto(h::CSC_CFEBXX_DMB_L1A_DIFF, crateID, dmbID, nCFEB + 1, mo_CFEB_DMB_L1A_diff);
1916 
1917  for (int nLayer = 1; nLayer <= N_Layers; ++nLayer) {
1919  MonitorObject* mo_CFEB_Out_Off_Range_Strips = nullptr;
1920  getCSCHisto(h::CSC_CFEB_OUT_OFF_RANGE_STRIPS_LYXX, crateID, dmbID, nLayer, mo_CFEB_Out_Off_Range_Strips);
1921  MonitorObject* mo_CFEB_Active_Samples_vs_Strip = nullptr;
1922  getCSCHisto(
1923  h::CSC_CFEB_ACTIVE_SAMPLES_VS_STRIP_LYXX, crateID, dmbID, nLayer, mo_CFEB_Active_Samples_vs_Strip);
1924  MonitorObject* mo_CFEB_Active_Samples_vs_Strip_Profile = nullptr;
1926  crateID,
1927  dmbID,
1928  nLayer,
1929  mo_CFEB_Active_Samples_vs_Strip_Profile);
1930  MonitorObject* mo_CFEB_ActiveStrips = nullptr;
1931  getCSCHisto(h::CSC_CFEB_ACTIVESTRIPS_LYXX, crateID, dmbID, nLayer, mo_CFEB_ActiveStrips);
1932  MonitorObject* mo_CFEB_SCA_Cell_Peak = nullptr;
1933  getCSCHisto(h::CSC_CFEB_SCA_CELL_PEAK_LY_XX, crateID, dmbID, nLayer, mo_CFEB_SCA_Cell_Peak);
1934 
1935  MonitorObject* mo_CFEB_Pedestal_withEMV_Sample = nullptr;
1936  getCSCHisto(
1937  h::CSC_CFEB_PEDESTAL_WITHEMV_SAMPLE_01_LYXX, crateID, dmbID, nLayer, mo_CFEB_Pedestal_withEMV_Sample);
1938  MonitorObject* mo_CFEB_Pedestal_withRMS_Sample = nullptr;
1939  getCSCHisto(
1940  h::CSC_CFEB_PEDESTAL_WITHRMS_SAMPLE_01_LYXX, crateID, dmbID, nLayer, mo_CFEB_Pedestal_withRMS_Sample);
1941  MonitorObject* mo_CFEB_PedestalRMS_Sample = nullptr;
1942  getCSCHisto(h::CSC_CFEB_PEDESTALRMS_SAMPLE_01_LYXX, crateID, dmbID, nLayer, mo_CFEB_PedestalRMS_Sample);
1943 
1944  for (int nSample = 0; nSample < NmbTimeSamples; ++nSample) {
1945  if (timeSlice(data, nCFEB, nSample) == nullptr) {
1946  LOG_WARN << "CFEB" << nCFEB << " nSample: " << nSample << " - B-Word";
1947  continue;
1948  }
1949 
1950  if (mo_CFEB_DMB_L1A_diff && !fCloseL1As) {
1951  int cfeb_dmb_l1a_diff =
1952  (int)((timeSlice(data, nCFEB, nSample)->get_L1A_number()) - dmbHeader->l1a24() % 64);
1953  if (cfeb_dmb_l1a_diff != 0) {
1954  L1A_out_of_sync = true;
1955  }
1956  if (cfeb_dmb_l1a_diff < -32)
1957  mo->Fill(cfeb_dmb_l1a_diff + 64);
1958  else {
1959  if (cfeb_dmb_l1a_diff >= 32)
1960  mo->Fill(cfeb_dmb_l1a_diff - 64);
1961  else
1962  mo_CFEB_DMB_L1A_diff->Fill(cfeb_dmb_l1a_diff);
1963  }
1964  mo_CFEB_DMB_L1A_diff->SetAxisRange(
1965  0.1, 1.1 * (1.0 + mo_CFEB_DMB_L1A_diff->GetBinContent(mo_CFEB_DMB_L1A_diff->GetMaximumBin())), "Y");
1966  }
1967 
1969  FreeCells = timeSlice(data, nCFEB, nSample)->get_n_free_sca_blocks();
1970  LCT_Pipe_Empty = timeSlice(data, nCFEB, nSample)->get_lctpipe_empty();
1971  LCT_Pipe_Full = timeSlice(data, nCFEB, nSample)->get_lctpipe_full();
1972  LCT_Pipe_Count = timeSlice(data, nCFEB, nSample)->get_lctpipe_count();
1973  L1_Pipe_Empty = timeSlice(data, nCFEB, nSample)->get_l1pipe_empty();
1974  L1_Pipe_Full = timeSlice(data, nCFEB, nSample)->get_l1pipe_full();
1975  Buffer_Count = timeSlice(data, nCFEB, nSample)->get_buffer_count();
1976 
1977  SCA_BLK = (int)(timeSlice(data, nCFEB, nSample)->scaControllerWord(nLayer).sca_blk);
1978 
1979  for (int nStrip = 0; nStrip < N_Strips; ++nStrip) {
1980  SCABlockData[nCFEB * 16 + nStrip][nSample][nLayer - 1] = SCA_BLK;
1981  }
1982 
1984  if (mo_CFEB_SCA_Block_Occupancy)
1985  mo_CFEB_SCA_Block_Occupancy->Fill(SCA_BLK);
1986 
1988  if (mo_CFEB_Free_SCA_Cells) {
1989  if (timeSlice(data, nCFEB, nSample)->scaControllerWord(nLayer).sca_full == 1)
1990  mo_CFEB_Free_SCA_Cells->Fill(-1);
1991  mo_CFEB_Free_SCA_Cells->Fill(FreeCells);
1992  }
1993 
1995  if (mo_CFEB_SCA_Blocks_Locked_by_LCTs) {
1996  if (LCT_Pipe_Empty == 1)
1997  mo_CFEB_SCA_Blocks_Locked_by_LCTs->Fill(-0.5);
1998  if (LCT_Pipe_Full == 1)
1999  mo_CFEB_SCA_Blocks_Locked_by_LCTs->Fill(16.5);
2000  mo_CFEB_SCA_Blocks_Locked_by_LCTs->Fill(LCT_Pipe_Count);
2001  }
2002 
2004  if (mo_CFEB_SCA_Blocks_Locked_by_LCTxL1) {
2005  if (L1_Pipe_Empty == 1)
2006  mo_CFEB_SCA_Blocks_Locked_by_LCTxL1->Fill(-0.5);
2007  if (L1_Pipe_Full == 1)
2008  mo_CFEB_SCA_Blocks_Locked_by_LCTxL1->Fill(31.5);
2009  mo_CFEB_SCA_Blocks_Locked_by_LCTxL1->Fill(Buffer_Count);
2010  }
2011 
2013  if (nSample == 0 && nLayer == 1) {
2014  TrigTime = (int)(timeSlice(data, nCFEB, nSample)->scaControllerWord(nLayer).trig_time);
2015  int k = 1;
2016  while (((TrigTime >> (k - 1)) & 0x1) != 1 && k <= 8) {
2017  k = k + 1;
2018  }
2019  L1APhase = (int)((timeSlice(data, nCFEB, nSample)->scaControllerWord(nLayer).l1a_phase) & 0x1);
2020  UnpackedTrigTime = ((k << 1) & 0xE) + L1APhase;
2021 
2022  if (getCSCHisto(h::CSC_CFEBXX_L1A_SYNC_TIME, crateID, dmbID, nCFEB + 1, mo))
2023  mo->Fill((int)UnpackedTrigTime);
2024  LCTPhase = (int)((timeSlice(data, nCFEB, nSample)->scaControllerWord(nLayer).lct_phase) & 0x1);
2025 
2026  if (getCSCHisto(h::CSC_CFEBXX_LCT_PHASE_VS_L1A_PHASE, crateID, dmbID, nCFEB + 1, mo))
2027  mo->Fill(LCTPhase, L1APhase);
2028 
2029  if (getCSCHisto(h::CSC_CFEBXX_L1A_SYNC_TIME_VS_DMB, crateID, dmbID, nCFEB + 1, mo))
2030  mo->Fill((int)(dmbHeader->dmbCfebSync()), (int)UnpackedTrigTime);
2031 
2032  if (getCSCHisto(h::CSC_CFEBXX_L1A_SYNC_TIME_DMB_DIFF, crateID, dmbID, nCFEB + 1, mo)) {
2033  int cfeb_dmb_L1A_sync_time = (int)(dmbHeader->dmbCfebSync()) - (int)UnpackedTrigTime;
2034  if (cfeb_dmb_L1A_sync_time < -8)
2035  mo->Fill(cfeb_dmb_L1A_sync_time + 16);
2036  else {
2037  if (cfeb_dmb_L1A_sync_time >= 8)
2038  mo->Fill(cfeb_dmb_L1A_sync_time - 16);
2039  else
2040  mo->Fill(cfeb_dmb_L1A_sync_time);
2041  }
2042  mo->SetAxisRange(0.1, 1.1 * (1.0 + mo->GetBinContent(mo->GetMaximumBin())), "Y");
2043  }
2044  }
2045 
2046  for (int nStrip = 1; nStrip <= N_Strips; ++nStrip) {
2047  ADC = (int)((timeSample(data, nCFEB, nSample, nLayer, nStrip)->adcCounts) & 0xFFF);
2048  OutOffRange = (int)((timeSample(data, nCFEB, nSample, nLayer, nStrip)->adcOverflow) & 0x1);
2049 
2050  if (nSample == 0) { // nSample == 0
2051  CellPeak[nCFEB][nLayer - 1][nStrip - 1] = std::make_pair(nSample, ADC);
2052  Pedestal[nCFEB][nLayer - 1][nStrip - 1] = ADC;
2053  }
2054 
2055  if (OutOffRange == 1 && CheckOutOffRangeStripInTheLayer[nLayer - 1][nCFEB * 16 + nStrip - 1] == true) {
2056  if (mo_CFEB_Out_Off_Range_Strips)
2057  mo_CFEB_Out_Off_Range_Strips->Fill((int)(nCFEB * 16 + nStrip - 1));
2058  CheckOutOffRangeStripInTheLayer[nLayer - 1][nCFEB * 16 + nStrip - 1] = false;
2059  }
2060  if (ADC - Pedestal[nCFEB][nLayer - 1][nStrip - 1] > Threshold && OutOffRange != 1) {
2061  if (mo_CFEB_Active_Samples_vs_Strip)
2062  mo_CFEB_Active_Samples_vs_Strip->Fill((int)(nCFEB * 16 + nStrip - 1), nSample);
2063 
2064  if (mo_CFEB_Active_Samples_vs_Strip_Profile)
2065  mo_CFEB_Active_Samples_vs_Strip_Profile->Fill((int)(nCFEB * 16 + nStrip - 1), nSample);
2066 
2067  if (CheckThresholdStripInTheLayer[nLayer - 1][nCFEB * 16 + nStrip - 1] == true) {
2068  if (mo_CFEB_ActiveStrips)
2069  mo_CFEB_ActiveStrips->Fill((int)(nCFEB * 16 + nStrip));
2070  CheckThresholdStripInTheLayer[nLayer - 1][nCFEB * 16 + nStrip - 1] = false;
2071  }
2073  if (ADC - Pedestal[nCFEB][nLayer - 1][nStrip - 1] > Threshold) {
2074  cscdata[nCFEB * 16 + nStrip - 1][nSample][nLayer - 1] = ADC - Pedestal[nCFEB][nLayer - 1][nStrip - 1];
2075  }
2077  if (ADC > CellPeak[nCFEB][nLayer - 1][nStrip - 1].second) {
2078  CellPeak[nCFEB][nLayer - 1][nStrip - 1].first = nSample;
2079  CellPeak[nCFEB][nLayer - 1][nStrip - 1].second = ADC;
2080  }
2081  }
2084  if (nSample == 1) {
2085  int channel_threshold = 40;
2086  if (std::abs(ADC - Pedestal[nCFEB][nLayer - 1][nStrip - 1]) < channel_threshold) {
2087  if (mo_CFEB_Pedestal_withEMV_Sample)
2088  mo_CFEB_Pedestal_withEMV_Sample->Fill((int)(nCFEB * 16 + nStrip - 1),
2089  Pedestal[nCFEB][nLayer - 1][nStrip - 1]);
2090 
2091  if (mo_CFEB_Pedestal_withRMS_Sample) {
2092  mo_CFEB_Pedestal_withRMS_Sample->Fill((int)(nCFEB * 16 + nStrip - 1),
2093  Pedestal[nCFEB][nLayer - 1][nStrip - 1]);
2094 
2095  if (mo_CFEB_PedestalRMS_Sample) {
2096  mo_CFEB_PedestalRMS_Sample->SetBinContent(
2097  nCFEB * 16 + nStrip - 1, mo_CFEB_Pedestal_withRMS_Sample->GetBinError(nCFEB * 16 + nStrip));
2098  mo_CFEB_PedestalRMS_Sample->SetBinError(nCFEB * 16 + nStrip - 1, 0.00000000001);
2099  }
2100  }
2101  }
2102  Pedestal[nCFEB][nLayer - 1][nStrip - 1] += ADC;
2103  Pedestal[nCFEB][nLayer - 1][nStrip - 1] /= 2;
2104  }
2106  }
2107  }
2108 
2109  for (int nStrip = 1; nStrip <= N_Strips; ++nStrip) {
2110  if (mo_CFEB_SCA_Cell_Peak && CellPeak[nCFEB][nLayer - 1][nStrip - 1].first) {
2111  mo_CFEB_SCA_Cell_Peak->Fill((int)(nCFEB * 16 + nStrip - 1),
2112  CellPeak[nCFEB][nLayer - 1][nStrip - 1].first);
2113  if (mo_CFEB_SCA_CellPeak_Time) {
2114  mo_CFEB_SCA_CellPeak_Time->Fill(CellPeak[nCFEB][nLayer - 1][nStrip - 1].first);
2115  }
2116 
2117  if (mo_EventDisplay) {
2118  int peak_sample = CellPeak[nCFEB][nLayer - 1][nStrip - 1].first;
2119  int peak_adc = CellPeak[nCFEB][nLayer - 1][nStrip - 1].second;
2120  int pedestal = Pedestal[nCFEB][nLayer - 1][nStrip - 1];
2121  int peak_sca_charge = peak_adc - pedestal;
2122 
2123  if (peak_adc - pedestal > Threshold) {
2124  if (peak_sample >= 1) {
2125  peak_sca_charge +=
2126  ((timeSample(data, nCFEB, peak_sample - 1, nLayer, nStrip)->adcCounts) & 0xFFF) - pedestal;
2127  }
2128  if (peak_sample < NmbTimeSamples - 1) {
2129  peak_sca_charge +=
2130  ((timeSample(data, nCFEB, peak_sample + 1, nLayer, nStrip)->adcCounts) & 0xFFF) - pedestal;
2131  }
2132  mo_EventDisplay->SetBinContent(nLayer + 17, nCFEB * 16 + nStrip - 1, peak_sca_charge);
2134  mo_Emu_EventDisplay_Cathode, glChamberIndex, nCFEB * 16 + nStrip - 1, nLayer - 1);
2135  }
2136  }
2137 
2138  if (cid.endcap() == 1) {
2139  if (mo_CSC_Plus_endcap_CFEB_SCA_CellPeak_Time)
2140  mo_CSC_Plus_endcap_CFEB_SCA_CellPeak_Time->Fill(CellPeak[nCFEB][nLayer - 1][nStrip - 1].first);
2141  }
2142  if (cid.endcap() == 2) {
2143  if (mo_CSC_Minus_endcap_CFEB_SCA_CellPeak_Time)
2144  mo_CSC_Minus_endcap_CFEB_SCA_CellPeak_Time->Fill(CellPeak[nCFEB][nLayer - 1][nStrip - 1].first);
2145  }
2146  }
2147  }
2148  }
2149  }
2150  }
2151 
2152  // Fill Summary CFEB Raw Hits Timing Plots
2153  if (mo_CFEB_SCA_CellPeak_Time) {
2154  double cellpeak_time_mean = mo_CFEB_SCA_CellPeak_Time->getTH1()->GetMean();
2155  double cellpeak_time_rms = mo_CFEB_SCA_CellPeak_Time->getTH1()->GetRMS();
2156  if (cscPosition && mo_CSC_CFEB_SCA_CellPeak_Time_mean) {
2157  mo_CSC_CFEB_SCA_CellPeak_Time_mean->SetBinContent(cscPosition, cscType + 1, cellpeak_time_mean);
2158  }
2159  if (cscPosition && mo_CSC_CFEB_SCA_CellPeak_Time_rms) {
2160  mo_CSC_CFEB_SCA_CellPeak_Time_rms->SetBinContent(cscPosition, cscType + 1, cellpeak_time_rms);
2161  }
2162  }
2163 
2166  const int a = N_CFEBs * N_Strips;
2167  const int b = a * N_Samples;
2168  float Cathodes[b * N_Layers];
2169  for (int i = 0; i < N_Layers; ++i) {
2170  const int b1 = i * b;
2171  for (int j = 0; j < a; ++j) {
2172  const int b2 = b1 + j;
2173  for (int k = 0; k < N_Samples; ++k) {
2174  Cathodes[b2 + a * k] = cscdata[j][k][i];
2175  }
2176  }
2177  }
2178 
2179  std::vector<StripCluster> Clus;
2180  Clus.clear();
2181  StripClusterFinder ClusterFinder(N_Layers, N_Samples, N_CFEBs, N_Strips);
2182 
2183  for (int nLayer = 1; nLayer <= N_Layers; ++nLayer) {
2184  ClusterFinder.DoAction(nLayer - 1, Cathodes);
2185  Clus = ClusterFinder.getClusters();
2186 
2188  if (getCSCHisto(h::CSC_CFEB_NUMBER_OF_CLUSTERS_LY_XX, crateID, dmbID, nLayer, mo)) {
2189  mo->Fill(Clus.size());
2190  }
2191 
2192  for (uint32_t u = 0; u < Clus.size(); u++) {
2193  Clus_Sum_Charge = 0.0;
2194  for (uint32_t k = 0; k < Clus[u].ClusterPulseMapHeight.size(); k++) {
2195  for (int n = Clus[u].LFTBNDTime; n < Clus[u].IRTBNDTime; n++) {
2196  Clus_Sum_Charge = Clus_Sum_Charge + Clus[u].ClusterPulseMapHeight[k].height_[n];
2197  }
2198  }
2199 
2201  if (getCSCHisto(h::CSC_CFEB_CLUSTERS_CHARGE_LY_XX, crateID, dmbID, nLayer, mo)) {
2202  mo->Fill(Clus_Sum_Charge);
2203  }
2204 
2206  if (getCSCHisto(h::CSC_CFEB_WIDTH_OF_CLUSTERS_LY_XX, crateID, dmbID, nLayer, mo)) {
2207  mo->Fill(Clus[u].IRTBNDStrip - Clus[u].LFTBNDStrip + 1);
2208  }
2209 
2211  if (getCSCHisto(h::CSC_CFEB_CLUSTER_DURATION_LY_XX, crateID, dmbID, nLayer, mo)) {
2212  mo->Fill(Clus[u].IRTBNDTime - Clus[u].LFTBNDTime + 1);
2213  }
2214  }
2215 
2216  Clus.clear();
2217 
2219  }
2220 
2224  if (getCSCHisto(h::CSC_DMB_FEB_COMBINATIONS_UNPACKED_VS_DAV, crateID, dmbID, mo)) {
2225  float feb_combination_unpacked = -1.0;
2226  if (alct_unpacked == 0 && tmb_unpacked == 0 && cfeb_unpacked == 0)
2227  feb_combination_unpacked = 0.0;
2228  if (alct_unpacked > 0 && tmb_unpacked == 0 && cfeb_unpacked == 0)
2229  feb_combination_unpacked = 1.0;
2230  if (alct_unpacked == 0 && tmb_unpacked > 0 && cfeb_unpacked == 0)
2231  feb_combination_unpacked = 2.0;
2232  if (alct_unpacked == 0 && tmb_unpacked == 0 && cfeb_unpacked > 0)
2233  feb_combination_unpacked = 3.0;
2234  if (alct_unpacked > 0 && tmb_unpacked > 0 && cfeb_unpacked == 0)
2235  feb_combination_unpacked = 4.0;
2236  if (alct_unpacked > 0 && tmb_unpacked == 0 && cfeb_unpacked > 0)
2237  feb_combination_unpacked = 5.0;
2238  if (alct_unpacked == 0 && tmb_unpacked > 0 && cfeb_unpacked > 0)
2239  feb_combination_unpacked = 6.0;
2240  if (alct_unpacked > 0 && tmb_unpacked > 0 && cfeb_unpacked > 0)
2241  feb_combination_unpacked = 7.0;
2242  mo->Fill(feb_combination_dav, feb_combination_unpacked);
2243  }
2244 
2245  if ((clct_kewdistrip > -1 && alct_keywg > -1) &&
2247  mo->Fill(alct_keywg, clct_kewdistrip);
2248  }
2249 
2250  if (L1A_out_of_sync && cscPosition && getEMUHisto(h::EMU_CSC_L1A_OUT_OF_SYNC, mo)) {
2251  mo->Fill(cscPosition, cscType);
2252  }
2253 
2254  if (L1A_out_of_sync && getEMUHisto(h::EMU_DMB_L1A_OUT_OF_SYNC, mo)) {
2255  mo->Fill(crateID, dmbID);
2256  }
2257  }
uint16_t BXNCount() const
Definition: CSCTMBHeader.h:43
std::vector< CSCShowerDigi > alctShowerDigis() const
CSCComparatorData * comparatorData() const
user must check if nclct &gt; 0
unsigned tmb_half() const
Definition: CSCDMBTrailer.h:47
uint16_t gem_timing_dataword() const
Definition: CSCTMBHeader.h:90
CSCTMBTrailer * tmbTrailer()
Definition: CSCTMBData.h:51
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.
int wordCount() const
uint16_t hmt_ALCTMatchTime() const
Definition: CSCTMBHeader.h:82
uint16_t gem_enabled_fibers() const
Definition: CSCTMBHeader.h:85
int nclct() const
the number of CLCTs
Definition: CSCEventData.h:70
CSCGEMData * gemData()
Definition: CSCTMBData.cc:409
int FirmwareRevision() const
Definition: CSCTMBHeader.h:41
uint16_t clct1_xky() const
Definition: CSCTMBHeader.h:80
unsigned cfeb_empty() const
Definition: CSCDMBTrailer.h:44
unsigned l1a24() const
Definition: CSCDMBHeader.h:40
const unsigned long getNEvents() const
unsigned nclct() const
Definition: CSCDMBHeader.h:43
unsigned alct_full() const
Definition: CSCDMBTrailer.h:50
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
#define LOG_INFO
Definition: CSCDQM_Logger.h:42
bool isChamberStandby(unsigned int side, unsigned int station, unsigned int ring, unsigned int chamber) const
Check if chamber is in standby?
uint16_t run3_CLCT_patternID() const
Definition: CSCTMBHeader.h:91
unsigned short adcOverflow
unsigned tmb_empty() const
Definition: CSCDMBTrailer.h:43
unsigned cfebActive() const
Definition: CSCDMBHeader.h:34
unsigned cfeb_endtimeout() const
Definition: CSCDMBTrailer.h:33
const CSCDMBTrailer * dmbTrailer() const
DMB trailer.
Definition: CSCEventData.h:95
uint16_t CLCTOnly() const
Definition: CSCTMBHeader.h:45
uint16_t L1ANumber() const
Definition: CSCTMBHeader.h:52
std::function< bool(const unsigned int, const unsigned int, CSCDetId &)> fnGetCSCDetId
unsigned get_l1pipe_full() const
std::vector< CSCCorrelatedLCTDigi > CorrelatedLCTDigis(uint32_t idlayer) const
returns CorrelatedLCT digis
Definition: CSCTMBHeader.h:103
uint16_t Bxn1Diff() const
Definition: CSCTMBHeader.h:50
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
ExaminerStatusType errorsForChamber(CSCIdType chamber) const
unsigned nalct() const
Definition: CSCDMBHeader.h:42
uint16_t alctHMT() const
Definition: CSCTMBHeader.h:83
unsigned cfebMovlp() const
Definition: CSCDMBHeader.h:44
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...
uint16_t clctHMT() const
Definition: CSCTMBHeader.h:84
CSCAnodeData * alctData() const
user must check if nalct &gt; 0
std::vector< GEMPadDigiCluster > etaDigis(int gem_chamber, int eta) const
Definition: CSCGEMData.cc:146
tuple nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
CSCALCTHeader * alctHeader() const
user must check if nalct &gt; 0
bool check() const
makes sure each time slice has a trailer
Definition: CSCCFEBData.cc:298
CSCCFEBSCAControllerWord scaControllerWord(int layer) const
unpacked from the controller words for each channel in the layer
int nalct() const
the flag for existence of ALCT data
Definition: CSCEventData.h:67
uint16_t clct0_ComparatorCode() const
== Run 3 CSC-GEM Trigger Format
Definition: CSCTMBHeader.h:77
int wordCount() const
uint16_t NCFEBs() const
Definition: CSCTMBHeader.h:67
const bool getCSCHisto(const HistoId &histo, const HwId &crateID, const HwId &dmbSlot, MonitorObject *&me)
Get CSC (Chamber) Level Monitoring Object.
unsigned get_buffer_count() const
std::vector< GEMPadDigiCluster > digis(int gem_chamber) const
Definition: CSCGEMData.cc:65
int endcap() const
Definition: CSCDetId.h:85
U second(std::pair< T, U > const &p)
uint16_t getFormatVersion() const
Definition: CSCEventData.h:126
CSCALCTTrailer * alctTrailer() const
user must check if nalct &gt; 0
unsigned cfeb_starttimeout() const
Definition: CSCDMBTrailer.h:37
unsigned get_lctpipe_empty() const
unsigned tmb_starttimeout() const
Definition: CSCDMBTrailer.h:36
CSCTMBData * tmbData() const
user must check in nclct &gt; 0
CSCDetId chamberID(const CSCDetId &cscDetId)
uint16_t ALCTOnly() const
Definition: CSCTMBHeader.h:46
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
unsigned alct_starttimeout() const
Definition: CSCDMBTrailer.h:35
uint16_t Bxn0Diff() const
Definition: CSCTMBHeader.h:49
unsigned tmb_full() const
Definition: CSCDMBTrailer.h:51
void setChamberCounterValue(const ChamberCounterType counter, const HwId crateId, const HwId dmbId, const uint32_t value)
Set Chamber counter value.
const std::string getPath() const override
Get path part of the histogram (used only for DDUs and CSCs)
const Detector getDetector() const
unsigned bxn12() const
Definition: CSCDMBHeader.h:38
unsigned alct_half() const
Definition: CSCDMBTrailer.h:46
uint16_t ALCTMatchTime() const
Definition: CSCTMBHeader.h:44
unsigned get_n_free_sca_blocks() const
bool hasGEM() const
Definition: CSCTMBData.h:55
unsigned cfeb_half() const
Definition: CSCDMBTrailer.h:48
unsigned get_l1pipe_empty() const
std::vector< CSCALCTDigi > ALCTDigis() const
int ring() const
Definition: CSCDetId.h:68
unsigned cfeb_full() const
Definition: CSCDMBTrailer.h:52
unsigned crateID() const
Definition: CSCDMBHeader.h:35
std::vector< CSCCLCTDigi > CLCTDigis(uint32_t idlayer)
returns CLCT digis
Definition: CSCTMBHeader.h:100
void fill(std::map< std::string, TH1 * > &h, const std::string &s, double x)
unsigned short int alctFirmwareVersion() const
unsigned short int L1Acc() const
Definition: CSCALCTHeader.h:98
std::vector< CSCWireDigi > wireDigis(int layer) const
input layer is from 1 to 6
Definition: CSCAnodeData.h:21
double b
Definition: hdecay.h:118
const uint32_t getChamberCounterValue(const ChamberCounterType counter, const HwId crateId, const HwId dmbId) const
Get Chamber counter value.
CSCCFEBTimeSlice const *const timeSlice(T const &data, int nCFEB, int nSample)
void copyChamberCounterValue(const ChamberCounterType counter_from, const ChamberCounterType counter_to, const HwId crateId, const HwId dmbId)
Copy Chamber counter value from one counter to another.
#define LOG_WARN
Definition: CSCDQM_Logger.h:41
unsigned dmbID() const
Definition: CSCDMBHeader.h:36
CSCTMBHeader * tmbHeader()
Definition: CSCTMBData.h:40
const CSCCFEBData * cfebData(unsigned icfeb) const
unpacked in long mode: has overflow and error bits decoded
uint16_t TMBMatch() const
Definition: CSCTMBHeader.h:47
CSCCFEBDataWord const *const timeSample(T const &data, int nCFEB, int nSample, int nLayer, int nStrip)
uint16_t hmt_nhits() const
Definition: CSCTMBHeader.h:81
double a
Definition: hdecay.h:119
int numGEMs() const
Definition: CSCGEMData.h:22
int FirmwareVersion() const
Definition: CSCTMBHeader.h:40
uint16_t gem_sync_dataword() const
Definition: CSCTMBHeader.h:89
bool fCloseL1As
Data Format version (2005, 2013)
unsigned tmb_endtimeout() const
Definition: CSCDMBTrailer.h:32
int station() const
Definition: CSCDetId.h:79
std::vector< CSCComparatorDigi > comparatorDigis(int layer)
layers count from one
unsigned int GlobalChamberIndex(unsigned int side, unsigned int station, unsigned int ring, unsigned int chamber) const
Return global chamber index on his geometric location.
uint16_t theFormatVersion
Total Number of TMBs per event from DMB DAV.
unsigned short int alctFirmwareRevision() const
uint16_t clct0_xky() const
Definition: CSCTMBHeader.h:79
unsigned short adcCounts
static constexpr float b2
unsigned alct_endtimeout() const
Definition: CSCDMBTrailer.h:31
const bool getEMUHisto(const HistoId &histo, MonitorObject *&me)
Get EMU (Top Level) Monitoring Object.
unsigned short int BXNCount() const
Definition: CSCALCTHeader.h:62
unsigned alct_empty() const
Definition: CSCDMBTrailer.h:42
const CSCDMBHeader * dmbHeader() const
the DAQ motherboard header. A good place for event and chamber info
Definition: CSCEventData.h:73
unsigned dmbCfebSync() const
Definition: CSCDMBHeader.h:45
unsigned get_lctpipe_count() const
bool cfebAvailable(unsigned icfeb)
Definition: CSCDMBHeader.h:21
#define LOG_ERROR
Definition: CSCDQM_Logger.h:40
static constexpr float b1
struct ADC ADC
unsigned dmb_l1pipe() const
Definition: CSCDMBTrailer.h:40
unsigned get_lctpipe_full() const
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(), config, 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::Configuration::getNEvents(), cscdqm::DDUHistoDef::getPath(), cscdqm::Utility::getRUIfromDDUId(), CSCDDUEventData::header(), mps_fire::i, 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  }
CSCDDUHeader header() const
const unsigned long getNEvents() const
int lvl1num() const
Definition: CSCDDUHeader.h:24
const bool getDDUHisto(const HistoId &histo, const HwId &dduID, MonitorObject *&me)
Get DDU Level Monitoring Object.
unsigned errorstat() const
Definition: CSCDDUTrailer.h:36
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.
unsigned dmb_warn() const
Definition: CSCDDUTrailer.h:41
std::map< uint32_t, uint32_t > L1ANumbers
int bxnum() const
Definition: CSCDDUHeader.h:23
int output_path_status() const
Definition: CSCDDUHeader.h:30
int dmb_dav() const
Definition: CSCDDUHeader.h:27
const std::string getPath() const override
Get path part of the histogram (used only for DDUs and CSCs)
unsigned reserved() const
Definition: CSCDDUTrailer.h:43
bool check() const
Definition: CSCDDUTrailer.h:25
const std::vector< CSCEventData > & cscData() const
accessor to data
unsigned dmb_full() const
Definition: CSCDDUTrailer.h:42
#define LOG_WARN
Definition: CSCDQM_Logger.h:41
CSCDDUTrailer trailer() const
bool fCloseL1As
Data Format version (2005, 2013)
unsigned wordcount() const
Definition: CSCDDUTrailer.h:37
int ncsc() const
Definition: CSCDDUHeader.h:26
int source_id() const
Definition: CSCDDUHeader.h:22
int live_cscs() const
Definition: CSCDDUHeader.h:29
std::map< uint32_t, bool > fNotFirstEvent
const bool getEMUHisto(const HistoId &histo, MonitorObject *&me)
Get EMU (Top Level) Monitoring Object.
int sizeInWords() const
bool cscdqm::EventProcessor::processExaminer ( const CSCDCCExaminer binChecker)
private
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, CSCDigiToRawAccept::chamberID(), cntALCTs, cntCFEBs, cntDMBs, cntTMBs, config, cscdqm::Configuration::copyChamberCounterValue(), 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::Configuration::fnGetCSCDetId, cscdqm::MonitorObject::GetBinContent(), cscdqm::Configuration::getChamberCounterValue(), CSCDCCFormatStatusDigi::getCSCErrors(), getCSCFromMap(), getCSCHisto(), CSCDCCFormatStatusDigi::getCSCPayload(), CSCDCCFormatStatusDigi::getCSCStatus(), CSCDCCFormatStatusDigi::getDDUErrors(), CSCDCCFormatStatusDigi::getDDUSummaryErrors(), getEMUHisto(), CSCDCCFormatStatusDigi::getListOfDDUs(), cscdqm::Utility::getRUIfromDDUId(), mps_fire::i, cscdqm::Configuration::incChamberCounter(), cscdqm::Configuration::incNEventsBad(), LOG_WARN, FEDNumbering::MAXCSCDDUFEDID, FEDNumbering::MINCSCDDUFEDID, CSCDCCFormatStatusDigi::nextCSCWithError(), CSCDCCFormatStatusDigi::nextCSCWithPayload(), CSCDCCFormatStatusDigi::nextCSCWithStatus(), CSCDCCExaminer::nSTATUSES, jetCorrFactors_cfi::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) {
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);
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
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.
uint32_t cntCFEBs
Total Number of DMBs per event from DDU Header DAV.
void incChamberCounter(const ChamberCounterType counter, const HwId crateId, const HwId dmbId)
Increment Chamber counter by 1.
int32_t CSCIdType
ExaminerStatusType getDDUSummaryErrors() const
std::function< bool(const unsigned int, const unsigned int, CSCDetId &)> fnGetCSCDetId
std::set< DDUIdType > getListOfDDUs() const
ExaminerStatusType getCSCStatus(const CSCIdType CSCId) const
static int getRUIfromDDUId(unsigned ddu_id)
Get RUI Number from DDU source ID for post LS1 configuration.
bool nextCSCWithStatus(uint32_t &iterator, CSCIdType &CSCId) const
CSC with status iteration procedure.
ExaminerStatusType getCSCErrors(const CSCIdType CSCId) const
ExaminerStatusType getDDUErrors(const DDUIdType DDUId) const
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.
CSCDetId chamberID(const CSCDetId &cscDetId)
ExaminerStatusType getCSCPayload(const CSCIdType CSCId) const
uint32_t ExaminerStatusType
const uint32_t getChamberCounterValue(const ChamberCounterType counter, const HwId crateId, const HwId dmbId) const
Get Chamber counter value.
void copyChamberCounterValue(const ChamberCounterType counter_from, const ChamberCounterType counter_to, const HwId crateId, const HwId dmbId)
Copy Chamber counter value from one counter to another.
#define LOG_WARN
Definition: CSCDQM_Logger.h:41
bool nextCSCWithPayload(uint32_t &iterator, CSCIdType &CSCId) const
CSC with payload iteration procedure.
const bool getEMUHisto(const HistoId &histo, MonitorObject *&me)
Get EMU (Top Level) Monitoring Object.
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.
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 cscdqm::MonitorObject::GetBinContent(), resetEmuEventDisplays(), and cscdqm::MonitorObject::SetBinContent().

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.
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::MonitorObject::getTH1Lock(), cscdqm::AddressMask::hv, cscdqm::AddressMask::layer, CommonMethods::lock(), cscdqm::Address::mask, hlt_dqm_clientPB-live_cfg::me, cscdqm::HWStandbyType::MeM, cscdqm::HWStandbyType::MeP, cscdqm::Lock::mutex, 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;
368  if (getEMUHisto(h::EMU_CSC_STANDBY, me)) {
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 SetValue(const HWStatusBit bit, const int value=1)
SetValue for the whole of detector.
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.
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, config, 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, submitPVValidationJobs::err, cscdqm::FIFOFULL_ERR, cscdqm::MonitorObject::Fill(), cscdqm::FORMAT_ERR, cscdqm::Summary::getDetector(), cscdqm::Summary::GetEfficiencyHW(), getEMUHisto(), cscdqm::Configuration::getNEvents(), getParHisto(), cscdqm::MonitorObject::getRefRootObject(), cscdqm::MonitorObject::getTH1(), cscdqm::MonitorObject::getTH1Lock(), 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, cscdqm::Lock::mutex, 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 
104  if (getEMUHisto(h::EMU_PHYSICS_ME1, me)) {
105  LockType lock(me->mutex);
106  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
107  summary.Write(tmp, 1);
108  }
109 
110  if (getEMUHisto(h::EMU_PHYSICS_ME2, me)) {
111  LockType lock(me->mutex);
112  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
113  summary.Write(tmp, 2);
114  }
115 
116  if (getEMUHisto(h::EMU_PHYSICS_ME3, me)) {
117  LockType lock(me->mutex);
118  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
119  summary.Write(tmp, 3);
120  }
121 
122  if (getEMUHisto(h::EMU_PHYSICS_ME4, me)) {
123  LockType lock(me->mutex);
124  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
125  summary.Write(tmp, 4);
126  }
127 
128  if (getEMUHisto(h::EMU_PHYSICS_EMU, me)) {
129  LockType lock(me->mutex);
130  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
131  summary.WriteMap(tmp);
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) {
195  if (getParHisto(parameters[parameter++], me))
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 
207  if (getParHisto(parameters[parameter++], me))
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 
218  if (getParHisto(parameters[parameter++], me))
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  }
string rep
Definition: cuy.py:1189
void ReadReportingChambers(const TH2 *&h2, const double threshold=1.0)
Read Reporting Chamber histogram and fill in detector map.
const unsigned long getNEvents() const
void Write(TH2 *&h2, const unsigned int station) const
Write detector map to H1 histogram (linear data) for the selected adr.station.
const unsigned int NumberOfRings(const unsigned int station) const
Returns the number of rings for the given station.
HW element is cold comparing with reference histogram.
Format errors.
const double GetEfficiencyHW() const
Get efficiency of the whole detector.
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 Detector getDetector() const
#define N_STATIONS
No CFEB data.
DMB Input timeout error.
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
DMB FIFO full error.
No CLCT data.
const unsigned int NumberOfChambers(const unsigned int station, const unsigned int ring) const
Returns the number of chambers for the given station and ring.
tmp
align.sh
Definition: createJobs.py:716
const bool getEMUHisto(const HistoId &histo, MonitorObject *&me)
Get EMU (Top Level) Monitoring Object.
No ALCT data.
void cscdqm::EventProcessor::updateFractionHistos ( )

Update Fractional MOs.

Definition at line 26 of file CSCDQM_EventProcessor_updateFracHistos.cc.

References calcEMUFractionHisto(), config, 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, cscdqm::Configuration::fnNextBookedCSC, cscdqm::Configuration::getChamberCounterValue(), 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  }
std::function< bool(unsigned int &, unsigned int &, unsigned int &)> fnNextBookedCSC
const bool getCSCHisto(const HistoId &histo, const HwId &crateID, const HwId &dmbSlot, MonitorObject *&me)
Get CSC (Chamber) Level Monitoring Object.
const uint32_t getChamberCounterValue(const ChamberCounterType counter, const HwId crateId, const HwId dmbId) const
Get Chamber counter value.
void calcEMUFractionHisto(const HistoId &result, const HistoId &set, const HistoId &subset)
Calculate fractional histogram.
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, config, 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(), cscdqm::MonitorObject::getTH1Lock(), HWSTATUSERRORBITS, CommonMethods::lock(), hlt_dqm_clientPB-live_cfg::me, cscdqm::Lock::mutex, 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);
247  summary.WriteChamberState(tmp, HWSTATUSERRORBITS, COLOR_RED, false, true);
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
string COLOR_GREEN
Definition: dqmd_manager.py:10
string COLOR_RED
Definition: dqmd_manager.py:12
string COLOR_BLUE
Definition: dqmd_manager.py:9
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

uint32_t cscdqm::EventProcessor::BXN
private

Definition at line 160 of file CSCDQM_EventProcessor.h.

Referenced by processCSC(), and processDDU().

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().

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().

uint32_t cscdqm::EventProcessor::cntDMBs
private

Definition at line 161 of file CSCDQM_EventProcessor.h.

Referenced by processExaminer().

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().

Configuration* cscdqm::EventProcessor::config
private
bool cscdqm::EventProcessor::EmuEventDisplayWasReset
private

Definition at line 170 of file CSCDQM_EventProcessor.h.

Referenced by preProcessEvent(), and resetEmuEventDisplays().

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().

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

Definition at line 158 of file CSCDQM_EventProcessor.h.

Referenced by processDDU().

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

Definition at line 173 of file CSCDQM_EventProcessor.h.

uint32_t cscdqm::EventProcessor::L1ANumber
private

Definition at line 159 of file CSCDQM_EventProcessor.h.

Referenced by processCSC(), and processDDU().

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

Definition at line 157 of file CSCDQM_EventProcessor.h.

Referenced by processDDU().

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().

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().