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 Attributes
HcalEEUSMonitor Class Reference

#include <HcalEEUSMonitor.h>

Inheritance diagram for HcalEEUSMonitor:
HcalBaseMonitor

Public Member Functions

void clearME ()
 
 HcalEEUSMonitor ()
 
void processEvent (const FEDRawDataCollection &rawraw, const HcalUnpackerReport &report, const HcalElectronicsMap &emap)
 
void processEvent_RawData (const FEDRawDataCollection &rawraw, const HcalUnpackerReport &report, const HcalElectronicsMap &emap)
 
void reset ()
 
void setup (const edm::ParameterSet &ps, DQMStore::IBooker &ib)
 
void unpack (const FEDRawData &raw, const HcalElectronicsMap &emap)
 
 ~HcalEEUSMonitor ()
 
- Public Member Functions inherited from HcalBaseMonitor
void beginLuminosityBlock (int lb)
 
virtual void beginRun ()
 
virtual void done ()
 
void endLuminosityBlock ()
 
bool getDiagnostics () const
 
int getVerbosity () const
 
 HcalBaseMonitor ()
 
void hideKnownBadCells ()
 
virtual void periodicReset ()
 
void processEvent ()
 
void setDiagnostics (bool myval)
 
void setMinMaxHists1D (std::vector< MonitorElement * > &hh, double min, double max)
 
void setMinMaxHists2D (std::vector< MonitorElement * > &hh, double min, double max)
 
void setupDepthHists1D (DQMStore::IBooker &ib, MonitorElement *&h, std::vector< MonitorElement * > &hh, std::string Name, std::string Units, int lowbound, int highbound, int Nbins)
 
void setupDepthHists1D (DQMStore::IBooker &ib, std::vector< MonitorElement * > &hh, std::string Name, std::string Units, int lowbound, int highbound, int Nbins)
 
void setupDepthHists2D (DQMStore::IBooker &ib, MonitorElement *&h, std::vector< MonitorElement * > &hh, std::string Name, std::string Units)
 
void setupDepthHists2D (DQMStore::IBooker &ib, std::vector< MonitorElement * > &hh, std::string Name, std::string Units)
 
void setupDepthHists2D (DQMStore::IBooker &ib, MonitorElement *&h, std::vector< MonitorElement * > &hh, std::string Name, std::string Units, int nbinsx, int lowboundx, int highboundx, int nbinsy, int lowboundy, int highboundy)
 
void setupDepthHists2D (DQMStore::IBooker &ib, std::vector< MonitorElement * > &hh, std::string Name, std::string Units, int nbinsx, int lowboundx, int highboundx, int nbinsy, int lowboundy, int highboundy)
 
void SetupEtaPhiHists (DQMStore::IBooker &ib, MonitorElement *&h, EtaPhiHists &hh, std::string Name, std::string Units)
 
void SetupEtaPhiHists (DQMStore::IBooker &ib, EtaPhiHists &hh, std::string Name, std::string Units)
 
void setVerbosity (int verb)
 
bool vetoCell (HcalDetId &id)
 
virtual ~HcalBaseMonitor ()
 

Private Attributes

uint32_t consecutiveEETriggers [32][15]
 
uint32_t consecutiveNETriggers [32][15]
 
uint32_t consecutiveTriggers [32][15]
 
int dccOrN
 
bool EEthisEvent [15 *32]
 
std::vector< int > fedUnpackList_
 
int firstFED_
 
int ievt_
 
MonitorElementmeEECorrel_
 
MonitorElementmeEEFractSpigs_US0_EE1_
 
MonitorElementmeEEPerSpigot_
 
MonitorElementmeEEThisEvent_
 
MonitorElementmeEVT_
 
MonitorElementmeNormFractSpigs_US0_EE0_
 
MonitorElementmeNumberEETriggered_
 
MonitorElementmeNumberNETriggered_
 
MonitorElementmeNumberTriggered_
 
MonitorElementmeRawDataLength2_US0_EE0_
 
MonitorElementmeRawDataLength2_US0_EE1_
 
MonitorElementmeRawDataLength2_US1_EE0_
 
MonitorElementmeRawDataLength2_US1_EE1_
 
MonitorElementmeUSFractSpigs_US1_EE0_
 
MonitorElementmeUSFractSpigs_US1_EE1_
 
int numEEthisEvent
 
int prevOrN
 
int prevWasEE [32][15]
 
uint64_t US0EE0count [32][15]
 
uint64_t US0EE1count [32][15]
 
uint64_t US1EE0count [32][15]
 
uint64_t US1EE1count [32][15]
 
uint64_t UScount [32][15]
 

Additional Inherited Members

- Protected Member Functions inherited from HcalBaseMonitor
void LumiBlockUpdate (int lb)
 
- Protected Attributes inherited from HcalBaseMonitor
std::vector< int > AllowedCalibTypes_
 
std::vector< std::string > badCells_
 
std::string baseFolder_
 
bool checkHB_
 
bool checkHE_
 
bool checkHF_
 
bool checkHO_
 
int checkNevents_
 
edm::CPUTimer cpu_timer
 
bool dump2database
 
int etaBins_
 
