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 *dbe)
 
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 (MonitorElement *&h, std::vector< MonitorElement * > &hh, std::string Name, std::string Units, int lowbound, int highbound, int Nbins)
 
void setupDepthHists1D (std::vector< MonitorElement * > &hh, std::string Name, std::string Units, int lowbound, int highbound, int Nbins)
 
void setupDepthHists2D (MonitorElement *&h, std::vector< MonitorElement * > &hh, std::string Name, std::string Units)
 
void setupDepthHists2D (std::vector< MonitorElement * > &hh, std::string Name, std::string Units)
 
void setupDepthHists2D (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 (std::vector< MonitorElement * > &hh, std::string Name, std::string Units, int nbinsx, int lowboundx, int highboundx, int nbinsy, int lowboundy, int highboundy)
 
void SetupEtaPhiHists (MonitorElement *&h, EtaPhiHists &hh, std::string Name, std::string Units)
 
void SetupEtaPhiHists (EtaPhiHists &hh, std::string Name, std::string Units)
 
void setVerbosity (int verb)
 
bool vetoCell (HcalDetId &id)
 
virtual ~HcalBaseMonitor ()
 

Private Attributes

uint32_t consecutiveEETriggers [NUMFEDS][NUMSPIGS]
 
uint32_t consecutiveNETriggers [NUMFEDS][NUMSPIGS]
 
uint32_t consecutiveTriggers [NUMFEDS][NUMSPIGS]
 
int dccOrN
 
bool EEthisEvent [NUMSPIGS *NUMFEDS]
 
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 [NUMFEDS][NUMSPIGS]
 
uint64_t US0EE0count [NUMFEDS][NUMSPIGS]
 
uint64_t US0EE1count [NUMFEDS][NUMSPIGS]
 
uint64_t US1EE0count [NUMFEDS][NUMSPIGS]
 
uint64_t US1EE1count [NUMFEDS][NUMSPIGS]
 
uint64_t UScount [NUMFEDS][NUMSPIGS]
 

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
 
DQMStorem_dbe
 
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

Date:
2009/07/06 10:51:54
Revision:
1.3
Author
J. Temple - Univ. of Maryland

Definition at line 37 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[NUMFEDS][NUMSPIGS]
#define NUMSPIGS
uint32_t consecutiveEETriggers[NUMFEDS][NUMSPIGS]
#define NUMFEDS
uint32_t consecutiveNETriggers[NUMFEDS][NUMSPIGS]
int prevWasEE[NUMFEDS][NUMSPIGS]
double f[11][100]
uint64_t UScount[NUMFEDS][NUMSPIGS]
uint64_t US1EE0count[NUMFEDS][NUMSPIGS]
uint64_t US0EE1count[NUMFEDS][NUMSPIGS]
uint64_t US0EE0count[NUMFEDS][NUMSPIGS]
uint64_t US1EE1count[NUMFEDS][NUMSPIGS]
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 HcalBaseMonitor::baseFolder_, HcalBaseMonitor::m_dbe, meEVT_, DQMStore::removeContents(), and DQMStore::setCurrentFolder().

70 {
71  if (m_dbe)
72  {
75  } // if (m_dbe)
76  meEVT_=0;
77 } // void HcalEEUSMonitor::clearME()
void removeContents(void)
erase all monitoring elements in current directory (not including subfolders);
Definition: DQMStore.cc:2564
MonitorElement * meEVT_
std::string baseFolder_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void HcalEEUSMonitor::processEvent ( const FEDRawDataCollection rawraw,
const HcalUnpackerReport report,
const HcalElectronicsMap emap 
)

Definition at line 236 of file HcalEEUSMonitor.cc.

References gather_cfg::cout, dccOrN, EEthisEvent, MonitorElement::Fill(), HcalBaseMonitor::fVerbosity, i, ievt_, HcalBaseMonitor::m_dbe, meEVT_, NUMFEDS, NUMSPIGS, prevOrN, and processEvent_RawData().

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

Definition at line 263 of file HcalEEUSMonitor.cc.

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

Referenced by processEvent().

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

Definition at line 67 of file HcalEEUSMonitor.cc.

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

Reimplemented from HcalBaseMonitor.

Definition at line 80 of file HcalEEUSMonitor.cc.

References HcalBaseMonitor::baseFolder_, DQMStore::book1D(), DQMStore::book2D(), DQMStore::bookInt(), gather_cfg::cout, f, fedUnpackList_, firstFED_, HcalBaseMonitor::fVerbosity, i, ievt_, diffTwoXMLs::label, HcalBaseMonitor::m_dbe, 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::setCurrentFolder(), HcalBaseMonitor::setup(), HcalDCCHeader::SPIGOT_COUNT, and indexGen::title.

81 {
82  HcalBaseMonitor::setup(ps,dbe); // 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 
102  if (m_dbe)
103  {
104  std::string type;
106  meEVT_ = m_dbe->bookInt("EEUSMonitor Event Number"); // store event number
107 
108  char label[10];
109  //Francesco
110 
111  //fraction of X-Type events
112 
113  type = "Fraction Normal Events - US0 EE0";
114  meNormFractSpigs_US0_EE0_ = m_dbe->book1D(type,type,481,0,481);
115  for(int f=0; f<NUMFEDS; f++) {
116  sprintf(label, "FED 7%02d", f);
118  for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
119  sprintf(label, "sp%02d", s-1);
120  meNormFractSpigs_US0_EE0_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
121 
122  type = "Fraction Empty Events - US0 EE1";
123  meEEFractSpigs_US0_EE1_ = m_dbe->book1D(type,type,481,0,481);
124  for(int f=0; f<NUMFEDS; f++) {
125  sprintf(label, "FED 7%02d", f);
126  meEEFractSpigs_US0_EE1_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f), label);
127  for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
128  sprintf(label, "sp%02d", s-1);
129  meEEFractSpigs_US0_EE1_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
130 
131  type = "Fraction UnSuppressed Events - US1 EE0";
132  meUSFractSpigs_US1_EE0_ = m_dbe->book1D(type,type,481,0,481);
133  for(int f=0; f<NUMFEDS; f++) {
134  sprintf(label, "FED 7%02d", f);
135  meUSFractSpigs_US1_EE0_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f), label);
136  for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
137  sprintf(label, "sp%02d", s-1);
138  meUSFractSpigs_US1_EE0_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
139 
140  type = "Fraction UnSuppressed Events - US1 EE1";
141  meUSFractSpigs_US1_EE1_ = m_dbe->book1D(type,type,481,0,481);
142  for(int f=0; f<NUMFEDS; f++) {
143  sprintf(label, "FED 7%02d", f);
144  meUSFractSpigs_US1_EE1_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f), label);
145  for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
146  sprintf(label, "sp%02d", s-1);
147  meUSFractSpigs_US1_EE1_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
148 
149  //raw data length for X-type events
150 
151  type = "Length of raw data - US0 EE0";
152  meRawDataLength2_US0_EE0_ = m_dbe->book2D(type,type,481,0,481,600,0,1200);
153  for(int f=0; f<NUMFEDS; f++) {
154  sprintf(label, "FED 7%02d", f);
155  meRawDataLength2_US0_EE0_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f), label);
156  for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
157  sprintf(label, "sp%02d", s-1);
158  meRawDataLength2_US0_EE0_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
159 
160  type = "Length of raw data - US0 EE1";
161  meRawDataLength2_US0_EE1_ = m_dbe->book2D(type,type,481,0,481,600,0,1200);
162  for(int f=0; f<NUMFEDS; f++) {
163  sprintf(label, "FED 7%02d", f);
164  meRawDataLength2_US0_EE1_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f), label);
165  for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
166  sprintf(label, "sp%02d", s-1);
167  meRawDataLength2_US0_EE1_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
168 
169  type = "Length of raw data - US1 EE0";
170  meRawDataLength2_US1_EE0_ = m_dbe->book2D(type,type,481,0,481,600,0,1200);
171  for(int f=0; f<NUMFEDS; f++) {
172  sprintf(label, "FED 7%02d", f);
173  meRawDataLength2_US1_EE0_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f), label);
174  for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
175  sprintf(label, "sp%02d", s-1);
176  meRawDataLength2_US1_EE0_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
177 
178  type = "Length of raw data - US1 EE1";
179  meRawDataLength2_US1_EE1_ = m_dbe->book2D(type,type,481,0,481,600,0,1200);
180  for(int f=0; f<NUMFEDS; f++) {
181  sprintf(label, "FED 7%02d", f);
182  meRawDataLength2_US1_EE1_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f), label);
183  for(int s=1; s<HcalDCCHeader::SPIGOT_COUNT; s++) {
184  sprintf(label, "sp%02d", s-1);
185  meRawDataLength2_US1_EE1_->setBinLabel(1+(HcalDCCHeader::SPIGOT_COUNT*f)+s, label);}}
186 
187  //---------
188 
189  //EECorrels Jason
190 
191  type="EE Spigot Correlation";
192  meEECorrel_ = m_dbe->book2D(type, type,
193  (NUMSPIGS * NUMFEDS), 0, (NUMSPIGS * NUMFEDS),
194  (NUMSPIGS * NUMFEDS), 0, (NUMSPIGS * NUMFEDS));
195  type="EE per Spigot";
196  meEEPerSpigot_ = m_dbe->book1D(type, type,
197  (NUMSPIGS * NUMFEDS), 0, (NUMSPIGS * NUMFEDS));
198  type="EE Spigots per Event";
199  meEEThisEvent_ = m_dbe->book1D(type, type,500,-0.5,499.5);
200 
201  //EE/NE Triggers Jared
202 
203  char title[128];
204  sprintf(title, "EE Triggers"); // DCC FED number 700:731
205  meNumberEETriggered_ = m_dbe->book2D(title,title,(NUMSPIGS * NUMFEDS),0,(NUMSPIGS * NUMFEDS),100,-0.5,99.5);
206  sprintf(title, "NE Triggers"); // DCC FED number 700:731
207  meNumberNETriggered_ = m_dbe->book2D(title,title,(NUMSPIGS * NUMFEDS),0,(NUMSPIGS * NUMFEDS),100,-0.5,99.5);
208  sprintf(title, "Triggers"); // DCC FED number 700:731
209  meNumberTriggered_ = m_dbe->book2D(title,title,(NUMSPIGS * NUMFEDS),0,(NUMSPIGS * NUMFEDS),100,-0.5,99.5);
210 
211  for (int f=0; f<NUMFEDS;f++){
212  sprintf(label, "DCC 7%02d", f); // DCC FED number 700:731
213  meEECorrel_->setBinLabel(1+(f*NUMSPIGS), label, 1);
214  meEECorrel_->setBinLabel(1+(f*NUMSPIGS), label, 2);
215  meEEPerSpigot_->setBinLabel(1+(f*NUMSPIGS), label, 1);
216  meNumberEETriggered_->setBinLabel(1+(f*NUMSPIGS), label, 1);
217  meNumberNETriggered_->setBinLabel(1+(f*NUMSPIGS), label, 1);
218  meNumberTriggered_->setBinLabel(1+(f*NUMSPIGS), label, 1);
219  for (int s=1; s<NUMSPIGS; s+=2) {
220  sprintf(label, "Spgt %02d", s-1); // DCC Spigots
221  meEECorrel_->setBinLabel((f*NUMSPIGS)+s+1, label, 1);
222  meEECorrel_->setBinLabel((f*NUMSPIGS)+s+1, label, 2);
223  meEEPerSpigot_->setBinLabel((f*NUMSPIGS)+s+1, label, 1);
224  meNumberEETriggered_->setBinLabel((f*NUMSPIGS)+s+1, label, 1);
225  meNumberNETriggered_->setBinLabel((f*NUMSPIGS)+s+1, label, 1);
226  meNumberTriggered_->setBinLabel((f*NUMSPIGS)+s+1, label, 1);}}
227 
228  prevOrN = -1;
229  } // if (m_dbe)
230 
231  return;
232 
233 } // void HcalEEUSMonitor::setup()
type
Definition: HCALResponse.h:22
int i
Definition: DBlmapReader.cc:9
MonitorElement * meUSFractSpigs_US1_EE1_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
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_
std::vector< int > fedUnpackList_
double f[11][100]
MonitorElement * meNumberTriggered_
MonitorElement * meRawDataLength2_US1_EE0_
std::string baseFolder_
MonitorElement * meEEThisEvent_
static const int SPIGOT_COUNT
Definition: HcalDCCHeader.h:21
MonitorElement * meNumberEETriggered_
MonitorElement * meUSFractSpigs_US1_EE0_
tuple cout
Definition: gather_cfg.py:121
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:624
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:845
MonitorElement * meEEPerSpigot_
MonitorElement * meEECorrel_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
MonitorElement * meRawDataLength2_US1_EE1_
virtual void setup(const edm::ParameterSet &ps, DQMStore *dbe)
void HcalEEUSMonitor::unpack ( const FEDRawData raw,
const HcalElectronicsMap emap 
)

