CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 113 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 
29  config = p_config;
30  // fFirstEvent = true;
31  fCloseL1As = true;
32 
33  }
bool fCloseL1As
Data Format version (2005, 2013)
cscdqm::EventProcessor::~EventProcessor ( )
inline

Destructor.

Definition at line 132 of file CSCDQM_EventProcessor.h.

132 { }

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 90 of file CSCDQM_EventProcessor_updateFracHistos.cc.

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

Referenced by updateFractionHistos().

90  {
91 
92  MonitorObject *mo = 0, *mo1 = 0, *mo2 = 0;
93 
94  if (getEMUHisto(result, mo) && getEMUHisto(set, mo2) && getEMUHisto(subset, mo1)) {
95  LockType lock(mo->mutex);
96  TH1* th = mo->getTH1Lock();
97  th->Reset();
98  th->Divide(mo1->getTH1(), mo2->getTH1());
99  mo->SetMaximum(1.);
100  }
101 
102  }
tuple result
Definition: mps_fire.py:84
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 159 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(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by processCSC(), and processExaminer().

159  {
160  bool result = false;
161 
162  CSCDetId cid;
163  if (config->fnGetCSCDetId(crateId, dmbId, cid)) {
164  cscPosition = cid.chamber();
165  int iring = cid.ring();
166  int istation = cid.station();
167  int iendcap = cid.endcap();
168  std::string tlabel = cscdqm::Utility::getCSCTypeLabel(iendcap, istation, iring);
169  cscType = cscdqm::Utility::getCSCTypeBin(tlabel);
170  result = true;
171  }
172 
173  /*
174  if (!result) {
175  LOG_ERROR << "Event #" << config->getNEvents() << ": Invalid CSC=" << CSCHistoDef::getPath(crateId, dmbId);
176  }
177  */
178 
179  return result;
180 
181  }
int chamber() const
Definition: CSCDetId.h:68
tuple result
Definition: mps_fire.py:84
int endcap() const
Definition: CSCDetId.h:93
boost::function< bool(const unsigned int, const unsigned int, CSCDetId &) > fnGetCSCDetId
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:75
int station() const
Definition: CSCDetId.h:86
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 114 of file CSCDQM_EventProcessor.cc.

References config, cscdqm::Configuration::fnGetCacheCSCHisto, cscdqm::Configuration::fnGetHisto, and NULL.

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

114  {
115  if (config->fnGetCacheCSCHisto(histo, crateID, dmbSlot, 0, me)) return (me != NULL);
116  CSCHistoDef histoD(histo, crateID, dmbSlot);
117  if (config->fnGetHisto(histoD, me)) return (me != NULL);
118  return false;
119  }
#define NULL
Definition: scimark2.h:8
boost::function< bool(const HistoId id, const HwId &id1, const HwId &id2, const HwId &id3, MonitorObject *&mo) > fnGetCacheCSCHisto
boost::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 131 of file CSCDQM_EventProcessor.cc.

References config, cscdqm::Configuration::fnGetCacheCSCHisto, cscdqm::Configuration::fnGetHisto, and NULL.

131  {
132  if (config->fnGetCacheCSCHisto(histo, crateID, dmbSlot, adId, me)) return (me != NULL);
133  CSCHistoDef histoD(histo, crateID, dmbSlot, adId);
134  if (config->fnGetHisto(histoD, me)) return (me != NULL);
135  return false;
136  }
#define NULL
Definition: scimark2.h:8
boost::function< bool(const HistoId id, const HwId &id1, const HwId &id2, const HwId &id3, MonitorObject *&mo) > fnGetCacheCSCHisto
boost::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 99 of file CSCDQM_EventProcessor.cc.

References config, cscdqm::Configuration::fnGetCacheDDUHisto, cscdqm::Configuration::fnGetHisto, and NULL.

Referenced by processDDU().

99  {
100  if (config->fnGetCacheDDUHisto(histo, dduID, me)) return (me != NULL);
101  DDUHistoDef histoD(histo, dduID);
102  if (config->fnGetHisto(histoD, me)) return (me != NULL);
103  return false;
104  }
#define NULL
Definition: scimark2.h:8
boost::function< bool(const HistoDef &histoT, MonitorObject *&) > fnGetHisto
boost::function< bool(const HistoId id, const HwId &id1, MonitorObject *&mo) > fnGetCacheDDUHisto
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 71 of file CSCDQM_EventProcessor.cc.

References config, cscdqm::Configuration::fnGetCacheEMUHisto, cscdqm::Configuration::fnGetHisto, and NULL.

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

71  {
72  if (config->fnGetCacheEMUHisto(histo, me)) return (me != NULL);
73  EMUHistoDef histoD(histo);
74  if (config->fnGetHisto(histoD, me)) return (me != NULL);
75  return false;
76  }
#define NULL
Definition: scimark2.h:8
boost::function< bool(const HistoDef &histoT, MonitorObject *&) > fnGetHisto
boost::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 85 of file CSCDQM_EventProcessor.cc.

References config, cscdqm::Configuration::fnGetCacheFEDHisto, cscdqm::Configuration::fnGetHisto, and NULL.

85  {
86  if (config->fnGetCacheFEDHisto(histo, fedID, me)) return (me != NULL);
87  FEDHistoDef histoD(histo, fedID);
88  if (config->fnGetHisto(histoD, me)) return (me != NULL);
89  return false;
90  }
#define NULL
Definition: scimark2.h:8
boost::function< bool(const HistoDef &histoT, MonitorObject *&) > fnGetHisto
boost::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 144 of file CSCDQM_EventProcessor.cc.

References config, cscdqm::Configuration::fnGetCacheParHisto, cscdqm::Configuration::fnGetHisto, and NULL.

Referenced by updateEfficiencyHistos().

144  {
145  if (config->fnGetCacheParHisto(histo, me)) return (me != NULL);
146  ParHistoDef histoD(histo);
147  if (config->fnGetHisto(histoD, me)) return (me != NULL);
148  return false;
149  }
boost::function< bool(const HistoId id, MonitorObject *&mo) > fnGetCacheParHisto
#define NULL
Definition: scimark2.h:8
boost::function< bool(const HistoDef &histoT, MonitorObject *&) > fnGetHisto
void cscdqm::EventProcessor::init ( void  )

Initialize EventProcessor: reading out config information.

Definition at line 61 of file CSCDQM_EventProcessor.cc.

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

61  {
62 
63  }
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 189 of file CSCDQM_EventProcessor.cc.

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

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

189  {
190  unsigned int masked = summary.setMaskedHWElements(tokens);
191  LOG_INFO << masked << " HW Elements masked";
192  return masked;
193  }
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:43
void cscdqm::EventProcessor::preProcessEvent ( )
private

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

Definition at line 27 of file CSCDQM_EventProcessor_processEvent.cc.

References config, EmuEventDisplayWasReset, and cscdqm::Configuration::incNEvents().

28 {
29 
30  config->incNEvents();
32 
33 }
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;

if (getCSCHisto(h::CSC_DMB_BXN_VS_DDU_BXN, crateID, dmbID, mo)) mo->Fill((int)(BXN), (int)dmbHeaderBXN);

Unpacking CFEB information from DMB header

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

if (getCSCHisto(h::CSC_DMB_CFEB_ACTIVE, crateID, dmbID, mo) mo->Fill((dmbTrailer->header_1a>>5)&0x1F); //KK

if (getCSCHisto(h::CSC_DMB_CFEB_ACTIVE_VS_DAV, crateID, dmbID, mo)) mo->Fill(dmbHeader->cfebAvailable(),(int)((dmbTrailer->header_1a>>5)&0x1F)); //KK

if (getCSCHisto(h::CSC_DMB_CFEB_ACTIVE_VS_DAV, crateID, dmbID, mo)) mo->Fill(dmbHeader->cfebAvailable(),dmbHeader->cfebActive()); //KK

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

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

TODO: Add support for more than 2 ALCTs

int tbin = wireDigisItr->getBeamCrossingTag();

ALCT not found

ALCT and CLCT coinsidence

if (getCSCHisto(h::CSC_TMB_BXN_VS_ALCT_BXN, crateID, dmbID, mo)) mo->Fill((int)((alctHeader->BXNCount())),(int)(tmbHeader->BXNCount()));

CLCT Found

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

Set number of CLCT-events to forth bin

Use 6-bit L1A

if (getCSCHisto(h::CSC_DMB_L1A_VS_CLCT_L1A, crateID, dmbID, mo)) mo->Fill(tmbHeader->L1ANumber(),dmbHeader->l1a());

if (getCSCHisto(h::CSC_CLCT_BXN_VS_DMB_BXN, crateID, dmbID, mo)) mo->Fill(tmbHeader->BXNCount(),dmbHeader->bxn());

LOG_DEBUG << "TMB Trailer Word Count = " << dec << (int)tmbTrailer->wordCount();

LOG_DEBUG << "CLCT BX = " << clctsDatas[lct].getBX() << " TMB BX = " << tmbHeader->BXNCount() << " 03 = " << (int)(tmbHeader->BXNCount()&0x3);

LOG_DEBUG << "diff = " << clctsDatas[lct].getBX()-(tmbHeader->BXNCount()&0x3);

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

int NmbCell, SCA_Nmb_FC;

–————E

–————B

int TrigTimeData[N_CFEBs*16][N_Samples][N_Layers];

memset(TrigTimeData, 0, sizeof(TrigTimeData));

–————E

CFEB Found

-————B

-————E

LOG_DEBUG << "NEvents = " << config->getNEvents();

LOG_DEBUG << "Chamber ID = "<< cscTag << " Crate ID = "<< crateID << " DMB ID = " << dmbID << "nCFEB =" << nCFEB;

=VB= Optimizations for faster histogram object access

LOG_DEBUG << " nSample = " << nSample;

=VB= Optimizations for faster histogram object access

if (mo_CFEB_DMB_L1A_diff)

LOG_DEBUG << " nSample = " << nSample;

for(int nLayer = 1; nLayer <= N_Layers; ++nLayer)

–————B

L1_Pipe_Count = (timeSlice[nCFEB][nSample])->get_L1A_number();

LOG_DEBUG << "SCA BLOCK: Chamber=" << chamberID << " CFEB=" << nCFEB + 1

<<" TRIGTIME="<<TrigTime<<" TimeSlice="<<nSample+1<<" Layer="<<nLayer<<" SCA_BLK="<<SCA_BLK;

if(res<=1) TrigTimeData[nCFEB*16+nStrip][nSample][nLayer-1] = TrigTime;

LOG_DEBUG << "*********"<<" TRIGTIME="<<TrigTime<<" BIT COUNT="<<bit_count;

SCA Block Occupancy Histograms

if (getCSCHisto(h::CSC_CFEBXX_SCA_BLOCK_OCCUPANCY, crateID, dmbID, nCFEB + 1, mo)) mo->Fill(SCA_BLK);

Free SCA Cells

if (getCSCHisto(h::CSC_CFEBXX_FREE_SCA_CELLS, crateID, dmbID, nCFEB + 1, mo))

Number of SCA Blocks Locked by LCTs

if (getCSCHisto(h::CSC_CFEBXX_SCA_BLOCKS_LOCKED_BY_LCTS, crateID, dmbID, nCFEB + 1, mo))

Number of SCA Blocks Locked by LCTxL1

if (getCSCHisto(h::CSC_CFEBXX_SCA_BLOCKS_LOCKED_BY_LCTXL1, crateID, dmbID, nCFEB + 1, mo))

–————E

LOG_DEBUG << "nCFEB " << nCFEB << " nSample " << nSample << " nLayer " << nLayer << " TrigTime " << TrigTime;

LOG_DEBUG << "L1APhase " << L1APhase << " UnpackedTrigTime " << UnpackedTrigTime;

LOG_DEBUG << " nStrip="<< dec << nStrip << " ADC=" << std::hex << ADC;

LOG_DEBUG << " nStrip="<< dec << nStrip << " Pedestal=" << std::hex << Pedestal[nCFEB][nLayer-1][nStrip-1];

if (getCSCHisto(h::CSC_CFEB_OUT_OFF_RANGE_STRIPS_LYXX, crateID, dmbID, nLayer, mo))

if (getCSCHisto(h::CSC_CFEB_ACTIVE_SAMPLES_VS_STRIP_LYXX, crateID, dmbID, nLayer, mo))

if (getCSCHisto(h::CSC_CFEB_ACTIVE_SAMPLES_VS_STRIP_LYXX_PROFILE, crateID, dmbID, nLayer, mo))

if (getCSCHisto(h::CSC_CFEB_ACTIVESTRIPS_LYXX, crateID, dmbID, nLayer, mo))

–————B

LOG_DEBUG << "Layer="<<nLayer<<" Strip="<<nCFEB*16+nStrip<<" Time="<<nSample << " ADC-PEDEST = "<<ADC - Pedestal[nCFEB][nLayer-1][nStrip-1];

–————E

continue;

–————B

if (getCSCHisto(h::CSC_CFEB_PEDESTAL__WITHEMV__SAMPLE_01_LYXX, crateID, dmbID, nLayer, mo))

if (getCSCHisto(h::CSC_CFEB_PEDESTAL__WITHRMS__SAMPLE_01_LYXX, crateID, dmbID, nLayer, mo))

if (getCSCHisto(h::CSC_CFEB_PEDESTALRMS_SAMPLE_01_LYXX, crateID, dmbID, nLayer, mo))

–————E

–————B

Refactored for performance (VR)

StripClusterFinder *ClusterFinder = new StripClusterFinder(N_Layers, N_Samples, N_CFEBs, N_Strips);

LOG_DEBUG << "*** CATHODE PART DEBUG: Layer=" << nLayer <<" Number of Clusters=" << Clus.size() << " ***";

Number of Clusters Histograms

LOG_DEBUG << "Strip: " << Clus[u].ClusterPulseMapHeight[k].channel_+1;

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 83 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::alctFirmwareVersion(), CSCEventData::alctHeader(), CSCTMBHeader::ALCTMatchTime(), CSCTMBHeader::ALCTOnly(), CSCEventData::alctTrailer(), b, 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(), cscd2r::chamberID(), CSCCFEBData::check(), CSCCLCTData::check(), cscdqm::CLCT_TRIGGERS, CSCEventData::clctData(), CSCTMBHeader::CLCTDigis(), CSCTMBHeader::CLCTOnly(), CSCCLCTData::comparatorDigis(), config, cscdqm::Configuration::copyChamberCounterValue(), 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_CLCTTIME_LYXX, cscdqm::h::CSC_CLCTTIME_LYXX_PROFILE, cscdqm::h::CSC_CLCTXX_BXN, 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_KEYDISTRIP, cscdqm::h::CSC_CLCTXX_KEYHALFSTRIP, 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_LCT0_MATCH_BXN_DIFFERENCE, cscdqm::h::CSC_LCT1_MATCH_BXN_DIFFERENCE, cscdqm::h::CSC_LCT_MATCH_STATUS, 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, 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_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_MINUS_ENDCAP_CFEB_SCA_CELLPEAK_TIME, cscdqm::h::EMU_CSC_PLUS_ENDCAP_CFEB_SCA_CELLPEAK_TIME, 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, CSCDetId::endcap(), benchmark_cfg::errors, CSCDCCExaminer::errorsForChamber(), cscdqm::EVENT_DISPLAY_PLOT, fCloseL1As, cscdqm::MonitorObject::Fill(), lumiContext::fill, plotBeamSpotDB::first, cscdqm::Configuration::fnGetCSCDetId, stage2BMTFBufferRaw_cfi::fwVersion, 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(), i, cscdqm::Configuration::incNUnpackedCSC(), cscdqm::Summary::isChamberStandby(), j, relval_2017::k, CSCDMBHeader::l1a24(), CSCCFEBSCAControllerWord::l1a_phase, CSCALCTHeader::L1Acc(), CSCTMBHeader::L1ANumber(), L1ANumber, LOG_ERROR, LOG_INFO, LOG_WARN, gen::n, CSCDMBHeader::nalct(), CSCEventData::nalct(), CSCTMBHeader::NCFEBs(), CSCDMBHeader::nclct(), CSCEventData::nclct(), NULL, listBenchmarks::pattern, EcalCondDBWriter_cfi::pedestal, DetId::rawId(), CSCDetId::ring(), 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().

83  {
84 
86 
87  if (&data == 0) {
88  LOG_ERROR << "Zero pointer. DMB data are not available for unpacking"; //KK is->are
89  return;
90  }
91 
92  int FEBunpacked = 0;
93  int alct_unpacked = 0;
94  int tmb_unpacked = 0;
95  int cfeb_unpacked = 0;
96 
97  int alct_keywg = -1;
98  int clct_kewdistrip = -1;
99 
100  bool L1A_out_of_sync = false;
101 
102  int nCFEBs = 5;
103 
104  MonitorObject* mo = NULL;
105 
108  const CSCDMBHeader* dmbHeader = data.dmbHeader();
109  const CSCDMBTrailer* dmbTrailer = data.dmbTrailer();
110  if (!dmbHeader && !dmbTrailer) {
111  LOG_ERROR << "Can not unpack DMB Header or/and Trailer";
112  return;
113  }
114 
116 
117 
119  unsigned int crateID = 0xFF;
120  unsigned int dmbID = 0xF;
121  unsigned int chamberID = 0xFFF;
122 
123  crateID = dmbHeader->crateID();
124  dmbID = dmbHeader->dmbID();
125  chamberID = (((crateID) << 4) + dmbID) & 0xFFF;
126 
127  const std::string cscTag = CSCHistoDef::getPath(crateID, dmbID);
128 
129 
130  unsigned long errors = binChecker.errorsForChamber(chamberID);
131  if ((errors & config->getBINCHECK_MASK()) > 0 ) {
132  LOG_WARN << "Format Errors " << cscTag << ": 0x" << std::hex << errors << " Skipped CSC Unpacking";
133  return;
134  }
135 
136  unsigned int cscType = 0;
137  unsigned int cscPosition = 0;
138  if (!getCSCFromMap(crateID, dmbID, cscType, cscPosition )) return;
139 
140 
141  CSCDetId cid;
142  if (!config->fnGetCSCDetId(crateID, dmbID, cid)) {
143  return;
144  }
145 
146  // Check if ME11 with PostLS1 readout (7 DCFEBs)
147  if ((cscType == 8 || cscType == 9) && theFormatVersion == 2013) nCFEBs = 7;
148 
149  // Check if in standby!
150  if (summary.isChamberStandby(cid)) {
151  return;
152  }
153 
154  double DMBEvents = 0.0;
155  DMBEvents = config->getChamberCounterValue(DMB_EVENTS, crateID, dmbID);
156 
157  // Get Event display plot number and next plot object
158  uint32_t evDisplNo = config->getChamberCounterValue(EVENT_DISPLAY_PLOT, crateID, dmbID);
159  evDisplNo += 1;
160  if (evDisplNo >= 5) {
161  config->setChamberCounterValue(EVENT_DISPLAY_PLOT, crateID, dmbID, 0);
162  } else {
163  config->setChamberCounterValue(EVENT_DISPLAY_PLOT, crateID, dmbID, evDisplNo);
164  }
165  MonitorObject* mo_EventDisplay = 0;
166  if (getCSCHisto(h::CSC_EVENT_DISPLAY_NOXX, crateID, dmbID, evDisplNo, mo_EventDisplay)) {
167  mo_EventDisplay->getTH1Lock()->Reset("");
168  }
169 
170  // Receiving EMU Event displays
171  MonitorObject *mo_Emu_EventDisplay_Anode = 0, *mo_Emu_EventDisplay_Cathode = 0, *mo_Emu_EventDisplay_XY = 0;
172  getEMUHisto(h::EMU_EVENT_DISPLAY_ANODE, mo_Emu_EventDisplay_Anode);
173  getEMUHisto(h::EMU_EVENT_DISPLAY_CATHODE, mo_Emu_EventDisplay_Cathode);
174  getEMUHisto(h::EMU_EVENT_DISPLAY_XY, mo_Emu_EventDisplay_XY);
175 
176  // Global chamber index
177  uint32_t glChamberIndex = 0;
178 
179  if (mo_EventDisplay) {
180  mo_EventDisplay->SetBinContent(1, 1, cid.endcap());
181  mo_EventDisplay->SetBinContent(1, 2, cid.station());
182  mo_EventDisplay->SetBinContent(1, 3, cid.ring());
183  mo_EventDisplay->SetBinContent(1, 4, cscPosition);
184  mo_EventDisplay->SetBinContent(1, 5, crateID);
185  mo_EventDisplay->SetBinContent(1, 6, dmbID);
186  mo_EventDisplay->SetBinContent(1, 7, dmbHeader->l1a24());
187  if (mo_Emu_EventDisplay_Anode || mo_Emu_EventDisplay_Cathode || mo_Emu_EventDisplay_XY) {
188  glChamberIndex = summary.getDetector().GlobalChamberIndex(cid.endcap(), cid.station(), cid.ring(), cscPosition);
189  }
190  }
191 
193 
194  if (cscPosition && getEMUHisto(h::EMU_CSC_UNPACKED, mo)){
195  mo->Fill(cscPosition, cscType);
196  }
197 
199  float DMBEff = float(DMBEvents) / float(config->getNEvents());
200  if(DMBEff > 1.0) {
201  LOG_ERROR << cscTag << " has efficiency " << DMBEff << " which is greater than 1";
202  }
203 
207  int dmbHeaderL1A = dmbHeader->l1a24()%64;
209  int dmb_ddu_l1a_diff = (int)(dmbHeaderL1A-(int)(L1ANumber%64));
210  if (dmb_ddu_l1a_diff != 0) L1A_out_of_sync = true;
211 
214  if (getCSCHisto(h::CSC_DMB_L1A_DISTRIB, crateID, dmbID, mo)) mo->Fill(dmbHeaderL1A);
215 
216  if (getCSCHisto(h::CSC_DMB_DDU_L1A_DIFF, crateID, dmbID, mo)) {
217  if(dmb_ddu_l1a_diff < -32) {
218  mo->Fill(dmb_ddu_l1a_diff + 64);
219  } else {
220  if(dmb_ddu_l1a_diff >= 32) mo->Fill(dmb_ddu_l1a_diff - 64);
221  else mo->Fill(dmb_ddu_l1a_diff);
222  }
223  mo->SetAxisRange(0.1, 1.1 * (1.0 + mo->GetBinContent(mo->GetMaximumBin())), "Y");
224  }
225 
226  if (getCSCHisto(h::CSC_DMB_L1A_VS_DDU_L1A, crateID, dmbID, mo)) mo->Fill((int)(L1ANumber & 0xFF), (int)dmbHeaderL1A);
227 
229  int dmbHeaderBXN = 0;
230  int dmb_ddu_bxn_diff = 0;
231 
236  dmbHeaderBXN = dmbHeader->bxn12();
240  dmb_ddu_bxn_diff = dmbHeaderBXN%64-BXN%64;
242  if (getCSCHisto(h::CSC_DMB_BXN_DISTRIB, crateID, dmbID, mo)) mo->Fill((int)(dmbHeader->bxn12()));
243 
244  if (getCSCHisto(h::CSC_DMB_DDU_BXN_DIFF, crateID, dmbID, mo)) {
245  if(dmb_ddu_bxn_diff < -32) mo->Fill(dmb_ddu_bxn_diff + 64);
246  else {
247  if(dmb_ddu_bxn_diff >= 32) mo->Fill(dmb_ddu_bxn_diff - 64);
248  else mo->Fill(dmb_ddu_bxn_diff);
249  }
250  mo->SetAxisRange(0.1, 1.1 * (1.0 + mo->GetBinContent(mo->GetMaximumBin())), "Y");
251  }
252 
254  if (getCSCHisto(h::CSC_DMB_BXN_VS_DDU_BXN, crateID, dmbID, mo)) mo->Fill(((int)(BXN)) % 256, ((int)dmbHeaderBXN) % 256);
255 
257  int cfeb_dav = 0;
258  int cfeb_dav_num = 0;
259  int cfeb_movlp = 0;
260  int dmb_cfeb_sync = 0;
261 
262  cfeb_dav = (int)dmbHeader->cfebAvailable();
263  for (int i = 0; i < nCFEBs; i++) cfeb_dav_num += (cfeb_dav >> i) & 0x1;
264  cfeb_movlp = (int)dmbHeader->cfebMovlp();
265  dmb_cfeb_sync = (int)dmbHeader->dmbCfebSync();
266 
267  if (getCSCHisto(h::CSC_DMB_CFEB_DAV, crateID, dmbID, mo)) {
268  for (int i = 0; i < nCFEBs; i++) {
269  int cfeb_present = (cfeb_dav >> i) & 0x1;
270  if (cfeb_present) {
271  mo->Fill(i);
272  }
273  }
274  }
275 
276  if (getCSCHisto(h::CSC_DMB_CFEB_DAV_MULTIPLICITY, crateID, dmbID, mo)) mo->Fill(cfeb_dav_num);
277  if (getCSCHisto(h::CSC_DMB_CFEB_MOVLP, crateID, dmbID, mo)) mo->Fill(cfeb_movlp);
278  if (getCSCHisto(h::CSC_DMB_CFEB_SYNC, crateID, dmbID, mo)) mo->Fill(dmb_cfeb_sync);
279 
280  if (getEMUHisto(h::EMU_DMB_UNPACKED, mo)) {
281  mo->Fill(crateID, dmbID);
283  }
284 
286  if (getCSCHisto(h::CSC_DMB_CFEB_ACTIVE, crateID, dmbID, mo)) mo->Fill(dmbHeader->cfebActive()); //KK
287 
291  if (getCSCHisto(h::CSC_DMB_L1_PIPE, crateID, dmbID, mo)) mo->Fill(dmbTrailer->dmb_l1pipe());
292 
294  if (getCSCHisto(h::CSC_DMB_FIFO_STATS, crateID, dmbID, mo)) {
295  if (dmbTrailer->tmb_empty() == 1) mo->Fill(1.0, 0.0); //KK
296  if (dmbTrailer->tmb_half() == 0) mo->Fill(1.0, 1.0);
297  if (dmbTrailer->tmb_full() == 1) mo->Fill(1.0, 2.0); //KK
298  if (dmbTrailer->alct_empty() == 1) mo->Fill(0.0, 0.0);
299  if (dmbTrailer->alct_half() == 0) mo->Fill(0.0, 1.0);
300  if (dmbTrailer->alct_full() == 1) mo->Fill(0.0, 2.0); //KK 0->1
301  for (int i = 0; i < nCFEBs; i++) {
302  if ((int)((dmbTrailer->cfeb_empty()>>i)&0x1) == 1) mo->Fill(i + 2, 0.0);
303  if ((int)((dmbTrailer->cfeb_half()>>i)&0x1) == 0) mo->Fill(i + 2, 1);
304  if ((int)((dmbTrailer->cfeb_full()>>i)&0x1) == 1) {
305  mo->Fill(i + 2, 2);
306  }
307  }
308  mo->SetEntries((int)DMBEvents);
309  }
310 
312  if (getCSCHisto(h::CSC_DMB_FEB_TIMEOUTS, crateID, dmbID, mo)) {
313  if ((dmbTrailer->tmb_starttimeout() == 0) && (dmbTrailer->alct_starttimeout() == 0) && (dmbTrailer->cfeb_starttimeout() == 0) && (dmbTrailer->cfeb_endtimeout() == 0)) {
314  mo->Fill(0.0);
315  }else{
316  if (dmbTrailer->alct_starttimeout()) mo->Fill(1);
317  if (dmbTrailer->tmb_starttimeout()) mo->Fill(2);
318  if (dmbTrailer->alct_endtimeout()) mo->Fill(8); // KK
319  if (dmbTrailer->tmb_endtimeout()) mo->Fill(9); // KK
320  }
321  for (int i = 0; i < nCFEBs; i++) {
322  if ((dmbTrailer->cfeb_starttimeout() >> i) & 0x1) {
323  mo->Fill(i + 3);
324  }
325  if ((dmbTrailer->cfeb_endtimeout() >> i) & 0x1) {
326  mo->Fill(i + 10); // KK 8->10
327  }
328  }
329  mo->SetEntries((int)DMBEvents);
330  }
331 
333  int alct_dav = dmbHeader->nalct();
334  int tmb_dav = dmbHeader->nclct();
335  int cfeb_dav2 = 0;
336  for (int i = 0; i < nCFEBs; i++) cfeb_dav2 = cfeb_dav2 + (int)((dmbHeader->cfebAvailable() >> i) & 0x1);
337 
340  if ((alct_dav > 0) && (getCSCHisto(h::CSC_DMB_FEB_DAV_RATE, crateID, dmbID, mo))) {
341  mo->Fill(0.0);
342  float alct_dav_number = mo->GetBinContent(1);
343  if (getCSCHisto(h::CSC_DMB_FEB_DAV_EFFICIENCY, crateID, dmbID, mo)) {
344  mo->SetBinContent(1, ((float)alct_dav_number / (float)(DMBEvents) * 100.0));
345  mo->SetEntries((int)DMBEvents);
346  }
347  }
348 
349  if ((tmb_dav > 0) && (getCSCHisto(h::CSC_DMB_FEB_DAV_RATE, crateID, dmbID, mo))) {
350  mo->Fill(1.0);
351  float tmb_dav_number = mo->GetBinContent(2);
352  if (getCSCHisto(h::CSC_DMB_FEB_DAV_EFFICIENCY, crateID, dmbID, mo)) {
353  mo->SetBinContent(2, ((float)tmb_dav_number / (float)(DMBEvents) * 100.0));
354  mo->SetEntries((int)DMBEvents);
355  }
356  }
357 
358  if ((cfeb_dav2 > 0) && (getCSCHisto(h::CSC_DMB_FEB_DAV_RATE, crateID, dmbID, mo))) {
359  mo->Fill(2.0);
360  float cfeb_dav2_number = mo->GetBinContent(3);
361  if (getCSCHisto(h::CSC_DMB_FEB_DAV_EFFICIENCY, crateID, dmbID, mo)) {
362  mo->SetBinContent(3, ((float)cfeb_dav2_number / (float)(DMBEvents) * 100.0));
363  mo->SetEntries((int)DMBEvents);
364  }
365  }
366 
367  float feb_combination_dav = -1.0;
369  if (getCSCHisto(h::CSC_DMB_FEB_COMBINATIONS_DAV_RATE, crateID, dmbID, mo)) {
370  if(alct_dav == 0 && tmb_dav == 0 && cfeb_dav2 == 0) feb_combination_dav = 0.0; // Nothing
371  if(alct_dav > 0 && tmb_dav == 0 && cfeb_dav2 == 0) feb_combination_dav = 1.0; // ALCT Only
372  if(alct_dav == 0 && tmb_dav > 0 && cfeb_dav2 == 0) feb_combination_dav = 2.0; // TMB Only
373  if(alct_dav == 0 && tmb_dav == 0 && cfeb_dav2 > 0) feb_combination_dav = 3.0; // CFEB Only
374  if(alct_dav == 0 && tmb_dav > 0 && cfeb_dav2 > 0) feb_combination_dav = 4.0; // TMB+CFEB
375  if(alct_dav > 0 && tmb_dav > 0 && cfeb_dav2 == 0) feb_combination_dav = 5.0; // ALCT+TMB
376  if(alct_dav > 0 && tmb_dav == 0 && cfeb_dav2 > 0) feb_combination_dav = 6.0; // ALCT+CFEB
377  if(alct_dav > 0 && tmb_dav > 0 && cfeb_dav2 > 0) feb_combination_dav = 7.0; // ALCT+TMB+CFEB
378  mo->Fill(feb_combination_dav);
379  float feb_combination_dav_number = mo->GetBinContent((int)(feb_combination_dav + 1.0));
380  if (getCSCHisto(h::CSC_DMB_FEB_COMBINATIONS_DAV_EFFICIENCY, crateID, dmbID, mo)) {
381  mo->SetBinContent((int)(feb_combination_dav + 1.0), ((float)feb_combination_dav_number / (float)(DMBEvents) * 100.0));
382  mo->SetEntries((int)DMBEvents);
383  }
384  }
385 
387  if (data.nalct()) {
388 
389 
390  const CSCALCTHeader* alctHeader = data.alctHeader();
391  int fwVersion = alctHeader->alctFirmwareVersion();
392  const CSCALCTTrailer* alctTrailer = data.alctTrailer();
393  const CSCAnodeData* alctData = data.alctData();
394 
395  if (alctHeader && alctTrailer) {
396 
397  std::vector<CSCALCTDigi> alctsDatasTmp = alctHeader->ALCTDigis();
398  std::vector<CSCALCTDigi> alctsDatas;
399 
400  for (uint32_t lct = 0; lct < alctsDatasTmp.size(); lct++) {
401  if (alctsDatasTmp[lct].isValid()) alctsDatas.push_back(alctsDatasTmp[lct]);
402  }
403 
404  FEBunpacked = FEBunpacked + 1;
405  alct_unpacked = 1;
406 
408  if (getCSCHisto(h::CSC_CSC_RATE, crateID, dmbID, mo)) {
409  mo->Fill(2);
410  uint32_t ALCTEvent = (uint32_t)mo->GetBinContent(3);
411  config->setChamberCounterValue(ALCT_TRIGGERS, crateID, dmbID, ALCTEvent);
412  if (getCSCHisto(h::CSC_CSC_EFFICIENCY, crateID, dmbID, mo)){
413  if(config->getNEvents() > 0) {
416  mo->SetBinContent(1, ((float)ALCTEvent / (float)(DMBEvents) * 100.0));
418  mo->SetEntries((int)DMBEvents);
419  }
420  }
421  }
422 
423  if ((alct_dav >0) && (getCSCHisto(h::CSC_DMB_FEB_UNPACKED_VS_DAV, crateID, dmbID, mo))) {
424  mo->Fill(0.0, 0.0);
425  }
426 
429  if (getCSCHisto(h::CSC_ALCT_L1A, crateID, dmbID, mo)) mo->Fill((int)(alctHeader->L1Acc()));
430 
432  if (getCSCHisto(h::CSC_ALCT_DMB_L1A_DIFF, crateID, dmbID, mo)) {
434  int alct_dmb_l1a_diff = (int)(alctHeader->L1Acc() % 64 - dmbHeader->l1a24() % 64);
435  if (alct_dmb_l1a_diff != 0) L1A_out_of_sync = true;
436  if(alct_dmb_l1a_diff < -32) mo->Fill(alct_dmb_l1a_diff + 64);
437  else {
438  if(alct_dmb_l1a_diff >= 32) mo->Fill(alct_dmb_l1a_diff - 64);
439  else mo->Fill(alct_dmb_l1a_diff);
440  }
441  mo->SetAxisRange(0.1, 1.1 * (1.0 + mo->GetBinContent(mo->GetMaximumBin())), "Y");
442  }
443 
445  if (getCSCHisto(h::CSC_DMB_L1A_VS_ALCT_L1A, crateID, dmbID, mo)) mo->Fill(alctHeader->L1Acc() % 256, dmbHeader->l1a24()%256);
446 
449  if (getCSCHisto(h::CSC_ALCT_DMB_BXN_DIFF, crateID, dmbID, mo)) {
450  int alct_dmb_bxn_diff = (int)(alctHeader->BXNCount()-dmbHeader->bxn12());
451  if (alct_dmb_bxn_diff > 0) alct_dmb_bxn_diff -= 3564;
452  alct_dmb_bxn_diff %= 32;
453  mo->Fill(alct_dmb_bxn_diff);
454  mo->SetAxisRange(0.1, 1.1 * (1.0 + mo->GetBinContent(mo->GetMaximumBin())), "Y");
455  }
456 
457  if (getCSCHisto(h::CSC_ALCT_BXN, crateID, dmbID, mo)) mo->Fill(alctHeader->BXNCount());
458 
460  if (getCSCHisto(h::CSC_ALCT_BXN_VS_DMB_BXN, crateID, dmbID, mo)) mo->Fill((int)((alctHeader->BXNCount()) % 256), (int)(dmbHeader->bxn12()) % 256);
461 
462  if (getCSCHisto(h::CSC_ALCT_NUMBER_RATE, crateID, dmbID, mo)) {
463  mo->Fill(alctsDatas.size());
464  int nALCT = (int)mo->GetBinContent((int)(alctsDatas.size() + 1));
465  if (getCSCHisto(h::CSC_ALCT_NUMBER_EFFICIENCY, crateID, dmbID, mo))
466  mo->SetBinContent((int)(alctsDatas.size() + 1), (float)(nALCT) / (float)(DMBEvents) * 100.0);
467  }
468 
469  if (getCSCHisto(h::CSC_ALCT_WORD_COUNT, crateID, dmbID, mo)) mo->Fill((int)(alctTrailer->wordCount()));
470 
473  if (alctsDatas.size() == 2) {
474  if (getCSCHisto(h::CSC_ALCT1_VS_ALCT0_KEYWG, crateID, dmbID, mo))
475  mo->Fill(alctsDatas[0].getKeyWG(),alctsDatas[1].getKeyWG());
476  }
477 
478  MonitorObject* mo_CSC_ALCT0_BXN_mean = 0;
479  getEMUHisto(h::EMU_CSC_ALCT0_BXN_MEAN, mo_CSC_ALCT0_BXN_mean);
480 
481  MonitorObject* mo_CSC_ALCT0_BXN_rms = 0;
482  getEMUHisto(h::EMU_CSC_ALCT0_BXN_RMS, mo_CSC_ALCT0_BXN_rms);
483 
484  MonitorObject* mo_CSC_Plus_endcap_ALCT0_dTime = 0;
485  getEMUHisto(h::EMU_CSC_ALCT0_ENDCAP_PLUS_DTIME, mo_CSC_Plus_endcap_ALCT0_dTime);
486 
487  MonitorObject* mo_CSC_Minus_endcap_ALCT0_dTime = 0;
488  getEMUHisto(h::EMU_CSC_ALCT0_ENDCAP_MINUS_DTIME, mo_CSC_Minus_endcap_ALCT0_dTime);
489 
490  for (uint32_t lct = 0; lct < alctsDatas.size(); lct++) {
491 
493  if (lct >= 2) continue;
494 
495  if (getCSCHisto(h::CSC_ALCTXX_KEYWG, crateID, dmbID, lct, mo)) {
496  mo->Fill(alctsDatas[lct].getKeyWG());
497  }
498 
499  if(lct == 0) alct_keywg = alctsDatas[lct].getKeyWG();
500 
501  int alct_dtime = 0;
502  if (fwVersion == 2007) {
503  alct_dtime = alctsDatas[lct].getBX();
504  } else {
505  // Older 2006 Format
506  alct_dtime = (int) (alctsDatas[lct].getBX() - (alctHeader->BXNCount()&0x1F));
507  }
508 
509  // == Those two summary histos need to be outside of per-chamber CSC_ALCTXX_DTIME histo check.
510  // Otherwise will be empty in Offline DQM
511  if (lct == 0) {
512  if (cid.endcap() == 1) {
513  if (mo_CSC_Plus_endcap_ALCT0_dTime) mo_CSC_Plus_endcap_ALCT0_dTime->Fill(alct_dtime);
514  }
515  if (cid.endcap() == 2) {
516  if (mo_CSC_Minus_endcap_ALCT0_dTime) mo_CSC_Minus_endcap_ALCT0_dTime->Fill(alct_dtime);
517  }
518  }
519 
520  if (getCSCHisto(h::CSC_ALCTXX_DTIME, crateID, dmbID, lct, mo)) {
521 
522  if(alct_dtime < -16) {
523  mo->Fill(alct_dtime + 32);
524  } else {
525  if(alct_dtime >= 16) mo->Fill(alct_dtime - 32);
526  else mo->Fill(alct_dtime);
527  }
528 
529  mo->SetAxisRange(0.1, 1.1 * (1.0 + mo->GetBinContent(mo->GetMaximumBin())), "Y");
530 
531  double dTime_mean = mo->getTH1()->GetMean();
532  double dTime_rms = mo->getTH1()->GetRMS();
533 
534  // == For ALCT0 Fill Summary dTime Histograms
535  if (lct == 0) {
536  /* -- Moved outside of CSC histo check
537  if (cid.endcap() == 1) {
538  if (mo_CSC_Plus_endcap_ALCT0_dTime) mo_CSC_Plus_endcap_ALCT0_dTime->Fill(alct_dtime);
539  }
540  if (cid.endcap() == 2) {
541  if (mo_CSC_Minus_endcap_ALCT0_dTime) mo_CSC_Minus_endcap_ALCT0_dTime->Fill(alct_dtime);
542  }
543  */
544  if (cscPosition && mo_CSC_ALCT0_BXN_mean) {
545  mo_CSC_ALCT0_BXN_mean->SetBinContent(cscPosition, cscType + 1, dTime_mean);
546  }
547  if (cscPosition && mo_CSC_ALCT0_BXN_rms) {
548  mo_CSC_ALCT0_BXN_rms->SetBinContent(cscPosition, cscType + 1, dTime_rms);
549  }
550  }
551  }
552 
553 
554  if (getCSCHisto(h::CSC_ALCTXX_DTIME_VS_KEYWG, crateID, dmbID, lct, mo)) {
555  if(alct_dtime < -16) {
556  mo->Fill(alctsDatas[lct].getKeyWG(), alct_dtime + 32);
557  } else {
558  if(alct_dtime >= 16) mo->Fill(alctsDatas[lct].getKeyWG(), alct_dtime - 32);
559  else mo->Fill(alctsDatas[lct].getKeyWG(), alct_dtime);
560  }
561  }
562 
563  if (getCSCHisto(h::CSC_ALCTXX_DTIME_PROFILE, crateID, dmbID, lct, mo)) {
564  if(alct_dtime < -16) {
565  mo->Fill(alctsDatas[lct].getKeyWG(), alct_dtime + 32);
566  } else {
567  if (alct_dtime >= 16) mo->Fill(alctsDatas[lct].getKeyWG(), alct_dtime - 32);
568  else mo->Fill(alctsDatas[lct].getKeyWG(), alct_dtime);
569  }
570  }
571 
572  int alct_bxn = alctsDatas[lct].getBX();
573  if (fwVersion == 2007) {
574  alct_bxn = (alct_bxn + alctHeader->BXNCount())&0x1F;
575  }
576 
577  if (getCSCHisto(h::CSC_ALCTXX_BXN, crateID, dmbID, lct, mo)) mo->Fill(alct_bxn);
578 
579  if (getCSCHisto(h::CSC_ALCTXX_QUALITY, crateID, dmbID, lct, mo)) mo->Fill(alctsDatas[lct].getKeyWG(), alctsDatas[lct].getQuality());
580 
581  if (mo_EventDisplay) {
582  mo_EventDisplay->SetBinContent(2, alctsDatas[lct].getKeyWG(), alct_bxn + 1 );
583  mo_EventDisplay->SetBinContent(3, alctsDatas[lct].getKeyWG(), alctsDatas[lct].getQuality());
584  }
585 
586  if (getCSCHisto(h::CSC_ALCTXX_QUALITY_DISTR, crateID, dmbID, lct, mo)) {
587  mo->Fill(alctsDatas[lct].getQuality());
588  if (lct == 0) {
589  MonitorObject* mo1 = 0;
590  if (cscPosition && getEMUHisto(h::EMU_CSC_ALCT0_QUALITY, mo1)) {
591  mo1->SetBinContent(cscPosition, cscType + 1, mo->getTH1()->GetMean());
592  }
593  }
594  }
595 
596  if (getCSCHisto(h::CSC_ALCTXX_QUALITY_PROFILE, crateID, dmbID, lct, mo)) mo->Fill(alctsDatas[lct].getKeyWG(), alctsDatas[lct].getQuality());
597 
598  if (getCSCHisto(h::CSC_ALCTXX_PATTERN, crateID, dmbID, lct, mo)) {
599  int pattern = (alctsDatas[lct].getAccelerator() << 1) + alctsDatas[lct].getCollisionB();
600  int keywg = alctsDatas[lct].getKeyWG();
601  mo->Fill(keywg, pattern );
602  }
603 
604  if (getCSCHisto(h::CSC_ALCTXX_PATTERN_DISTR, crateID, dmbID, lct, mo)) {
605  int pattern = (alctsDatas[lct].getAccelerator()<<1) + alctsDatas[lct].getCollisionB();
606  mo->Fill(pattern);
607  }
608 
609  }
610 
611  int NumberOfLayersWithHitsInALCT = 0;
612  int NumberOfWireGroupsWithHitsInALCT = 0;
613 
614  if (alctData) {
615 
616  MonitorObject* mo_AFEB_RawHits_TimeBins = 0;
617  getCSCHisto(h::CSC_CFEB_AFEB_RAWHITS_TIMEBINS, crateID, dmbID, mo_AFEB_RawHits_TimeBins);
618 
619  MonitorObject* mo_CSC_Plus_endcap_AFEB_RawHits_Time = 0;
620  getEMUHisto(h::EMU_CSC_AFEB_ENDCAP_PLUS_RAWHITS_TIME, mo_CSC_Plus_endcap_AFEB_RawHits_Time);
621 
622  MonitorObject* mo_CSC_Minus_endcap_AFEB_RawHits_Time = 0;
623  getEMUHisto(h::EMU_CSC_AFEB_ENDCAP_MINUS_RAWHITS_TIME, mo_CSC_Minus_endcap_AFEB_RawHits_Time);
624 
625  MonitorObject* mo_CSC_AFEB_RawHits_Time_mean = 0;
626  getEMUHisto(h::EMU_CSC_AFEB_RAWHITS_TIME_MEAN, mo_CSC_AFEB_RawHits_Time_mean);
627 
628  MonitorObject* mo_CSC_AFEB_RawHits_Time_rms = 0;
629  getEMUHisto(h::EMU_CSC_AFEB_RAWHITS_TIME_RMS, mo_CSC_AFEB_RawHits_Time_rms);
630 
631  for (int nLayer = 1; nLayer <= 6; nLayer++) {
632 
633  int wg_previous = -1;
634  int tbin_previous = -1;
635  bool CheckLayerALCT = true;
636 
637  std::vector<CSCWireDigi> wireDigis = alctData->wireDigis(nLayer);
638  for (std::vector<CSCWireDigi>::iterator wireDigisItr = wireDigis.begin(); wireDigisItr != wireDigis.end(); ++wireDigisItr) {
639 
640  int wg = wireDigisItr->getWireGroup();
642  std::vector<int> tbins = wireDigisItr->getTimeBinsOn();
643  int tbin = wireDigisItr->getTimeBin();
644 
645  if (mo_EventDisplay) {
646  mo_EventDisplay->SetBinContent(nLayer + 3, wg - 1, tbin + 1);
647  setEmuEventDisplayBit(mo_Emu_EventDisplay_Anode, glChamberIndex, wg - 1, nLayer - 1);
648  setEmuEventDisplayBit(mo_Emu_EventDisplay_XY, glChamberIndex, wg - 1, nLayer - 1);
649  }
650 
651  if (CheckLayerALCT) {
652  NumberOfLayersWithHitsInALCT = NumberOfLayersWithHitsInALCT + 1;
653  CheckLayerALCT = false;
654  }
655 
656  for (uint32_t n = 0; n < tbins.size(); n++) {
657 
658  tbin = tbins[n];
659  if(wg != wg_previous || (tbin != tbin_previous + 1 && tbin != tbin_previous - 1) ) {
660 
661  if (getCSCHisto(h::CSC_ALCTTIME_LYXX, crateID, dmbID, nLayer, mo)) mo->Fill(wg - 1, tbin);
662 
663  if (getCSCHisto(h::CSC_ALCTTIME_LYXX_PROFILE, crateID, dmbID, nLayer, mo)) mo->Fill(wg - 1, tbin);
664 
665  if (mo_AFEB_RawHits_TimeBins) mo_AFEB_RawHits_TimeBins->Fill(tbin);
666 
667  if (cid.endcap() == 1) {
668  if (mo_CSC_Plus_endcap_AFEB_RawHits_Time) mo_CSC_Plus_endcap_AFEB_RawHits_Time->Fill(tbin);
669  }
670  if (cid.endcap() == 2) {
671  if (mo_CSC_Minus_endcap_AFEB_RawHits_Time) mo_CSC_Minus_endcap_AFEB_RawHits_Time->Fill(tbin);
672  }
673 
674  if (getCSCHisto(h::CSC_ALCT_LYXX_RATE, crateID, dmbID, nLayer, mo)) {
675  mo->Fill(wg - 1);
676  int number_wg = (int)(mo->GetBinContent(wg));
677  Double_t Number_of_entries_ALCT = mo->GetEntries();
678  if (getCSCHisto(h::CSC_ALCT_LYXX_EFFICIENCY, crateID, dmbID, nLayer, mo)) {
679  mo->SetBinContent(wg, ((float) number_wg));
680  if((Double_t)(DMBEvents) > 0.0) {
681  mo->SetNormFactor(100.0*Number_of_entries_ALCT/(Double_t)(DMBEvents));
682  } else {
683  mo->SetNormFactor(100.0);
684  }
685  mo->SetEntries((int)DMBEvents);
686  }
687  }
688  }
689  if(wg != wg_previous) {
690  NumberOfWireGroupsWithHitsInALCT = NumberOfWireGroupsWithHitsInALCT + 1;
691  }
692 
693  wg_previous = wg;
694  tbin_previous = tbin;
695  }
696  }
697 
698  // Fill Summary Anode Raw Hits Timing Plots
699  if (mo_AFEB_RawHits_TimeBins) {
700 
701  double rawhits_time_mean = mo_AFEB_RawHits_TimeBins->getTH1()->GetMean();
702  double rawhits_time_rms = mo_AFEB_RawHits_TimeBins->getTH1()->GetRMS();
703 
704  if ( cscPosition && mo_CSC_AFEB_RawHits_Time_mean) {
705  mo_CSC_AFEB_RawHits_Time_mean->SetBinContent(cscPosition, cscType + 1, rawhits_time_mean);
706  }
707 
708  if ( cscPosition && mo_CSC_AFEB_RawHits_Time_rms) {
709  mo_CSC_AFEB_RawHits_Time_rms->SetBinContent(cscPosition, cscType + 1, rawhits_time_rms);
710  }
711 
712  }
713 
714  }
715 
716  } else {
717  LOG_ERROR << cscTag << " Can not unpack Anode Data";
718  }
719 
720  if (getCSCHisto(h::CSC_ALCT_NUMBER_OF_LAYERS_WITH_HITS, crateID, dmbID, mo)) {
721  mo->Fill(NumberOfLayersWithHitsInALCT);
722  MonitorObject* mo1 = 0;
723  if ( cscPosition && getEMUHisto(h::EMU_CSC_ALCT_PLANES_WITH_HITS, mo1)) {
724  mo1->SetBinContent(cscPosition, cscType + 1, mo->getTH1()->GetMean());
725  }
726  }
727 
728  if (getCSCHisto(h::CSC_ALCT_NUMBER_OF_WIREGROUPS_WITH_HITS, crateID, dmbID, mo)) mo->Fill(NumberOfWireGroupsWithHitsInALCT);
729 
730  } else {
731  LOG_ERROR << cscTag << " Can not unpack ALCT Header or/and Trailer";
732  }
733  } else {
736  if (getCSCHisto(h::CSC_ALCT_NUMBER_RATE, crateID, dmbID, mo)) {
737  mo->Fill(0);
738  int nALCT = (int)mo->GetBinContent(1);
739  if (getCSCHisto(h::CSC_ALCT_NUMBER_EFFICIENCY, crateID, dmbID, mo))
740  mo->SetBinContent(1, (float)(nALCT) / (float)(DMBEvents) * 100.0);
741  }
742 
743  if ((alct_dav > 0) && (getCSCHisto(h::CSC_DMB_FEB_UNPACKED_VS_DAV, crateID, dmbID, mo))) {
744  mo->Fill(0.0, 1.0);
745  }
746  }
747 
749  if(data.nclct() && data.nalct()) {
750 
751  CSCALCTHeader* alctHeader = data.alctHeader();
752 
753  if (alctHeader) {
754  std::vector<CSCALCTDigi> alctsDatasTmp = alctHeader->ALCTDigis();
755  std::vector<CSCALCTDigi> alctsDatas;
756 
757  for (uint32_t lct = 0; lct < alctsDatasTmp.size(); lct++) {
758  if (alctsDatasTmp[lct].isValid())
759  alctsDatas.push_back(alctsDatasTmp[lct]);
760  }
761 
762  CSCTMBData* tmbData = data.tmbData();
763  if (tmbData) {
764  CSCTMBHeader* tmbHeader = tmbData->tmbHeader();
765  if (tmbHeader) {
767  if (getCSCHisto(h::CSC_TMB_BXN_VS_ALCT_BXN, crateID, dmbID, mo))
768  mo->Fill( ((int)(alctHeader->BXNCount())) % 256, ((int)(tmbHeader->BXNCount())) % 256 );
769 
770  if (getCSCHisto(h::CSC_TMB_ALCT_BXN_DIFF, crateID, dmbID, mo)) {
771  int clct_alct_bxn_diff = (int)(alctHeader->BXNCount() - tmbHeader->BXNCount());
772  if(clct_alct_bxn_diff < -2048) mo->Fill(clct_alct_bxn_diff + 4096);
773  else {
774  if(clct_alct_bxn_diff > 2048) mo->Fill(clct_alct_bxn_diff - 4096);
775  else mo->Fill(clct_alct_bxn_diff);
776  }
777  mo->SetAxisRange(0.1, 1.1*(1.0+mo->GetBinContent(mo->GetMaximumBin())), "Y");
778  }
779 
780  if (getCSCHisto(h::CSC_TMB_L1A_VS_ALCT_L1A, crateID, dmbID, mo))
781  mo->Fill((int)(alctHeader->L1Acc()%256),(int)(tmbHeader->L1ANumber()%256));
782 
783  if (getCSCHisto(h::CSC_TMB_ALCT_L1A_DIFF, crateID, dmbID, mo)) {
784  int clct_alct_l1a_diff = (int)(tmbHeader->L1ANumber() - alctHeader->L1Acc());
785  if(clct_alct_l1a_diff < -2048) mo->Fill(clct_alct_l1a_diff + 4096);
786  else {
787  if(clct_alct_l1a_diff > 2048) mo->Fill(clct_alct_l1a_diff - 4096);
788  else mo->Fill(clct_alct_l1a_diff);
789  }
790  mo->SetAxisRange(0.1, 1.1*(1.0+mo->GetBinContent(mo->GetMaximumBin())), "Y");
791  }
792  } else {
793  LOG_ERROR << cscTag << " Can not unpack TMB Header";
794  }
795 
796  } else {
797  LOG_ERROR << cscTag << " Can not unpack TMB Data";
798  }
799  } else {
800  LOG_ERROR << cscTag << " Can not unpack ALCT Header";
801  }
802  }
803 
805  if (data.nclct()) {
806 
809  CSCTMBData* tmbData = data.tmbData();
810  if (tmbData) {
811 
812 
813  CSCTMBHeader* tmbHeader = tmbData->tmbHeader();
814  CSCTMBTrailer* tmbTrailer = tmbData->tmbTrailer();
815 
816  if (tmbHeader && tmbTrailer) {
817 
818  CSCCLCTData* clctData = data.clctData();
819 
820  std::vector<CSCCLCTDigi> clctsDatasTmp = tmbHeader->CLCTDigis(cid.rawId());
821  std::vector<CSCCLCTDigi> clctsDatas;
822 
823  for (uint32_t lct = 0; lct < clctsDatasTmp.size(); lct++) {
824  if (clctsDatasTmp[lct].isValid()) clctsDatas.push_back(clctsDatasTmp[lct]);
825  }
826 
827  FEBunpacked = FEBunpacked +1;
828  tmb_unpacked = 1;
829 
830  if (getCSCHisto(h::CSC_ALCT_MATCH_TIME, crateID, dmbID, mo)) {
831 
832  mo->Fill(tmbHeader->ALCTMatchTime());
833  double alct_match_mean = mo->getTH1()->GetMean();
834  double alct_match_rms = mo->getTH1()->GetRMS();
835  MonitorObject* mo1 = 0;
836 
837  if (cid.endcap() == 1) {
838  if (cscPosition && getEMUHisto(h::EMU_CSC_ENDCAP_PLUS_ALCT_CLCT_MATCH_TIME, mo1)) {
839  mo1->Fill(tmbHeader->ALCTMatchTime());
840  }
841  }
842 
843  if (cid.endcap() == 2) {
845  mo1->Fill(tmbHeader->ALCTMatchTime());
846  }
847  }
848 
849  if (cscPosition && getEMUHisto(h::EMU_CSC_ALCT_CLCT_MATCH_MEAN, mo1)) {
850  mo1->SetBinContent(cscPosition, cscType + 1, alct_match_mean);
851  }
852 
853  if (cscPosition && getEMUHisto(h::EMU_CSC_ALCT_CLCT_MATCH_RMS, mo1)) {
854  mo1->SetBinContent(cscPosition, cscType + 1, alct_match_rms);
855  }
856 
857  }
858 
859  if (getCSCHisto(h::CSC_LCT_MATCH_STATUS, crateID, dmbID, mo)) {
860  if (tmbHeader->CLCTOnly()) mo->Fill(0.0,0.0);
861  if (tmbHeader->ALCTOnly()) mo->Fill(0.0,1.0);
862  if (tmbHeader->TMBMatch()) mo->Fill(0.0,2.0);
863  }
864 
865  if (getCSCHisto(h::CSC_LCT0_MATCH_BXN_DIFFERENCE, crateID, dmbID, mo)) mo->Fill(tmbHeader->Bxn0Diff());
866  if (getCSCHisto(h::CSC_LCT1_MATCH_BXN_DIFFERENCE, crateID, dmbID, mo)) mo->Fill(tmbHeader->Bxn1Diff());
867 
868  if ((tmb_dav > 0) && (getCSCHisto(h::CSC_DMB_FEB_UNPACKED_VS_DAV, crateID, dmbID, mo))) {
869  mo->Fill(1.0, 0.0);
870  }
871 
873  if (getCSCHisto(h::CSC_CSC_RATE, crateID, dmbID, mo)) {
874  mo->Fill(3);
875  uint32_t CLCTEvent = (uint32_t)mo->GetBinContent(4);
876  config->setChamberCounterValue(CLCT_TRIGGERS, crateID, dmbID, CLCTEvent);
877  if (getCSCHisto(h::CSC_CSC_EFFICIENCY, crateID, dmbID, mo)) {
878  if(config->getNEvents() > 0) {
879  mo->SetBinContent(2,((float)CLCTEvent/(float)(DMBEvents)*100.0));
880  mo->SetEntries(DMBEvents);
881  }
882  }
883  }
884 
885  if (getCSCHisto(h::CSC_CLCT_L1A, crateID, dmbID, mo)) mo->Fill(tmbHeader->L1ANumber());
886 
888  if (getCSCHisto(h::CSC_CLCT_DMB_L1A_DIFF, crateID, dmbID, mo)) {
889  int clct_dmb_l1a_diff = (int)((tmbHeader->L1ANumber() % 64)-dmbHeader->l1a24() % 64);
890  if (clct_dmb_l1a_diff != 0) L1A_out_of_sync = true;
891  if(clct_dmb_l1a_diff < -32) mo->Fill(clct_dmb_l1a_diff + 64);
892  else {
893  if(clct_dmb_l1a_diff >= 32) mo->Fill(clct_dmb_l1a_diff - 64);
894  else mo->Fill(clct_dmb_l1a_diff);
895  }
896  mo->SetAxisRange(0.1, 1.1*(1.0+mo->GetBinContent(mo->GetMaximumBin())), "Y");
897  }
898 
900  if (getCSCHisto(h::CSC_DMB_L1A_VS_CLCT_L1A, crateID, dmbID, mo)) mo->Fill(tmbHeader->L1ANumber()%256,dmbHeader->l1a24()%256);
901 
902  if (getCSCHisto(h::CSC_CLCT_DMB_BXN_DIFF, crateID, dmbID, mo)) {
903  int clct_dmb_bxn_diff = (int)(tmbHeader->BXNCount()%64-dmbHeader->bxn12()%64);
904  if(clct_dmb_bxn_diff < -32) mo->Fill(clct_dmb_bxn_diff + 64);
905  else {
906  if(clct_dmb_bxn_diff >= 32) mo->Fill(clct_dmb_bxn_diff - 64);
907  else mo->Fill(clct_dmb_bxn_diff);
908  }
909  mo->SetAxisRange(0.1, 1.1*(1.0+mo->GetBinContent(mo->GetMaximumBin())), "Y");
910  }
911 
912  if (getCSCHisto(h::CSC_CLCT_BXN, crateID, dmbID, mo)) mo->Fill((int)(tmbHeader->BXNCount()));
913 
915  if (getCSCHisto(h::CSC_CLCT_BXN_VS_DMB_BXN, crateID, dmbID, mo)) mo->Fill(tmbHeader->BXNCount()%256,dmbHeader->bxn12()%256);
916 
917  if (getCSCHisto(h::CSC_CLCT_NUMBER_RATE, crateID, dmbID, mo)) {
918  mo->Fill(clctsDatas.size());
919  int nCLCT = (int)mo->GetBinContent((int)(clctsDatas.size()+1));
920  if (getCSCHisto(h::CSC_CLCT_NUMBER, crateID, dmbID, mo)) mo->SetBinContent((int)(clctsDatas.size() + 1), (float)(nCLCT) / (float)(DMBEvents) * 100.0);
921  }
922 
923  if (clctsDatas.size() == 1) {
924  if (getCSCHisto(h::CSC_CLCT0_CLSSIFICATION, crateID, dmbID, mo)) {
925  if (clctsDatas[0].getStripType()) mo->Fill(0.0);
926  else mo->Fill(1.0);
927  }
928  }
929 
930  if (clctsDatas.size() == 2) {
931  if (getCSCHisto(h::CSC_CLCT1_VS_CLCT0_KEY_STRIP, crateID, dmbID, mo))
932  mo->Fill(clctsDatas[0].getKeyStrip(),clctsDatas[1].getKeyStrip());
933  if (getCSCHisto(h::CSC_CLCT0_CLCT1_CLSSIFICATION, crateID, dmbID, mo)) {
934  if ( clctsDatas[0].getStripType() && clctsDatas[1].getStripType()) mo->Fill(0.0);
935  if ( clctsDatas[0].getStripType() && !clctsDatas[1].getStripType()) mo->Fill(1.0);
936  if (!clctsDatas[0].getStripType() && clctsDatas[1].getStripType()) mo->Fill(2.0);
937  if (!clctsDatas[0].getStripType() && !clctsDatas[1].getStripType()) mo->Fill(3.0);
938  }
939  }
940 
941  if (getCSCHisto(h::CSC_TMB_WORD_COUNT, crateID, dmbID, mo)) mo->Fill((int)(tmbTrailer->wordCount()));
944  MonitorObject* mo_CSC_Plus_endcap_CLCT0_dTime = 0;
945  getEMUHisto(h::EMU_CSC_ENDCAP_PLUS_CLCT0_DTIME, mo_CSC_Plus_endcap_CLCT0_dTime);
946 
947  MonitorObject* mo_CSC_Minus_endcap_CLCT0_dTime = 0;
948  getEMUHisto(h::EMU_CSC_ENDCAP_MINUS_CLCT0_DTIME, mo_CSC_Minus_endcap_CLCT0_dTime);
949 
950  MonitorObject* mo_CSC_CLCT0_BXN_mean = 0;
951  getEMUHisto(h::EMU_CSC_CLCT0_BXN_MEAN, mo_CSC_CLCT0_BXN_mean);
952 
953  MonitorObject* mo_CSC_CLCT0_BXN_rms = 0;
954  getEMUHisto(h::EMU_CSC_CLCT0_BXN_RMS, mo_CSC_CLCT0_BXN_rms);
955 
956  for (uint32_t lct = 0; lct < clctsDatas.size(); lct++) {
957 
958  if (getCSCHisto(h::CSC_CLCTXX_BXN, crateID, dmbID, lct, mo)) mo->Fill(clctsDatas[lct].getFullBX()%64);
959 
960  int clct_dtime = clctsDatas[lct].getFullBX() - tmbHeader->BXNCount();
961  if (clct_dtime > 0) {
962  clct_dtime -= 3564;
963  }
964 
965  int dTime = clct_dtime;
966 
967  if (lct == 0) {
968  if (cid.endcap() == 1) {
969  if (mo_CSC_Plus_endcap_CLCT0_dTime) mo_CSC_Plus_endcap_CLCT0_dTime->Fill(dTime);
970  }
971  if (cid.endcap() == 2) {
972  if (mo_CSC_Minus_endcap_CLCT0_dTime) mo_CSC_Minus_endcap_CLCT0_dTime->Fill(dTime);
973  }
974  }
975 
976  if (getCSCHisto(h::CSC_CLCTXX_DTIME, crateID, dmbID, lct, mo)) {
977  /*
978  int dTime = clct_dtime;
979  if (clct_dtime < -16) {
980  dTime = clct_dtime + 32;
981  } else {
982  if (clct_dtime > 16) dTime = clct_dtime - 32;
983  }
984  */
985 
986  mo->Fill(dTime);
987  mo->SetAxisRange(0.1, 1.1 * (1.0 + mo->GetBinContent(mo->GetMaximumBin())), "Y");
988 
989  double dTime_mean = mo->getTH1()->GetMean();
990  double dTime_rms = mo->getTH1()->GetRMS();
991 
992  // == For CLCT0 Fill Summary dTime Histograms
993  if (lct == 0) {
994  /* -- Moved
995  if (cid.endcap() == 1) {
996  if (mo_CSC_Plus_endcap_CLCT0_dTime) mo_CSC_Plus_endcap_CLCT0_dTime->Fill(dTime);
997  }
998  if (cid.endcap() == 2) {
999  if (mo_CSC_Minus_endcap_CLCT0_dTime) mo_CSC_Minus_endcap_CLCT0_dTime->Fill(dTime);
1000  }
1001  */
1002  if (cscPosition && mo_CSC_CLCT0_BXN_mean) {
1003  mo_CSC_CLCT0_BXN_mean->SetBinContent(cscPosition, cscType + 1, dTime_mean);
1004  }
1005  if (cscPosition && mo_CSC_CLCT0_BXN_rms) {
1006  mo_CSC_CLCT0_BXN_rms->SetBinContent(cscPosition, cscType + 1, dTime_rms);
1007  }
1008  }
1009 
1010  }
1011 
1014  LOG_DEBUG << "LCT:" << lct << " Type:" << clctsDatas[lct].getStripType() << " Strip:" << clctsDatas[lct].getKeyStrip();
1015 
1016  if (clctsDatas[lct].getStripType()) { // HalfStrip Type
1017 
1018  if (getCSCHisto(h::CSC_CLCTXX_KEYHALFSTRIP, crateID, dmbID, lct, mo))
1019  mo->Fill(clctsDatas[lct].getKeyStrip());
1020 
1021  if (getCSCHisto(h::CSC_CLCTXX_DTIME_VS_HALF_STRIP, crateID, dmbID, lct, mo)) {
1022  mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime);
1023  /*
1024  if (clct_dtime < -16) {
1025  mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime + 32);
1026  } else {
1027  if (clct_dtime > 16) mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime - 32);
1028  else mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime);
1029  }
1030  */
1031  }
1032 
1033  if (getCSCHisto(h::CSC_CLCTXX_DTIME_PROFILE, crateID, dmbID, lct, mo)) {
1034  mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime);
1035  /*
1036  if (clct_dtime < -16) {
1037  mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime + 32);
1038  } else {
1039  if (clct_dtime > 16) mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime - 32);
1040  else mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime);
1041  }
1042  */
1043  }
1044 
1045  if (getCSCHisto(h::CSC_CLCTXX_HALF_STRIP_PATTERN, crateID, dmbID, lct, mo)) {
1046 
1047  int pattern_clct = clctsDatas[lct].getPattern();
1051  double tbin = -1;
1052 
1053  switch (pattern_clct) {
1054  case 0: tbin=0.; break;
1055  case 1: tbin=1.; break;
1056  case 2: tbin=2.; break;
1057  case 3: tbin=10.; break;
1058  case 4: tbin=3.; break;
1059  case 5: tbin=9.; break;
1060  case 6: tbin=4.; break;
1061  case 7: tbin=8.; break;
1062  case 8: tbin=5.; break;
1063  case 9: tbin=7.; break;
1064  case 10: tbin=6.; break;
1065  }
1066 
1067  if (tbin >= 0) mo->Fill(clctsDatas[lct].getKeyStrip(), tbin);
1068 
1069  MonitorObject* mo1 = 0;
1070  if (getCSCHisto(h::CSC_CLCT_HALF_STRIP_PATTERN_DISTR, crateID, dmbID, lct, mo1)) mo1->Fill(tbin);
1071 
1072  }
1073 
1074  if (getCSCHisto(h::CSC_CLCTXX_HALF_STRIP_QUALITY, crateID, dmbID, lct, mo))
1075  mo->Fill((int)(clctsDatas[lct].getKeyStrip()),(int)(clctsDatas[lct].getQuality()));
1076 
1077  if (mo_EventDisplay) {
1078  mo_EventDisplay->SetBinContent(10, clctsDatas[lct].getKeyStrip(), clct_dtime);
1079  mo_EventDisplay->SetBinContent(11, clctsDatas[lct].getKeyStrip(), clctsDatas[lct].getQuality());
1080  }
1081 
1082  if (getCSCHisto(h::CSC_CLCTXX_HALF_STRIP_QUALITY_DISTR, crateID, dmbID, lct, mo)) {
1083  mo->Fill((int)(clctsDatas[lct].getQuality()));
1084  if (lct == 0) {
1085  MonitorObject* mo1 = 0;
1086  if (cscPosition && getEMUHisto(h::EMU_CSC_CLCT0_QUALITY, mo1)) {
1087  mo1->SetBinContent(cscPosition, cscType + 1, mo->getTH1()->GetMean());
1088  }
1089  }
1090  }
1091 
1092  if (getCSCHisto(h::CSC_CLCTXX_HALF_STRIP_QUALITY_PROFILE, crateID, dmbID, lct, mo))
1093  mo->Fill((int)(clctsDatas[lct].getKeyStrip()), (int)(clctsDatas[lct].getQuality()));
1094 
1095  } else { // DiStrip Type
1096 
1097  LOG_INFO << "Entering block!";
1098 
1099  if (getCSCHisto(h::CSC_CLCTXX_KEYDISTRIP, crateID, dmbID, lct, mo)) mo->Fill(clctsDatas[lct].getKeyStrip());
1100  else LOG_ERROR << "Not found h::CSC_CLCTXX_KEYDISTRIP = " << h::CSC_CLCTXX_KEYDISTRIP;
1101 
1102  if(lct == 0) clct_kewdistrip = clctsDatas[lct].getKeyStrip();
1103 
1104  if (getCSCHisto(h::CSC_CLCTXX_DTIME_VS_DISTRIP, crateID, dmbID, lct, mo)) {
1105  mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime);
1106  /*
1107  if(clct_dtime < -16) mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime + 32);
1108  else {
1109  if(clct_dtime > 16) mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime - 32);
1110  else mo->Fill((int)(clctsDatas[lct].getKeyStrip()), clct_dtime);
1111  }
1112  */
1113  }
1114 
1115  if (getCSCHisto(h::CSC_CLCTXX_DISTRIP_PATTERN, crateID, dmbID, lct, mo)) {
1116  int pattern_clct = (int)((clctsDatas[lct].getPattern() >> 1) & 0x3);
1119  if(pattern_clct == 1) mo->Fill(clctsDatas[lct].getKeyStrip(), 7.0);
1120  if(pattern_clct == 3) mo->Fill(clctsDatas[lct].getKeyStrip(), 6.0);
1121  if(pattern_clct == 5) mo->Fill(clctsDatas[lct].getKeyStrip(), 5.0);
1122  if(pattern_clct == 7) mo->Fill(clctsDatas[lct].getKeyStrip(), 4.0);
1123  if(pattern_clct == 6) mo->Fill(clctsDatas[lct].getKeyStrip(), 3.0);
1124  if(pattern_clct == 4) mo->Fill(clctsDatas[lct].getKeyStrip(), 2.0);
1125  if(pattern_clct == 2) mo->Fill(clctsDatas[lct].getKeyStrip(), 1.0);
1126  if(pattern_clct == 0) mo->Fill(clctsDatas[lct].getKeyStrip(), 0.0);
1127  }
1128 
1129  if (getCSCHisto(h::CSC_CLCTXX_DISTRIP_QUALITY, crateID, dmbID, lct, mo))
1130  mo->Fill((int)(clctsDatas[lct].getKeyStrip()),(int)(clctsDatas[lct].getQuality()));
1131 
1132  if (getCSCHisto(h::CSC_CLCTXX_DISTRIP_QUALITY_PROFILE, crateID, dmbID, lct, mo))
1133  mo->Fill((int)(clctsDatas[lct].getKeyStrip()), (int)(clctsDatas[lct].getQuality()));
1134  }
1135  }
1136 
1137  // int N_CFEBs = 5;
1138  int N_CFEBs=tmbHeader->NCFEBs();
1139 
1140  int NumberOfLayersWithHitsInCLCT = 0;
1141  int NumberOfHalfStripsWithHitsInCLCT = 0;
1142 
1143  if (clctData && clctData->check()) {
1144 
1145  MonitorObject* mo_CFEB_Comparators_TimeSamples = 0;
1146  getCSCHisto(h::CSC_CFEB_COMPARATORS_TIMESAMPLES, crateID, dmbID, mo_CFEB_Comparators_TimeSamples);
1147 
1148  MonitorObject* mo_CSC_Plus_endcap_CFEB_Comparators_Time = 0;
1149  getEMUHisto(h::EMU_CSC_ENDCAP_PLUS_CFEB_COMPARATORS_TIME, mo_CSC_Plus_endcap_CFEB_Comparators_Time);
1150 
1151  MonitorObject* mo_CSC_Minus_endcap_CFEB_Comparators_Time = 0;
1152  getEMUHisto(h::EMU_CSC_ENDCAP_MINUS_CFEB_COMPARATORS_TIME, mo_CSC_Minus_endcap_CFEB_Comparators_Time);
1153 
1154  MonitorObject* mo_CSC_CFEB_Comparators_Time_mean = 0;
1155  getEMUHisto(h::EMU_CSC_CFEB_COMPARATORS_TIME_MEAN, mo_CSC_CFEB_Comparators_Time_mean);
1156 
1157  MonitorObject* mo_CSC_CFEB_Comparators_Time_rms = 0;
1158  getEMUHisto(h::EMU_CSC_CFEB_COMPARATORS_TIME_RMS, mo_CSC_CFEB_Comparators_Time_rms);
1159 
1160  for(int nCFEB = 0; nCFEB < N_CFEBs; ++nCFEB) {
1161  for (int nLayer = 1; nLayer <= 6; nLayer++) {
1162 
1163  int hstrip_previous = -1;
1164  int tbin_clct_previous = -1;
1165  bool CheckLayerCLCT = true;
1166 
1167  std::vector<CSCComparatorDigi> compOutData = clctData->comparatorDigis(nLayer, nCFEB);
1168 
1169  for (std::vector<CSCComparatorDigi>::iterator compOutDataItr = compOutData.begin(); compOutDataItr != compOutData.end(); ++compOutDataItr) {
1171  int hstrip = 2 * (compOutDataItr->getStrip() - 1) + compOutDataItr->getComparator();
1172  std::vector<int> tbins_clct = compOutDataItr->getTimeBinsOn();
1173  int tbin_clct = (int)compOutDataItr->getTimeBin();
1174 
1175  if (mo_EventDisplay) {
1176  mo_EventDisplay->SetBinContent(nLayer + 11, hstrip, tbin_clct + 1);
1177  setEmuEventDisplayBit(mo_Emu_EventDisplay_Anode, glChamberIndex, 160 + hstrip, nLayer - 1);
1178  setEmuEventDisplayBit(mo_Emu_EventDisplay_XY, glChamberIndex, 160 + hstrip, nLayer - 1);
1179  }
1180 
1181  if(CheckLayerCLCT) {
1182  NumberOfLayersWithHitsInCLCT = NumberOfLayersWithHitsInCLCT + 1;
1183  CheckLayerCLCT = false;
1184  }
1185 
1186  for (uint32_t n=0; n < tbins_clct.size(); n++) {
1187  tbin_clct = tbins_clct[n];
1188  if(hstrip != hstrip_previous || (tbin_clct != tbin_clct_previous + 1 && tbin_clct != tbin_clct_previous - 1) ) {
1189 
1190  if (getCSCHisto(h::CSC_CLCTTIME_LYXX, crateID, dmbID, nLayer, mo)) mo->Fill(hstrip, tbin_clct);
1191 
1192  if (mo_CFEB_Comparators_TimeSamples) mo_CFEB_Comparators_TimeSamples->Fill(tbin_clct);
1193 
1194  if (cid.endcap() == 1) {
1195  if (mo_CSC_Plus_endcap_CFEB_Comparators_Time) mo_CSC_Plus_endcap_CFEB_Comparators_Time->Fill(tbin_clct);
1196  }
1197 
1198  if (cid.endcap() == 2) {
1199  if (mo_CSC_Minus_endcap_CFEB_Comparators_Time) mo_CSC_Minus_endcap_CFEB_Comparators_Time->Fill(tbin_clct);
1200  }
1201 
1202  if (getCSCHisto(h::CSC_CLCTTIME_LYXX_PROFILE, crateID, dmbID, nLayer, mo)) mo->Fill(hstrip, tbin_clct);
1203 
1204  if (getCSCHisto(h::CSC_CLCT_LYXX_RATE, crateID, dmbID, nLayer, mo)) {
1205 
1206  mo->Fill(hstrip);
1207 
1208  double number_hstrip = mo->GetBinContent(hstrip+1);
1209  double Number_of_entries_CLCT = mo->GetEntries();
1210 
1211  if (getCSCHisto(h::CSC_CLCT_LYXX_EFFICIENCY, crateID, dmbID, nLayer, mo)) {
1212  mo->SetBinContent(hstrip + 1, number_hstrip);
1213  if(DMBEvents > 0) {
1214  double norm = (100.0 * Number_of_entries_CLCT) / ((double)(DMBEvents));
1216  mo->SetNormFactor(norm);
1217  } else {
1218  mo->SetNormFactor(100.0);
1219  }
1220  mo->SetEntries(DMBEvents);
1221  }
1222  }
1223  }
1224 
1225  if(hstrip != hstrip_previous) {
1226  NumberOfHalfStripsWithHitsInCLCT = NumberOfHalfStripsWithHitsInCLCT + 1;
1227  }
1228  hstrip_previous = hstrip;
1229  tbin_clct_previous = tbin_clct;
1230  }
1231  }
1232  }
1233  }
1234 
1235  if (mo_CFEB_Comparators_TimeSamples) {
1236 
1237  double comps_time_mean = mo_CFEB_Comparators_TimeSamples->getTH1()->GetMean();
1238  double comps_time_rms = mo_CFEB_Comparators_TimeSamples->getTH1()->GetRMS();
1239 
1240  if (cscPosition && mo_CSC_CFEB_Comparators_Time_mean) {
1241  mo_CSC_CFEB_Comparators_Time_mean->SetBinContent(cscPosition, cscType + 1, comps_time_mean);
1242  }
1243  if (cscPosition && mo_CSC_CFEB_Comparators_Time_rms) {
1244  mo_CSC_CFEB_Comparators_Time_rms->SetBinContent(cscPosition, cscType + 1, comps_time_rms);
1245  }
1246 
1247  }
1248 
1249  } else {
1250  LOG_ERROR << cscTag << " Can not unpack CLCT Data";
1251  }
1252 
1253  if (getCSCHisto(h::CSC_CLCT_NUMBER_OF_LAYERS_WITH_HITS, crateID, dmbID, mo)) {
1254  mo->Fill(NumberOfLayersWithHitsInCLCT);
1255  MonitorObject* mo1 = 0;
1256  if (cscPosition && getEMUHisto(h::EMU_CSC_CLCT_PLANES_WITH_HITS, mo1)) {
1257  mo1->SetBinContent(cscPosition, cscType + 1, mo->getTH1()->GetMean());
1258  }
1259  }
1260 
1262  mo->Fill(NumberOfHalfStripsWithHitsInCLCT);
1263  } else {
1264  LOG_ERROR << cscTag << " Can not unpack TMB Header or/and Trailer";
1265  }
1266  } else {
1267  LOG_ERROR << cscTag << " Can not unpack TMB Data";
1268  }
1269 
1270  } else {
1273  if (getCSCHisto(h::CSC_CLCT_NUMBER_RATE, crateID, dmbID, mo)) {
1274  mo->Fill(0);
1275  int nCLCT = (int)mo->GetBinContent(1);
1276  if (getCSCHisto(h::CSC_CLCT_NUMBER, crateID, dmbID, mo)) mo->SetBinContent(1, (float)(nCLCT) / (float)(DMBEvents) * 100.0);
1277  }
1278  if ((tmb_dav > 0) && (getCSCHisto(h::CSC_DMB_FEB_UNPACKED_VS_DAV, crateID, dmbID, mo))) {
1279  mo->Fill(1.0, 1.0);
1280  }
1281  }
1282 
1284  int NumberOfUnpackedCFEBs = 0;
1285  const int N_CFEBs = nCFEBs, N_Samples = 16, N_Layers = 6, N_Strips = 16, nStrips = nCFEBs * N_Strips;
1286  int ADC = 0, OutOffRange, Threshold = 30;
1288 // CSCCFEBData * cfebData[N_CFEBs];
1289 // CSCCFEBTimeSlice * timeSlice[N_CFEBs][16];
1290 // CSCCFEBDataWord * timeSample[N_CFEBs][16][6][16];
1291  int Pedestal[N_CFEBs][6][16]; memset(Pedestal, 0, sizeof(Pedestal));
1292  #ifdef __clang__
1293  std::vector<std::array<std::array<std::pair<int,int>, 6>, 16>> CellPeak(N_CFEBs);
1294  std::fill(CellPeak.begin(), CellPeak.end(), std::array<std::array<std::pair<int,int>, 6>, 16>{});
1295  #else
1296  std::pair<int,int> CellPeak[N_CFEBs][6][16];
1297  memset(CellPeak, 0, sizeof(CellPeak));
1298  #endif
1299 // float PedestalError[N_CFEBs][6][16];
1300 // CSCCFEBSCAControllerWord scaControllerWord[5][16][6];
1301  bool CheckCFEB = true;
1303  float Clus_Sum_Charge;
1304  int TrigTime, L1APhase, UnpackedTrigTime, LCTPhase, SCA_BLK, NmbTimeSamples;
1306  int FreeCells, LCT_Pipe_Empty, LCT_Pipe_Full, LCT_Pipe_Count, L1_Pipe_Empty, L1_Pipe_Full, Buffer_Count;
1309  bool CheckThresholdStripInTheLayer[6][nStrips];
1310  for(int i=0; i<6; i++) {
1311  for(int j = 0; j < nStrips; j++) CheckThresholdStripInTheLayer[i][j] = true;
1312  }
1313 
1314  bool CheckOutOffRangeStripInTheLayer[6][nStrips];
1315  for(int i=0; i<6; i++) {
1316  for(int j=0; j<nStrips; j++) CheckOutOffRangeStripInTheLayer[i][j] = true;
1317  }
1318 
1320  float cscdata[N_CFEBs * 16][N_Samples][N_Layers];
1322  int SCABlockData[N_CFEBs * 16][N_Samples][N_Layers];
1323  memset(cscdata, 0, sizeof(cscdata));
1325  memset(SCABlockData, 0, sizeof(SCABlockData));
1328  char hbuf[255];
1329  memset(hbuf, 0, sizeof(hbuf));
1330 
1331  MonitorObject* mo_CFEB_SCA_CellPeak_Time = 0;
1332  getCSCHisto(h::CSC_CFEB_SCA_CELLPEAK_TIME, crateID, dmbID, mo_CFEB_SCA_CellPeak_Time);
1333 
1334  MonitorObject* mo_CSC_Plus_endcap_CFEB_SCA_CellPeak_Time = 0;
1335  getEMUHisto(h::EMU_CSC_PLUS_ENDCAP_CFEB_SCA_CELLPEAK_TIME, mo_CSC_Plus_endcap_CFEB_SCA_CellPeak_Time);
1336 
1337  MonitorObject* mo_CSC_Minus_endcap_CFEB_SCA_CellPeak_Time = 0;
1338  getEMUHisto(h::EMU_CSC_MINUS_ENDCAP_CFEB_SCA_CELLPEAK_TIME, mo_CSC_Minus_endcap_CFEB_SCA_CellPeak_Time);
1339 
1340  MonitorObject* mo_CSC_CFEB_SCA_CellPeak_Time_mean = 0;
1341  getEMUHisto(h::EMU_CSC_CFEB_SCA_CELLPEAK_TIME_MEAN, mo_CSC_CFEB_SCA_CellPeak_Time_mean);
1342 
1343  MonitorObject* mo_CSC_CFEB_SCA_CellPeak_Time_rms = 0;
1344  getEMUHisto(h::EMU_CSC_CFEB_SCA_CELLPEAK_TIME_RMS, mo_CSC_CFEB_SCA_CellPeak_Time_rms);
1345 
1346  for(int nCFEB = 0; nCFEB < N_CFEBs; ++nCFEB) {
1347 
1348 // cfebData[nCFEB] = data.cfebData(nCFEB);
1349  if (data.cfebData(nCFEB) !=0) {
1350  if (!data.cfebData(nCFEB)->check()) continue;
1351 
1353  FEBunpacked = FEBunpacked +1; // Increment number of unpacked FED
1354  NumberOfUnpackedCFEBs = NumberOfUnpackedCFEBs + 1; // Increment number of unpaked CFEB
1355  cfeb_unpacked = 1;
1356  if(CheckCFEB == true){
1357  if (getCSCHisto(h::CSC_CSC_RATE, crateID, dmbID, mo)) {
1358  mo->Fill(4);
1359  uint32_t CFEBEvent = (uint32_t)mo->GetBinContent(5);
1360  config->setChamberCounterValue(CFEB_TRIGGERS, crateID, dmbID, CFEBEvent);
1361  if (getCSCHisto(h::CSC_CSC_EFFICIENCY, crateID, dmbID, mo)) {
1362  if(config->getNEvents() > 0) {
1363  mo->SetBinContent(3, ((float)CFEBEvent/(float)(DMBEvents)*100.0));
1364  mo->SetEntries((int)DMBEvents);
1365  }
1366  }
1367  }
1368 
1369  if ((cfeb_dav2 > 0) && (getCSCHisto(h::CSC_DMB_FEB_UNPACKED_VS_DAV, crateID, dmbID, mo))) {
1370  mo->Fill(2.0, 0.0);
1371  }
1372  CheckCFEB = false;
1373  }
1375  NmbTimeSamples= (data.cfebData(nCFEB))->nTimeSamples();
1381  MonitorObject* mo_CFEB_SCA_Block_Occupancy = 0;
1382  getCSCHisto(h::CSC_CFEBXX_SCA_BLOCK_OCCUPANCY, crateID, dmbID, nCFEB + 1, mo_CFEB_SCA_Block_Occupancy);
1383  MonitorObject* mo_CFEB_Free_SCA_Cells = 0;
1384  getCSCHisto(h::CSC_CFEBXX_FREE_SCA_CELLS, crateID, dmbID, nCFEB + 1, mo_CFEB_Free_SCA_Cells);
1385  MonitorObject* mo_CFEB_SCA_Blocks_Locked_by_LCTs = 0;
1386  getCSCHisto(h::CSC_CFEBXX_SCA_BLOCKS_LOCKED_BY_LCTS, crateID, dmbID, nCFEB + 1, mo_CFEB_SCA_Blocks_Locked_by_LCTs);
1387  MonitorObject* mo_CFEB_SCA_Blocks_Locked_by_LCTxL1 = 0;
1388  getCSCHisto(h::CSC_CFEBXX_SCA_BLOCKS_LOCKED_BY_LCTXL1, crateID, dmbID, nCFEB + 1, mo_CFEB_SCA_Blocks_Locked_by_LCTxL1);
1389  MonitorObject* mo_CFEB_DMB_L1A_diff = 0;
1390  getCSCHisto(h::CSC_CFEBXX_DMB_L1A_DIFF, crateID, dmbID, nCFEB + 1, mo_CFEB_DMB_L1A_diff);
1391 
1394  for(int nLayer = 1; nLayer <= N_Layers; ++nLayer) {
1396  MonitorObject * mo_CFEB_Out_Off_Range_Strips = 0;
1397  getCSCHisto(h::CSC_CFEB_OUT_OFF_RANGE_STRIPS_LYXX, crateID, dmbID, nLayer, mo_CFEB_Out_Off_Range_Strips);
1398  MonitorObject * mo_CFEB_Active_Samples_vs_Strip = 0;
1399  getCSCHisto(h::CSC_CFEB_ACTIVE_SAMPLES_VS_STRIP_LYXX, crateID, dmbID, nLayer, mo_CFEB_Active_Samples_vs_Strip);
1400  MonitorObject * mo_CFEB_Active_Samples_vs_Strip_Profile = 0;
1401  getCSCHisto(h::CSC_CFEB_ACTIVE_SAMPLES_VS_STRIP_LYXX_PROFILE, crateID, dmbID, nLayer, mo_CFEB_Active_Samples_vs_Strip_Profile);
1402  MonitorObject * mo_CFEB_ActiveStrips = 0;
1403  getCSCHisto(h::CSC_CFEB_ACTIVESTRIPS_LYXX, crateID, dmbID, nLayer, mo_CFEB_ActiveStrips);
1404  MonitorObject * mo_CFEB_SCA_Cell_Peak = 0;
1405  getCSCHisto(h::CSC_CFEB_SCA_CELL_PEAK_LY_XX, crateID, dmbID, nLayer, mo_CFEB_SCA_Cell_Peak);
1406 
1407  MonitorObject * mo_CFEB_Pedestal_withEMV_Sample = 0;
1408  getCSCHisto(h::CSC_CFEB_PEDESTAL_WITHEMV_SAMPLE_01_LYXX, crateID, dmbID, nLayer, mo_CFEB_Pedestal_withEMV_Sample);
1409  MonitorObject * mo_CFEB_Pedestal_withRMS_Sample = 0;
1410  getCSCHisto(h::CSC_CFEB_PEDESTAL_WITHRMS_SAMPLE_01_LYXX, crateID, dmbID, nLayer, mo_CFEB_Pedestal_withRMS_Sample);
1411  MonitorObject * mo_CFEB_PedestalRMS_Sample = 0;
1412  getCSCHisto(h::CSC_CFEB_PEDESTALRMS_SAMPLE_01_LYXX, crateID, dmbID, nLayer, mo_CFEB_PedestalRMS_Sample);
1413 
1414  for(int nSample = 0; nSample < NmbTimeSamples; ++nSample) {
1415 // timeSlice[nCFEB][nSample] = (CSCCFEBTimeSlice * )((cfebData[nCFEB])->timeSlice(nSample));
1416  if (timeSlice(data, nCFEB, nSample) == 0) {
1417  LOG_WARN << "CFEB" << nCFEB << " nSample: " << nSample << " - B-Word";
1418  continue;
1419  }
1420 
1421  if (mo_CFEB_DMB_L1A_diff && !fCloseL1As ) {
1423  int cfeb_dmb_l1a_diff = (int)((timeSlice(data, nCFEB, nSample)->get_L1A_number())-dmbHeader->l1a24()%64);
1424  if (cfeb_dmb_l1a_diff != 0) {
1425  L1A_out_of_sync = true;
1426  }
1427  if(cfeb_dmb_l1a_diff < -32) mo->Fill(cfeb_dmb_l1a_diff + 64);
1428  else {
1429  if(cfeb_dmb_l1a_diff >= 32) mo->Fill(cfeb_dmb_l1a_diff - 64);
1430  else mo_CFEB_DMB_L1A_diff->Fill(cfeb_dmb_l1a_diff);
1431  }
1432  mo_CFEB_DMB_L1A_diff->SetAxisRange(0.1, 1.1*(1.0+mo_CFEB_DMB_L1A_diff->GetBinContent(mo_CFEB_DMB_L1A_diff->GetMaximumBin())), "Y");
1433  }
1434 
1437 // scaControllerWord[nCFEB][nSample][nLayer-1] = timeSlice(cfebData, nCFEB, nSample)->scaControllerWord(nLayer);
1438 
1439  TrigTime = (int)(timeSlice(data, nCFEB, nSample)->scaControllerWord(nLayer).trig_time);
1441  FreeCells = timeSlice(data, nCFEB, nSample)->get_n_free_sca_blocks();
1442  LCT_Pipe_Empty = timeSlice(data, nCFEB, nSample)->get_lctpipe_empty();
1443  LCT_Pipe_Full = timeSlice(data, nCFEB, nSample)->get_lctpipe_full();
1444  LCT_Pipe_Count = timeSlice(data, nCFEB, nSample)->get_lctpipe_count();
1445  L1_Pipe_Empty = timeSlice(data, nCFEB, nSample)->get_l1pipe_empty();
1446  L1_Pipe_Full = timeSlice(data, nCFEB, nSample)->get_l1pipe_full();
1448  Buffer_Count = timeSlice(data, nCFEB, nSample)->get_buffer_count();
1449 
1450  SCA_BLK = (int)(timeSlice(data, nCFEB, nSample)->scaControllerWord(nLayer).sca_blk);
1454  for(int nStrip = 0; nStrip < N_Strips; ++nStrip) {
1455  SCABlockData[nCFEB*16+nStrip][nSample][nLayer-1] = SCA_BLK;
1457  }
1462  if (mo_CFEB_SCA_Block_Occupancy) mo_CFEB_SCA_Block_Occupancy->Fill(SCA_BLK);
1463 
1466  if (mo_CFEB_Free_SCA_Cells) {
1467  if (timeSlice(data, nCFEB, nSample)->scaControllerWord(nLayer).sca_full == 1) mo_CFEB_Free_SCA_Cells->Fill(-1);
1468  mo_CFEB_Free_SCA_Cells->Fill(FreeCells);
1469  }
1470 
1473  if (mo_CFEB_SCA_Blocks_Locked_by_LCTs) {
1474  if (LCT_Pipe_Empty == 1) mo_CFEB_SCA_Blocks_Locked_by_LCTs->Fill(-0.5);
1475  if (LCT_Pipe_Full == 1) mo_CFEB_SCA_Blocks_Locked_by_LCTs->Fill(16.5);
1476  mo_CFEB_SCA_Blocks_Locked_by_LCTs->Fill(LCT_Pipe_Count);
1477  }
1478 
1481  if (mo_CFEB_SCA_Blocks_Locked_by_LCTxL1) {
1482  if (L1_Pipe_Empty == 1) mo_CFEB_SCA_Blocks_Locked_by_LCTxL1->Fill(-0.5);
1483  if (L1_Pipe_Full == 1) mo_CFEB_SCA_Blocks_Locked_by_LCTxL1->Fill(31.5);
1484  mo_CFEB_SCA_Blocks_Locked_by_LCTxL1->Fill(Buffer_Count);
1485  }
1486 
1489  if(nSample == 0 && nLayer == 1) {
1490  TrigTime = (int)(timeSlice(data, nCFEB, nSample)->scaControllerWord(nLayer).trig_time);
1491  int k = 1;
1492  while (((TrigTime >> (k-1)) & 0x1) != 1 && k <= 8) {
1493  k = k + 1;
1494  }
1495  L1APhase = (int)((timeSlice(data, nCFEB, nSample)->scaControllerWord(nLayer).l1a_phase) & 0x1);
1496  UnpackedTrigTime = ((k << 1) & 0xE) + L1APhase;
1497 
1498  if (getCSCHisto(h::CSC_CFEBXX_L1A_SYNC_TIME, crateID, dmbID, nCFEB + 1, mo))
1499  mo->Fill((int)UnpackedTrigTime);
1500  LCTPhase = (int)((timeSlice(data, nCFEB, nSample)->scaControllerWord(nLayer).lct_phase)&0x1);
1501 
1502  if (getCSCHisto(h::CSC_CFEBXX_LCT_PHASE_VS_L1A_PHASE, crateID, dmbID, nCFEB + 1, mo))
1503  mo->Fill(LCTPhase, L1APhase);
1504 
1507  if (getCSCHisto(h::CSC_CFEBXX_L1A_SYNC_TIME_VS_DMB, crateID, dmbID, nCFEB + 1, mo))
1508  mo->Fill((int)(dmbHeader->dmbCfebSync()), (int)UnpackedTrigTime);
1509 
1510  if (getCSCHisto(h::CSC_CFEBXX_L1A_SYNC_TIME_DMB_DIFF, crateID, dmbID, nCFEB + 1, mo)) {
1511  int cfeb_dmb_L1A_sync_time = (int)(dmbHeader->dmbCfebSync()) - (int)UnpackedTrigTime;
1512  if(cfeb_dmb_L1A_sync_time < -8) mo->Fill(cfeb_dmb_L1A_sync_time+16);
1513  else {
1514  if(cfeb_dmb_L1A_sync_time >= 8) mo->Fill(cfeb_dmb_L1A_sync_time-16);
1515  else mo->Fill(cfeb_dmb_L1A_sync_time);
1516  }
1517  mo->SetAxisRange(0.1, 1.1*(1.0+mo->GetBinContent(mo->GetMaximumBin())), "Y");
1518  }
1519 
1520  }
1521 
1522 
1523  for(int nStrip = 1; nStrip <= N_Strips; ++nStrip) {
1524 // timeSample[nCFEB][nSample][nLayer - 1][nStrip - 1]=(data.cfebData(nCFEB)->timeSlice(nSample))->timeSample(nLayer,nStrip,data.cfebData(nCFEB)->isDCFEB());
1525  ADC = (int) ((timeSample(data, nCFEB, nSample, nLayer, nStrip)->adcCounts) & 0xFFF);
1527  OutOffRange = (int) ((timeSample(data, nCFEB, nSample, nLayer, nStrip)->adcOverflow) & 0x1);
1528 
1529  if(nSample == 0) { // nSample == 0
1530  CellPeak[nCFEB][nLayer-1][nStrip-1] = std::make_pair(nSample,ADC);
1531  Pedestal[nCFEB][nLayer-1][nStrip-1] = ADC;
1533  }
1534 
1535  if(OutOffRange == 1 && CheckOutOffRangeStripInTheLayer[nLayer - 1][nCFEB * 16 + nStrip - 1] == true) {
1537  if ( mo_CFEB_Out_Off_Range_Strips)
1538  mo_CFEB_Out_Off_Range_Strips->Fill((int)(nCFEB * 16 + nStrip - 1));
1539  CheckOutOffRangeStripInTheLayer[nLayer - 1][nCFEB * 16 + nStrip - 1] = false;
1540  }
1541  if(ADC - Pedestal[nCFEB][nLayer - 1][nStrip - 1] > Threshold && OutOffRange != 1) {
1543  if (mo_CFEB_Active_Samples_vs_Strip)
1544  mo_CFEB_Active_Samples_vs_Strip->Fill((int)(nCFEB * 16 + nStrip - 1), nSample);
1545 
1547  if (mo_CFEB_Active_Samples_vs_Strip_Profile)
1548  mo_CFEB_Active_Samples_vs_Strip_Profile->Fill((int)(nCFEB * 16 + nStrip - 1), nSample);
1549 
1550  if(CheckThresholdStripInTheLayer[nLayer - 1][nCFEB * 16 + nStrip - 1] == true) {
1552  if (mo_CFEB_ActiveStrips)
1553  mo_CFEB_ActiveStrips->Fill((int)(nCFEB * 16 + nStrip));
1554  CheckThresholdStripInTheLayer[nLayer - 1][nCFEB * 16 + nStrip - 1] = false;
1555  }
1557  if(ADC - Pedestal[nCFEB][nLayer - 1][nStrip - 1] > Threshold) {
1559  cscdata[nCFEB * 16 + nStrip - 1][nSample][nLayer - 1] = ADC - Pedestal[nCFEB][nLayer - 1][nStrip - 1];
1560  }
1562  if(ADC > CellPeak[nCFEB][nLayer - 1][nStrip - 1].second) {
1563  CellPeak[nCFEB][nLayer - 1][nStrip - 1].first = nSample;
1564  CellPeak[nCFEB][nLayer - 1][nStrip - 1].second = ADC;
1565  }
1566  }
1569  if(nSample == 1) {
1570  int channel_threshold = 40;
1571  if (std::abs(ADC - Pedestal[nCFEB][nLayer - 1][nStrip - 1]) < channel_threshold) {
1573  if (mo_CFEB_Pedestal_withEMV_Sample)
1574  mo_CFEB_Pedestal_withEMV_Sample->Fill((int)(nCFEB * 16 + nStrip - 1), Pedestal[nCFEB][nLayer - 1][nStrip - 1]);
1575 
1577  if (mo_CFEB_Pedestal_withRMS_Sample) {
1578  mo_CFEB_Pedestal_withRMS_Sample->Fill((int)(nCFEB * 16 + nStrip - 1), Pedestal[nCFEB][nLayer - 1][nStrip - 1]);
1579 // PedestalError[nCFEB][nLayer - 1][nStrip - 1] = mo_CFEB_Pedestal_withRMS_Sample->GetBinError(nCFEB * 16 + nStrip);
1580 
1582  if (mo_CFEB_PedestalRMS_Sample) {
1583  mo_CFEB_PedestalRMS_Sample->SetBinContent(nCFEB * 16 + nStrip - 1, mo_CFEB_Pedestal_withRMS_Sample->GetBinError(nCFEB * 16 + nStrip));
1584  mo_CFEB_PedestalRMS_Sample->SetBinError(nCFEB * 16 + nStrip - 1, 0.00000000001);
1585  }
1586  }
1587  }
1588  Pedestal[nCFEB][nLayer-1][nStrip-1] += ADC;
1589  Pedestal[nCFEB][nLayer-1][nStrip-1] /= 2;
1590  }
1592  }
1593  }
1594 
1595  for(int nStrip = 1; nStrip <= N_Strips; ++nStrip) {
1596  if (mo_CFEB_SCA_Cell_Peak && CellPeak[nCFEB][nLayer - 1][nStrip - 1].first) {
1597  mo_CFEB_SCA_Cell_Peak->Fill((int)(nCFEB * 16 + nStrip - 1), CellPeak[nCFEB][nLayer - 1][nStrip - 1].first);
1598  if (mo_CFEB_SCA_CellPeak_Time) {
1599  mo_CFEB_SCA_CellPeak_Time->Fill(CellPeak[nCFEB][nLayer - 1][nStrip - 1].first);
1600  }
1601 
1602  if (mo_EventDisplay) {
1603  int peak_sample = CellPeak[nCFEB][nLayer-1][nStrip-1].first;
1604  int peak_adc = CellPeak[nCFEB][nLayer-1][nStrip-1].second;
1605  int pedestal = Pedestal[nCFEB][nLayer-1][nStrip-1];
1606  int peak_sca_charge = peak_adc - pedestal;
1607 
1608  if (peak_adc - pedestal > Threshold) {
1609  if (peak_sample >=1) {
1610  peak_sca_charge += ((timeSample(data, nCFEB, peak_sample-1, nLayer, nStrip)->adcCounts)&0xFFF)-pedestal;
1611  }
1612  if (peak_sample < NmbTimeSamples-1) {
1613  peak_sca_charge += ((timeSample(data, nCFEB, peak_sample+1, nLayer, nStrip)->adcCounts)&0xFFF)-pedestal;
1614  }
1615  mo_EventDisplay->SetBinContent(nLayer + 17, nCFEB * 16 + nStrip - 1, peak_sca_charge);
1616  setEmuEventDisplayBit(mo_Emu_EventDisplay_Cathode, glChamberIndex, nCFEB * 16 + nStrip - 1, nLayer - 1);
1617  }
1618  }
1619 
1620  if (cid.endcap() == 1) {
1621  if (mo_CSC_Plus_endcap_CFEB_SCA_CellPeak_Time)
1622  mo_CSC_Plus_endcap_CFEB_SCA_CellPeak_Time->Fill(CellPeak[nCFEB][nLayer - 1][nStrip - 1].first);
1623  }
1624  if (cid.endcap() == 2) {
1625  if (mo_CSC_Minus_endcap_CFEB_SCA_CellPeak_Time)
1626  mo_CSC_Minus_endcap_CFEB_SCA_CellPeak_Time->Fill(CellPeak[nCFEB][nLayer - 1][nStrip - 1].first);
1627  }
1628  }
1629  }
1630 
1631  }
1632  }
1633 
1634  }
1635 
1636  // Fill Summary CFEB Raw Hits Timing Plots
1637  if (mo_CFEB_SCA_CellPeak_Time) {
1638  double cellpeak_time_mean = mo_CFEB_SCA_CellPeak_Time->getTH1()->GetMean();
1639  double cellpeak_time_rms = mo_CFEB_SCA_CellPeak_Time->getTH1()->GetRMS();
1640  if (cscPosition && mo_CSC_CFEB_SCA_CellPeak_Time_mean) {
1641  mo_CSC_CFEB_SCA_CellPeak_Time_mean->SetBinContent(cscPosition, cscType + 1, cellpeak_time_mean);
1642  }
1643  if (cscPosition && mo_CSC_CFEB_SCA_CellPeak_Time_rms) {
1644  mo_CSC_CFEB_SCA_CellPeak_Time_rms->SetBinContent(cscPosition, cscType + 1 ,cellpeak_time_rms);
1645  }
1646  }
1647 
1650  const int a = N_CFEBs * N_Strips;
1651  const int b = a * N_Samples;
1652  float Cathodes[b * N_Layers];
1653  for(int i = 0; i < N_Layers; ++i) {
1654  const int b1 = i * b;
1655  for(int j = 0; j < a; ++j) {
1656  const int b2 = b1 + j;
1657  for(int k = 0; k < N_Samples; ++k) {
1658  Cathodes[b2 + a * k] = cscdata[j][k][i];
1659  }
1660  }
1661  }
1662 
1663  std::vector<StripCluster> Clus;
1664  Clus.clear();
1665  StripClusterFinder ClusterFinder(N_Layers, N_Samples, N_CFEBs, N_Strips);
1666 
1667  for(int nLayer = 1; nLayer <= N_Layers; ++nLayer) {
1668 
1671  ClusterFinder.DoAction(nLayer - 1, Cathodes);
1672  Clus = ClusterFinder.getClusters();
1673 
1676  if (getCSCHisto(h::CSC_CFEB_NUMBER_OF_CLUSTERS_LY_XX, crateID, dmbID, nLayer, mo)) {
1677  // Allways true because Clus.size() = unsigned
1678  // if (Clus.size() >= 0)
1679  mo->Fill(Clus.size());
1680  }
1681 
1682  for(uint32_t u = 0; u < Clus.size(); u++){
1683 
1684  Clus_Sum_Charge = 0.0;
1685 
1686  for(uint32_t k = 0;k < Clus[u].ClusterPulseMapHeight.size(); k++) {
1687 
1690  for(int n = Clus[u].LFTBNDTime; n < Clus[u].IRTBNDTime; n++) {
1691  Clus_Sum_Charge = Clus_Sum_Charge + Clus[u].ClusterPulseMapHeight[k].height_[n];
1692  }
1693 
1694  }
1695 
1697  if (getCSCHisto(h::CSC_CFEB_CLUSTERS_CHARGE_LY_XX, crateID, dmbID, nLayer, mo)) {
1698  mo->Fill(Clus_Sum_Charge);
1699  }
1700 
1702  if (getCSCHisto(h::CSC_CFEB_WIDTH_OF_CLUSTERS_LY_XX, crateID, dmbID, nLayer, mo)) {
1703  mo->Fill(Clus[u].IRTBNDStrip - Clus[u].LFTBNDStrip + 1);
1704  }
1705 
1707  if (getCSCHisto(h::CSC_CFEB_CLUSTER_DURATION_LY_XX, crateID, dmbID, nLayer, mo)) {
1708  mo->Fill(Clus[u].IRTBNDTime - Clus[u].LFTBNDTime + 1);
1709  }
1710 
1711  }
1712 
1713  Clus.clear();
1714 
1716  }
1717 
1721  if (getCSCHisto(h::CSC_DMB_FEB_COMBINATIONS_UNPACKED_VS_DAV, crateID, dmbID, mo)) {
1722  float feb_combination_unpacked = -1.0;
1723  if(alct_unpacked == 0 && tmb_unpacked == 0 && cfeb_unpacked == 0) feb_combination_unpacked = 0.0;
1724  if(alct_unpacked > 0 && tmb_unpacked == 0 && cfeb_unpacked == 0) feb_combination_unpacked = 1.0;
1725  if(alct_unpacked == 0 && tmb_unpacked > 0 && cfeb_unpacked == 0) feb_combination_unpacked = 2.0;
1726  if(alct_unpacked == 0 && tmb_unpacked == 0 && cfeb_unpacked > 0) feb_combination_unpacked = 3.0;
1727  if(alct_unpacked > 0 && tmb_unpacked > 0 && cfeb_unpacked == 0) feb_combination_unpacked = 4.0;
1728  if(alct_unpacked > 0 && tmb_unpacked == 0 && cfeb_unpacked > 0) feb_combination_unpacked = 5.0;
1729  if(alct_unpacked == 0 && tmb_unpacked > 0 && cfeb_unpacked > 0) feb_combination_unpacked = 6.0;
1730  if(alct_unpacked > 0 && tmb_unpacked > 0 && cfeb_unpacked > 0) feb_combination_unpacked = 7.0;
1731  mo->Fill(feb_combination_dav, feb_combination_unpacked);
1732  }
1733 
1734  if((clct_kewdistrip > -1 && alct_keywg > -1) && (getCSCHisto(h::CSC_CLCT0_KEYDISTRIP_VS_ALCT0_KEYWIREGROUP, crateID, dmbID, mo))) {
1735  mo->Fill(alct_keywg, clct_kewdistrip);
1736  }
1737 
1738  if (L1A_out_of_sync && cscPosition && getEMUHisto(h::EMU_CSC_L1A_OUT_OF_SYNC, mo)){
1739  mo->Fill(cscPosition, cscType);
1740  }
1741 
1742  if (L1A_out_of_sync && getEMUHisto(h::EMU_DMB_L1A_OUT_OF_SYNC, mo)){
1743  mo->Fill(crateID, dmbID);
1744  }
1745 
1746  }
uint16_t BXNCount() const
Definition: CSCTMBHeader.h:42
unsigned tmb_half() const
Definition: CSCDMBTrailer.h:56
CSCTMBTrailer * tmbTrailer()
Definition: CSCTMBData.h:53
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 i
Definition: DBlmapReader.cc:9
int wordCount() const
int nclct() const
the number of CLCTs
Definition: CSCEventData.h:93
string fill
Definition: lumiContext.py:319
unsigned cfeb_empty() const
Definition: CSCDMBTrailer.h:53
unsigned l1a24() const
Definition: CSCDMBHeader.h:51
const unsigned long getNEvents() const
unsigned nclct() const
Definition: CSCDMBHeader.h:54
unsigned alct_full() const
Definition: CSCDMBTrailer.h:59
#define LOG_INFO
Definition: CSCDQM_Logger.h:43
bool isChamberStandby(unsigned int side, unsigned int station, unsigned int ring, unsigned int chamber) const
Check if chamber is in standby?
unsigned short adcOverflow
unsigned tmb_empty() const
Definition: CSCDMBTrailer.h:52
unsigned cfebActive() const
Definition: CSCDMBHeader.h:45
unsigned cfeb_endtimeout() const
Definition: CSCDMBTrailer.h:42
const CSCDMBTrailer * dmbTrailer() const
DMB trailer.
Definition: CSCEventData.h:118
uint16_t CLCTOnly() const
Definition: CSCTMBHeader.h:48
uint16_t L1ANumber() const
Definition: CSCTMBHeader.h:65
unsigned get_l1pipe_full() const
uint16_t Bxn1Diff() const
Definition: CSCTMBHeader.h:61
ExaminerStatusType errorsForChamber(CSCIdType chamber) const
unsigned nalct() const
Definition: CSCDMBHeader.h:53
#define NULL
Definition: scimark2.h:8
const std::string getPath() const
Get path part of the histogram (used only for DDUs and CSCs)
unsigned cfebMovlp() const
Definition: CSCDMBHeader.h:55
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...
CSCAnodeData * alctData() const
user must check if nalct &gt; 0
CSCALCTHeader * alctHeader() const
user must check if nalct &gt; 0
bool check() const
makes sure each time slice has a trailer
Definition: CSCCFEBData.cc:321
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:90
int wordCount() const
uint16_t NCFEBs() const
Definition: CSCTMBHeader.h:82
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
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
int endcap() const
Definition: CSCDetId.h:93
U second(std::pair< T, U > const &p)
uint16_t getFormatVersion() const
Definition: CSCEventData.h:143
CSCCLCTData * clctData() const
user must check if nclct &gt; 0
CSCALCTTrailer * alctTrailer() const
user must check if nalct &gt; 0
unsigned cfeb_starttimeout() const
Definition: CSCDMBTrailer.h:46
unsigned get_lctpipe_empty() const
unsigned tmb_starttimeout() const
Definition: CSCDMBTrailer.h:45
CSCTMBData * tmbData() const
user must check in nclct &gt; 0
uint16_t ALCTOnly() const
Definition: CSCTMBHeader.h:51
boost::function< bool(const unsigned int, const unsigned int, CSCDetId &) > fnGetCSCDetId
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
unsigned alct_starttimeout() const
Definition: CSCDMBTrailer.h:44
int j
Definition: DBlmapReader.cc:9
uint16_t Bxn0Diff() const
Definition: CSCTMBHeader.h:58
unsigned tmb_full() const
Definition: CSCDMBTrailer.h:60
CSCDetId chamberID(const CSCDetId &cscDetId)
takes layer ID, converts to chamber ID, switching ME1A to ME11
Definition: CSCDigiToRaw.cc:31
void setChamberCounterValue(const ChamberCounterType counter, const HwId crateId, const HwId dmbId, const uint32_t value)
Set Chamber counter value.
const Detector getDetector() const
unsigned bxn12() const
Definition: CSCDMBHeader.h:49
unsigned alct_half() const
Definition: CSCDMBTrailer.h:55
uint16_t ALCTMatchTime() const
Definition: CSCTMBHeader.h:45
std::vector< CSCComparatorDigi > comparatorDigis(int layer)
layers count from one
Definition: CSCCLCTData.cc:206
unsigned get_n_free_sca_blocks() const
unsigned cfeb_half() const
Definition: CSCDMBTrailer.h:57
unsigned get_l1pipe_empty() const
std::vector< CSCALCTDigi > ALCTDigis() const
int ring() const
Definition: CSCDetId.h:75
unsigned cfeb_full() const
Definition: CSCDMBTrailer.h:61
unsigned crateID() const
Definition: CSCDMBHeader.h:46
std::vector< CSCCLCTDigi > CLCTDigis(uint32_t idlayer)
returns CLCT digis
Definition: CSCTMBHeader.h:98
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:24
double b
Definition: hdecay.h:120
bool check() const
Definition: CSCCLCTData.cc:359
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:42
unsigned dmbID() const
Definition: CSCDMBHeader.h:47
CSCTMBHeader * tmbHeader()
Definition: CSCTMBData.h:42
uint16_t TMBMatch() const
Definition: CSCTMBHeader.h:54
CSCCFEBDataWord const *const timeSample(T const &data, int nCFEB, int nSample, int nLayer, int nStrip)
double a
Definition: hdecay.h:121
CSCCFEBData * cfebData(unsigned icfeb) const
unpacked in long mode: has overflow and error bits decoded
bool fCloseL1As
Data Format version (2005, 2013)
unsigned tmb_endtimeout() const
Definition: CSCDMBTrailer.h:41
int station() const
Definition: CSCDetId.h:86
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 adcCounts
struct ADC ADC
unsigned alct_endtimeout() const
Definition: CSCDMBTrailer.h:40
const bool getEMUHisto(const HistoId &histo, MonitorObject *&me)
Get EMU (Top Level) Monitoring Object.
unsigned short int BXNCount() const
Definition: CSCALCTHeader.h:61
unsigned alct_empty() const
Definition: CSCDMBTrailer.h:51
const CSCDMBHeader * dmbHeader() const
the DAQ motherboard header. A good place for event and chamber info
Definition: CSCEventData.h:96
unsigned dmbCfebSync() const
Definition: CSCDMBHeader.h:56
unsigned get_lctpipe_count() const
bool cfebAvailable(unsigned icfeb)
Definition: CSCDMBHeader.h:29
#define LOG_ERROR
Definition: CSCDQM_Logger.h:41
unsigned dmb_l1pipe() const
Definition: CSCDMBTrailer.h:49
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 (ddu_output_path_status) { mo->Fill(dduID,1); // Any Error for (int i=0; i<16; i++) {

{
  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 28 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(), 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().

29 {
30 
31  CSCDDUHeader dduHeader = dduData.header();
32  CSCDDUTrailer dduTrailer = dduData.trailer();
33  if (!dduTrailer.check())
34  {
36  return;
37  }
38 
39  int dduID = dduHeader.source_id();
40 
41  if ( (dduID >= FEDNumbering::MINCSCDDUFEDID) && (dduID <= FEDNumbering::MAXCSCDDUFEDID) )
42  {
43  // dduID -= (FEDNumbering::MINCSCDDUFEDID - 1); /// TODO: Can require DDU-RUI remapping for actual system
44  dduID = cscdqm::Utility::getRUIfromDDUId(dduHeader.source_id());
45  if (dduID < 0)
46  {
47  LOG_WARN << "DDU source ID (" << dduHeader.source_id() << ") is out of valid range. Remapping to DDU ID 1.";
48  dduID = 1;
49  }
50  }
51  else
52  {
53 
55  dduID = dduID & 0xFF;
56  }
57 
58 
59  MonitorObject* mo = 0;
60 
62  {
63  mo->Fill(dduID);
64  }
65 
66  std::string dduTag = DDUHistoDef::getPath(dduID);
67 
68  uint32_t dduEvtSize = dduData.sizeInWords()*2;
69 
70  // if (dduEvtSize > 48)
71  {
72 
74  int trl_word_count = 0;
75  trl_word_count = dduTrailer.wordcount();
76 
77  if (getDDUHisto(h::DDU_BUFFER_SIZE, dduID, mo)) mo->Fill(dduEvtSize);
78 
79  if (getDDUHisto(h::DDU_WORD_COUNT, dduID, mo)) mo->Fill(trl_word_count );
80 
83  if (trl_word_count > 0)
84  {
86  {
87  mo->Fill(dduID, log10((double)trl_word_count));
88  }
89  }
90 
92  {
93  mo->Fill(dduID, trl_word_count);
94  }
95 
96  }
97 
98  fCloseL1As = dduTrailer.reserved() & 0x1; // Get status if Close L1As bit
102  BXN = dduHeader.bxnum();
104  if (getEMUHisto(h::EMU_DDU_BXN, mo)) mo->Fill(BXN);
105  if (getDDUHisto(h::DDU_BXN, dduID, mo)) mo->Fill(BXN);
106 
108  int L1ANumber_previous_event = L1ANumbers[dduID];
109  L1ANumbers[dduID] = (int)(dduHeader.lvl1num());
110  L1ANumber = L1ANumbers[dduID];
112  int L1A_inc = L1ANumber - L1ANumber_previous_event;
113 
115  if ( L1A_inc < 0 ) L1A_inc = 0xFFFFFF + L1A_inc;
116 
117  // if (!fFirstEvent) {
118  if (fNotFirstEvent[dduID])
119  {
120  if (getDDUHisto(h::DDU_L1A_INCREMENT, dduID, mo)) mo->Fill(L1A_inc);
122  {
123  if (L1A_inc > 100000)
124  {
125  L1A_inc = 19;
126  }
127  else if (L1A_inc > 30000)
128  {
129  L1A_inc = 18;
130  }
131  else if (L1A_inc > 10000)
132  {
133  L1A_inc = 17;
134  }
135  else if (L1A_inc > 3000)
136  {
137  L1A_inc = 16;
138  }
139  else if (L1A_inc > 1000)
140  {
141  L1A_inc = 15;
142  }
143  else if (L1A_inc > 300)
144  {
145  L1A_inc = 14;
146  }
147  else if (L1A_inc > 100)
148  {
149  L1A_inc = 13;
150  }
151  else if (L1A_inc > 30)
152  {
153  L1A_inc = 12;
154  }
155  else if (L1A_inc > 10)
156  {
157  L1A_inc = 11;
158  }
159  mo->Fill(dduID, L1A_inc);
160  }
161  }
162 
164  int dmb_dav_header = 0;
165  int dmb_dav_header_cnt = 0;
166 
167  int ddu_connected_inputs= 0;
168  int ddu_connected_inputs_cnt = 0;
169 
170  int csc_error_state = 0;
171  int csc_warning_state = 0;
172 
174  int dmb_active_header = 0;
175 
176  dmb_dav_header = dduHeader.dmb_dav();
177  dmb_active_header = (int)(dduHeader.ncsc() & 0xF);
178  csc_error_state = dduTrailer.dmb_full() & 0x7FFF; // Only 15 inputs for DDU
179  csc_warning_state = dduTrailer.dmb_warn() & 0x7FFF; // Only 15 inputs for DDU
180  ddu_connected_inputs = dduHeader.live_cscs();
181 
185  double freq = 0;
186  for (int i = 0;
187  i < 15;
188  ++i)
189  {
190  if ((dmb_dav_header >> i) & 0x1)
191  {
192  dmb_dav_header_cnt++;
194  {
195  mo->Fill(i + 1);
196  freq = (100.0 * mo->GetBinContent(i + 1)) / config->getNEvents();
198  mo->SetBinContent(i+1,freq);
199  }
201  {
202  mo->Fill(dduID, i);
203  }
204  }
205 
206  if ( (ddu_connected_inputs >> i) & 0x1 )
207  {
208  ddu_connected_inputs_cnt++;
210  {
211  mo->Fill(i + 1);
212  freq = (100.0 * mo->GetBinContent(i + 1)) / config->getNEvents();
214  mo->SetBinContent(i + 1, freq);
215  }
217  {
218  mo->Fill(dduID, i);
219  }
220  }
221 
222  if ( (csc_error_state >> i) & 0x1 )
223  {
224  if (getDDUHisto(h::DDU_CSC_ERRORS_RATE, dduID, mo))
225  {
226  mo->Fill(i + 1);
227  freq = (100.0 * mo->GetBinContent(i + 1)) / config->getNEvents();
228  if (getDDUHisto(h::DDU_CSC_ERRORS, dduID, mo))
229  mo->SetBinContent(i + 1, freq);
230  }
232  {
233  mo->Fill(dduID, i + 2);
234  }
235  }
236 
237  if ((csc_warning_state >> i) & 0x1 )
238  {
239  if (getDDUHisto(h::DDU_CSC_WARNINGS_RATE, dduID, mo))
240  {
241  mo->Fill(i + 1);
242  freq = (100.0 * mo->GetBinContent(i + 1)) / config->getNEvents();
243  if (getDDUHisto(h::DDU_CSC_WARNINGS, dduID, mo)) mo->SetBinContent(i + 1, freq);
244  }
246  {
247  mo->Fill(dduID, i + 2);
248  }
249  }
250  }
251 
253  {
254  mo->Fill(dduID, ddu_connected_inputs_cnt);
255  }
256 
257  // if (dduEvtSize > 48)
258  {
260  {
261  mo->Fill(dduID, dmb_dav_header_cnt);
262  }
263  }
264 
266  {
267  if (csc_error_state > 0)
268  {
269  mo->Fill(dduID, 1); // Any Input
270  }
271  else
272  {
273  mo->Fill(dduID, 0); // No errors
274  }
275  }
276 
278  {
279  if (csc_warning_state > 0)
280  {
281  mo->Fill(dduID, 1); // Any Input
282  }
283  else
284  {
285  mo->Fill(dduID, 0); // No errors
286  }
287  }
288 
289  if (getDDUHisto(h::DDU_DMB_DAV_HEADER_OCCUPANCY, dduID, mo)) mo->SetEntries(config->getNEvents());
290  if (getDDUHisto(h::DDU_DMB_CONNECTED_INPUTS, dduID, mo)) mo->SetEntries(config->getNEvents());
291  if (getDDUHisto(h::DDU_CSC_ERRORS, dduID, mo)) mo->SetEntries(config->getNEvents());
292  if (getDDUHisto(h::DDU_CSC_WARNINGS, dduID, mo)) mo->SetEntries(config->getNEvents());
293  if (getDDUHisto(h::DDU_DMB_ACTIVE_HEADER_COUNT, dduID, mo)) mo->Fill(dmb_active_header);
295  mo->Fill(dmb_active_header, dmb_dav_header_cnt);
296 
298  uint32_t trl_errorstat = dduTrailer.errorstat();
299  if (dmb_dav_header_cnt == 0) trl_errorstat &= ~0x20000000; // Ignore No Good DMB CRC bit of no DMB is present
301  for (int i = 0; i < 32; i++)
302  {
303  if ((trl_errorstat >> i) & 0x1)
304  {
306  {
307  mo->Fill(i);
308  double freq = (100.0 * mo->GetBinContent(i + 1)) / config->getNEvents();
310  mo->SetBinContent(i+1, freq);
311  }
313  mo->Fill(0.,i);
314  }
315  }
317  {
318  if (trl_errorstat)
319  {
320  mo->Fill(dduID, 1); // Any Error
321  for (int i = 0; i < 32; i++)
322  {
323  if ((trl_errorstat >> i) & 0x1)
324  {
325  mo->Fill(dduID, i + 2);
326  }
327  }
328  }
329  else
330  {
331  mo->Fill(dduID, 0); // No Errors
332  }
333  }
334 
335  if (getDDUHisto(h::DDU_TRAILER_ERRORSTAT_TABLE, dduID, mo)) mo->SetEntries(config->getNEvents());
336  if (getDDUHisto(h::DDU_TRAILER_ERRORSTAT_FREQUENCY, dduID, mo)) mo->SetEntries(config->getNEvents());
337 
339  uint32_t ddu_output_path_status = dduHeader.output_path_status();
341  {
342  if (ddu_output_path_status)
343  {
344  mo->Fill(dduID,1); // Any Error
345  for (int i=0; i<16; i++)
346  {
347  if ((ddu_output_path_status>>i) & 0x1)
348  {
349  mo->Fill(dduID,i+2); // Fill Summary Histo
350  }
351  }
352  }
353  else
354  {
355  mo->Fill(dduID,0); // No Errors
356  }
357  }
358 
359 
360  uint32_t nCSCs = 0;
361 
363  if (config->getPROCESS_CSC())
364  {
365 
366  std::vector<CSCEventData> chamberDatas;
367  chamberDatas.clear();
368  chamberDatas = dduData.cscData();
369 
370  nCSCs = chamberDatas.size();
371 
372  for (uint32_t i = 0; i < nCSCs; i++)
373  {
374  processCSC(chamberDatas[i], dduID, binChecker);
375  }
376 
377  }
378 
379  if (getDDUHisto(h::DDU_DMB_UNPACKED_VS_DAV, dduID, mo)) mo->Fill(dmb_active_header, nCSCs);
380 
381  // fFirstEvent = false;
382 
384  fNotFirstEvent[dduID] = true;
385 
386 }
int i
Definition: DBlmapReader.cc:9
CSCDDUHeader header() const
const unsigned long getNEvents() const
int lvl1num() const
Definition: CSCDDUHeader.h:25
const bool getDDUHisto(const HistoId &histo, const HwId &dduID, MonitorObject *&me)
Get DDU Level Monitoring Object.
unsigned errorstat() const
Definition: CSCDDUTrailer.h:41
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:46
std::map< uint32_t, uint32_t > L1ANumbers
int bxnum() const
Definition: CSCDDUHeader.h:24
int output_path_status() const
Definition: CSCDDUHeader.h:31
int dmb_dav() const
Definition: CSCDDUHeader.h:28
unsigned reserved() const
Definition: CSCDDUTrailer.h:48
bool check() const
Definition: CSCDDUTrailer.h:30
const std::vector< CSCEventData > & cscData() const
accessor to data
const std::string getPath() const
Get path part of the histogram (used only for DDUs and CSCs)
unsigned dmb_full() const
Definition: CSCDDUTrailer.h:47
#define LOG_WARN
Definition: CSCDQM_Logger.h:42
CSCDDUTrailer trailer() const
bool fCloseL1As
Data Format version (2005, 2013)
unsigned wordcount() const
Definition: CSCDDUTrailer.h:42
int ncsc() const
Definition: CSCDDUHeader.h:27
int source_id() const
Definition: CSCDDUHeader.h:23
int live_cscs() const
Definition: CSCDDUHeader.h:30
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 28 of file CSCDQM_EventProcessor_processExaminer.cc.

References cscdqm::BAD_EVENTS, cscd2r::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(), i, cscdqm::Configuration::incChamberCounter(), cscdqm::Configuration::incNEventsBad(), LOG_WARN, FEDNumbering::MAXCSCDDUFEDID, FEDNumbering::MINCSCDDUFEDID, CSCDCCFormatStatusDigi::nextCSCWithError(), CSCDCCFormatStatusDigi::nextCSCWithPayload(), CSCDCCFormatStatusDigi::nextCSCWithStatus(), CSCDCCExaminer::nSTATUSES, cscdqm::MonitorObject::SetBinContent(), cscdqm::MonitorObject::SetEntries(), and cscdqm::MonitorObject::SetMaximum().

29 {
30 
31  bool eventAccepted = true;
32  MonitorObject* mo = 0;
33 
34  uint32_t binErrorStatus = digi.getDDUSummaryErrors();
35 
37  {
38 
39  const std::set<DDUIdType> DDUs = digi.getListOfDDUs();
40  for (std::set<DDUIdType>::const_iterator ddu_itr = DDUs.begin(); ddu_itr != DDUs.end(); ++ddu_itr)
41  {
42  ExaminerStatusType errs = digi.getDDUErrors(*ddu_itr);
43  int dduID = (*ddu_itr)&0xFF;
44  if ( ((*ddu_itr) >= FEDNumbering::MINCSCDDUFEDID) && ((*ddu_itr) <= FEDNumbering::MAXCSCDDUFEDID) )
45  {
46  // dduID = (*ddu_itr) - FEDNumbering::MINCSCDDUFEDID + 1; /// TODO: Can require DDU-RUI remapping for actual system
47  dduID = cscdqm::Utility::getRUIfromDDUId((*ddu_itr));
48  if (dduID < 0) {
49  LOG_WARN << "DDU source ID (" << (*ddu_itr) << ") is out of valid range. Remapping to DDU ID 1.";
50  dduID = 1;
51  }
52  }
53  if (errs != 0)
54  {
55  for (int i = 0; i < 29; i++)
56  {
57  if ((errs >> i) & 0x1 )
58  {
59  mo->Fill(dduID, i + 1);
60  }
61  }
62  }
63  else
64  {
65  mo->Fill(dduID, 0);
66  }
67  }
68 
69  }
70 
71  // =VB= We want to use DCC level check mask as in CSCDCCUnpacker and not DDU mask
72  // Otherwise whole DCC event could be skipped because of a single chamber error
73  unsigned long dccBinCheckMask = 0x06080016;
74 // if ((binErrorStatus & config->getDDU_BINCHECK_MASK()) > 0) {
75  if ((binErrorStatus & dccBinCheckMask) > 0)
76  {
77  eventAccepted = false;
78  }
79 
80  if (binErrorStatus != 0)
81  {
83  }
84 
87  {
88  uint32_t i = 0;
89  CSCIdType chamberID = 0;
90  while (digi.nextCSCWithPayload(i, chamberID))
91  {
92 
93  int crateID = (chamberID >> 4) & 0xFF;
94  int dmbSlot = chamberID & 0xF;
95 
96  if (crateID == 255)
97  {
98  continue;
99  }
100  if ((crateID > 60) || (dmbSlot > 10) || (crateID <= 0) || (dmbSlot <= 0) )
101  {
102  continue;
103  }
104 
105  // Check if in standby!
106  {
107  CSCDetId cid;
108  if (!config->fnGetCSCDetId(crateID, dmbSlot, cid))
109  {
110  continue;
111  }
112  }
113 
115  config->incChamberCounter(DMB_EVENTS, crateID, dmbSlot);
116  long DMBEvents = config->getChamberCounterValue(DMB_EVENTS, crateID, dmbSlot);
118  cntDMBs++;
119 
121  {
122  mo->Fill(crateID, dmbSlot);
123  }
124 
125  unsigned int cscType = 0;
126  unsigned int cscPosition = 0;
127  if (!getCSCFromMap(crateID, dmbSlot, cscType, cscPosition)) continue;
128 
129  if (cscPosition && getEMUHisto(h::EMU_CSC_REPORTING, mo))
130  {
131  mo->Fill(cscPosition, cscType);
132  }
133 
135  long payload = digi.getCSCPayload(chamberID);
136  int cfeb_dav = (payload >> 7) & 0x7F;
137  int cfeb_active = payload & 0x1F;
138  cfeb_active |= ((payload >> 14) &0x03) << 5;
139  int alct_dav = (payload >> 5) & 0x1;
140  int tmb_dav = (payload >> 6) & 0x1;
141  int cfeb_dav_num = 0;
142 
143  if (alct_dav == 0)
144  {
145  if (cscPosition && getEMUHisto(h::EMU_CSC_WO_ALCT, mo))
146  {
147  mo->Fill(cscPosition, cscType);
148  }
150  {
151  mo->Fill(crateID, dmbSlot);
152  }
153  }
154 
155  if (tmb_dav == 0)
156  {
157  if (cscPosition && getEMUHisto(h::EMU_CSC_WO_CLCT, mo))
158  {
159  mo->Fill(cscPosition, cscType);
160  }
162  {
163  mo->Fill(crateID, dmbSlot);
164  }
165  }
166 
167  if (cfeb_dav == 0)
168  {
169  if (cscPosition && getEMUHisto(h::EMU_CSC_WO_CFEB, mo))
170  {
171  mo->Fill(cscPosition, cscType);
172  }
174  {
175  mo->Fill(crateID, dmbSlot);
176  }
177  }
178 
180  for (int i=0; i<7; i++)
181  {
182  if ((cfeb_dav>>i) & 0x1) cntCFEBs++;
183  }
184 
185  if (alct_dav > 0)
186  {
187  cntALCTs++;
188  }
189 
190  if (tmb_dav > 0)
191  {
192  cntTMBs++;
193  }
194 
195 
196  MonitorObject *mof = 0, *mo1 = 0, *mo2 = 0;
197  if (getCSCHisto(h::CSC_ACTUAL_DMB_CFEB_DAV_RATE, crateID, dmbSlot, mo)
198  && getCSCHisto(h::CSC_ACTUAL_DMB_CFEB_DAV_FREQUENCY, crateID, dmbSlot, mof))
199  {
200  if (getCSCHisto(h::CSC_DMB_CFEB_DAV_UNPACKING_INEFFICIENCY, crateID, dmbSlot, mo1)
201  && getCSCHisto(h::CSC_DMB_CFEB_DAV, crateID, dmbSlot, mo2))
202  {
203  for (int i=1; i<=7; i++)
204  {
205  double actual_dav_num = mo->GetBinContent(i);
206  double unpacked_dav_num = mo2->GetBinContent(i);
207  if (actual_dav_num)
208  {
209  mo1->SetBinContent(i,1, 100.*(1-unpacked_dav_num/actual_dav_num));
210  }
211  mo1->SetEntries((int)DMBEvents);
212  }
213  }
214  for (int i=0; i<7; i++)
215  {
216  int cfeb_present = (cfeb_dav>>i) & 0x1;
217  cfeb_dav_num += cfeb_present;
218  if (cfeb_present)
219  {
220  mo->Fill(i);
221  }
222  float cfeb_entries = mo->GetBinContent(i+1);
223  mof->SetBinContent(i+1, ((float)cfeb_entries/(float)(DMBEvents)*100.0));
224  }
225  mof->SetEntries((int)DMBEvents);
226  }
227 
230  {
231  for (unsigned short i = 1; i < 7; i++)
232  {
233  float cfeb_entries = mo->GetBinContent(i);
234  mof->SetBinContent(i, ((float)cfeb_entries / (float)(DMBEvents) * 100.0));
235  }
236  mof->SetEntries((int)DMBEvents);
237 
239  && getCSCHisto(h::CSC_DMB_CFEB_DAV_MULTIPLICITY, crateID, dmbSlot, mo2))
240  {
241  for (unsigned short i = 1; i < 9; i++)
242  {
243  float actual_dav_num = mo->GetBinContent(i);
244  float unpacked_dav_num = mo2->GetBinContent(i);
245  if (actual_dav_num)
246  {
247  mo1->SetBinContent(i, 1, 100. * (1-unpacked_dav_num/actual_dav_num));
248  }
249  mo1->SetEntries((int)DMBEvents);
250  }
251  }
252  mo->Fill(cfeb_dav_num);
253  }
254 
255  if (getCSCHisto(h::CSC_DMB_CFEB_ACTIVE_VS_DAV, crateID, dmbSlot, mo)) mo->Fill(cfeb_dav, cfeb_active);
256 
258  if (getCSCHisto(h::CSC_ACTUAL_DMB_FEB_DAV_RATE, crateID, dmbSlot, mo))
259  {
260  if (getCSCHisto(h::CSC_ACTUAL_DMB_FEB_DAV_FREQUENCY, crateID, dmbSlot, mo1))
261  {
262  for (int i = 1; i < 4; i++)
263  {
264  float dav_num = mo->GetBinContent(i);
265  mo1->SetBinContent(i, ((float)dav_num / (float)(DMBEvents) * 100.0));
266  }
267  mo1->SetEntries((int)DMBEvents);
268 
269  if (getCSCHisto(h::CSC_DMB_FEB_DAV_UNPACKING_INEFFICIENCY, crateID, dmbSlot, mof)
270  && getCSCHisto(h::CSC_DMB_FEB_DAV_RATE, crateID, dmbSlot, mo2))
271  {
272  for (int i = 1; i < 4; i++)
273  {
274  float actual_dav_num = mo->GetBinContent(i);
275  float unpacked_dav_num = mo2->GetBinContent(i);
276  if (actual_dav_num)
277  {
278  mof->SetBinContent(i,1, 100. * (1 - unpacked_dav_num / actual_dav_num));
279  }
280  mof->SetEntries((int)DMBEvents);
281  mof->SetMaximum(100.0);
282  }
283  }
284  }
285 
286  if (alct_dav > 0)
287  {
288  mo->Fill(0.0);
289  }
290  if (tmb_dav > 0)
291  {
292  mo->Fill(1.0);
293  }
294  if (cfeb_dav > 0)
295  {
296  mo->Fill(2.0);
297  }
298  }
299 
300 
301  float feb_combination_dav = -1.0;
303  if (getCSCHisto(h::CSC_ACTUAL_DMB_FEB_COMBINATIONS_DAV_RATE, crateID, dmbSlot, mo))
304  {
305  if (alct_dav == 0 && tmb_dav == 0 && cfeb_dav == 0) feb_combination_dav = 0.0; // Nothing
306  if (alct_dav > 0 && tmb_dav == 0 && cfeb_dav == 0) feb_combination_dav = 1.0; // ALCT Only
307  if (alct_dav == 0 && tmb_dav > 0 && cfeb_dav == 0) feb_combination_dav = 2.0; // TMB Only
308  if (alct_dav == 0 && tmb_dav == 0 && cfeb_dav > 0) feb_combination_dav = 3.0; // CFEB Only
309  if (alct_dav == 0 && tmb_dav > 0 && cfeb_dav > 0) feb_combination_dav = 4.0; // TMB+CFEB
310  if (alct_dav > 0 && tmb_dav > 0 && cfeb_dav == 0) feb_combination_dav = 5.0; // ALCT+TMB
311  if (alct_dav > 0 && tmb_dav == 0 && cfeb_dav > 0) feb_combination_dav = 6.0; // ALCT+CFEB
312  if (alct_dav > 0 && tmb_dav > 0 && cfeb_dav > 0) feb_combination_dav = 7.0; // ALCT+TMB+CFEB
313  // mo->Fill(feb_combination_dav);
314 
316  {
317  for (int i = 1; i < 9; i++)
318  {
319  float feb_combination_dav_number = mo->GetBinContent(i);
320  mo1->SetBinContent(i, ((float)feb_combination_dav_number / (float)(DMBEvents) * 100.0));
321  }
322  mo1->SetEntries(DMBEvents);
323 
325  && getCSCHisto(h::CSC_DMB_FEB_COMBINATIONS_DAV_RATE, crateID, dmbSlot, mo2))
326  {
327  for (int i = 1; i < 9; i++)
328  {
329  float actual_dav_num = mo->GetBinContent(i);
330  float unpacked_dav_num = mo2->GetBinContent(i);
331  if (actual_dav_num)
332  {
333  mof->SetBinContent(i, 1, 100. * (1 - unpacked_dav_num / actual_dav_num));
334  }
335  mof->SetEntries((int)DMBEvents);
336  mof->SetMaximum(100.0);
337  }
338  }
339 
340  }
341  mo->Fill(feb_combination_dav);
342  }
343 
344  }
345  }
346 
349  {
350  uint32_t i = 0;
351  CSCIdType chamberID = 0;
352  while (digi.nextCSCWithStatus(i, chamberID))
353  {
354 
355  unsigned int crateID = (chamberID >> 4) & 0xFF;
356  unsigned int dmbSlot = chamberID & 0xF;
357  ExaminerStatusType chStatus = digi.getCSCStatus(chamberID);
358 
359  if (crateID == 255)
360  {
361  continue;
362  }
363  if ((crateID > 60) || (dmbSlot > 10) || (crateID <= 0) || (dmbSlot <= 0) )
364  {
365  continue;
366  }
367 
368  // Check if in standby!
369  {
370  CSCDetId cid;
371  if (!config->fnGetCSCDetId(crateID, dmbSlot, cid))
372  {
373  continue;
374  }
375  }
376 
377  unsigned int cscType = 0;
378  unsigned int cscPosition = 0;
379  if (!getCSCFromMap(crateID, dmbSlot, cscType, cscPosition)) continue;
380 
381  if (getCSCHisto(h::CSC_BINCHECK_DATAFLOW_PROBLEMS_TABLE, crateID, dmbSlot, mo))
382  {
383  for (int bit = 0; bit < binChecker.nSTATUSES; bit++)
384  {
385  if (chStatus & (1<<bit) )
386  {
387  mo->Fill(0., bit);
388  }
389  }
390  mo->SetEntries(config->getChamberCounterValue(DMB_EVENTS, crateID, dmbSlot));
391  }
392 
393 
394  int anyInputFull = chStatus & 0x3F;
395  if (anyInputFull)
396  {
397  if (cscPosition && getEMUHisto(h::EMU_CSC_DMB_INPUT_FIFO_FULL, mo))
398  {
399  mo->Fill(cscPosition, cscType);
400  }
402  {
403  mo->Fill(crateID, dmbSlot);
404  }
405  }
406 
407  int anyInputTO = (chStatus >> 7) & 0x3FFF;
408  if (anyInputTO)
409  {
410  if (cscPosition && getEMUHisto(h::EMU_CSC_DMB_INPUT_TIMEOUT, mo))
411  {
412  mo->Fill(cscPosition, cscType);
413  }
415  {
416  mo->Fill(crateID, dmbSlot);
417  }
418  }
419 
420  if (digi.getCSCStatus(chamberID) & (1 << 22))
421  {
423  {
424  mo->Fill(crateID, dmbSlot);
425  }
426 
427  if (cscPosition && getEMUHisto(h::EMU_CSC_FORMAT_WARNINGS, mo))
428  {
429  mo->Fill(cscPosition, cscType);
430  }
431 
432  }
433  }
434 
435  }
436 
439  {
440  uint32_t i = 0;
441  CSCIdType chamberID = 0;
442  while (digi.nextCSCWithError(i, chamberID))
443  {
444 
445  const unsigned int crateID = (chamberID >> 4) & 0xFF;
446  const unsigned int dmbSlot = chamberID & 0xF;
447  const ExaminerStatusType chErr = digi.getCSCErrors(chamberID);
448 
449  if ((crateID ==255) || (chErr & 0x80))
450  {
451  continue; // = Skip chamber detection if DMB header is missing (Error code 6)
452  }
453  if ((crateID > 60) || (dmbSlot > 10) || (crateID <= 0) || (dmbSlot <= 0) )
454  {
455  continue;
456  }
457 
458 
459  // Check if in standby!
460  {
461  CSCDetId cid;
462  if (!config->fnGetCSCDetId(crateID, dmbSlot, cid))
463  {
464  continue;
465  }
466  }
467 
468  if ((chErr & config->getBINCHECK_MASK()) != 0)
469  {
470  config->incChamberCounter(BAD_EVENTS, crateID , dmbSlot);
471  }
472 
473  bool isCSCError = false;
474  bool fillBC = getCSCHisto(h::CSC_BINCHECK_ERRORSTAT_TABLE, crateID, dmbSlot, mo);
475 
476  for (int bit = 5; bit < 24; bit++)
477  {
478 
479  if (chErr & (1 << bit) )
480  {
481  isCSCError = true;
482  if (fillBC)
483  {
484  mo->Fill(0., bit - 5);
485  }
486  else
487  {
488  break;
489  }
490  }
491 
492  if (fillBC)
493  {
494  mo->SetEntries(config->getChamberCounterValue(DMB_EVENTS, crateID , dmbSlot));
495  }
496 
497  }
498 
499  if (isCSCError)
500  {
501 
503  {
504  mo->Fill(crateID, dmbSlot);
505  }
506 
507  if (eventAccepted && getEMUHisto(h::EMU_DMB_UNPACKED_WITH_ERRORS, mo))
508  {
509  mo->Fill(crateID, dmbSlot);
510  }
511 
512  unsigned int cscType = 0;
513  unsigned int cscPosition = 0;
514  if (!getCSCFromMap(crateID, dmbSlot, cscType, cscPosition)) continue;
515 
516  if ( cscPosition && getEMUHisto(h::EMU_CSC_FORMAT_ERRORS, mo))
517  {
518  mo->Fill(cscPosition, cscType);
519  }
520 
521  if (eventAccepted && cscPosition && getEMUHisto(h::EMU_CSC_UNPACKED_WITH_ERRORS, mo))
522  {
523  mo->Fill(cscPosition, cscType);
524  }
525  }
526 
527  }
528  }
529 
530  return eventAccepted;
531 
532 }
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.
int i
Definition: DBlmapReader.cc:9
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::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.
boost::function< bool(const unsigned int, const unsigned int, CSCDetId &) > fnGetCSCDetId
CSCDetId chamberID(const CSCDetId &cscDetId)
takes layer ID, converts to chamber ID, switching ME1A to ME11
Definition: CSCDigiToRaw.cc:31
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:42
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 
59  // Reseting EMU level Event displays
60  MonitorObject* mo = 0;
62  mo->getTH1Lock()->Reset("");
63  }
64 
66  mo->getTH1Lock()->Reset("");
67  }
68 
70  mo->getTH1Lock()->Reset("");
71  }
72 
74 
75  }
76  }
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 43 of file CSCDQM_EventProcessor_processCSC.cc.