double etaMax_
 
double etaMin_
 
int fVerbosity
 
int ievt_
 
bool LBprocessed_
 
int levt_
 
int lumiblock
 
bool makeDiagnostics
 
MonitorElementmeEVT_
 
MonitorElementmeTOTALEVT_
 
double minErrorFlag_
 
int Nlumiblocks_
 
int NumBadHB
 
int NumBadHE
 
int NumBadHF
 
int NumBadHO
 
int oldlumiblock
 
bool Online_
 
int phiBins_
 
double phiMax_
 
double phiMin_
 
MonitorElementProblemCells
 
EtaPhiHists ProblemCellsByDepth
 
MonitorElementProblemsVsLB
 
MonitorElementProblemsVsLB_HB
 
MonitorElementProblemsVsLB_HBHEHF
 
MonitorElementProblemsVsLB_HE
 
MonitorElementProblemsVsLB_HF
 
MonitorElementProblemsVsLB_HO
 
int resetNevents_
 
std::string rootFolder_
 
bool showTiming
 
int tevt_
 

Detailed Description

Author
J. Temple - Univ. of Maryland

Definition at line 35 of file HcalEEUSMonitor.h.

Constructor & Destructor Documentation

HcalEEUSMonitor::HcalEEUSMonitor ( )

Definition at line 16 of file HcalEEUSMonitor.cc.

References consecutiveEETriggers, consecutiveNETriggers, consecutiveTriggers, f, NUMFEDS, NUMSPIGS, prevWasEE, alignCSCRings::s, US0EE0count, US0EE1count, US1EE0count, US1EE1count, and UScount.

17 {
18  for (int f=0; f<NUMFEDS;f++){
19  for (int s=0; s<NUMSPIGS; s++) {
22  consecutiveTriggers[f][s] = 0;
23  prevWasEE[f][s] = 0;}}
24 
25 // std::cout << (int)sizeof(UScount) << std::endl;
26  for (int f=0; f<NUMFEDS; f++) {
27  for (int s=0; s<NUMSPIGS; s++) {
28  UScount[f][s] = 0;
29  }
30  }
31 
32  //Francesco
33 // std::cout << (int)sizeof(US0EE0count) << std::endl;
34  for (int f=0; f<NUMFEDS; f++) {
35  for (int s=0; s<NUMSPIGS; s++) {
36  US0EE0count[f][s] = 0;
37  }
38  }
39 
40 // std::cout << (int)sizeof(US0EE1count) << std::endl;
41  for (int f=0; f<NUMFEDS; f++) {
42  for (int s=0; s<NUMSPIGS; s++) {
43  US0EE1count[f][s] = 0;
44  }
45  }
46 
47 // std::cout << (int)sizeof(US1EE0count) << std::endl;
48  for (int f=0; f<NUMFEDS; f++) {
49  for (int s=0; s<NUMSPIGS; s++) {
50  US1EE0count[f][s] = 0;
51  }
52  }
53 
54 // std::cout << (int)sizeof(US1EE1count) << std::endl;
55  for (int f=0; f<NUMFEDS; f++) {
56  for (int s=0; s<NUMSPIGS; s++) {
57  US1EE1count[f][s] = 0;
58  }
59  }
60  //----------
61 
62 }
uint32_t consecutiveTriggers[32][15]
int prevWasEE[32][15]
uint32_t consecutiveNETriggers[32][15]
uint32_t consecutiveEETriggers[32][15]
uint64_t US0EE1count[32][15]
uint64_t US0EE0count[32][15]
#define NUMSPIGS
#define NUMFEDS
uint64_t US1EE1count[32][15]
uint64_t UScount[32][15]
double f[11][100]
uint64_t US1EE0count[32][15]
HcalEEUSMonitor::~HcalEEUSMonitor ( )

Definition at line 65 of file HcalEEUSMonitor.cc.

65 {}

Member Function Documentation

void HcalEEUSMonitor::clearME ( )
virtual

Reimplemented from HcalBaseMonitor.

Definition at line 69 of file HcalEEUSMonitor.cc.

References meEVT_.

70 {
71  /*if (m_dbe)
72  {
73  m_dbe->setCurrentFolder(baseFolder_);
74  m_dbe->removeContents();
75  } // if (m_dbe)*/
76  meEVT_=0;
77 } // void HcalEEUSMonitor::clearME()
MonitorElement * meEVT_
void HcalEEUSMonitor::processEvent ( const FEDRawDataCollection rawraw,
const HcalUnpackerReport report,
const HcalElectronicsMap emap 
)

Definition at line 233 of file HcalEEUSMonitor.cc.

References dccOrN, EEthisEvent, MonitorElement::Fill(), i, ievt_, meEVT_, NUMFEDS, NUMSPIGS, prevOrN, and processEvent_RawData().