Definition at line 308 of file HcalEEUSMonitor.cc.

References consecutiveEETriggers, consecutiveNETriggers, consecutiveTriggers, gather_cfg::cout, FEDRawData::data(), dccOrN, 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, 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().

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

Member Data Documentation

uint32_t HcalEEUSMonitor::consecutiveEETriggers[NUMFEDS][NUMSPIGS]
private

Definition at line 107 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor(), and unpack().

uint32_t HcalEEUSMonitor::consecutiveNETriggers[NUMFEDS][NUMSPIGS]
private

Definition at line 108 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor(), and unpack().

uint32_t HcalEEUSMonitor::consecutiveTriggers[NUMFEDS][NUMSPIGS]
private

Definition at line 109 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor(), and unpack().

int HcalEEUSMonitor::dccOrN
private

Definition at line 110 of file HcalEEUSMonitor.h.

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

bool HcalEEUSMonitor::EEthisEvent[NUMSPIGS *NUMFEDS]
private

Definition at line 75 of file HcalEEUSMonitor.h.

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

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

Definition at line 63 of file HcalEEUSMonitor.h.

Referenced by processEvent_RawData(), and setup().

int HcalEEUSMonitor::firstFED_
private

Definition at line 64 of file HcalEEUSMonitor.h.

Referenced by setup().