References cscdqm::MonitorObject::GetBinContent(), resetEmuEventDisplays(), and cscdqm::MonitorObject::SetBinContent().

Referenced by processCSC().

43  {
44  if (mo && x) {
46  int bitset = (int) mo->GetBinContent(x, y);
47  bitset |= 1 << bit;
48  mo->SetBinContent(x, y, bitset);
49  }
50  }
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 366 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, tmp, cscdqm::WAS_ON, and cscdqm::Summary::WriteChamberState().

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

366  {
367 
368  Address adr;
369  adr.mask.side = true;
370  adr.mask.station = adr.mask.ring = adr.mask.chamber = adr.mask.layer = adr.mask.cfeb = adr.mask.hv = false;
371 
372  adr.side = 1;
373  summary.SetValue(adr, STANDBY, (standby.MeP ? 1 : 0));
374  if (!standby.MeP) {
375  summary.SetValue(adr, WAS_ON);
376  }
377 
378  adr.side = 2;
379  summary.SetValue(adr, STANDBY, (standby.MeM ? 1 : 0));
380  if (!standby.MeM) {
381  summary.SetValue(adr, WAS_ON);
382  }
383 
384  MonitorObject *me = 0;
386  LockType lock(me->mutex);
387  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
388 
389  // All standby
390  summary.WriteChamberState(tmp, 0x1000, 5);
391 
392  // Temporary in standby (was ON)
393  summary.WriteChamberState(tmp, 0x3000, 1, false);
394 
395  }
396 
397  }
HW element in standby mode.
Data with CFEB BWORDS.
void SetValue(const HWStatusBit bit, const int value=1)
SetValue for the whole of detector.
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
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.
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, 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, HLT_25ns10e33_v2_cff::parameters, 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, tmp, cscdqm::Summary::Write(), cscdqm::Summary::WriteMap(), and writeShifterHistograms().

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