238 {
239  /*if (!m_dbe)
240  {
241  if (fVerbosity) std::cout <<"HcalEEUSMonitor::processEvent DQMStore not instantiated!!!"<<std::endl;
242  return;
243  }*/
244 
245  // Fill Event Number
246  ievt_++;
247  meEVT_->Fill(ievt_);
248 
249 
250  //EECorrels Assume the best, before unpack()
251  for (int i=0; i<(NUMSPIGS*NUMFEDS); i++)
252  EEthisEvent[i]=false;
253 
254  processEvent_RawData(rawraw, report, emap);
255  prevOrN=dccOrN;
256  return;
257 } // void HcalEEUSMonitor::processEvent
int i
Definition: DBlmapReader.cc:9
#define NUMSPIGS
void Fill(long long x)
#define NUMFEDS
MonitorElement * meEVT_
bool EEthisEvent[15 *32]
void processEvent_RawData(const FEDRawDataCollection &rawraw, const HcalUnpackerReport &report, const HcalElectronicsMap &emap)
void HcalEEUSMonitor::processEvent_RawData ( const FEDRawDataCollection rawraw,
const HcalUnpackerReport report,
const HcalElectronicsMap emap 
)

Definition at line 260 of file HcalEEUSMonitor.cc.

References dccOrN, EEthisEvent, FEDRawDataCollection::FEDData(), fedUnpackList_, MonitorElement::Fill(), i, SurfaceOrientation::inner, meEECorrel_, meEEThisEvent_, numEEthisEvent, NUMFEDS, NUMSPIGS, SurfaceOrientation::outer, prevOrN, FEDRawData::size(), and unpack().

Referenced by processEvent().

263 {
264  /*
265  This processes Raw Data.
266  Additional info on working with Raw Data can be found in
267  HcalDataFormatMonitor.cc
268  */
269 
270 
271  // Should not see this error
272  /*if(!m_dbe)
273  {
274  std::cout <<"HcalEEUSMonitor::processEvent_RawData: DQMStore not instantiated!!!\n"<<std::endl;
275  return;
276  }*/
277  numEEthisEvent = 0;
278  // Loop over all FEDs reporting the event, unpacking if good.
279  for (std::vector<int>::const_iterator i=fedUnpackList_.begin();i!=fedUnpackList_.end(); i++)
280  {
281  const FEDRawData& fed = rawraw.FEDData(*i);
282  if (fed.size()<12) continue; // Was 16.
283  unpack(fed,emap);
284  } // for (std::vector<int>::const_iterator i=fedUnpackList_.begin();...
285 
286  prevOrN=dccOrN;
288  numEEthisEvent = 0;
289 
290  //EECorrels :Fill a 2D histo where two each pair of
291  //spigots have EE in the same event.
292  for (int outer=0; outer<(NUMSPIGS*NUMFEDS); outer++)
293  if (EEthisEvent[outer])
294  for (int inner=0; inner<(NUMSPIGS*NUMFEDS); inner++)
295  if (EEthisEvent[inner])
296  meEECorrel_->Fill(outer, inner);
297 
298  return;
299 
300 } // void HcalEEUSMonitor::processEvent_RawData(const FEDRawDataCollection& rawraw,
void unpack(const FEDRawData &raw, const HcalElectronicsMap &emap)
int i
Definition: DBlmapReader.cc:9
#define NUMSPIGS
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
void Fill(long long x)
#define NUMFEDS
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
std::vector< int > fedUnpackList_
bool EEthisEvent[15 *32]
MonitorElement * meEEThisEvent_
MonitorElement * meEECorrel_
void HcalEEUSMonitor::reset ( void  )

Definition at line 67 of file HcalEEUSMonitor.cc.

67 {}
void HcalEEUSMonitor::setup ( const edm::ParameterSet ps,
DQMStore::IBooker ib 
)
virtual

Reimplemented from HcalBaseMonitor.

Definition at line 80 of file HcalEEUSMonitor.cc.

References HcalBaseMonitor::baseFolder_, DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::bookInt(), gather_cfg::cout, f, fedUnpackList_, firstFED_, HcalBaseMonitor::fVerbosity, i, ievt_, diffTwoXMLs::label, FEDNumbering::MAXHCALFEDID, meEECorrel_, meEEFractSpigs_US0_EE1_, meEEPerSpigot_, meEEThisEvent_, meEVT_, meNormFractSpigs_US0_EE0_, meNumberEETriggered_, meNumberNETriggered_, meNumberTriggered_, meRawDataLength2_US0_EE0_, meRawDataLength2_US0_EE1_, meRawDataLength2_US1_EE0_, meRawDataLength2_US1_EE1_, meUSFractSpigs_US1_EE0_, meUSFractSpigs_US1_EE1_, FEDNumbering::MINHCALFEDID, NUMFEDS, NUMSPIGS, prevOrN, HcalBaseMonitor::rootFolder_, alignCSCRings::s, MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), HcalBaseMonitor::setup(), HcalDCCHeader::SPIGOT_COUNT, AlCaHLTBitMon_QueryRunRegistry::string, and indexGen::title.

