CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalZDCMonitor.cc
Go to the documentation of this file.
2 
4 }
6 }
8 }
9 
11  HcalBaseMonitor::setup(ps, dbe);
12 
13  baseFolder_ = rootFolder_ + "ZDCMonitor_Hcal";
14 
15  if (showTiming) {
16  cpu_timer.reset();
17  cpu_timer.start();
18  }
19 
20  if (fVerbosity > 0)
21  std::cout << "<HcalZDCMonitor::setup> Setting up histograms" << std::endl;
22 
23  if (fVerbosity > 1)
24  std::cout << "<HcalZDCMonitor::setup> Getting variable values from cfg files" << std::endl;
25 
26  // Set initial event # to 0
27  ievt_ = 0;
28 
29 //Histograms
30  if (m_dbe) {
31  if (fVerbosity > 1)
32  std::cout << "<HcalZDCMonitor::setup> Setting up Histograms" << std::endl;
33 
35  meEVT_ = m_dbe->bookInt("ZDC Event Number");
36  meEVT_->Fill(ievt_);
37  char name[128];
38  char title[128];
39 
40  h_2D_charge = m_dbe->book2D("2D_DigiCharge", "Digi Charge (fC)", 2, 0, 2, 9, 0, 9);
41  h_2D_charge->setBinLabel(1,"ZDC+",1);
42  h_2D_charge->setBinLabel(2,"ZDC-",1);
43  h_2D_charge->setBinLabel(1,"EM1",2);
44  h_2D_charge->setBinLabel(2,"EM2",2);
45  h_2D_charge->setBinLabel(3,"EM3",2);
46  h_2D_charge->setBinLabel(4,"EM4",2);
47  h_2D_charge->setBinLabel(5,"EM5",2);
48  h_2D_charge->setBinLabel(6,"HAD1",2);
49  h_2D_charge->setBinLabel(7,"HAD2",2);
50  h_2D_charge->setBinLabel(8,"HAD3",2);
51  h_2D_charge->setBinLabel(9,"HAD4",2);
52 
53  h_2D_TSMean = m_dbe->book2D("2D_DigiTiming", "Digi Timing", 2, 0, 2, 9, 0, 9);
54  h_2D_TSMean->setBinLabel(1,"ZDC+",1);
55  h_2D_TSMean->setBinLabel(2,"ZDC-",1);
56  h_2D_TSMean->setBinLabel(1,"EM1",2);
57  h_2D_TSMean->setBinLabel(2,"EM2",2);
58  h_2D_TSMean->setBinLabel(3,"EM3",2);
59  h_2D_TSMean->setBinLabel(4,"EM4",2);
60  h_2D_TSMean->setBinLabel(5,"EM5",2);
61  h_2D_TSMean->setBinLabel(6,"HAD1",2);
62  h_2D_TSMean->setBinLabel(7,"HAD2",2);
63  h_2D_TSMean->setBinLabel(8,"HAD3",2);
64  h_2D_TSMean->setBinLabel(9,"HAD4",2);
65 
66  h_2D_RecHitEnergy = m_dbe->book2D("2D_RecHitEnergy", "Rechit Energy", 2, 0, 2, 9, 0, 9);
67  h_2D_RecHitEnergy->setBinLabel(1,"ZDC+",1);
68  h_2D_RecHitEnergy->setBinLabel(2,"ZDC-",1);
69  h_2D_RecHitEnergy->setBinLabel(1,"EM1",2);
70  h_2D_RecHitEnergy->setBinLabel(2,"EM2",2);
71  h_2D_RecHitEnergy->setBinLabel(3,"EM3",2);
72  h_2D_RecHitEnergy->setBinLabel(4,"EM4",2);
73  h_2D_RecHitEnergy->setBinLabel(5,"EM5",2);
74  h_2D_RecHitEnergy->setBinLabel(6,"HAD1",2);
75  h_2D_RecHitEnergy->setBinLabel(7,"HAD2",2);
76  h_2D_RecHitEnergy->setBinLabel(8,"HAD3",2);
77  h_2D_RecHitEnergy->setBinLabel(9,"HAD4",2);
78 
79  h_2D_RecHitTime = m_dbe->book2D("2D_RecHitTime", "Rechit Timing", 2, 0, 2, 9, 0, 9);
80  h_2D_RecHitTime->setBinLabel(1,"ZDC+",1);
81  h_2D_RecHitTime->setBinLabel(2,"ZDC-",1);
82  h_2D_RecHitTime->setBinLabel(1,"EM1",2);
83  h_2D_RecHitTime->setBinLabel(2,"EM2",2);
84  h_2D_RecHitTime->setBinLabel(3,"EM3",2);
85  h_2D_RecHitTime->setBinLabel(4,"EM4",2);
86  h_2D_RecHitTime->setBinLabel(5,"EM5",2);
87  h_2D_RecHitTime->setBinLabel(6,"HAD1",2);
88  h_2D_RecHitTime->setBinLabel(7,"HAD2",2);
89  h_2D_RecHitTime->setBinLabel(8,"HAD3",2);
90  h_2D_RecHitTime->setBinLabel(9,"HAD4",2);
91 
92  h_2D_saturation = m_dbe->book2D("h_2D_QIE", "Saturation Check", 2, 0, 2, 9, 0, 9);
93  h_2D_saturation->setBinLabel(1,"ZDC+",1);
94  h_2D_saturation->setBinLabel(2,"ZDC-",1);
95  h_2D_saturation->setBinLabel(1,"EM1",2);
96  h_2D_saturation->setBinLabel(2,"EM2",2);
97  h_2D_saturation->setBinLabel(3,"EM3",2);
98  h_2D_saturation->setBinLabel(4,"EM4",2);
99  h_2D_saturation->setBinLabel(5,"EM5",2);
100  h_2D_saturation->setBinLabel(6,"HAD1",2);
101  h_2D_saturation->setBinLabel(7,"HAD2",2);
102  h_2D_saturation->setBinLabel(8,"HAD3",2);
103  h_2D_saturation->setBinLabel(9,"HAD4",2);
104 
105  m_dbe->setCurrentFolder(baseFolder_ + "/Digis");
106 
107  for (int i = 0; i < 5; ++i) {
108  // pulse Plus Side
109  sprintf(title, "h_ZDCP_EMChan_%i_Pulse", i + 1);
110  sprintf(name, "ZDC Plus EM Section Pulse for channel %i", i + 1);
111  h_ZDCP_EM_Pulse[i] = m_dbe->book1D(title, name, 10, -0.5, 9.5);
112  h_ZDCP_EM_Pulse[i]->setAxisTitle("Time Slice id",1);
113  h_ZDCP_EM_Pulse[i]->setAxisTitle("Pulse Height",2);
114  // pulse Minus Side
115  sprintf(title, "h_ZDCM_EMChan_%i_Pulse", i + 1);
116  sprintf(name, "ZDC Minus EM Section Pulse for channel %i", i + 1);
117  h_ZDCM_EM_Pulse[i] = m_dbe->book1D(title, name, 10, -0.5, 9.5);
118  h_ZDCM_EM_Pulse[i]->setAxisTitle("Time Slice id",1);
119  h_ZDCM_EM_Pulse[i]->setAxisTitle("Pulse Height",2);
120  // integrated charge over 10 time samples
121  sprintf(title, "h_ZDCP_EMChan_%i_Charge", i + 1);
122  sprintf(name, "ZDC Plus EM Section Charge for channel %i", i + 1);
123  h_ZDCP_EM_Charge[i] = m_dbe->book1D(title, name, 1000, 0., 30000.);
124  h_ZDCP_EM_Charge[i]->setAxisTitle("Charge (fC)",1);
125  h_ZDCP_EM_Charge[i]->setAxisTitle("Events",2);
126  // integrated charge over 10 time samples
127  sprintf(title, "h_ZDCM_EMChan_%i_Charge", i + 1);
128  sprintf(name, "ZDC Minus EM Section Charge for channel %i", i + 1);
129  h_ZDCM_EM_Charge[i] = m_dbe->book1D(title, name, 1000, 0., 30000.);
130  h_ZDCM_EM_Charge[i]->setAxisTitle("Charge (fC)",1);
131  h_ZDCM_EM_Charge[i]->setAxisTitle("Events",2);
132  // charge weighted time slice
133  sprintf(title, "h_ZDCP_EMChan_%i_TSMean", i + 1);
134  sprintf(name, "ZDC Plus EM Section TSMean for channel %i", i + 1);
135  h_ZDCP_EM_TSMean[i] = m_dbe->book1D(title, name, 100, -0.5, 9.5);
136  h_ZDCP_EM_TSMean[i]->setAxisTitle("Timing",1);
137  h_ZDCP_EM_TSMean[i]->setAxisTitle("Events",2);
138  // charge weighted time slice
139  sprintf(title, "h_ZDCM_EMChan_%i_TSMean", i + 1);
140  sprintf(name, "ZDC Minus EM Section TSMean for channel %i", i + 1);
141  h_ZDCM_EM_TSMean[i] = m_dbe->book1D(title, name, 100, -0.5, 9.5);
142  h_ZDCM_EM_TSMean[i]->setAxisTitle("Timing",1);
143  h_ZDCM_EM_TSMean[i]->setAxisTitle("Events",2);
144  }
145 
146  for (int i = 0; i < 4; ++i) {
147  // pulse Plus Side
148  sprintf(title, "h_ZDCP_HADChan_%i_Pulse", i + 1);
149  sprintf(name, "ZDC Plus HAD Section Pulse for channel %i", i + 1);
150  h_ZDCP_HAD_Pulse[i] = m_dbe->book1D(title, name, 10, -0.5, 9.5);
151  h_ZDCP_HAD_Pulse[i]->setAxisTitle("Time Slice id",1);
152  h_ZDCP_HAD_Pulse[i]->setAxisTitle("Pulse Height",2);
153  // pulse Minus Side
154  sprintf(title, "h_ZDCM_HADChan_%i_Pulse", i + 1);
155  sprintf(name, "ZDC Minus HAD Section Pulse for channel %i", i + 1);
156  h_ZDCM_HAD_Pulse[i] = m_dbe->book1D(title, name, 10, -0.5, 9.5);
157  h_ZDCP_HAD_Pulse[i]->setAxisTitle("Time Slice id",1);
158  h_ZDCP_HAD_Pulse[i]->setAxisTitle("Pulse Height",2);
159  // integrated charge over 10 time samples
160  sprintf(title, "h_ZDCP_HADChan_%i_Charge", i + 1);
161  sprintf(name, "ZDC Plus HAD Section Charge for channel %i", i + 1);
162  h_ZDCP_HAD_Charge[i] = m_dbe->book1D(title, name, 1000, 0., 30000.);
163  h_ZDCP_HAD_Charge[i]->setAxisTitle("Charge (fC)",1);
164  h_ZDCP_HAD_Charge[i]->setAxisTitle("Events",2);
165  // integrated charge over 10 time samples
166  sprintf(title, "h_ZDCM_HADChan_%i_Charge", i + 1);
167  sprintf(name, "ZDC Minus HAD Section Charge for channel %i", i + 1);
168  h_ZDCM_HAD_Charge[i] = m_dbe->book1D(title, name, 1000, 0., 30000.);
169  h_ZDCM_HAD_Charge[i]->setAxisTitle("Charge (fC)",1);
170  h_ZDCM_HAD_Charge[i]->setAxisTitle("Events",2);
171  // charge weighted time slice
172  sprintf(title, "h_ZDCP_HADChan_%i_TSMean", i + 1);
173  sprintf(name, "ZDC Plus HAD Section TSMean for channel %i", i + 1);
174  h_ZDCP_HAD_TSMean[i] = m_dbe->book1D(title, name, 100, -0.5, 9.5);
175  h_ZDCP_HAD_TSMean[i]->setAxisTitle("Timing",1);
176  h_ZDCP_HAD_TSMean[i]->setAxisTitle("Events",2);
177  // charge weighted time slice
178  sprintf(title, "h_ZDCM_HADChan_%i_TSMean", i + 1);
179  sprintf(name, "ZDC Minus HAD Section TSMean for channel %i", i + 1);
180  h_ZDCM_HAD_TSMean[i] = m_dbe->book1D(title, name, 100, -0.5, 9.5);
181  h_ZDCM_HAD_TSMean[i]->setAxisTitle("Timing",1);
182  h_ZDCM_HAD_TSMean[i]->setAxisTitle("Events",2);
183  }
184 
185  m_dbe->setCurrentFolder(baseFolder_ + "/RecHits");
186 
187  for (int i = 0; i < 5; ++i) {
188  //RecHitEnergy Plus Side
189  sprintf(title,"h_ZDCP_EMChan_%i_RecHit_Energy",i+1);
190  sprintf(name,"ZDC EM Section Rechit Energy for channel %i",i+1);
191  h_ZDCP_EM_RecHitEnergy[i] = m_dbe->book1D(title, name, 1010, -100., 10000.);
192  h_ZDCP_EM_RecHitEnergy[i]->setAxisTitle("Energy (GeV)",1);
193  h_ZDCP_EM_RecHitEnergy[i]->setAxisTitle("Events",2);
194  //RecHitEnergy Minus Side
195  sprintf(title,"h_ZDCM_EMChan_%i_RecHit_Energy",i+1);
196  sprintf(name,"ZDC EM Section Rechit Energy for channel %i",i+1);
197  h_ZDCM_EM_RecHitEnergy[i] = m_dbe->book1D(title, name, 1010, -100., 10000.);
198  h_ZDCM_EM_RecHitEnergy[i]->setAxisTitle("Energy (GeV)",1);
199  h_ZDCM_EM_RecHitEnergy[i]->setAxisTitle("Events",2);
200  //RecHit Timing Plus Side
201  sprintf(title,"h_ZDCP_EMChan_%i_RecHit_Timing",i+1);
202  sprintf(name,"ZDC EM Section Rechit Timing for channel %i",i+1);
203  h_ZDCP_EM_RecHitTiming[i] = m_dbe->book1D(title, name, 100, -100., 100.);
204  h_ZDCP_EM_RecHitTiming[i]->setAxisTitle("RecHit Time",1);
205  h_ZDCP_EM_RecHitTiming[i]->setAxisTitle("Events",2);
206  //RecHit Timing Minus Side
207  sprintf(title,"h_ZDCM_EMChan_%i_RecHit_Timing",i+1);
208  sprintf(name,"ZDC EM Section Rechit Timing for channel %i",i+1);
209  h_ZDCM_EM_RecHitTiming[i] = m_dbe->book1D(title, name, 100, -100., 100.);
210  h_ZDCM_EM_RecHitTiming[i]->setAxisTitle("RecHit Time",1);
211  h_ZDCM_EM_RecHitTiming[i]->setAxisTitle("Events",2);
212  }
213 
214  for (int i = 0; i < 4; ++i) {
215  //RecHitEnergy Plus Side
216  sprintf(title,"h_ZDCP_HADChan_%i_RecHit_Energy",i+1);
217  sprintf(name,"ZDC HAD Section Rechit Energy for channel %i",i+1);
218  h_ZDCP_HAD_RecHitEnergy[i] = m_dbe->book1D(title, name, 1010, -100., 10000.);
219  h_ZDCP_HAD_RecHitEnergy[i]->setAxisTitle("Energy (GeV)",1);
220  h_ZDCP_HAD_RecHitEnergy[i]->setAxisTitle("Events",2);
221  //RecHitEnergy Minus Side
222  sprintf(title,"h_ZDCM_HADChan_%i_RecHit_Energy",i+1);
223  sprintf(name,"ZDC HAD Section Rechit Energy for channel %i",i+1);
224  h_ZDCM_HAD_RecHitEnergy[i] = m_dbe->book1D(title, name, 1010, -100., 10000.);
225  h_ZDCM_HAD_RecHitEnergy[i]->setAxisTitle("Energy (GeV)",1);
226  h_ZDCM_HAD_RecHitEnergy[i]->setAxisTitle("Events",2);
227  //RecHit Timing Plus Side
228  sprintf(title,"h_ZDCP_HADChan_%i_RecHit_Timing",i+1);
229  sprintf(name,"ZDC HAD Section Rechit Timing for channel %i",i+1);
230  h_ZDCP_HAD_RecHitTiming[i] = m_dbe->book1D(title, name, 100, -100., 100.);
231  h_ZDCP_HAD_RecHitTiming[i]->setAxisTitle("RecHit Time",1);
232  h_ZDCP_HAD_RecHitTiming[i]->setAxisTitle("Events",2);
233  //RecHit Timing Minus Side
234  sprintf(title,"h_ZDCM_HADChan_%i_RecHit_Timing",i+1);
235  sprintf(name,"ZDC HAD Section Rechit Timing for channel %i",i+1);
236  h_ZDCM_HAD_RecHitTiming[i] = m_dbe->book1D(title, name, 100, -100., 100.);
237  h_ZDCM_HAD_RecHitTiming[i]->setAxisTitle("RecHit Time",1);
238  h_ZDCM_HAD_RecHitTiming[i]->setAxisTitle("Events",2);
239  }
240 
241  }
242  return;
243 }
244 
246  if (fVerbosity > 0)
247  std::cout << "<HcalZDCMonitor::processEvent> Processing Event..." << std::endl;
248  if (showTiming)
249  {
250  cpu_timer.reset();
251  cpu_timer.start();
252  }
253  ++ievt_;
254  meEVT_->Fill(ievt_);
255 
256  //--------------------------------------
257  // ZDC Digi part
258  //--------------------------------------
259  double fSum = 0.;
260  std::vector<double> fData;
261  double digiThresh = 99.5; //corresponds to 40 ADC counts
262  //int digiThreshADC = 40;
263  int digiSaturation = 127;
264  //double ZDCQIEConst = 2.6;
265 
266  for (ZDCDigiCollection::const_iterator digi_iter = digi.begin();
267  digi_iter != digi.end(); ++digi_iter)
268  {
269  const ZDCDataFrame digi = (const ZDCDataFrame) (*digi_iter);
270  //HcalZDCDetId id(digi_iter->id());
271  int iSide = digi_iter->id().zside();
272  int iSection = digi_iter->id().section();
273  int iChannel = digi_iter->id().channel();
274 
275  unsigned int fTS = digi_iter->size();
276  while (fData.size()<fTS)
277  fData.push_back(-999);
278  while (fData.size()>fTS)
279  fData.pop_back(); // delete last elements
280 
281  fSum = 0.;
282  bool saturated = false;
283  for (unsigned int i = 0; i < fTS; ++i)
284  {
285  //fData[i]=digi[i].nominal_fC() * ZDCQIEConst;
286  fData[i]=digi[i].nominal_fC();
287  if (digi[i].adc()==digiSaturation){
288  saturated=true;
289  }
290  }
291 
292  double fTSMean = 0;
293  if (fData.size()>6)
294  fTSMean = getTime(fData, 4, 6, fSum); // tsmin = 4, tsmax = 6.
295  //std::cout << "Side= " << iSide << " Section= " << iSection << " Channel= " << iChannel << "\tCharge\t" << fSum <<std::endl;
296  if (saturated==true){
297  h_2D_saturation->Fill(iSide==1?0:1,iSection==1?iChannel-1:iChannel+4,1);
298  }
299 
300  if (iSection == 1)
301  { // EM
302  if (iSide == 1) { // Plus
303  for (unsigned int i = 0; i < fTS; ++i) {
304  if (fData[i] > digiThresh) h_ZDCP_EM_Pulse[iChannel - 1]->Fill(i, fData[i]);
305  }
306  if (fSum > digiThresh) {
307  h_ZDCP_EM_Charge[iChannel - 1]->Fill(fSum);
308  h_ZDCP_EM_TSMean[iChannel - 1]->Fill(fTSMean);
309  //std::cout<< "fSum " << fSum << " fTSMean " << fTSMean <<std::endl;
310  }
311  } // Plus
312  if (iSide == -1) { // Minus
313  for (unsigned int i = 0; i < fTS; ++i) {
314  if (fData[i] > digiThresh) h_ZDCM_EM_Pulse[iChannel - 1]->Fill(i, fData[i]);
315  }
316  if (fSum > digiThresh) {
317  h_ZDCM_EM_Charge[iChannel - 1]->Fill(fSum);
318  h_ZDCM_EM_TSMean[iChannel - 1]->Fill(fTSMean);
319  }
320  } // Minus
321  }// EM
322 
323  else if (iSection == 2)
324  { // HAD
325  if (iSide == 1) { // Plus
326  for (unsigned int i = 0; i < fTS; ++i) {
327  if (fData[i] > digiThresh) h_ZDCP_HAD_Pulse[iChannel - 1]->Fill(i, fData[i]);
328  }
329  if (fSum > digiThresh) {
330  h_ZDCP_HAD_Charge[iChannel - 1]->Fill(fSum);
331  h_ZDCP_HAD_TSMean[iChannel - 1]->Fill(fTSMean);
332  }
333  } // Plus
334  if (iSide == -1) { // Minus
335  for (unsigned int i = 0; i < fTS; ++i) {
336  if (fData[i] > digiThresh) h_ZDCM_HAD_Pulse[iChannel - 1]->Fill(i, fData[i]);
337  }
338  if (fSum > digiThresh) {
339  h_ZDCM_HAD_Charge[iChannel - 1]->Fill(fSum);
340  h_ZDCM_HAD_TSMean[iChannel - 1]->Fill(fTSMean);
341  }
342  }// Minus
343  } // HAD
344  } // loop on zdc digi collection
345 
346 
347  //--------------------------------------
348  // ZDC RecHit part
349  //--------------------------------------
350  for (ZDCRecHitCollection::const_iterator rechit_iter = rechit.begin();
351  rechit_iter != rechit.end(); ++rechit_iter)
352  {
353  int Side = (rechit_iter->id()).zside();
354  int Section = (rechit_iter->id()).section();
355  int Channel = (rechit_iter->id()).channel();
356  //std::cout << "RecHitEnergy " << zhit->energy() << " RecHitTime " << zhit->time() << std::endl;
357 
358  if(Section==1)
359  { //EM
360  if (Side ==1 ){ // Plus
361  h_ZDCP_EM_RecHitEnergy[Channel-1]->Fill(rechit_iter->energy());
362  h_ZDCP_EM_RecHitTiming[Channel-1]->Fill(rechit_iter->time());
363  }
364  if (Side == -1 ){ //Minus
365  h_ZDCM_EM_RecHitEnergy[Channel-1]->Fill(rechit_iter->energy());
366  h_ZDCM_EM_RecHitTiming[Channel-1]->Fill(rechit_iter->time());
367  }
368  } //EM
369  else if(Section==2)
370  { //HAD
371  if (Side ==1 ){ //Plus
372  h_ZDCP_HAD_RecHitEnergy[Channel-1]->Fill(rechit_iter->energy());
373  h_ZDCP_HAD_RecHitTiming[Channel-1]->Fill(rechit_iter->time());
374  }
375  if (Side == -1 ){ //Minus
376  h_ZDCM_HAD_RecHitEnergy[Channel-1]->Fill(rechit_iter->energy());
377  h_ZDCM_HAD_RecHitTiming[Channel-1]->Fill(rechit_iter->time());
378  }
379  } // HAD
380  } // loop on rechits
381 
382 } // end of event processing
383 /*
384 ------------------------------------------------------------------------------------
385 // This is what we did to find the good signal. After we've started to use only time slice 4,5,6.
386 bool HcalZDCMonitor::isGood(std::vector<double>fData, double fCut, double fPercentage) {
387  bool dec = false;
388  int ts_max = -1;
389 
390  ts_max = getTSMax(fData);
391  if (ts_max == 0 || ts_max == (int)(fData.size() - 1))
392  return false;
393  float sum = fData[ts_max - 1] + fData[ts_max + 1];
394 
395  // cout << "tsMax " << ts_max << " data[tsmax] " << mData[ts_max] << " sum " << sum << endl;
396  if (fData[ts_max] > fCut && sum > (fData[ts_max] * fPercentage))
397  dec = true;
398  return dec;
399 } // bool HcalZDCMonitor::isGood
400 
401 int HcalZDCMonitor::getTSMax(std::vector<double>fData)
402 {
403  int ts_max = -100;
404  double max = -999.;
405 
406  for (unsigned int j = 0; j < fData.size(); ++j) {
407  if (max < fData[j]) {
408  max = fData[j];
409  ts_max = j;
410  }
411  }
412  return ts_max;
413 } // int HcalZDCMonitor::getTSMax()
414 ------------------------------------------------------------------------------------
415 */
416 double HcalZDCMonitor::getTime(const std::vector<double>& fData, unsigned int ts_min, unsigned int ts_max, double &fSum) {
417  double weightedTime = 0.;
418  double SumT = 0.;
419  double Time = -999.;
420  double digiThreshf = 99.5;
421 
422  for (unsigned int ts=ts_min; ts<=ts_max; ++ts) {
423  if (fData[ts] > digiThreshf){
424  weightedTime += ts * fData[ts];
425  SumT += fData[ts];
426  }
427  }
428 
429  if (SumT > 0.) {
430  Time = weightedTime / SumT;
431  }
432 
433  fSum = SumT;
434 
435  return Time;
436 
437 } //double HcalZDCMonitor::getTime()
438 
439 
441 {
442 
443  for (int i = 0; i < 5; ++i) { // EM Channels
444  // ZDC Plus
445  h_2D_charge->setBinContent(1, i + 1, h_ZDCP_EM_Charge[i]->getMean());
446  h_2D_TSMean->setBinContent(1, i + 1, h_ZDCP_EM_TSMean[i]->getMean());
449  // ZDC Minus
450  h_2D_charge->setBinContent(2, i + 1, h_ZDCM_EM_Charge[i]->getMean());
451  h_2D_TSMean->setBinContent(2, i + 1, h_ZDCM_EM_TSMean[i]->getMean());
454  }
455 
456  for (int i = 0; i < 4; ++i) { // HAD channels
457  // ZDC Plus
458  h_2D_charge->setBinContent(1, i + 6, h_ZDCP_HAD_Charge[i]->getMean());
459  h_2D_TSMean->setBinContent(1, i + 6, h_ZDCP_HAD_TSMean[i]->getMean());
462  // ZDC Minus
463  //h_ZDCM_HAD_Pulse[i]->Scale(10. / h_ZDCM_HAD_Pulse[i]->getEntries());
464  h_2D_charge->setBinContent(2, i + 6, h_ZDCM_HAD_Charge[i]->getMean());
465  h_2D_TSMean->setBinContent(2, i + 6, h_ZDCM_HAD_TSMean[i]->getMean());
468  }
469 } // void HcalZDCMonitor::endLuminosityBlock()
470 
int adc(sample_type sample)
get the ADC sample (12 bits)
MonitorElement * h_ZDCP_HAD_TSMean[4]
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * h_ZDCP_HAD_RecHitTiming[4]
MonitorElement * h_ZDCM_EM_Pulse[5]
MonitorElement * h_ZDCM_HAD_TSMean[4]
void start()
Definition: CPUTimer.cc:74
MonitorElement * h_ZDCM_EM_TSMean[5]
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:942
MonitorElement * h_ZDCM_EM_RecHitTiming[5]
MonitorElement * h_2D_TSMean
MonitorElement * h_ZDCM_HAD_RecHitTiming[4]
MonitorElement * h_ZDCP_EM_RecHitEnergy[5]
std::vector< ZDCDataFrame >::const_iterator const_iterator
MonitorElement * h_ZDCP_EM_Pulse[5]
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)
void reset()
Definition: CPUTimer.cc:107
MonitorElement * h_ZDCP_EM_TSMean[5]
int zside(DetId const &)
MonitorElement * h_ZDCM_EM_Charge[5]
void Fill(long long x)
MonitorElement * h_ZDCP_HAD_Charge[4]
void setup(const edm::ParameterSet &ps, DQMStore *dbe)
std::string rootFolder_
MonitorElement * h_2D_saturation
MonitorElement * h_2D_charge
edm::CPUTimer cpu_timer
MonitorElement * h_2D_RecHitTime
MonitorElement * h_ZDCM_HAD_Charge[4]
std::string baseFolder_
MonitorElement * h_ZDCM_HAD_RecHitEnergy[4]
const_iterator end() const
void endLuminosityBlock(void)
double getTime(const std::vector< double > &fData, unsigned int ts_min, unsigned int ts_max, double &fSum)
MonitorElement * h_2D_RecHitEnergy
MonitorElement * h_ZDCP_HAD_Pulse[4]
MonitorElement * meEVT_
MonitorElement * h_ZDCM_EM_RecHitEnergy[5]
size_type size() const
MonitorElement * h_ZDCP_HAD_RecHitEnergy[4]
tuple cout
Definition: gather_cfg.py:121
DQMChannel Channel
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:849
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:1070
MonitorElement * h_ZDCP_EM_Charge[5]
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
const_iterator begin() const
virtual void setup(const edm::ParameterSet &ps, DQMStore *dbe)
MonitorElement * h_ZDCP_EM_RecHitTiming[5]
MonitorElement * h_ZDCM_HAD_Pulse[4]