int HcalEEUSMonitor::ievt_
private

Definition at line 60 of file HcalEEUSMonitor.h.

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

MonitorElement* HcalEEUSMonitor::meEECorrel_
private

Definition at line 69 of file HcalEEUSMonitor.h.

Referenced by processEvent_RawData(), and setup().

MonitorElement* HcalEEUSMonitor::meEEFractSpigs_US0_EE1_
private

Definition at line 80 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meEEPerSpigot_
private

Definition at line 70 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meEEThisEvent_
private

Definition at line 71 of file HcalEEUSMonitor.h.

Referenced by processEvent_RawData(), and setup().

MonitorElement* HcalEEUSMonitor::meEVT_
private

Definition at line 61 of file HcalEEUSMonitor.h.

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

MonitorElement* HcalEEUSMonitor::meNormFractSpigs_US0_EE0_
private

Definition at line 79 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meNumberEETriggered_
private

Definition at line 102 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meNumberNETriggered_
private

Definition at line 103 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meNumberTriggered_
private

Definition at line 104 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meRawDataLength2_US0_EE0_
private

Definition at line 84 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meRawDataLength2_US0_EE1_
private

Definition at line 85 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meRawDataLength2_US1_EE0_
private

Definition at line 86 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meRawDataLength2_US1_EE1_
private