81 {
82  HcalBaseMonitor::setup(ps,ib); // perform setups of base class
83 
84  ievt_=0; // event counter
85  baseFolder_ = rootFolder_ + "EEUSMonitor"; // Will create an "EEUSMonitor" subfolder in .root output
86  if (fVerbosity) std::cout <<"<HcalEEUSMonitor::setup> Setup in progress"<<std::endl;
87 
88 
89  if(fVerbosity) std::cout << "About to pushback fedUnpackList_" << std::endl;
91  if (fVerbosity>0) std::cout <<"FIRST FED = "<<firstFED_<<std::endl;
92 
95  {
96  if(fVerbosity) std::cout << "<HcalEEUSMonitor::setup>:Pushback for fedUnpackList_: " << i <<std::endl;
97  fedUnpackList_.push_back(i);
98  } // for (int i=FEDNumbering::MINHCALFEDID
99 
100 
101 
104  meEVT_ = ib.bookInt("EEUSMonitor Event Number"); // store event number
105 
106  char label[10];
107  //Francesco
108 
109  //fraction of X-Type events
110 
111  type = "Fraction Normal Events - US0 EE0";
112  meNormFractSpigs_US0_EE0_ = ib.book1D(type,type,481,0,481);
113  for(int f=0; f<NUMFEDS; f++) {
114  sprintf(label, "FED 7%02d", f);
116  for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
117  sprintf(label, "sp%02d", s-1);
118  meNormFractSpigs_US0_EE0_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
119 
120  type = "Fraction Empty Events - US0 EE1";
121  meEEFractSpigs_US0_EE1_ = ib.book1D(type,type,481,0,481);
122  for(int f=0; f<NUMFEDS; f++) {
123  sprintf(label, "FED 7%02d", f);
124  meEEFractSpigs_US0_EE1_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f), label);
125  for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
126  sprintf(label, "sp%02d", s-1);
127  meEEFractSpigs_US0_EE1_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
128 
129  type = "Fraction UnSuppressed Events - US1 EE0";
130  meUSFractSpigs_US1_EE0_ = ib.book1D(type,type,481,0,481);
131  for(int f=0; f<NUMFEDS; f++) {
132  sprintf(label, "FED 7%02d", f);
133  meUSFractSpigs_US1_EE0_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f), label);
134  for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
135  sprintf(label, "sp%02d", s-1);
136  meUSFractSpigs_US1_EE0_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
137 
138  type = "Fraction UnSuppressed Events - US1 EE1";
139  meUSFractSpigs_US1_EE1_ = ib.book1D(type,type,481,0,481);
140  for(int f=0; f<NUMFEDS; f++) {
141  sprintf(label, "FED 7%02d", f);
142  meUSFractSpigs_US1_EE1_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f), label);
143  for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
144  sprintf(label, "sp%02d", s-1);
145  meUSFractSpigs_US1_EE1_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
146 
147  //raw data length for X-type events
148 
149  type = "Length of raw data - US0 EE0";
150  meRawDataLength2_US0_EE0_ = ib.book2D(type,type,481,0,481,600,0,1200);
151  for(int f=0; f<NUMFEDS; f++) {
152  sprintf(label, "FED 7%02d", f);
153  meRawDataLength2_US0_EE0_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f), label);
154  for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
155  sprintf(label, "sp%02d", s-1);
156  meRawDataLength2_US0_EE0_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
157 
158  type = "Length of raw data - US0 EE1";
159  meRawDataLength2_US0_EE1_ = ib.book2D(type,type,481,0,481,600,0,1200);
160  for(int f=0; f<NUMFEDS; f++) {
161  sprintf(label, "FED 7%02d", f);
162  meRawDataLength2_US0_EE1_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f), label);
163  for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
164  sprintf(label, "sp%02d", s-1);
165  meRawDataLength2_US0_EE1_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
166 
167  type = "Length of raw data - US1 EE0";
168  meRawDataLength2_US1_EE0_ = ib.book2D(type,type,481,0,481,600,0,1200);
169  for(int f=0; f<NUMFEDS; f++) {
170  sprintf(label, "FED 7%02d", f);
171  meRawDataLength2_US1_EE0_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f), label);
172  for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
173  sprintf(label, "sp%02d", s-1);
174  meRawDataLength2_US1_EE0_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
175 
176  type = "Length of raw data - US1 EE1";
177  meRawDataLength2_US1_EE1_ = ib.book2D(type,type,481,0,481,600,0,1200);
178  for(int f=0; f<NUMFEDS; f++) {
179  sprintf(label, "FED 7%02d", f);
180  meRawDataLength2_US1_EE1_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f), label);
181  for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
182  sprintf(label, "sp%02d", s-1);
183  meRawDataLength2_US1_EE1_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
184 
185  //---------
186 
187  //EECorrels Jason
188 
189  type="EE Spigot Correlation";
190  meEECorrel_ = ib.book2D(type, type,
191  (NUMSPIGS * NUMFEDS), 0, (NUMSPIGS * NUMFEDS),
192  (NUMSPIGS * NUMFEDS), 0, (NUMSPIGS * NUMFEDS));
193  type="EE per Spigot";
194  meEEPerSpigot_ = ib.book1D(type, type,
195  (NUMSPIGS * NUMFEDS), 0, (NUMSPIGS * NUMFEDS));
196  type="EE Spigots per Event";
197  meEEThisEvent_ = ib.book1D(type, type,500,-0.5,499.5);
198 
199  //EE/NE Triggers Jared
200 
201  char title[128];
202  sprintf(title, "EE Triggers"); // DCC FED number 700:731
203  meNumberEETriggered_ = ib.book2D(title,title,(NUMSPIGS * NUMFEDS),0,(NUMSPIGS * NUMFEDS),100,-0.5,99.5);
204  sprintf(title, "NE Triggers"); // DCC FED number 700:731
205  meNumberNETriggered_ = ib.book2D(title,title,(NUMSPIGS * NUMFEDS),0,(NUMSPIGS * NUMFEDS),100,-0.5,99.5);
206  sprintf(title, "Triggers"); // DCC FED number 700:731
207  meNumberTriggered_ = ib.book2D(title,title,(NUMSPIGS * NUMFEDS),0,(NUMSPIGS * NUMFEDS),100,-0.5,99.5);
208 
209  for (int f=0; f<NUMFEDS;f++){
210  sprintf(label, "DCC 7%02d", f); // DCC FED number 700:731
211  meEECorrel_->setBinLabel(1+(f*NUMSPIGS), label, 1);
212  meEECorrel_->setBinLabel(1+(f*NUMSPIGS), label, 2);
213  meEEPerSpigot_->setBinLabel(1+(f*NUMSPIGS), label, 1);
214  meNumberEETriggered_->setBinLabel(1+(f*NUMSPIGS), label, 1);
215  meNumberNETriggered_->setBinLabel(1+(f*NUMSPIGS), label, 1);
216  meNumberTriggered_->setBinLabel(1+(f*NUMSPIGS), label, 1);
217  for (int s=1; s<NUMSPIGS; s+=2) {
218  sprintf(label, "Spgt %02d", s-1); // DCC Spigots
219  meEECorrel_->setBinLabel((f*NUMSPIGS)+s+1, label, 1);
220  meEECorrel_->setBinLabel((f*NUMSPIGS)+s+1, label, 2);
221  meEEPerSpigot_->setBinLabel((f*NUMSPIGS)+s+1, label, 1);
222  meNumberEETriggered_->setBinLabel((f*NUMSPIGS)+s+1, label, 1);
223  meNumberNETriggered_->setBinLabel((f*NUMSPIGS)+s+1, label, 1);
224  meNumberTriggered_->setBinLabel((f*NUMSPIGS)+s+1, label, 1);}}
225 
226  prevOrN = -1;
227 
228  return;
229 
230 } // void HcalEEUSMonitor::setup()
type
Definition: HCALResponse.h:21
int i
Definition: DBlmapReader.cc:9
MonitorElement * meUSFractSpigs_US1_EE1_
virtual void setup(const edm::ParameterSet &ps, DQMStore::IBooker &ib)
MonitorElement * bookInt(Args &&...args)
Definition: DQMStore.h:103
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
#define NUMSPIGS
MonitorElement * meNumberNETriggered_
MonitorElement * meEEFractSpigs_US0_EE1_
MonitorElement * meNormFractSpigs_US0_EE0_
MonitorElement * meRawDataLength2_US0_EE0_
#define NUMFEDS
MonitorElement * meEVT_
MonitorElement * meRawDataLength2_US0_EE1_
std::string rootFolder_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
std::vector< int > fedUnpackList_
double f[11][100]
MonitorElement * meNumberTriggered_
MonitorElement * meRawDataLength2_US1_EE0_
std::string baseFolder_
MonitorElement * meEEThisEvent_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
static const int SPIGOT_COUNT
Definition: HcalDCCHeader.h:19
MonitorElement * meNumberEETriggered_
MonitorElement * meUSFractSpigs_US1_EE0_
tuple cout
Definition: gather_cfg.py:145
MonitorElement * meEEPerSpigot_
MonitorElement * meEECorrel_
MonitorElement * meRawDataLength2_US1_EE1_
void HcalEEUSMonitor::unpack ( const FEDRawData raw,
const HcalElectronicsMap emap 
)

