CMS 3D CMS Logo

CastorPedestalsAnalysis.cc
Go to the documentation of this file.
1 // Original Author: Steven Won
2 // Original Author: Alan Campbell for castor
3 // Created: Fri May 2 15:34:43 CEST 2008
4 // Written to replace the combination of HcalPedestalAnalyzer and HcalPedestalAnalysis
5 // This code runs 1000x faster and produces all outputs from a single run
6 // (ADC, fC in .txt plus an .xml file)
7 //
8 
17 
32 
37 
40 
41 #include "TProfile.h"
42 #include "TH1.h"
43 #include "TH2.h"
44 #include "TCanvas.h"
45 #include "TStyle.h"
46 
47 #include <cmath>
48 #include <iostream>
49 #include <map>
50 #include <memory>
51 #include <iomanip>
52 #include <fstream>
53 #include <vector>
54 #include <string>
55 
56 namespace edm {
57  class ParameterSet;
58  class Event;
59  class EventSetup;
60 } // namespace edm
61 
62 struct NewPedBunch {
64  bool usedflag;
65  float cap[4];
66  float capfc[4];
67  float sig[4][4];
68  float sigfc[4][4];
69  float prod[4][4];
70  float prodfc[4][4];
71  int num[4][4];
72 };
73 
74 class CastorPedestalsAnalysis : public edm::one::EDAnalyzer<edm::one::SharedResources> {
75 public:
76  //Constructor
78  //Destructor
79  ~CastorPedestalsAnalysis() override;
80  //Analysis
81  void analyze(const edm::Event& event, const edm::EventSetup& eventSetup) override;
82 
83 private:
84  //Container for data, 1 per channel
85  std::vector<NewPedBunch> Bunches;
86  //Flag for saving histos
87  bool hiSaveFlag;
88  bool dumpXML;
90  int runnum;
91  int firstTS;
92  int lastTS;
101 
104 
105  TH1F* CASTORMeans;
107 
108  // TH2F *dephist[4];
109  TH2F* dephist;
110 
111  bool firsttime;
112 
114 };
115 
117  : castorDigiCollectionTag(ps.getParameter<edm::InputTag>("castorDigiCollectionTag")) {
118  usesResource(TFileService::kSharedResource);
119 
120  hiSaveFlag = ps.getUntrackedParameter<bool>("hiSaveFlag", false);
121  dumpXML = ps.getUntrackedParameter<bool>("dumpXML", false);
122  verboseflag = ps.getUntrackedParameter<bool>("verbose", false);
123  firstTS = ps.getUntrackedParameter<int>("firstTS", 0);
124  lastTS = ps.getUntrackedParameter<int>("lastTS", 9);
125  firsttime = true;
126 
127  tok_cond_ = esConsumes<CastorDbService, CastorDbRecord>();
128  tok_map_ = esConsumes<CastorElectronicsMap, CastorElectronicsMapRcd>();
129 }
130 
132  CastorPedestals* rawPedsItem = new CastorPedestals(true);
133  CastorPedestalWidths* rawWidthsItem = new CastorPedestalWidths(true);
134  CastorPedestals* rawPedsItemfc = new CastorPedestals(false);
135  CastorPedestalWidths* rawWidthsItemfc = new CastorPedestalWidths(false);
136 
137  //Calculate pedestal constants
138  std::cout << "Calculating Pedestal constants...\n";
139  std::vector<NewPedBunch>::iterator bunch_it;
140  for (bunch_it = Bunches.begin(); bunch_it != Bunches.end(); ++bunch_it) {
141  if (bunch_it->usedflag) {
142  if (verboseflag)
143  std::cout << "Analyzing channel sector= " << bunch_it->detid.sector()
144  << " module = " << bunch_it->detid.module() << std::endl;
145  //pedestal constant is the mean
146  bunch_it->cap[0] /= bunch_it->num[0][0];
147  bunch_it->cap[1] /= bunch_it->num[1][1];
148  bunch_it->cap[2] /= bunch_it->num[2][2];
149  bunch_it->cap[3] /= bunch_it->num[3][3];
150  bunch_it->capfc[0] /= bunch_it->num[0][0];
151  bunch_it->capfc[1] /= bunch_it->num[1][1];
152  bunch_it->capfc[2] /= bunch_it->num[2][2];
153  bunch_it->capfc[3] /= bunch_it->num[3][3];
154  //widths are the covariance matrix--assumed symmetric
155  bunch_it->sig[0][0] = (bunch_it->prod[0][0] / bunch_it->num[0][0]) - (bunch_it->cap[0] * bunch_it->cap[0]);
156  bunch_it->sig[0][1] = (bunch_it->prod[0][1] / bunch_it->num[0][1]) - (bunch_it->cap[0] * bunch_it->cap[1]);
157  bunch_it->sig[0][2] = (bunch_it->prod[0][2] / bunch_it->num[0][2]) - (bunch_it->cap[0] * bunch_it->cap[2]);
158  bunch_it->sig[0][3] = (bunch_it->prod[0][3] / bunch_it->num[0][3]) - (bunch_it->cap[0] * bunch_it->cap[3]);
159  bunch_it->sig[1][0] = (bunch_it->prod[1][0] / bunch_it->num[1][0]) - (bunch_it->cap[1] * bunch_it->cap[0]);
160  bunch_it->sig[1][1] = (bunch_it->prod[1][1] / bunch_it->num[1][1]) - (bunch_it->cap[1] * bunch_it->cap[1]);
161  bunch_it->sig[1][2] = (bunch_it->prod[1][2] / bunch_it->num[1][2]) - (bunch_it->cap[1] * bunch_it->cap[2]);
162  bunch_it->sig[1][3] = (bunch_it->prod[1][3] / bunch_it->num[1][3]) - (bunch_it->cap[1] * bunch_it->cap[3]);
163  bunch_it->sig[2][0] = (bunch_it->prod[2][0] / bunch_it->num[2][0]) - (bunch_it->cap[2] * bunch_it->cap[0]);
164  bunch_it->sig[2][1] = (bunch_it->prod[2][1] / bunch_it->num[2][1]) - (bunch_it->cap[2] * bunch_it->cap[1]);
165  bunch_it->sig[2][2] = (bunch_it->prod[2][2] / bunch_it->num[2][2]) - (bunch_it->cap[2] * bunch_it->cap[2]);
166  bunch_it->sig[2][3] = (bunch_it->prod[2][3] / bunch_it->num[2][3]) - (bunch_it->cap[2] * bunch_it->cap[3]);
167  bunch_it->sig[3][0] = (bunch_it->prod[3][0] / bunch_it->num[3][0]) - (bunch_it->cap[3] * bunch_it->cap[0]);
168  bunch_it->sig[3][1] = (bunch_it->prod[3][1] / bunch_it->num[3][1]) - (bunch_it->cap[3] * bunch_it->cap[1]);
169  bunch_it->sig[3][2] = (bunch_it->prod[3][2] / bunch_it->num[3][2]) - (bunch_it->cap[3] * bunch_it->cap[2]);
170  bunch_it->sig[3][3] = (bunch_it->prod[3][3] / bunch_it->num[3][3]) - (bunch_it->cap[3] * bunch_it->cap[3]);
171 
172  bunch_it->sigfc[0][0] =
173  (bunch_it->prodfc[0][0] / bunch_it->num[0][0]) - (bunch_it->capfc[0] * bunch_it->capfc[0]);
174  bunch_it->sigfc[0][1] =
175  (bunch_it->prodfc[0][1] / bunch_it->num[0][1]) - (bunch_it->capfc[0] * bunch_it->capfc[1]);
176  bunch_it->sigfc[0][2] =
177  (bunch_it->prodfc[0][2] / bunch_it->num[0][2]) - (bunch_it->capfc[0] * bunch_it->capfc[2]);
178  bunch_it->sigfc[0][3] =
179  (bunch_it->prodfc[0][3] / bunch_it->num[0][3]) - (bunch_it->capfc[0] * bunch_it->capfc[3]);
180  bunch_it->sigfc[1][0] =
181  (bunch_it->prodfc[1][0] / bunch_it->num[1][0]) - (bunch_it->capfc[1] * bunch_it->capfc[0]);
182  bunch_it->sigfc[1][1] =
183  (bunch_it->prodfc[1][1] / bunch_it->num[1][1]) - (bunch_it->capfc[1] * bunch_it->capfc[1]);
184  bunch_it->sigfc[1][2] =
185  (bunch_it->prodfc[1][2] / bunch_it->num[1][2]) - (bunch_it->capfc[1] * bunch_it->capfc[2]);
186  bunch_it->sigfc[1][3] =
187  (bunch_it->prodfc[1][3] / bunch_it->num[1][3]) - (bunch_it->capfc[1] * bunch_it->capfc[3]);
188  bunch_it->sigfc[2][0] =
189  (bunch_it->prodfc[2][0] / bunch_it->num[2][0]) - (bunch_it->capfc[2] * bunch_it->capfc[0]);
190  bunch_it->sigfc[2][1] =
191  (bunch_it->prodfc[2][1] / bunch_it->num[2][1]) - (bunch_it->capfc[2] * bunch_it->capfc[1]);
192  bunch_it->sigfc[2][2] =
193  (bunch_it->prodfc[2][2] / bunch_it->num[2][2]) - (bunch_it->capfc[2] * bunch_it->capfc[2]);
194  bunch_it->sigfc[2][3] =
195  (bunch_it->prodfc[2][3] / bunch_it->num[2][3]) - (bunch_it->capfc[2] * bunch_it->capfc[3]);
196  bunch_it->sigfc[3][0] =
197  (bunch_it->prodfc[3][0] / bunch_it->num[3][0]) - (bunch_it->capfc[3] * bunch_it->capfc[0]);
198  bunch_it->sigfc[3][1] =
199  (bunch_it->prodfc[3][1] / bunch_it->num[3][1]) - (bunch_it->capfc[3] * bunch_it->capfc[1]);
200  bunch_it->sigfc[3][2] =
201  (bunch_it->prodfc[3][2] / bunch_it->num[3][2]) - (bunch_it->capfc[3] * bunch_it->capfc[2]);
202  bunch_it->sigfc[3][3] =
203  (bunch_it->prodfc[3][3] / bunch_it->num[3][3]) - (bunch_it->capfc[3] * bunch_it->capfc[3]);
204 
205  for (int i = 0; i != 3; i++) {
206  CASTORMeans->Fill(bunch_it->cap[i]);
207  CASTORWidths->Fill(bunch_it->sig[i][i]);
208  }
209 
210  //if(bunch_it->detid.subdet() == 1){
211 
212  int fillphi = bunch_it->detid.sector();
213  //if (bunch_it->detid.depth()==4) fillphi++;
214 
215  // dephist[bunch_it->detid.module()-1]->Fill(bunch_it->detid.ieta(),fillphi,
216  // (bunch_it->cap[0]+bunch_it->cap[1]+bunch_it->cap[2]+bunch_it->cap[3])/4);
217  dephist->Fill(bunch_it->detid.module(),
218  fillphi,
219  (bunch_it->cap[0] + bunch_it->cap[1] + bunch_it->cap[2] + bunch_it->cap[3]) / 4);
220 
221  const CastorPedestal item(bunch_it->detid,
222  bunch_it->cap[0],
223  bunch_it->cap[1],
224  bunch_it->cap[2],
225  bunch_it->cap[3],
226  bunch_it->sig[0][0],
227  bunch_it->sig[1][1],
228  bunch_it->sig[2][2],
229  bunch_it->sig[3][3]);
230  rawPedsItem->addValues(item);
231  CastorPedestalWidth widthsp(bunch_it->detid);
232  widthsp.setSigma(0, 0, bunch_it->sig[0][0]);
233  widthsp.setSigma(0, 1, bunch_it->sig[0][1]);
234  widthsp.setSigma(0, 2, bunch_it->sig[0][2]);
235  widthsp.setSigma(0, 3, bunch_it->sig[0][3]);
236  widthsp.setSigma(1, 0, bunch_it->sig[1][0]);
237  widthsp.setSigma(1, 1, bunch_it->sig[1][1]);
238  widthsp.setSigma(1, 2, bunch_it->sig[1][2]);
239  widthsp.setSigma(1, 3, bunch_it->sig[1][3]);
240  widthsp.setSigma(2, 0, bunch_it->sig[2][0]);
241  widthsp.setSigma(2, 1, bunch_it->sig[2][1]);
242  widthsp.setSigma(2, 2, bunch_it->sig[2][2]);
243  widthsp.setSigma(2, 3, bunch_it->sig[2][3]);
244  widthsp.setSigma(3, 0, bunch_it->sig[3][0]);
245  widthsp.setSigma(3, 1, bunch_it->sig[3][1]);
246  widthsp.setSigma(3, 2, bunch_it->sig[3][2]);
247  widthsp.setSigma(3, 3, bunch_it->sig[3][3]);
248  rawWidthsItem->addValues(widthsp);
249 
250  const CastorPedestal itemfc(bunch_it->detid,
251  bunch_it->capfc[0],
252  bunch_it->capfc[1],
253  bunch_it->capfc[2],
254  bunch_it->capfc[3],
255  bunch_it->sigfc[0][0],
256  bunch_it->sigfc[1][1],
257  bunch_it->sigfc[2][2],
258  bunch_it->sigfc[3][3]);
259  rawPedsItemfc->addValues(itemfc);
260  CastorPedestalWidth widthspfc(bunch_it->detid);
261  widthspfc.setSigma(0, 0, bunch_it->sigfc[0][0]);
262  widthspfc.setSigma(0, 1, bunch_it->sigfc[0][1]);
263  widthspfc.setSigma(0, 2, bunch_it->sigfc[0][2]);
264  widthspfc.setSigma(0, 3, bunch_it->sigfc[0][3]);
265  widthspfc.setSigma(1, 0, bunch_it->sigfc[1][0]);
266  widthspfc.setSigma(1, 1, bunch_it->sigfc[1][1]);
267  widthspfc.setSigma(1, 2, bunch_it->sigfc[1][2]);
268  widthspfc.setSigma(1, 3, bunch_it->sigfc[1][3]);
269  widthspfc.setSigma(2, 0, bunch_it->sigfc[2][0]);
270  widthspfc.setSigma(2, 1, bunch_it->sigfc[2][1]);
271  widthspfc.setSigma(2, 2, bunch_it->sigfc[2][2]);
272  widthspfc.setSigma(2, 3, bunch_it->sigfc[2][3]);
273  widthspfc.setSigma(3, 0, bunch_it->sigfc[3][0]);
274  widthspfc.setSigma(3, 1, bunch_it->sigfc[3][1]);
275  widthspfc.setSigma(3, 2, bunch_it->sigfc[3][2]);
276  widthspfc.setSigma(3, 3, bunch_it->sigfc[3][3]);
277  rawWidthsItemfc->addValues(widthspfc);
278  }
279  }
280 
281  // dump the resulting list of pedestals into a file
282  std::ofstream outStream1(pedsADCfilename.c_str());
283  CastorDbASCIIIO::dumpObject(outStream1, (*rawPedsItem));
284  std::ofstream outStream2(widthsADCfilename.c_str());
285  CastorDbASCIIIO::dumpObject(outStream2, (*rawWidthsItem));
286 
287  std::ofstream outStream3(pedsfCfilename.c_str());
288  CastorDbASCIIIO::dumpObject(outStream3, (*rawPedsItemfc));
289  std::ofstream outStream4(widthsfCfilename.c_str());
290  CastorDbASCIIIO::dumpObject(outStream4, (*rawWidthsItemfc));
291 
292  if (dumpXML) {
293  std::ofstream outStream5(XMLfilename.c_str());
294  // CastorCondXML::dumpObject (outStream5, runnum, runnum, runnum, XMLtag, 1, (*rawPedsItem), (*rawWidthsItem));
295  }
296 
297  /*
298  if (hiSaveFlag) {
299  theFile->Write();
300  } else {
301  theFile->cd();
302  theFile->cd("CASTOR");
303  CASTORMeans->Write();
304  CASTORWidths->Write();
305  }
306  theFile->cd();
307  dephist->Write();
308  */
309  dephist->SetDrawOption("colz");
310  dephist->GetXaxis()->SetTitle("module");
311  dephist->GetYaxis()->SetTitle("sector");
312 
313  //for (int n=0; n!= 4; n++)
314  //{
315  //dephist[n]->Write();
316  //dephist[n]->SetDrawOption("colz");
317  //dephist[n]->GetXaxis()->SetTitle("i#eta");
318  //dephist[n]->GetYaxis()->SetTitle("i#phi");
319  //}
320 
321  std::stringstream tempstringout;
322  tempstringout << runnum;
323  std::string name1 = tempstringout.str() + "_pedplots_1d.png";
324  std::string name2 = tempstringout.str() + "_pedplots_2d.png";
325 
326  TStyle* theStyle = new TStyle("style", "null");
327  theStyle->SetPalette(1, nullptr);
328  theStyle->SetCanvasDefH(1200); //Height of canvas
329  theStyle->SetCanvasDefW(1600); //Width of canvas
330 
331  gStyle = theStyle;
332  /*
333  TCanvas * c1 = new TCanvas("c1","graph",1);
334  c1->Divide(2,2);
335  c1->cd(1);
336  CASTORMeans->Draw();
337  c1->SaveAs(name1.c_str());
338 
339  theStyle->SetOptStat("n");
340  gStyle = theStyle;
341 
342  TCanvas * c2 = new TCanvas("c2","graph",1);
343  // c2->Divide(2,2);
344  c2->cd(1);
345  dephist->Draw();
346  dephist->SetDrawOption("colz");
347  //c2->cd(2);
348  //dephist[1]->Draw();
349  //dephist[1]->SetDrawOption("colz");
350  //c2->cd(3);
351  //dephist[2]->Draw();
352  //dephist[2]->SetDrawOption("colz");
353  //c2->cd(4);
354  //dephist[3]->Draw();
355  //dephist[3]->SetDrawOption("colz");
356  c2->SaveAs(name2.c_str());
357 */
358  /*
359  std::cout << "Writing ROOT file... ";
360  theFile->Close();
361  std::cout << "ROOT file closed.\n";
362  */
363 }
364 
365 // ------------ method called to for each event ------------
368  e.getByLabel(castorDigiCollectionTag, castor);
369 
370  auto conditions = &iSetup.getData(tok_cond_);
371  const CastorQIEShape* shape = conditions->getCastorShape();
372 
373  if (firsttime) {
374  runnum = e.id().run();
375  std::string runnum_string;
376  std::stringstream tempstringout;
377  tempstringout << runnum;
378  runnum_string = tempstringout.str();
379  ROOTfilename = runnum_string + "-peds_ADC.root";
380  pedsADCfilename = runnum_string + "-peds_ADC.txt";
381  pedsfCfilename = runnum_string + "-peds_fC.txt";
382  widthsADCfilename = runnum_string + "-widths_ADC.txt";
383  widthsfCfilename = runnum_string + "-widths_fC.txt";
384  XMLfilename = runnum_string + "-peds_ADC_complete.xml";
385  XMLtag = "Castor_pedestals_" + runnum_string;
386 
388  fs->mkdir("CASTOR");
389  /*
390  theFile = new TFile(ROOTfilename.c_str(), "RECREATE");
391  theFile->cd();
392  // Create sub-directories
393  theFile->mkdir("CASTOR");
394  theFile->cd();
395  */
396  CASTORMeans = fs->make<TH1F>("All Ped Means CASTOR", "All Ped Means CASTOR", 100, 0, 9);
397  CASTORWidths = fs->make<TH1F>("All Ped Widths CASTOR", "All Ped Widths CASTOR", 100, 0, 3);
398 
399  dephist = fs->make<TH2F>("Pedestals (ADC)", "All Castor", 14, 0., 14.5, 16, .5, 16.5);
400  // dephist[0] = fs->make<TH2F>("Pedestals (ADC)","Depth 1",89, -44, 44, 72, .5, 72.5);
401  // dephist[1] = fs->make<TH2F>("Pedestals (ADC)","Depth 2",89, -44, 44, 72, .5, 72.5);
402  // dephist[2] = fs->make<TH2F>("Pedestals (ADC)","Depth 3",89, -44, 44, 72, .5, 72.5);
403  // dephist[3] = fs->make<TH2F>("Pedestals (ADC)","Depth 4",89, -44, 44, 72, .5, 72.5);
404 
405  const CastorElectronicsMap* myRefEMap = &iSetup.getData(tok_map_);
406  std::vector<HcalGenericDetId> listEMap = myRefEMap->allPrecisionId();
407  for (std::vector<HcalGenericDetId>::const_iterator it = listEMap.begin(); it != listEMap.end(); ++it) {
408  HcalGenericDetId mygenid(it->rawId());
409  if (mygenid.isHcalCastorDetId()) {
410  NewPedBunch a;
411  HcalCastorDetId chanid(mygenid.rawId());
412  a.detid = chanid;
413  a.usedflag = false;
414  std::string type = "CASTOR";
415  for (int i = 0; i != 4; i++) {
416  a.cap[i] = 0;
417  a.capfc[i] = 0;
418  for (int j = 0; j != 4; j++) {
419  a.sig[i][j] = 0;
420  a.sigfc[i][j] = 0;
421  a.prod[i][j] = 0;
422  a.prodfc[i][j] = 0;
423  a.num[i][j] = 0;
424  }
425  }
426  Bunches.push_back(a);
427  }
428  }
429  firsttime = false;
430  }
431 
432  std::vector<NewPedBunch>::iterator bunch_it;
433 
434  for (CastorDigiCollection::const_iterator j = castor->begin(); j != castor->end(); ++j) {
435  const CastorDataFrame digi = (const CastorDataFrame)(*j);
436  for (bunch_it = Bunches.begin(); bunch_it != Bunches.end(); ++bunch_it)
437  if (bunch_it->detid.rawId() == digi.id().rawId())
438  break;
439  bunch_it->usedflag = true;
440  for (int ts = firstTS; ts != lastTS + 1; ts++) {
441  const CastorQIECoder* coder = conditions->getCastorCoder(digi.id().rawId());
442  bunch_it->num[digi.sample(ts).capid()][digi.sample(ts).capid()] += 1;
443  bunch_it->cap[digi.sample(ts).capid()] += digi.sample(ts).adc();
444  double charge1 = coder->charge(*shape, digi.sample(ts).adc(), digi.sample(ts).capid());
445  bunch_it->capfc[digi.sample(ts).capid()] += charge1;
446  bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts).capid()] +=
447  (digi.sample(ts).adc() * digi.sample(ts).adc());
448  bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts).capid()] += charge1 * charge1;
449  if ((ts + 1 < digi.size()) && (ts + 1 < lastTS)) {
450  bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts + 1).capid()] +=
451  digi.sample(ts).adc() * digi.sample(ts + 1).adc();
452  double charge2 = coder->charge(*shape, digi.sample(ts + 1).adc(), digi.sample(ts + 1).capid());
453  bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts + 1).capid()] += charge1 * charge2;
454  bunch_it->num[digi.sample(ts).capid()][digi.sample(ts + 1).capid()] += 1;
455  }
456  if ((ts + 2 < digi.size()) && (ts + 2 < lastTS)) {
457  bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts + 2).capid()] +=
458  digi.sample(ts).adc() * digi.sample(ts + 2).adc();
459  double charge2 = coder->charge(*shape, digi.sample(ts + 2).adc(), digi.sample(ts + 2).capid());
460  bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts + 2).capid()] += charge1 * charge2;
461  bunch_it->num[digi.sample(ts).capid()][digi.sample(ts + 2).capid()] += 1;
462  }
463  if ((ts + 3 < digi.size()) && (ts + 3 < lastTS)) {
464  bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts + 3).capid()] +=
465  digi.sample(ts).adc() * digi.sample(ts + 3).adc();
466  double charge2 = coder->charge(*shape, digi.sample(ts + 3).adc(), digi.sample(ts + 3).capid());
467  bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts + 3).capid()] += charge1 * charge2;
468  bunch_it->num[digi.sample(ts).capid()][digi.sample(ts + 3).capid()] += 1;
469  }
470  }
471  }
472 
473  //this is the last brace
474 }
475 
476 //define this as a plug-in
static const std::string kSharedResource
Definition: TFileService.h:76
float charge(const CastorQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -> fC conversion.
void setSigma(int fCapId1, int fCapId2, float fSigma)
std::vector< NewPedBunch > Bunches
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
const HcalQIESample & sample(int i) const
access a sample
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::vector< T >::const_iterator const_iterator
edm::ESGetToken< CastorDbService, CastorDbRecord > tok_cond_
T getUntrackedParameter(std::string const &, T const &) const
int size() const
total number of samples in the digi
bool getData(T &iHolder) const
Definition: EventSetup.h:122
HcalCastorDetId detid
const HcalCastorDetId & id() const
bool dumpObject(std::ostream &fOutput, const CastorPedestals &fObject)
std::vector< HcalGenericDetId > allPrecisionId() const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
CastorPedestalsAnalysis(const edm::ParameterSet &ps)
bool addValues(const Item &myItem)
constexpr int capid() const
get the Capacitor id
Definition: HcalQIESample.h:47
HLT enums.
constexpr int adc() const
get the ADC sample
Definition: HcalQIESample.h:43
double a
Definition: hdecay.h:119
Definition: event.py:1
edm::ESGetToken< CastorElectronicsMap, CastorElectronicsMapRcd > tok_map_