Definition at line 87 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meUSFractSpigs_US1_EE0_
private

Definition at line 81 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

MonitorElement* HcalEEUSMonitor::meUSFractSpigs_US1_EE1_
private

Definition at line 82 of file HcalEEUSMonitor.h.

Referenced by setup(), and unpack().

int HcalEEUSMonitor::numEEthisEvent
private

Definition at line 76 of file HcalEEUSMonitor.h.

Referenced by processEvent_RawData(), and unpack().

int HcalEEUSMonitor::prevOrN
private

Definition at line 111 of file HcalEEUSMonitor.h.

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

int HcalEEUSMonitor::prevWasEE[NUMFEDS][NUMSPIGS]
private

Definition at line 112 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor(), and unpack().

uint64_t HcalEEUSMonitor::US0EE0count[NUMFEDS][NUMSPIGS]
private

Definition at line 92 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor(), and unpack().

uint64_t HcalEEUSMonitor::US0EE1count[NUMFEDS][NUMSPIGS]
private

Definition at line 93 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor(), and unpack().

uint64_t HcalEEUSMonitor::US1EE0count[NUMFEDS][NUMSPIGS]
private

Definition at line 94 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor(), and unpack().

uint64_t HcalEEUSMonitor::US1EE1count[NUMFEDS][NUMSPIGS]
private

Definition at line 95 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor(), and unpack().

uint64_t HcalEEUSMonitor::UScount[NUMFEDS][NUMSPIGS]
private

Definition at line 91 of file HcalEEUSMonitor.h.

Referenced by HcalEEUSMonitor().