Definition at line 305 of file HcalEEUSMonitor.cc.

References consecutiveEETriggers, consecutiveNETriggers, consecutiveTriggers, gather_cfg::cout, FEDRawData::data(), dccOrN, EE, EEthisEvent, MonitorElement::Fill(), HcalHTRData::getExtHdr6(), HcalDCCHeader::getLRBErrorBits(), HcalDCCHeader::getOrbitNumber(), HcalHTRData::getRawData(), HcalHTRData::getRawLength(), HcalDCCHeader::getSourceId(), HcalDCCHeader::getSpigotData(), HcalDCCHeader::getSpigotErrorBits(), HcalDCCHeader::getSpigotPresent(), ievt_, HcalHTRData::isHistogramEvent(), j, bookConverter::max, meEEFractSpigs_US0_EE1_, meEEPerSpigot_, meNormFractSpigs_US0_EE0_, meNumberEETriggered_, meNumberNETriggered_, meNumberTriggered_, meRawDataLength2_US0_EE0_, meRawDataLength2_US0_EE1_, meRawDataLength2_US1_EE0_, meRawDataLength2_US1_EE1_, meUSFractSpigs_US1_EE0_, meUSFractSpigs_US1_EE1_, numEEthisEvent, NUMSPIGS, prevOrN, prevWasEE, MonitorElement::setBinContent(), FEDRawData::size(), HcalDCCHeader::SPIGOT_COUNT, HcalDCCHeader::thereIsASecondCDFHeaderWord(), US0EE0count, US0EE1count, US1EE0count, and US1EE1count.

