CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalPedestalsAnalysis.cc
Go to the documentation of this file.
1 // Original Author: Steven Won
2 // Created: Fri May 2 15:34:43 CEST 2008
3 // Written to replace the combination of HcalPedestalAnalyzer and HcalPedestalAnalysis
4 // This code runs 1000x faster and produces all outputs from a single run
5 // (ADC, fC in .txt plus an .xml file)
6 //
7 #include <memory>
9 
11 {
12  hiSaveFlag = ps.getUntrackedParameter<bool>("hiSaveFlag", false);
13  dumpXML = ps.getUntrackedParameter<bool>("dumpXML", true);
14  verboseflag = ps.getUntrackedParameter<bool>("verbose", false);
15  firstTS = ps.getUntrackedParameter<int>("firstTS", 0);
16  lastTS = ps.getUntrackedParameter<int>("lastTS", 9);
17  firsttime = true;
18 
19  rawPedsItem = new HcalPedestals(true);
21  rawPedsItemfc = new HcalPedestals(false);
23 }
24 
25 
27 {
28  //Calculate pedestal constants
29  std::cout << "Calculating Pedestal constants...\n";
30  std::vector<NewPedBunch>::iterator bunch_it;
31  for(bunch_it=Bunches.begin(); bunch_it != Bunches.end(); bunch_it++)
32  {
33  if(bunch_it->usedflag){
34 
35  if(verboseflag) std::cout << "Analyzing channel " << bunch_it->detid << std::endl;
36  //pedestal constant is the mean
37  if(bunch_it->num[0][0]!=0) bunch_it->cap[0] /= bunch_it->num[0][0];
38  if(bunch_it->num[1][1]!=0) bunch_it->cap[1] /= bunch_it->num[1][1];
39  if(bunch_it->num[2][2]!=0) bunch_it->cap[2] /= bunch_it->num[2][2];
40  if(bunch_it->num[3][3]!=0) bunch_it->cap[3] /= bunch_it->num[3][3];
41  if(bunch_it->num[0][0]!=0) bunch_it->capfc[0] /= bunch_it->num[0][0];
42  if(bunch_it->num[1][1]!=0) bunch_it->capfc[1] /= bunch_it->num[1][1];
43  if(bunch_it->num[2][2]!=0) bunch_it->capfc[2] /= bunch_it->num[2][2];
44  if(bunch_it->num[3][3]!=0) bunch_it->capfc[3] /= bunch_it->num[3][3];
45  //widths are the covariance matrix--assumed symmetric
46  bunch_it->sig[0][0] = (bunch_it->prod[0][0]/bunch_it->num[0][0])-(bunch_it->cap[0])*(bunch_it->cap[0]);
47  bunch_it->sig[1][1] = (bunch_it->prod[1][1]/bunch_it->num[1][1])-(bunch_it->cap[1])*(bunch_it->cap[1]);
48  bunch_it->sig[2][2] = (bunch_it->prod[2][2]/bunch_it->num[2][2])-(bunch_it->cap[2])*(bunch_it->cap[2]);
49  bunch_it->sig[3][3] = (bunch_it->prod[3][3]/bunch_it->num[3][3])-(bunch_it->cap[3])*(bunch_it->cap[3]);
50  bunch_it->sig[0][1] = (bunch_it->prod[0][1])/(bunch_it->num[0][1])-(bunch_it->cap[0]*bunch_it->cap[1]);
51  bunch_it->sig[0][2] = (bunch_it->prod[0][2])/(bunch_it->num[0][2])-(bunch_it->cap[0]*bunch_it->cap[2]);
52  bunch_it->sig[0][3] = (bunch_it->prod[3][0])/(bunch_it->num[3][0])-(bunch_it->cap[0]*bunch_it->cap[3]); // sig03 MISNAMED in object!
53  bunch_it->sig[1][2] = (bunch_it->prod[1][2])/(bunch_it->num[1][2])-(bunch_it->cap[1]*bunch_it->cap[2]);
54  bunch_it->sig[1][3] = (bunch_it->prod[1][3])/(bunch_it->num[1][3])-(bunch_it->cap[1]*bunch_it->cap[3]);
55  bunch_it->sig[2][3] = (bunch_it->prod[2][3])/(bunch_it->num[2][3])-(bunch_it->cap[2]*bunch_it->cap[3]);
56 
57  bunch_it->sigfc[0][0] = (bunch_it->prodfc[0][0]/bunch_it->num[0][0])-(bunch_it->capfc[0])*(bunch_it->capfc[0]);
58  bunch_it->sigfc[1][1] = (bunch_it->prodfc[1][1]/bunch_it->num[1][1])-(bunch_it->capfc[1])*(bunch_it->capfc[1]);
59  bunch_it->sigfc[2][2] = (bunch_it->prodfc[2][2]/bunch_it->num[2][2])-(bunch_it->capfc[2])*(bunch_it->capfc[2]);
60  bunch_it->sigfc[3][3] = (bunch_it->prodfc[3][3]/bunch_it->num[3][3])-(bunch_it->capfc[3])*(bunch_it->capfc[3]);
61  bunch_it->sigfc[0][1] = (bunch_it->prodfc[0][1]/(bunch_it->num[0][1]))-(bunch_it->capfc[0]*bunch_it->capfc[1]);
62  bunch_it->sigfc[0][2] = (bunch_it->prodfc[0][2]/(bunch_it->num[0][2]))-(bunch_it->capfc[0]*bunch_it->capfc[2]);
63  bunch_it->sigfc[0][3] = (bunch_it->prodfc[3][0]/(bunch_it->num[3][0]))-(bunch_it->capfc[0]*bunch_it->capfc[3]); //sig03 MISNAMED in object!
64  bunch_it->sigfc[1][2] = (bunch_it->prodfc[1][2]/(bunch_it->num[1][2]))-(bunch_it->capfc[1]*bunch_it->capfc[2]);
65  bunch_it->sigfc[1][3] = (bunch_it->prodfc[1][3]/(bunch_it->num[1][3]))-(bunch_it->capfc[1]*bunch_it->capfc[3]);
66  bunch_it->sigfc[2][3] = (bunch_it->prodfc[2][3]/(bunch_it->num[2][3]))-(bunch_it->capfc[2]*bunch_it->capfc[3]);
67 
68  if(bunch_it->detid.subdet() == 1){
69  for(int i = 0; i != 4; i++){
70  HBMeans->Fill(bunch_it->cap[i]);
71  HBWidths->Fill(bunch_it->sig[i][i]);
72  }
73  }
74  if(bunch_it->detid.subdet() == 2){
75  for(int i = 0; i != 4; i++){
76  HEMeans->Fill(bunch_it->cap[i]);
77  HEWidths->Fill(bunch_it->sig[i][i]);
78  }
79  }
80  if(bunch_it->detid.subdet() == 3){
81  for(int i = 0; i != 4; i++){
82  HOMeans->Fill(bunch_it->cap[i]);
83  HOWidths->Fill(bunch_it->sig[i][i]);
84  }
85  }
86  if(bunch_it->detid.subdet() == 4){
87  for(int i = 0; i != 4; i++){
88  HFMeans->Fill(bunch_it->cap[i]);
89  HFWidths->Fill(bunch_it->sig[i][i]);
90  }
91  }
92 
93  const HcalPedestal item(bunch_it->detid, bunch_it->cap[0], bunch_it->cap[1], bunch_it->cap[2], bunch_it->cap[3]);
94  rawPedsItem->addValues(item);
95  HcalPedestalWidth widthsp(bunch_it->detid);
96  widthsp.setSigma(0,0,bunch_it->sig[0][0]);
97  widthsp.setSigma(0,1,bunch_it->sig[0][1]);
98  widthsp.setSigma(0,2,bunch_it->sig[0][2]);
99  widthsp.setSigma(0,3,bunch_it->sig[0][3]);
100  widthsp.setSigma(1,1,bunch_it->sig[1][1]);
101  widthsp.setSigma(1,2,bunch_it->sig[1][2]);
102  widthsp.setSigma(1,3,bunch_it->sig[1][3]);
103  widthsp.setSigma(2,2,bunch_it->sig[2][2]);
104  widthsp.setSigma(2,3,bunch_it->sig[2][3]);
105  widthsp.setSigma(3,3,bunch_it->sig[3][3]);
106  rawWidthsItem->addValues(widthsp);
107 
108  const HcalPedestal itemfc(bunch_it->detid, bunch_it->capfc[0], bunch_it->capfc[1],
109  bunch_it->capfc[2], bunch_it->capfc[3]);
110  rawPedsItemfc->addValues(itemfc);
111  HcalPedestalWidth widthspfc(bunch_it->detid);
112  widthspfc.setSigma(0,0,bunch_it->sigfc[0][0]);
113  widthspfc.setSigma(0,1,bunch_it->sigfc[0][1]);
114  widthspfc.setSigma(0,2,bunch_it->sigfc[0][2]);
115  widthspfc.setSigma(0,3,bunch_it->sigfc[0][3]);
116  widthspfc.setSigma(1,1,bunch_it->sigfc[1][1]);
117  widthspfc.setSigma(1,2,bunch_it->sigfc[1][2]);
118  widthspfc.setSigma(1,3,bunch_it->sigfc[1][3]);
119  widthspfc.setSigma(2,2,bunch_it->sigfc[2][2]);
120  widthspfc.setSigma(2,3,bunch_it->sigfc[2][3]);
121  widthspfc.setSigma(3,3,bunch_it->sigfc[3][3]);
122  rawWidthsItemfc->addValues(widthspfc);
123  }
124  }
125 
126  // dump the resulting list of pedestals into a file
127  std::ofstream outStream1(pedsADCfilename.c_str());
128  HcalDbASCIIIO::dumpObject (outStream1, (*rawPedsItem) );
129  std::ofstream outStream2(widthsADCfilename.c_str());
130  HcalDbASCIIIO::dumpObject (outStream2, (*rawWidthsItem) );
131 
132  std::ofstream outStream3(pedsfCfilename.c_str());
133  HcalDbASCIIIO::dumpObject (outStream3, (*rawPedsItemfc) );
134  std::ofstream outStream4(widthsfCfilename.c_str());
135  HcalDbASCIIIO::dumpObject (outStream4, (*rawWidthsItemfc) );
136 
137  if(dumpXML){
138  std::ofstream outStream5(XMLfilename.c_str());
139  HcalDbXml::dumpObject (outStream5, runnum, 0, 2147483647, XMLtag, 1, (*rawPedsItem), (*rawWidthsItem));
140  }
141 
142  if(hiSaveFlag){
143  theFile->Write();
144  }else{
145  theFile->cd();
146  theFile->cd("HB");
147  HBMeans->Write();
148  HBWidths->Write();
149  theFile->cd();
150  theFile->cd("HF");
151  HFMeans->Write();
152  HFWidths->Write();
153  theFile->cd();
154  theFile->cd("HE");
155  HEMeans->Write();
156  HEWidths->Write();
157  theFile->cd();
158  theFile->cd("HO");
159  HOMeans->Write();
160  HOWidths->Write();
161  }
162 
163  std::cout << "Writing ROOT file... ";
164  theFile->Close();
165  std::cout << "ROOT file closed.\n";
166 
167  delete rawPedsItem;
168  delete rawWidthsItem;
169  delete rawPedsItemfc;
170  delete rawWidthsItemfc;
171 }
172 
173 // ------------ method called to for each event ------------
174 void
176 {
177  using namespace edm;
178  using namespace std;
179 
183  edm::ESHandle<HcalDbService> conditions;
184  iSetup.get<HcalDbRecord>().get(conditions);
185 
186  const HcalQIEShape* shape = conditions->getHcalShape();
187 
188  if(firsttime)
189  {
190  runnum = e.id().run();
191  std::string runnum_string;
192  std::stringstream tempstringout;
193  tempstringout << runnum;
194  runnum_string = tempstringout.str();
195  ROOTfilename = runnum_string + "-peds_ADC.root";
196  pedsADCfilename = runnum_string + "-peds_ADC.txt";
197  pedsfCfilename = runnum_string + "-peds_fC.txt";
198  widthsADCfilename = runnum_string + "-widths_ADC.txt";
199  widthsfCfilename = runnum_string + "-widths_fC.txt";
200  XMLfilename = runnum_string + "-peds_ADC_complete.xml";
201  XMLtag = "Hcal_pedestals_" + runnum_string;
202 
203  theFile = new TFile(ROOTfilename.c_str(), "RECREATE");
204  theFile->cd();
205  // Create sub-directories
206  theFile->mkdir("HB");
207  theFile->mkdir("HE");
208  theFile->mkdir("HF");
209  theFile->mkdir("HO");
210  theFile->cd();
211 
212  HBMeans = new TH1F("All Ped Means HB","All Ped Means HB", 100, 0, 9);
213  HBWidths = new TH1F("All Ped Widths HB","All Ped Widths HB", 100, 0, 3);
214  HEMeans = new TH1F("All Ped Means HE","All Ped Means HE", 100, 0, 9);
215  HEWidths = new TH1F("All Ped Widths HE","All Ped Widths HE", 100, 0, 3);
216  HFMeans = new TH1F("All Ped Means HF","All Ped Means HF", 100, 0, 9);
217  HFWidths = new TH1F("All Ped Widths HF","All Ped Widths HF", 100, 0, 3);
218  HOMeans = new TH1F("All Ped Means HO","All Ped Means HO", 100, 0, 9);
219  HOWidths = new TH1F("All Ped Widths HO","All Ped Widths HO", 100, 0, 3);
220 
222  iSetup.get<HcalElectronicsMapRcd>().get(refEMap);
223  const HcalElectronicsMap* myRefEMap = refEMap.product();
224  std::vector<HcalGenericDetId> listEMap = myRefEMap->allPrecisionId();
225  for (std::vector<HcalGenericDetId>::const_iterator it = listEMap.begin(); it != listEMap.end(); it++)
226  {
227  HcalGenericDetId mygenid(it->rawId());
228  if(mygenid.isHcalDetId())
229  {
230  NewPedBunch a;
231  HcalDetId chanid(mygenid.rawId());
232  a.detid = chanid;
233  a.usedflag = false;
234  for(int i = 0; i != 4; i++)
235  {
236  a.cap[i] = 0;
237  a.capfc[i] = 0;
238  for(int j = 0; j != 4; j++)
239  {
240  a.sig[i][j] = 0;
241  a.sigfc[i][j] = 0;
242  a.prod[i][j] = 0;
243  a.prodfc[i][j] = 0;
244  a.num[i][j] = 0;
245  }
246  }
247  Bunches.push_back(a);
248  }
249  }
250  firsttime = false;
251  }
252 
253  std::vector<NewPedBunch>::iterator bunch_it;
254 
255  for(HBHEDigiCollection::const_iterator j = hbhe->begin(); j != hbhe->end(); j++)
256  {
257  const HBHEDataFrame digi = (const HBHEDataFrame)(*j);
258  for(bunch_it = Bunches.begin(); bunch_it != Bunches.end(); bunch_it++)
259  if(bunch_it->detid.rawId() == digi.id().rawId()) break;
260  bunch_it->usedflag = true;
261  for(int ts = firstTS; ts != lastTS+1; ts++)
262  {
263  if(digi.sample(ts).adc() > 15) continue;
264  const HcalQIECoder* coder = conditions->getHcalCoder(digi.id().rawId());
265  bunch_it->num[digi.sample(ts).capid()][digi.sample(ts).capid()] += 1;
266  bunch_it->cap[digi.sample(ts).capid()] += digi.sample(ts).adc();
267  double charge1 = coder->charge(*shape, digi.sample(ts).adc(), digi.sample(ts).capid());
268  bunch_it->capfc[digi.sample(ts).capid()] += charge1;
269  bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts).capid()] += (digi.sample(ts).adc() * digi.sample(ts).adc());
270  bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts).capid()] += charge1 * charge1;
271  if((ts+1 < digi.size()) && (ts+1 < lastTS)){
272  if(digi.sample(ts+1).adc() > 15) continue;
273  bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts+1).capid()] += digi.sample(ts).adc()*digi.sample(ts+1).adc();
274  double charge2 = coder->charge(*shape, digi.sample(ts+1).adc(), digi.sample(ts+1).capid());
275  bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts+1).capid()] += charge1*charge2;
276  bunch_it->num[digi.sample(ts).capid()][digi.sample(ts+1).capid()] += 1;
277  }
278  if((ts+2 < digi.size()) && (ts+2 < lastTS)){
279  if(digi.sample(ts+2).adc() > 15) continue;
280  bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts+2).capid()] += digi.sample(ts).adc()*digi.sample(ts+2).adc();
281  double charge2 = coder->charge(*shape, digi.sample(ts+2).adc(), digi.sample(ts+2).capid());
282  bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts+2).capid()] += charge1*charge2;
283  bunch_it->num[digi.sample(ts).capid()][digi.sample(ts+2).capid()] += 1;
284  }
285  if((ts+3 < digi.size()) && (ts+3 < lastTS)){
286  if(digi.sample(ts+3).adc() > 15) continue;
287  bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts+3).capid()] += digi.sample(ts).adc()*digi.sample(ts+3).adc();
288  double charge2 = coder->charge(*shape, digi.sample(ts+3).adc(), digi.sample(ts+3).capid());
289  bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts+3).capid()] += charge1*charge2;
290  bunch_it->num[digi.sample(ts).capid()][digi.sample(ts+3).capid()] += 1;
291  }
292  }
293  }
294 
295  for(HODigiCollection::const_iterator j = ho->begin(); j != ho->end(); j++)
296  {
297  const HODataFrame digi = (const HODataFrame)(*j);
298  for(bunch_it = Bunches.begin(); bunch_it != Bunches.end(); bunch_it++)
299  if(bunch_it->detid.rawId() == digi.id().rawId()) break;
300  bunch_it->usedflag = true;
301  for(int ts = firstTS; ts <= lastTS; ts++)
302  {
303  if(digi.sample(ts).adc() > 15) continue;
304  const HcalQIECoder* coder = conditions->getHcalCoder(digi.id().rawId());
305  bunch_it->num[digi.sample(ts).capid()][digi.sample(ts).capid()] += 1;
306  bunch_it->cap[digi.sample(ts).capid()] += digi.sample(ts).adc();
307  double charge1 = coder->charge(*shape, digi.sample(ts).adc(), digi.sample(ts).capid());
308  bunch_it->capfc[digi.sample(ts).capid()] += charge1;
309  bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts).capid()] += (digi.sample(ts).adc() * digi.sample(ts).adc());
310  bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts).capid()] += charge1 * charge1;
311  if((ts+1 < digi.size()) && (ts+1 < lastTS)){
312  if(digi.sample(ts+1).adc() > 15) continue;
313  bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts+1).capid()] += digi.sample(ts).adc()*digi.sample(ts+1).adc();
314  double charge2 = coder->charge(*shape, digi.sample(ts+1).adc(), digi.sample(ts+1).capid());
315  bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts+1).capid()] += charge1*charge2;
316  bunch_it->num[digi.sample(ts).capid()][digi.sample(ts+1).capid()] += 1;
317  }
318  if((ts+2 < digi.size()) && (ts+2 < lastTS)){
319  if(digi.sample(ts+2).adc() > 15) continue;
320  bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts+2).capid()] += digi.sample(ts).adc()*digi.sample(ts+2).adc();
321  double charge2 = coder->charge(*shape, digi.sample(ts+2).adc(), digi.sample(ts+2).capid());
322  bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts+2).capid()] += charge1*charge2;
323  bunch_it->num[digi.sample(ts).capid()][digi.sample(ts+2).capid()] += 1;
324  }
325  if((ts+3 < digi.size()) && (ts+3 < lastTS)){
326  if(digi.sample(ts+3).adc() > 15) continue;
327  bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts+3).capid()] += digi.sample(ts).adc()*digi.sample(ts+3).adc();
328  double charge2 = coder->charge(*shape, digi.sample(ts+3).adc(), digi.sample(ts+3).capid());
329  bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts+3).capid()] += charge1*charge2;
330  bunch_it->num[digi.sample(ts).capid()][digi.sample(ts+3).capid()] += 1;
331  }
332  }
333  }
334 
335  for(HFDigiCollection::const_iterator j = hf->begin(); j != hf->end(); j++)
336  {
337  const HFDataFrame digi = (const HFDataFrame)(*j);
338  for(bunch_it = Bunches.begin(); bunch_it != Bunches.end(); bunch_it++)
339  if(bunch_it->detid.rawId() == digi.id().rawId()) break;
340  bunch_it->usedflag = true;
341  for(int ts = firstTS; ts <= lastTS; ts++)
342  {
343  if(digi.sample(ts).adc() > 15) continue;
344  const HcalQIECoder* coder = conditions->getHcalCoder(digi.id().rawId());
345  bunch_it->num[digi.sample(ts).capid()][digi.sample(ts).capid()] += 1;
346  bunch_it->cap[digi.sample(ts).capid()] += digi.sample(ts).adc();
347  double charge1 = coder->charge(*shape, digi.sample(ts).adc(), digi.sample(ts).capid());
348  bunch_it->capfc[digi.sample(ts).capid()] += charge1;
349  bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts).capid()] += (digi.sample(ts).adc() * digi.sample(ts).adc());
350  bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts).capid()] += charge1 * charge1;
351  if((ts+1 < digi.size()) && (ts+1 < lastTS)){
352  if(digi.sample(ts+1).adc() > 15) continue;
353  bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts+1).capid()] += digi.sample(ts).adc()*digi.sample(ts+1).adc();
354  double charge2 = coder->charge(*shape, digi.sample(ts+1).adc(), digi.sample(ts+1).capid());
355  bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts+1).capid()] += charge1*charge2;
356  bunch_it->num[digi.sample(ts).capid()][digi.sample(ts+1).capid()] += 1;
357  }
358  if((ts+2 < digi.size()) && (ts+2 < lastTS)){
359  if(digi.sample(ts+2).adc() > 15) continue;
360  bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts+2).capid()] += digi.sample(ts).adc()*digi.sample(ts+2).adc();
361  double charge2 = coder->charge(*shape, digi.sample(ts+2).adc(), digi.sample(ts+2).capid());
362  bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts+2).capid()] += charge1*charge2;
363  bunch_it->num[digi.sample(ts).capid()][digi.sample(ts+2).capid()] += 1;
364  }
365  if((ts+3 < digi.size()) && (ts+3 < lastTS)){
366  if(digi.sample(ts+3).adc() > 15) continue;
367  bunch_it->prod[digi.sample(ts).capid()][digi.sample(ts+3).capid()] += digi.sample(ts).adc()*digi.sample(ts+3).adc();
368  double charge2 = coder->charge(*shape, digi.sample(ts+3).adc(), digi.sample(ts+3).capid());
369  bunch_it->prodfc[digi.sample(ts).capid()][digi.sample(ts+3).capid()] += charge1*charge2;
370  bunch_it->num[digi.sample(ts).capid()][digi.sample(ts+3).capid()] += 1;
371  }
372  }
373  }
374 
375 //this is the last brace
376 }
377 
378 //define this as a plug-in
RunNumber_t run() const
Definition: EventID.h:42
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
bool addValues(const Item &myItem, bool h2mode_=false)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
int adc() const
get the ADC sample
Definition: HcalQIESample.h:24
bool dumpObject(std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, unsigned fVersion, const HcalPedestals &fObject, const HcalPedestalWidths &fError)
Definition: HcalDbXml.cc:169
int size() const
total number of samples in the digi
Definition: HBHEDataFrame.h:26
std::vector< T >::const_iterator const_iterator
bool getByType(Handle< PROD > &result) const
Definition: Event.h:398
const HcalQIESample & sample(int i) const
access a sample
Definition: HODataFrame.h:40
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup)
HcalPedestalWidths * rawWidthsItem
const HcalDetId & id() const
Definition: HODataFrame.h:23
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
int size() const
total number of samples in the digi
Definition: HODataFrame.h:27
const HcalQIESample & sample(int i) const
access a sample
Definition: HFDataFrame.h:39
int j
Definition: DBlmapReader.cc:9
std::vector< HcalGenericDetId > allPrecisionId() const
HcalCastorDetId detid
int size() const
total number of samples in the digi
Definition: HFDataFrame.h:26
int capid() const
get the Capacitor id
Definition: HcalQIESample.h:28
const HcalQIESample & sample(int i) const
access a sample
Definition: HBHEDataFrame.h:39
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
edm::EventID id() const
Definition: EventBase.h:56
HcalPedestalsAnalysis(const edm::ParameterSet &ps)
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)
double a
Definition: hdecay.h:121
const HcalDetId & id() const
Definition: HBHEDataFrame.h:22
tuple cout
Definition: gather_cfg.py:121
HcalPedestalWidths * rawWidthsItemfc
const HcalDetId & id() const
Definition: HFDataFrame.h:22
void setSigma(int fCapId1, int fCapId2, float fSigma)
std::vector< NewPedBunch > Bunches
float charge(const HcalQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -&gt; fC conversion.
Definition: HcalQIECoder.cc:22