26  {
27 
28  MonitorObject *me = 0, *me1 = 0;
29 
30  if (config->getNEvents() > 0) {
31 
33 
34  const TH2* rep = dynamic_cast<const TH2*>(me->getTH1());
35 
37  const TObject *tobj = me->getRefRootObject();
38 
42  if (tobj) {
43  const TH2* ref = dynamic_cast<const TH2*>(tobj);
44  summary.ReadReportingChambersRef(rep, ref, config->getEFF_COLD_THRESHOLD(), config->getEFF_COLD_SIGFAIL(), config->getEFF_HOT_THRESHOLD(), config->getEFF_HOT_SIGFAIL());
45  } else {
47  }
48 
50  const TH2* err = dynamic_cast<const TH2*>(me1->getTH1());
51  summary.ReadErrorChambers(rep, err, FORMAT_ERR, config->getEFF_ERR_THRESHOLD(), config->getEFF_ERR_SIGFAIL());
52  }
53 
55  const TH2* err = dynamic_cast<const TH2*>(me1->getTH1());
56  summary.ReadErrorChambers(rep, err, L1SYNC_ERR, config->getEFF_ERR_THRESHOLD(), config->getEFF_ERR_SIGFAIL());
57  }
58 
60  const TH2* err = dynamic_cast<const TH2*>(me1->getTH1());
61  summary.ReadErrorChambers(rep, err, FIFOFULL_ERR, config->getEFF_ERR_THRESHOLD(), config->getEFF_ERR_SIGFAIL());
62  }
63 
65  const TH2* err = dynamic_cast<const TH2*>(me1->getTH1());
66  summary.ReadErrorChambers(rep, err, INPUTTO_ERR, config->getEFF_ERR_THRESHOLD(), config->getEFF_ERR_SIGFAIL());
67  }
68 
70  const TH2* err = dynamic_cast<const TH2*>(me1->getTH1());
71  summary.ReadErrorChambers(rep, err, NODATA_ALCT, config->getEFF_NODATA_THRESHOLD(), config->getEFF_NODATA_SIGFAIL());
72  }
73 
75  const TH2* err = dynamic_cast<const TH2*>(me1->getTH1());
76  summary.ReadErrorChambers(rep, err, NODATA_CLCT, config->getEFF_NODATA_THRESHOLD(), config->getEFF_NODATA_SIGFAIL());
77  }
78 
80  const TH2* err = dynamic_cast<const TH2*>(me1->getTH1());
81  summary.ReadErrorChambers(rep, err, NODATA_CFEB, config->getEFF_NODATA_THRESHOLD(), config->getEFF_NODATA_SIGFAIL());
82  }
83 
85  const TH2* err = dynamic_cast<const TH2*>(me1->getTH1());
86  summary.ReadErrorChambers(rep, err, CFEB_BWORDS, config->getEFF_NODATA_THRESHOLD(), config->getEFF_NODATA_SIGFAIL());
87  }
88 
89  }
90 
92 
98  LockType lock(me->mutex);
99  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
100  summary.Write(tmp, 1);
101  }
102 
104  LockType lock(me->mutex);
105  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
106  summary.Write(tmp, 2);
107  }
108 
110  LockType lock(me->mutex);
111  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
112  summary.Write(tmp, 3);
113  }
114 
116  LockType lock(me->mutex);
117  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
118  summary.Write(tmp, 4);
119  }
120 
121  if (getEMUHisto(h::EMU_PHYSICS_EMU, me)) {
122  LockType lock(me->mutex);
123  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
124  summary.WriteMap(tmp);
125  }
126 
127  }
128 
133  if (config->getPROCESS_EFF_PARAMETERS()) {
134 
135  { // Compute DQM information parameters
136 
137  Address adr;
138  adr.mask.side = adr.mask.station = adr.mask.ring = true;
139  adr.mask.chamber = adr.mask.layer = adr.mask.cfeb = adr.mask.hv = false;
140 
141  double e_detector = 0.0, e_side = 0.0, e_station = 0.0, e_ring = 0.0;
142  uint32_t e_detector_ch = 0, e_side_ch = 0, e_station_ch = 0;
143 
144  const HistoId parameters [] = {
173  };
174 
175  bool calc = (config->getNEvents() > 0);
176 
177  if (!calc) {
178  e_detector = e_side = e_station = e_ring = -1.0;
179  }
180 
181  unsigned int parameter = 0;
182  for (adr.side = 1; adr.side <= N_SIDES; adr.side++) {
183 
184  if (calc) {
185  e_side = 0.0;
186  e_side_ch = 0;
187  }
188 
189  adr.mask.station = true;
190  for (adr.station = 1; adr.station <= N_STATIONS; adr.station++) {
191 
192  if (calc) {
193  e_station = 0.0;
194  e_station_ch = 0;
195  }
196 
197  adr.mask.ring = true;
198  for (adr.ring = 1; adr.ring <= summary.getDetector().NumberOfRings(adr.station); adr.ring++) {
199 
200  if (calc) {
201  e_ring = summary.GetEfficiencyHW(adr);
202  uint32_t ch = summary.getDetector().NumberOfChambers(adr.station, adr.ring);
203  e_station += (e_ring * ch);
204  e_station_ch += ch;
205  }
206 
207  if (summary.getDetector().NumberOfRings(adr.station) > 1) {
208  if (getParHisto(parameters[parameter++], me)) me->Fill(e_ring);
209  }
210 
211  }
212 
213  adr.mask.ring = false;
214  if (calc) {
215  e_side += e_station;
216  e_side_ch += e_station_ch;
217  e_station = e_station / e_station_ch;
218  }
219 
220  if (getParHisto(parameters[parameter++], me)) me->Fill(e_station);
221 
222  }
223 
224  adr.mask.station = false;
225  if (calc) {
226  e_detector += e_side;
227  e_detector_ch += e_side_ch;
228  e_side = e_side / e_side_ch;
229  }
230 
231  if (getParHisto(parameters[parameter++], me)) me->Fill(e_side);
232 
233  }
234 
235  if (calc) {
236  e_detector = e_detector / e_detector_ch;
237  }
238 
239  if (getParHisto(h::PAR_REPORT_SUMMARY, me)) me->Fill(e_detector);
240 
241  }
242 
243  }
244 
245  }
string rep
Definition: cuy.py:1188
void ReadReportingChambers(const TH2 *&h2, const double threshold=1.0)
Read Reporting Chamber histogram and fill in detector map.
rval mask
Definition: vlib.h:152
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.
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
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.
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  {
27 
48 
49  unsigned int iter = 0, crateId = 0, dmbId = 0;
50  MonitorObject *mo = 0, *mof = 0;
51  while (config->fnNextBookedCSC(iter, crateId, dmbId)) {
52 
53  uint32_t dmbEvents = config->getChamberCounterValue(DMB_EVENTS, crateId, dmbId);
54 
55  if (getCSCHisto(h::CSC_BINCHECK_DATAFLOW_PROBLEMS_TABLE, crateId, dmbId, mo) &&
57 
58  LockType lock(mof->mutex);
59  TH1* th = mof->getTH1Lock();
60  th->Reset();
61  th->Add(mo->getTH1());
62  th->Scale(1. / dmbEvents);
63  mof->SetMaximum(1.);
64  mof->SetEntries(dmbEvents);
65  mo->SetEntries(dmbEvents);
66  }
67 
68  if (getCSCHisto(h::CSC_BINCHECK_ERRORSTAT_TABLE, crateId, dmbId, mo) &&
69  getCSCHisto(h::CSC_BINCHECK_ERRORS_FREQUENCY, crateId, dmbId, mof)) {
70  LockType lock(mof->mutex);
71  TH1* th = mof->getTH1Lock();
72  th->Reset();
73  th->Add(mo->getTH1());
74  th->Scale(1. / dmbEvents);
75  mof->SetMaximum(1.);
76  mof->SetEntries(dmbEvents);
77  mo->SetEntries(dmbEvents);
78  }
79 
80  }
81 
82  }
const bool getCSCHisto(const HistoId &histo, const HwId &crateID, const HwId &dmbSlot, MonitorObject *&me)
Get CSC (Chamber) Level Monitoring Object.
boost::function< bool(unsigned int &, unsigned int &, unsigned int &) > fnNextBookedCSC
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 247 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, tmp, and cscdqm::Summary::WriteChamberState().

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