Referenced by processEvent_RawData().

307 {
308  /*
309  This unpacks raw data info. Additional info on working with the raw data can be found in the unpack method of HcalDataFormatMonitor.cc
310  */
311 
312 
313  // get the DCC header
314  const HcalDCCHeader* dccHeader=reinterpret_cast<const HcalDCCHeader*>(raw.data());
315  if(!dccHeader) return;
316 
317  // get the DCC trailer
318  const unsigned char* trailer_ptr = reinterpret_cast<const unsigned char*> (raw.data()+raw.size()-sizeof(uint64_t));
319  FEDTrailer trailer = FEDTrailer(trailer_ptr);
320 
321  //DCC Event Fragment sizes distribution, in bytes.
322  // int rawsize = raw.size();
323 
324  int dccid = dccHeader->getSourceId();
325  // int dccBCN = dccHeader->getBunchId();
326  dccOrN = dccHeader->getOrbitNumber();
327  // unsigned long dccEvtNum = dccHeader->getDCCEventNumber();
328 
329  // uint64_t* lastDataWord = (uint64_t*) ( raw.data()+raw.size()-(2*sizeof(uint64_t)) );
330  // int EvFragLength = ((*lastDataWord>>32)*8);
331  // EvFragLength = raw.size();
332 
333 
334  unsigned char WholeErrorList=0;
335  for(int j=0; j<HcalDCCHeader::SPIGOT_COUNT; j++) {
336  WholeErrorList=dccHeader->getSpigotErrorBits((unsigned int) j);
337  //EECorrels :Record EE for cross-correlation plotting.
338  if ((WholeErrorList>>2)&0x01) EEthisEvent[(NUMSPIGS *std::max(0,dccid-700))+j] = true;
339  }
340 
341  //
342 
343  // walk through the HTR data...
344  HcalHTRData htr;
345  for (int spigot=0; spigot<HcalDCCHeader::SPIGOT_COUNT; spigot++) {
346  if (!dccHeader->getSpigotPresent(spigot)) continue;
347 
348  // bool chsummAOK=true;
349 // bool channAOK=true;
350 
351  // From this Spigot's DCC header, first.
352  WholeErrorList=dccHeader->getLRBErrorBits((unsigned int) spigot);
353  // Load the given decoder with the pointer and length from this spigot.
354  dccHeader->getSpigotData(spigot,htr, raw.size());
355  const unsigned short* HTRraw = htr.getRawData();
356  unsigned short HTRwdcount = HTRraw[htr.getRawLength() - 2];
357 
358 
359  //fix me!
360  HTRwdcount=htr.getRawLength();
361 
362  // Size checks for internal consistency
363  // getNTP(), get NDD() seems to be mismatched with format. Manually:
364  int NTP = ((htr.getExtHdr6() >> 8) & 0x00FF);
365  int NDAQ = (HTRraw[htr.getRawLength() - 4] & 0x7FF);
366 
367  int here=1+(HcalDCCHeader::SPIGOT_COUNT*(dccid-700))+spigot;
368 
369  if ( ! ((HTRwdcount != 8) ||
370  (HTRwdcount != 12 + NTP + NDAQ) ||
371  (HTRwdcount != 20 + NTP + NDAQ) )) {
372  // chsummAOK=false;
373  //incompatible Sizes declared. Skip it.
374  continue; }
375  bool EE = ((dccHeader->getSpigotErrorBits(spigot) >> 2) & 0x01);
376  if (EE) {
377  numEEthisEvent++;
378  meEEPerSpigot_->Fill(here);
379  if (HTRwdcount != 8) {
380  // chsummAOK=false;
381  //incompatible Sizes declared. Skip it.
382  continue;}}
383  else{ //For non-EE,
384  if ((HTRwdcount-NDAQ-NTP) != 20) {
385  // chsummAOK=false;
386  //incompatible Sizes declared. Skip it.
387  continue;}}
388 
389  //Jared
390  if(dccOrN==prevOrN){
391  consecutiveTriggers[dccid-700][spigot]++;
392  if(prevWasEE[dccid-700][spigot]) {
393  if (EE) consecutiveEETriggers[dccid-700][spigot]++;
394  else {
395  meNumberEETriggered_->Fill(here,consecutiveEETriggers[dccid-700][spigot]);
396  consecutiveEETriggers[dccid-700][spigot] = 0;
397  consecutiveNETriggers[dccid-700][spigot]++;}}
398  else {
399  if(!EE) consecutiveNETriggers[dccid-700][spigot]++;
400  else {
401  meNumberNETriggered_->Fill(here,consecutiveNETriggers[dccid-700][spigot]);
402  consecutiveNETriggers[dccid-700][spigot] = 0;
403  consecutiveEETriggers[dccid-700][spigot]++;}}}
404  else {
405  if (prevOrN>-1) {
406  meNumberTriggered_->Fill(here,consecutiveTriggers[dccid-700][spigot]);
407  meNumberEETriggered_->Fill(here,consecutiveEETriggers[dccid-700][spigot]);
408  meNumberNETriggered_->Fill(here,consecutiveNETriggers[dccid-700][spigot]);}
409  consecutiveTriggers[dccid-700][spigot] = 1;
410  if(EE) {
411  consecutiveEETriggers[dccid-700][spigot] = 1;
412  consecutiveNETriggers[dccid-700][spigot] = 0;}
413  else {
414  consecutiveEETriggers[dccid-700][spigot] = 0;
415  consecutiveNETriggers[dccid-700][spigot] = 1;}}
416  /*
417  printf("%5d, %7.2d, %d, %8d, %22d, %22d, %20d, %3d, %10d\n",dccid,spigot,dccOrN,prevOrN,\
418  consecutiveEETriggers[dccid-700][spigot],consecutiveNETriggers[dccid-700][spigot],\
419  consecutiveTriggers[dccid-700][spigot],EE,prevWasEE[dccid-700][spigot]);
420  */
421  if (EE) prevWasEE[dccid-700][spigot] = 1;
422  else prevWasEE[dccid-700][spigot] = 0;
423 
424  if (htr.isHistogramEvent()) continue;
425 
426  bool htrUnSuppressed=(HTRraw[6]>>15 & 0x0001);
427  //Francesco
428  bool htrEmpty=(HTRraw[2] & 0x4);
429 
430 // if (htrUnSuppressed) {
431 // UScount[dccid-700][spigot]++;
432 // int here=1+(HcalDCCHeader::SPIGOT_COUNT*(dccid-700))+spigot;
433 // meUSFractSpigs_->setBinContent(here,((double)UScount[dccid-700][spigot])/(double)ievt_);}
434 
435  //Francesco
436 
437  //std::cout << "HTRwdcount: " << HTRwdcount << std::endl;
438 
439  if (htrUnSuppressed==false && htrEmpty==false){
440  US0EE0count[dccid-700][spigot]++;
442  ((double)US0EE0count[dccid-700][spigot])/(double)ievt_);
443  meRawDataLength2_US0_EE0_->Fill(here-1, HTRwdcount);
444  }
445 
446  if (htrUnSuppressed==false && htrEmpty==true){
447  US0EE1count[dccid-700][spigot]++;
449  ((double)US0EE1count[dccid-700][spigot])/(double)ievt_);
450  meRawDataLength2_US0_EE1_->Fill(here-1, HTRwdcount);
451  }
452 
453  if (htrUnSuppressed==true && htrEmpty==false){
454  US1EE0count[dccid-700][spigot]++;
456  ((double)US1EE0count[dccid-700][spigot])/(double)ievt_);
457  meRawDataLength2_US1_EE0_->Fill(here-1, HTRwdcount);
458  }
459 
460  if (htrUnSuppressed==true && htrEmpty==true){
461  US1EE1count[dccid-700][spigot]++;
463  ((double)US1EE1count[dccid-700][spigot])/(double)ievt_);
464  meRawDataLength2_US1_EE1_->Fill(here-1, HTRwdcount);
465  }
466  //--------
467 
468 
469  }//end of HTRdata
470 
471  // Dump out some raw data info
472 // std::cout <<"RAWSIZE = "<<rawsize<<std::endl;
473 // std::cout <<"dcc id = "<<dccid<<std::endl;
474 // std::cout <<"dccBCN = "<<dccBCN<<std::endl;
475 // std::cout <<"dccEvtNum = "<<dccEvtNum<<std::endl;
476 // std::cout <<"EvFragLength = "<<EvFragLength<<std::endl;
477  /* 1 */ //There should always be a second CDF header word indicated.
478  if (!dccHeader->thereIsASecondCDFHeaderWord())
479  {
480  std::cout <<"No second CDF header found!"<<std::endl;
481  }
482 
483  return;
484 } // void HcalEEUSMonitor::unpack(...)
uint32_t consecutiveTriggers[32][15]
void setBinContent(int binx, double content)
set content of bin (1-D)
unsigned char getSpigotErrorBits(unsigned int nspigot) const
Access the HTR error bits (decoding tbd)
MonitorElement * meUSFractSpigs_US1_EE1_
int prevWasEE[32][15]
uint32_t consecutiveNETriggers[32][15]
uint32_t consecutiveEETriggers[32][15]
uint64_t US0EE1count[32][15]
uint64_t US0EE0count[32][15]
unsigned int getExtHdr6() const
Definition: HcalHTRData.h:227
int getSpigotData(int nspigot, HcalHTRData &decodeTool, int validSize) const
unsigned char getLRBErrorBits(unsigned int nspigot) const
Access the Link Receiver Board error bits (decoding tbd)
#define NUMSPIGS
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
MonitorElement * meNumberNETriggered_
MonitorElement * meEEFractSpigs_US0_EE1_
MonitorElement * meNormFractSpigs_US0_EE0_
void Fill(long long x)
MonitorElement * meRawDataLength2_US0_EE0_
unsigned int getOrbitNumber() const
Definition: HcalDCCHeader.h:46
uint64_t US1EE1count[32][15]
MonitorElement * meRawDataLength2_US0_EE1_
const int getRawLength() const
Get the length of the raw data.
Definition: HcalHTRData.h:39
int j
Definition: DBlmapReader.cc:9
bool EEthisEvent[15 *32]
bool getSpigotPresent(unsigned int nspigot) const
Read the &quot;PRESENT&quot; bit for this spigot.
MonitorElement * meNumberTriggered_
MonitorElement * meRawDataLength2_US1_EE0_
int getSourceId() const
Definition: HcalDCCHeader.h:32
unsigned long long uint64_t
Definition: Time.h:15
const unsigned short * getRawData() const
Get a pointer to the raw data.
Definition: HcalHTRData.h:36
static const int SPIGOT_COUNT
Definition: HcalDCCHeader.h:19
MonitorElement * meNumberEETriggered_
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
MonitorElement * meUSFractSpigs_US1_EE0_
tuple cout
Definition: gather_cfg.py:145
uint64_t US1EE0count[32][15]
bool thereIsASecondCDFHeaderWord() const
Definition: HcalDCCHeader.h:28
MonitorElement * meEEPerSpigot_
MonitorElement * meRawDataLength2_US1_EE1_
bool isHistogramEvent() const
Is this event a histogram event? (do not call standard unpack in this case!!!!!)
Definition: HcalHTRData.cc:385

