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 = getTime(fData, 4, 6, fSum); // tsmin = 4, tsmax = 6.
293  //std::cout << "Side= " << iSide << " Section= " << iSection << " Channel= " << iChannel << "\tCharge\t" << fSum <<std::endl;
294  if (saturated==true){
295  h_2D_saturation->Fill(iSide==1?0:1,iSection==1?iChannel-1:iChannel+4,1);
296  }
297 
298  if (iSection == 1)
299  { // EM
300  if (iSide == 1) { // Plus
301  for (unsigned int i = 0; i < fTS; ++i) {
302  if (fData[i] > digiThresh) h_ZDCP_EM_Pulse[iChannel - 1]->Fill(i, fData[i]);
303  }
304  if (fSum > digiThresh) {
305  h_ZDCP_EM_Charge[iChannel - 1]->Fill(fSum);
306  h_ZDCP_EM_TSMean[iChannel - 1]->Fill(fTSMean);
307  //std::cout<< "fSum " << fSum << " fTSMean " << fTSMean <<std::endl;
308  }
309  } // Plus
310  if (iSide == -1) { // Minus
311  for (unsigned int i = 0; i < fTS; ++i) {
312  if (fData[i] > digiThresh) h_ZDCM_EM_Pulse[iChannel - 1]->Fill(i, fData[i]);
313  }
314  if (fSum > digiThresh) {
315  h_ZDCM_EM_Charge[iChannel - 1]->Fill(fSum);
316  h_ZDCM_EM_TSMean[iChannel - 1]->Fill(fTSMean);
317  }
318  } // Minus
319  }// EM
320 
321  else if (iSection == 2)
322  { // HAD
323  if (iSide == 1) { // Plus
324  for (unsigned int i = 0; i < fTS; ++i) {
325  if (fData[i] > digiThresh) h_ZDCP_HAD_Pulse[iChannel - 1]->Fill(i, fData[i]);
326  }
327  if (fSum > digiThresh) {
328  h_ZDCP_HAD_Charge[iChannel - 1]->Fill(fSum);
329  h_ZDCP_HAD_TSMean[iChannel - 1]->Fill(fTSMean);
330  }
331  } // Plus
332  if (iSide == -1) { // Minus
333  for (unsigned int i = 0; i < fTS; ++i) {
334  if (fData[i] > digiThresh) h_ZDCM_HAD_Pulse[iChannel - 1]->Fill(i, fData[i]);
335  }
336  if (fSum > digiThresh) {
337  h_ZDCM_HAD_Charge[iChannel - 1]->Fill(fSum);
338  h_ZDCM_HAD_TSMean[iChannel - 1]->Fill(fTSMean);
339  }
340  }// Minus
341  } // HAD
342  } // loop on zdc digi collection
343 
344 
345  //--------------------------------------
346  // ZDC RecHit part
347  //--------------------------------------
348  for (ZDCRecHitCollection::const_iterator rechit_iter = rechit.begin();
349  rechit_iter != rechit.end(); ++rechit_iter)
350  {
351  HcalZDCDetId id(rechit_iter->id());
352  int Side = (rechit_iter->id()).zside();
353  int Section = (rechit_iter->id()).section();
354  int Channel = (rechit_iter->id()).channel();
355  //std::cout << "RecHitEnergy " << zhit->energy() << " RecHitTime " << zhit->time() << std::endl;
356 
357  if(Section==1)
358  { //EM
359  if (Side ==1 ){ // Plus
360  h_ZDCP_EM_RecHitEnergy[Channel-1]->Fill(rechit_iter->energy());
361  h_ZDCP_EM_RecHitTiming[Channel-1]->Fill(rechit_iter->time());
362  }
363  if (Side == -1 ){ //Minus
364  h_ZDCM_EM_RecHitEnergy[Channel-1]->Fill(rechit_iter->energy());
365  h_ZDCM_EM_RecHitTiming[Channel-1]->Fill(rechit_iter->time());
366  }
367  } //EM
368  else if(Section==2)
369  { //HAD
370  if (Side ==1 ){ //Plus
371  h_ZDCP_HAD_RecHitEnergy[Channel-1]->Fill(rechit_iter->energy());
372  h_ZDCP_HAD_RecHitTiming[Channel-1]->Fill(rechit_iter->time());
373  }
374  if (Side == -1 ){ //Minus
375  h_ZDCM_HAD_RecHitEnergy[Channel-1]->Fill(rechit_iter->energy());
376  h_ZDCM_HAD_RecHitTiming[Channel-1]->Fill(rechit_iter->time());
377  }
378  } // HAD
379  } // loop on rechits
380 
381 } // end of event processing
382 /*
383 ------------------------------------------------------------------------------------
384 // This is what we did to find the good signal. After we've started to use only time slice 4,5,6.
385 bool HcalZDCMonitor::isGood(std::vector<double>fData, double fCut, double fPercentage) {
386  bool dec = false;
387  int ts_max = -1;
388 
389  ts_max = getTSMax(fData);
390  if (ts_max == 0 || ts_max == (int)(fData.size() - 1))
391  return false;
392  float sum = fData[ts_max - 1] + fData[ts_max + 1];
393 
394  // cout << "tsMax " << ts_max << " data[tsmax] " << mData[ts_max] << " sum " << sum << endl;
395  if (fData[ts_max] > fCut && sum > (fData[ts_max] * fPercentage))
396  dec = true;
397  return dec;
398 } // bool HcalZDCMonitor::isGood
399 
400 int HcalZDCMonitor::getTSMax(std::vector<double>fData)
401 {
402  int ts_max = -100;
403  double max = -999.;
404 
405  for (unsigned int j = 0; j < fData.size(); ++j) {
406  if (max < fData[j]) {
407  max = fData[j];
408  ts_max = j;
409  }
410  }
411  return ts_max;
412 } // int HcalZDCMonitor::getTSMax()
413 ------------------------------------------------------------------------------------
414 */
415 double HcalZDCMonitor::getTime(std::vector<double>fData, unsigned int ts_min, unsigned int ts_max, double &fSum) {
416  double weightedTime = 0.;
417  double SumT = 0.;
418  double Time = -999.;
419  double digiThreshf = 99.5;
420 
421  for (unsigned int ts=ts_min; ts<=ts_max; ++ts) {
422  if (fData[ts] > digiThreshf){
423  weightedTime += ts * fData[ts];
424  SumT += fData[ts];
425  }
426  }
427 
428  if (SumT > 0.) {
429  Time = weightedTime / SumT;
430  }
431 
432  fSum = SumT;
433 
434  return Time;
435 
436 } //double HcalZDCMonitor::getTime()
437 
438 
440 {
441 
442  for (int i = 0; i < 5; ++i) { // EM Channels
443  // ZDC Plus
444  h_2D_charge->setBinContent(1, i + 1, h_ZDCP_EM_Charge[i]->getMean());
445  h_2D_TSMean->setBinContent(1, i + 1, h_ZDCP_EM_TSMean[i]->getMean());
448  // ZDC Minus
449  h_2D_charge->setBinContent(2, i + 1, h_ZDCM_EM_Charge[i]->getMean());
450  h_2D_TSMean->setBinContent(2, i + 1, h_ZDCM_EM_TSMean[i]->getMean());
453  }
454 
455  for (int i = 0; i < 4; ++i) { // HAD channels
456  // ZDC Plus
457  h_2D_charge->setBinContent(1, i + 6, h_ZDCP_HAD_Charge[i]->getMean());
458  h_2D_TSMean->setBinContent(1, i + 6, h_ZDCP_HAD_TSMean[i]->getMean());
461  // ZDC Minus
462  //h_ZDCM_HAD_Pulse[i]->Scale(10. / h_ZDCM_HAD_Pulse[i]->getEntries());
463  h_2D_charge->setBinContent(2, i + 6, h_ZDCM_HAD_Charge[i]->getMean());
464  h_2D_TSMean->setBinContent(2, i + 6, h_ZDCM_HAD_TSMean[i]->getMean());
467  }
468 } // void HcalZDCMonitor::endLuminosityBlock()
469 
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:514
MonitorElement * h_ZDCM_EM_RecHitTiming[5]
double getTime(std::vector< double > fData, unsigned int ts_min, unsigned int ts_max, double &fSum)
MonitorElement * h_2D_TSMean
MonitorElement * h_ZDCM_HAD_RecHitTiming[4]
MonitorElement * h_ZDCP_EM_RecHitEnergy[5]
std::vector< T >::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]
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)
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:41
DQMChannel Channel
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:421
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:642
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:232
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]