247  {
248 
249  MonitorObject *me = 0;
250 
251  //const int COLOR_WHITE = 0;
252  const int COLOR_GREEN = 1;
253  const int COLOR_RED = 2;
254  const int COLOR_BLUE = 3;
255  const int COLOR_GREY = 4;
256  const int COLOR_STANDBY = 5;
257 
259  LockType lock(me->mutex);
260  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
261  if (!config->getIN_FULL_STANDBY()) {
262  summary.WriteChamberState(tmp, 0x1, COLOR_GREEN, true, false);
263  summary.WriteChamberState(tmp, HWSTATUSERRORBITS, COLOR_RED, false, true);
264  }
265  summary.WriteChamberState(tmp, 0x1000, COLOR_STANDBY, false);
266  summary.WriteChamberState(tmp, 0x2, COLOR_GREY, false);
267  }
268 
270  LockType lock(me->mutex);
271  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
272  if (!config->getIN_FULL_STANDBY()) {
273  summary.WriteChamberState(tmp, 0x4, COLOR_RED, true, false);
274  summary.WriteChamberState(tmp, 0x8, COLOR_BLUE, false, false);
275  }
276  summary.WriteChamberState(tmp, 0x1000, COLOR_STANDBY, false);
277  summary.WriteChamberState(tmp, 0x2, COLOR_GREY, false, false);
278  }
279 
281  LockType lock(me->mutex);
282  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
283  if (!config->getIN_FULL_STANDBY()) {
284  summary.WriteChamberState(tmp, 0x10, COLOR_RED, true, false);
285  }
286  summary.WriteChamberState(tmp, 0x1000, COLOR_STANDBY, false);
287  summary.WriteChamberState(tmp, 0x2, COLOR_GREY, false, false);
288  }
289 
291  LockType lock(me->mutex);
292  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
293  if (!config->getIN_FULL_STANDBY()) {
294  summary.WriteChamberState(tmp, 0x20, COLOR_RED, true, false);
295  }
296  summary.WriteChamberState(tmp, 0x1000, COLOR_STANDBY, false);
297  summary.WriteChamberState(tmp, 0x2, COLOR_GREY, false, false);
298  }
299 
301  LockType lock(me->mutex);
302  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
303  if (!config->getIN_FULL_STANDBY()) {
304  summary.WriteChamberState(tmp, 0x40, COLOR_RED, true, false);
305  }
306  summary.WriteChamberState(tmp, 0x1000, COLOR_STANDBY, false);
307  summary.WriteChamberState(tmp, 0x2, COLOR_GREY, false, false);
308  }
309 
311  LockType lock(me->mutex);
312  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
313  if (!config->getIN_FULL_STANDBY()) {
314  summary.WriteChamberState(tmp, 0x80, COLOR_RED, true, false);
315  }
316  summary.WriteChamberState(tmp, 0x1000, COLOR_STANDBY, false);
317  summary.WriteChamberState(tmp, 0x2, COLOR_GREY, false, false);
318  }
319 
321  LockType lock(me->mutex);
322  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
323  if (!config->getIN_FULL_STANDBY()) {
324  summary.WriteChamberState(tmp, 0x100, COLOR_RED, true, false);
325  }
326  summary.WriteChamberState(tmp, 0x1000, COLOR_STANDBY, false);
327  summary.WriteChamberState(tmp, 0x2, COLOR_GREY, false, false);
328  }
329 
331  LockType lock(me->mutex);
332  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
333  if (!config->getIN_FULL_STANDBY()) {
334  summary.WriteChamberState(tmp, 0x200, COLOR_RED, true, false);
335  }
336  summary.WriteChamberState(tmp, 0x1000, COLOR_STANDBY, false);
337  summary.WriteChamberState(tmp, 0x2, COLOR_GREY, false, false);
338  }
339 
341  LockType lock(me->mutex);
342  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
343  if (!config->getIN_FULL_STANDBY()) {
344  summary.WriteChamberState(tmp, 0x400, COLOR_RED, true, false);
345  }
346  summary.WriteChamberState(tmp, 0x1000, COLOR_STANDBY, false);
347  summary.WriteChamberState(tmp, 0x2, COLOR_GREY, false, false);
348  }
349 
351  LockType lock(me->mutex);
352  TH2* tmp = dynamic_cast<TH2*>(me->getTH1Lock());
353  if (!config->getIN_FULL_STANDBY()) {
354  summary.WriteChamberState(tmp, 0x800, COLOR_RED, true, false);
355  }
356  summary.WriteChamberState(tmp, 0x1000, COLOR_STANDBY, false);
357  summary.WriteChamberState(tmp, 0x2, COLOR_GREY, false, false);
358  }
359 
360  }
#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
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
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.
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 173 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 176 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 175 of file CSCDQM_EventProcessor.h.

Referenced by processExaminer().

uint32_t cscdqm::EventProcessor::cntDMBs
private

Definition at line 174 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 177 of file CSCDQM_EventProcessor.h.

Referenced by processExaminer().

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

Definition at line 185 of file CSCDQM_EventProcessor.h.

Referenced by preProcessEvent(), and resetEmuEventDisplays().

bool cscdqm::EventProcessor::fCloseL1As
private

Data Format version (2005, 2013)

Definition at line 184 of file CSCDQM_EventProcessor.h.

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

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

Definition at line 171 of file CSCDQM_EventProcessor.h.

Referenced by processDDU().

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

Definition at line 188 of file CSCDQM_EventProcessor.h.

uint32_t cscdqm::EventProcessor::L1ANumber
private

Definition at line 172 of file CSCDQM_EventProcessor.h.

Referenced by processCSC(), and processDDU().

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

Definition at line 170 of file CSCDQM_EventProcessor.h.

Referenced by processDDU().

Summary cscdqm::EventProcessor::summary
private

Detector efficiency manipulation object

Definition at line 168 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 180 of file CSCDQM_EventProcessor.h.

Referenced by processCSC().