Member Data Documentation

uint32_t HcalEEUSMonitor::consecutiveEETriggers[32][15]
private

Definition at line 105 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor(), and unpack().

uint32_t HcalEEUSMonitor::consecutiveNETriggers[32][15]
private

Definition at line 106 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor(), and unpack().

uint32_t HcalEEUSMonitor::consecutiveTriggers[32][15]
private

Definition at line 107 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor(), and unpack().

int HcalEEUSMonitor::dccOrN
private

Definition at line 108 of file HcalEEUSMonitor.h.

Referenced by processEvent(), processEvent_RawData(), and unpack().

bool HcalEEUSMonitor::EEthisEvent[15 *32]
private

Definition at line 73 of file HcalEEUSMonitor.h.

Referenced by processEvent(), processEvent_RawData(), and unpack().

std::vector<int> HcalEEUSMonitor::fedUnpackList_
private

Definition at line 61 of file HcalEEUSMonitor.h.

Referenced by processEvent_RawData(), and setup().

int HcalEEUSMonitor::firstFED_
private

Definition at line 62 of file HcalEEUSMonitor.h.

Referenced by setup().

int HcalEEUSMonitor::ievt_
private

Definition at line 58 of file HcalEEUSMonitor.h.

Referenced by processEvent(), setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meEECorrel_
private

Definition at line 67 of file HcalEEUSMonitor.h.

Referenced by processEvent_RawData(), and setup().

MonitorElement* HcalEEUSMonitor::meEEFractSpigs_US0_EE1_
private

Definition at line 78 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meEEPerSpigot_
private

Definition at line 68 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meEEThisEvent_
private

Definition at line 69 of file HcalEEUSMonitor.h.

Referenced by processEvent_RawData(), and setup().

MonitorElement* HcalEEUSMonitor::meEVT_
private

Definition at line 59 of file HcalEEUSMonitor.h.

Referenced by clearME(), processEvent(), and setup().

MonitorElement* HcalEEUSMonitor::meNormFractSpigs_US0_EE0_
private

Definition at line 77 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meNumberEETriggered_
private

Definition at line 100 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meNumberNETriggered_
private

Definition at line 101 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meNumberTriggered_
private

Definition at line 102 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meRawDataLength2_US0_EE0_
private

Definition at line 82 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meRawDataLength2_US0_EE1_
private

Definition at line 83 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meRawDataLength2_US1_EE0_
private

Definition at line 84 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meRawDataLength2_US1_EE1_
private

Definition at line 85 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meUSFractSpigs_US1_EE0_
private

Definition at line 79 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meUSFractSpigs_US1_EE1_
private

Definition at line 80 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

int HcalEEUSMonitor::numEEthisEvent
private

Definition at line 74 of file HcalEEUSMonitor.h.

Referenced by processEvent_RawData(), and unpack().

int HcalEEUSMonitor::prevOrN
private

Definition at line 109 of file HcalEEUSMonitor.h.

Referenced by processEvent(), processEvent_RawData(), setup(), and unpack().

int HcalEEUSMonitor::prevWasEE[32][15]
private

Definition at line 110 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor(), and unpack().

uint64_t HcalEEUSMonitor::US0EE0count[32][15]
private

Definition at line 90 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor(), and unpack().

uint64_t HcalEEUSMonitor::US0EE1count[32][15]
private

Definition at line 91 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor(), and unpack().

uint64_t HcalEEUSMonitor::US1EE0count[32][15]
private

Definition at line 92 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor(), and unpack().

uint64_t HcalEEUSMonitor::US1EE1count[32][15]
private

Definition at line 93 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor(), and unpack().

uint64_t HcalEEUSMonitor::UScount[32][15]
private

Definition at line 89 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor().