CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GlobalDigisAnalyzer.cc
Go to the documentation of this file.
1 
12 
14  fName(""), verbosity(0), frequency(0), label(""), getAllProvenances(false),
15  printProvenanceInfo(false), hitsProducer(""), theCSCStripPedestalSum(0),
16  theCSCStripPedestalCount(0), count(0)
17 {
18  std::string MsgLoggerCat = "GlobalDigisAnalyzer_GlobalDigisAnalyzer";
19 
20  // get information from parameter set
21  fName = iPSet.getUntrackedParameter<std::string>("Name");
22  verbosity = iPSet.getUntrackedParameter<int>("Verbosity");
23  frequency = iPSet.getUntrackedParameter<int>("Frequency");
24  edm::ParameterSet m_Prov =
25  iPSet.getParameter<edm::ParameterSet>("ProvenanceLookup");
27  m_Prov.getUntrackedParameter<bool>("GetAllProvenances");
29  m_Prov.getUntrackedParameter<bool>("PrintProvenanceInfo");
30  hitsProducer = iPSet.getParameter<std::string>("hitsProducer");
31 
32  //get Labels to use to extract information
33  ECalEBSrc_ = iPSet.getParameter<edm::InputTag>("ECalEBSrc");
34  ECalEESrc_ = iPSet.getParameter<edm::InputTag>("ECalEESrc");
35  ECalESSrc_ = iPSet.getParameter<edm::InputTag>("ECalESSrc");
36  HCalSrc_ = iPSet.getParameter<edm::InputTag>("HCalSrc");
37  HCalDigi_ = iPSet.getParameter<edm::InputTag>("HCalDigi");
38  SiStripSrc_ = iPSet.getParameter<edm::InputTag>("SiStripSrc");
39  SiPxlSrc_ = iPSet.getParameter<edm::InputTag>("SiPxlSrc");
40  MuDTSrc_ = iPSet.getParameter<edm::InputTag>("MuDTSrc");
41  MuCSCStripSrc_ = iPSet.getParameter<edm::InputTag>("MuCSCStripSrc");
42  MuCSCWireSrc_ = iPSet.getParameter<edm::InputTag>("MuCSCWireSrc");
43  MuRPCSrc_ = iPSet.getParameter<edm::InputTag>("MuRPCSrc");
44 
45  // use value of first digit to determine default output level (inclusive)
46  // 0 is none, 1 is basic, 2 is fill output, 3 is gather output
47  verbosity %= 10;
48 
49  // print out Parameter Set information being used
50  if (verbosity >= 0) {
51  edm::LogInfo(MsgLoggerCat)
52  << "\n===============================\n"
53  << "Initialized as EDAnalyzer with parameter values:\n"
54  << " Name = " << fName << "\n"
55  << " Verbosity = " << verbosity << "\n"
56  << " Frequency = " << frequency << "\n"
57  << " GetProv = " << getAllProvenances << "\n"
58  << " PrintProv = " << printProvenanceInfo << "\n"
59  << " ECalEBSrc = " << ECalEBSrc_.label()
60  << ":" << ECalEBSrc_.instance() << "\n"
61  << " ECalEESrc = " << ECalEESrc_.label()
62  << ":" << ECalEESrc_.instance() << "\n"
63  << " ECalESSrc = " << ECalESSrc_.label()
64  << ":" << ECalESSrc_.instance() << "\n"
65  << " HCalSrc = " << HCalSrc_.label()
66  << ":" << HCalSrc_.instance() << "\n"
67  << " HCalDigi = " << HCalDigi_.label()
68  << ":" << HCalDigi_.instance() << "\n"
69  << " SiStripSrc = " << SiStripSrc_.label()
70  << ":" << SiStripSrc_.instance() << "\n"
71  << " SiPixelSrc = " << SiPxlSrc_.label()
72  << ":" << SiPxlSrc_.instance() << "\n"
73  << " MuDTSrc = " << MuDTSrc_.label()
74  << ":" << MuDTSrc_.instance() << "\n"
75  << " MuCSCStripSrc = " << MuCSCStripSrc_.label()
76  << ":" << MuCSCStripSrc_.instance() << "\n"
77  << " MuCSCWireSrc = " << MuCSCWireSrc_.label()
78  << ":" << MuCSCWireSrc_.instance() << "\n"
79  << " MuRPCSrc = " << MuRPCSrc_.label()
80  << ":" << MuRPCSrc_.instance() << "\n"
81  << "===============================\n";
82  }
83 
84  //Put in analyzer stuff here.... Pasted from Rec Hits...
85 
86  dbe = 0;
88  if (dbe) {
89  if (verbosity > 0 ) {
90  dbe->setVerbose(1);
91  } else {
92  dbe->setVerbose(0);
93  }
94  }
95  if (dbe) {
96  if (verbosity > 0 ) dbe->showDirStructure();
97  }
98 
99  Char_t hname[100];
100  Char_t htitle[100];
101 
102  //monitor elements
103 
104  //Si Strip
105  if (dbe) {
106  std::string SiStripString[19] = {"TECW1", "TECW2", "TECW3", "TECW4",
107  "TECW5", "TECW6", "TECW7", "TECW8",
108  "TIBL1", "TIBL2", "TIBL3", "TIBL4",
109  "TIDW1", "TIDW2", "TIDW3", "TOBL1",
110  "TOBL2", "TOBL3", "TOBL4"};
111  for(int i = 0; i<19; ++i) {
112  mehSiStripn[i]=0;
113  mehSiStripADC[i]=0;
114  mehSiStripStrip[i]=0;
115  }
116  std::string hcharname, hchartitle;
117  dbe->setCurrentFolder("GlobalDigisV/SiStrips");
118  for(int amend = 0; amend < 19; ++amend) {
119  hcharname = "hSiStripn_"+SiStripString[amend];
120  hchartitle= SiStripString[amend]+" Digis";
121  sprintf(hname, hcharname.c_str());
122  sprintf(htitle, hchartitle.c_str());
123  mehSiStripn[amend] = dbe->book1D(hname,htitle,5000,0.,10000.);
124  mehSiStripn[amend]->setAxisTitle("Number of Digis",1);
125  mehSiStripn[amend]->setAxisTitle("Count",2);
126 
127  hcharname = "hSiStripADC_"+SiStripString[amend];
128  hchartitle= SiStripString[amend]+" ADC";
129  sprintf(hname, hcharname.c_str());
130  sprintf(htitle, hchartitle.c_str());
131  mehSiStripADC[amend] = dbe->book1D(hname,htitle,150,0.0,300.);
132  mehSiStripADC[amend]->setAxisTitle("ADC",1);
133  mehSiStripADC[amend]->setAxisTitle("Count",2);
134 
135  hcharname = "hSiStripStripADC_"+SiStripString[amend];
136  hchartitle= SiStripString[amend]+" Strip";
137  sprintf(hname, hcharname.c_str());
138  sprintf(htitle, hchartitle.c_str());
139  mehSiStripStrip[amend] = dbe->book1D(hname,htitle,200,0.0,800.);
140  mehSiStripStrip[amend]->setAxisTitle("Strip Number",1);
141  mehSiStripStrip[amend]->setAxisTitle("Count",2);
142  }
143 
144  //HCal
145  std::string HCalString[4] = {"HB", "HE", "HO","HF"};
146  float calnUpper[4] = {30000.,30000.,30000.,20000.};
147  float calnLower[4]={0.,0.,0.,0.};
148  float SHEUpper[4]={1.,1.,1.,1.};
149  float SHEvAEEUpper[4] = {5000, 5000, 5000, 5000};
150  float SHEvAEELower[4] = {-5000, -5000, -5000, -5000};
151  int SHEvAEEnBins[4] = {200,200,200,200};
152  double ProfileUpper[4] = {1.,1.,1.,1.};
153 
154  for(int i =0; i<4; ++i) {
155  mehHcaln[i]=0;
156  mehHcalAEE[i]=0;
157  mehHcalSHE[i]=0;
158  mehHcalAEESHE[i]=0;
159  mehHcalSHEvAEE[i]=0;
160  }
161  dbe->setCurrentFolder("GlobalDigisV/HCals");
162 
163  for(int amend = 0; amend < 4; ++amend) {
164  hcharname = "hHcaln_"+HCalString[amend];
165  hchartitle= HCalString[amend]+" digis";
166  sprintf(hname, hcharname.c_str());
167  sprintf(htitle, hchartitle.c_str());
168  mehHcaln[amend] = dbe->book1D(hname,htitle, 10000, calnLower[amend],
169  calnUpper[amend]);
170  mehHcaln[amend]->setAxisTitle("Number of Digis",1);
171  mehHcaln[amend]->setAxisTitle("Count",2);
172 
173  hcharname = "hHcalAEE_"+HCalString[amend];
174  hchartitle= HCalString[amend]+"Cal AEE";
175  sprintf(hname, hcharname.c_str());
176  sprintf(htitle, hchartitle.c_str());
177  mehHcalAEE[amend] = dbe->book1D(hname,htitle, 60, -10., 50.);
178  mehHcalAEE[amend]->setAxisTitle("Analog Equivalent Energy",1);
179  mehHcalAEE[amend]->setAxisTitle("Count",2);
180 
181  hcharname = "hHcalSHE_"+HCalString[amend];
182  hchartitle= HCalString[amend]+"Cal SHE";
183  sprintf(hname, hcharname.c_str());
184  sprintf(htitle, hchartitle.c_str());
185  mehHcalSHE[amend] = dbe->book1D(hname,htitle, 1000, 0.0,
186  SHEUpper[amend]);
187  mehHcalSHE[amend]->setAxisTitle("Simulated Hit Energy",1);
188  mehHcalSHE[amend]->setAxisTitle("Count",2);
189 
190  hcharname = "hHcalAEESHE_"+HCalString[amend];
191  hchartitle= HCalString[amend]+"Cal AEE/SHE";
192  sprintf(hname, hcharname.c_str());
193  sprintf(htitle, hchartitle.c_str());
194  mehHcalAEESHE[amend] = dbe->book1D(hname, htitle, SHEvAEEnBins[amend],
195  SHEvAEELower[amend],
196  SHEvAEEUpper[amend]);
197  mehHcalAEESHE[amend]->setAxisTitle("ADC / SHE",1);
198  mehHcalAEESHE[amend]->setAxisTitle("Count",2);
199 
200  hcharname = "hHcalSHEvAEE_"+HCalString[amend];
201  hchartitle= HCalString[amend]+"Cal SHE vs. AEE";
202  sprintf(hname, hcharname.c_str());
203  sprintf(htitle, hchartitle.c_str());
204  mehHcalSHEvAEE[amend] = dbe->bookProfile(hname,htitle, 60, -10.,
205  50., 100, 0.,
206  (float)ProfileUpper[amend],"");
207  mehHcalSHEvAEE[amend]->setAxisTitle("AEE / SHE",1);
208  mehHcalSHEvAEE[amend]->setAxisTitle("SHE",2);
209 
210  }
211 
212  //Ecal
213  std::string ECalString[2] = {"EB","EE"};
214 
215  for(int i =0; i<2; ++i) {
216  mehEcaln[i]=0;
217  mehEcalAEE[i]=0;
218  mehEcalSHE[i]=0;
219  mehEcalMaxPos[i]=0;
220  mehEcalMultvAEE[i]=0;
221  mehEcalSHEvAEESHE[i]=0;
222  }
223  dbe->setCurrentFolder("GlobalDigisV/ECals");
224 
225  for(int amend = 0; amend < 2; ++amend) {
226  hcharname = "hEcaln_"+ECalString[amend];
227  hchartitle= ECalString[amend]+" digis";
228  sprintf(hname, hcharname.c_str());
229  sprintf(htitle, hchartitle.c_str());
230  mehEcaln[amend] = dbe->book1D(hname,htitle, 3000, 0., 40000.);
231  mehEcaln[amend]->setAxisTitle("Number of Digis",1);
232  mehEcaln[amend]->setAxisTitle("Count",2);
233 
234  hcharname = "hEcalAEE_"+ECalString[amend];
235  hchartitle= ECalString[amend]+"Cal AEE";
236  sprintf(hname, hcharname.c_str());
237  sprintf(htitle, hchartitle.c_str());
238  mehEcalAEE[amend] = dbe->book1D(hname,htitle, 1000, 0., 100.);
239  mehEcalAEE[amend]->setAxisTitle("Analog Equivalent Energy",1);
240  mehEcalAEE[amend]->setAxisTitle("Count",2);
241 
242  hcharname = "hEcalSHE_"+ECalString[amend];
243  hchartitle= ECalString[amend]+"Cal SHE";
244  sprintf(hname, hcharname.c_str());
245  sprintf(htitle, hchartitle.c_str());
246  mehEcalSHE[amend] = dbe->book1D(hname,htitle, 500, 0., 50.);
247  mehEcalSHE[amend]->setAxisTitle("Simulated Hit Energy",1);
248  mehEcalSHE[amend]->setAxisTitle("Count",2);
249 
250  hcharname = "hEcalMaxPos_"+ECalString[amend];
251  hchartitle= ECalString[amend]+"Cal MaxPos";
252  sprintf(hname, hcharname.c_str());
253  sprintf(htitle, hchartitle.c_str());
254  mehEcalMaxPos[amend] = dbe->book1D(hname,htitle,10, 0., 10.);
255  mehEcalMaxPos[amend]->setAxisTitle("Maximum Position",1);
256  mehEcalMaxPos[amend]->setAxisTitle("Count",2);
257 
258  hcharname = "hEcalSHEvAEESHE_"+ECalString[amend];
259  hchartitle= ECalString[amend]+"Cal SHE vs. AEE/SHE";
260  sprintf(hname, hcharname.c_str());
261  sprintf(htitle, hchartitle.c_str());
262  mehEcalSHEvAEESHE[amend] = dbe->bookProfile(hname,htitle,1000, 0., 100.,
263  500, 0., 50.,"");
264  mehEcalSHEvAEESHE[amend]->setAxisTitle("AEE / SHE",1);
265  mehEcalSHEvAEESHE[amend]->setAxisTitle("SHE",2);
266 
267  hcharname = "hEcalMultvAEE_"+ECalString[amend];
268  hchartitle= ECalString[amend]+"Cal Multi vs. AEE";
269  sprintf(hname, hcharname.c_str());
270  sprintf(htitle, hchartitle.c_str());
271  mehEcalMultvAEE[amend] = dbe->bookProfile(hname,htitle, 1000, 0., 100.,
272  4000, 0., 40000.,"");
273  mehEcalMultvAEE[amend]->setAxisTitle("Analog Equivalent Energy",1);
274  mehEcalMultvAEE[amend]->setAxisTitle("Number of Digis",2);
275  }
276  mehEScaln = 0;
277 
278  hcharname = "hEcaln_ES";
279  hchartitle= "ESCAL digis";
280  sprintf(hname, hcharname.c_str());
281  sprintf(htitle, hchartitle.c_str());
282  mehEScaln = dbe->book1D(hname,htitle, 1000, 0., 5000.);
283  mehEScaln->setAxisTitle("Number of Digis",1);
284  mehEScaln->setAxisTitle("Count",2);
285 
286  std::string ADCNumber[3] = {"0", "1", "2"};
287  for(int i =0; i<3; ++i) {
288  mehEScalADC[i] = 0;
289  hcharname = "hEcalADC"+ADCNumber[i]+"_ES";
290  hchartitle= "ESCAL ADC"+ADCNumber[i];
291  sprintf(hname, hcharname.c_str());
292  sprintf(htitle, hchartitle.c_str());
293  mehEScalADC[i] = dbe->book1D(hname,htitle, 1500, 0., 1500.);
294  mehEScalADC[i]->setAxisTitle("ADC"+ADCNumber[i],1);
295  mehEScalADC[i]->setAxisTitle("Count",2);
296  }
297 
298  //Si Pixels ***DONE***
299  std::string SiPixelString[7] = {"BRL1", "BRL2", "BRL3", "FWD1n", "FWD1p",
300  "FWD2n", "FWD2p"};
301  for(int j =0; j<7; ++j) {
302  mehSiPixeln[j]=0;
303  mehSiPixelADC[j]=0;
304  mehSiPixelRow[j]=0;
305  mehSiPixelCol[j]=0;
306  }
307 
308  dbe->setCurrentFolder("GlobalDigisV/SiPixels");
309  for(int amend = 0; amend < 7; ++amend) {
310  hcharname = "hSiPixeln_"+SiPixelString[amend];
311  hchartitle= SiPixelString[amend]+" Digis";
312  sprintf(hname, hcharname.c_str());
313  sprintf(htitle, hchartitle.c_str());
314  if(amend<3) mehSiPixeln[amend] = dbe->book1D(hname,htitle,500,0.,1000.);
315  else mehSiPixeln[amend] = dbe->book1D(hname,htitle,500,0.,1000.);
316  mehSiPixeln[amend]->setAxisTitle("Number of Digis",1);
317  mehSiPixeln[amend]->setAxisTitle("Count",2);
318 
319  hcharname = "hSiPixelADC_"+SiPixelString[amend];
320  hchartitle= SiPixelString[amend]+" ADC";
321  sprintf(hname, hcharname.c_str());
322  sprintf(htitle, hchartitle.c_str());
323  mehSiPixelADC[amend] = dbe->book1D(hname,htitle,150,0.0,300.);
324  mehSiPixelADC[amend]->setAxisTitle("ADC",1);
325  mehSiPixelADC[amend]->setAxisTitle("Count",2);
326 
327  hcharname = "hSiPixelRow_"+SiPixelString[amend];
328  hchartitle= SiPixelString[amend]+" Row";
329  sprintf(hname, hcharname.c_str());
330  sprintf(htitle, hchartitle.c_str());
331  mehSiPixelRow[amend] = dbe->book1D(hname,htitle,100,0.0,100.);
332  mehSiPixelRow[amend]->setAxisTitle("Row Number",1);
333  mehSiPixelRow[amend]->setAxisTitle("Count",2);
334 
335  hcharname = "hSiPixelColumn_"+SiPixelString[amend];
336  hchartitle= SiPixelString[amend]+" Column";
337  sprintf(hname, hcharname.c_str());
338  sprintf(htitle, hchartitle.c_str());
339  mehSiPixelCol[amend] = dbe->book1D(hname,htitle,200,0.0,500.);
340  mehSiPixelCol[amend]->setAxisTitle("Column Number",1);
341  mehSiPixelCol[amend]->setAxisTitle("Count",2);
342  }
343 
344  //Muons
345  dbe->setCurrentFolder("GlobalDigisV/Muons");
346 
347  //DT
348  std::string MuonString[4] = {"MB1", "MB2", "MB3", "MB4"};
349 
350  for(int i =0; i < 4; ++i) {
351  mehDtMuonn[i] = 0;
352  mehDtMuonLayer[i] = 0;
353  mehDtMuonTime[i] = 0;
354  mehDtMuonTimevLayer[i] = 0;
355  }
356 
357  for(int j = 0; j < 4; ++j) {
358  hcharname = "hDtMuonn_"+MuonString[j];
359  hchartitle= MuonString[j]+" digis";
360  sprintf(hname,hcharname.c_str());
361  sprintf(htitle,hchartitle.c_str());
362  mehDtMuonn[j] = dbe->book1D(hname,htitle,250, 0., 500.);
363  mehDtMuonn[j]->setAxisTitle("Number of Digis",1);
364  mehDtMuonn[j]->setAxisTitle("Count",2);
365 
366  hcharname = "hDtLayer_"+MuonString[j];
367  hchartitle= MuonString[j]+" Layer";
368  sprintf(hname,hcharname.c_str());
369  sprintf(htitle,hchartitle.c_str());
370  mehDtMuonLayer[j] = dbe->book1D(hname,htitle,12, 1., 13.);
371  mehDtMuonLayer[j]->setAxisTitle("4 * (SuperLayer - 1) + Layer",1);
372  mehDtMuonLayer[j]->setAxisTitle("Count",2);
373 
374  hcharname = "hDtMuonTime_"+MuonString[j];
375  hchartitle= MuonString[j]+" Time";
376  sprintf(hname,hcharname.c_str());
377  sprintf(htitle,hchartitle.c_str());
378  mehDtMuonTime[j] = dbe->book1D(hname,htitle,300, 400., 1000.);
379  mehDtMuonTime[j]->setAxisTitle("Time",1);
380  mehDtMuonTime[j]->setAxisTitle("Count",2);
381 
382  hcharname = "hDtMuonTimevLayer_"+MuonString[j];
383  hchartitle= MuonString[j]+" Time vs. Layer";
384  sprintf(hname,hcharname.c_str());
385  sprintf(htitle,hchartitle.c_str());
386  mehDtMuonTimevLayer[j] = dbe->bookProfile(hname,htitle,12, 1., 13., 300,
387  400., 1000.,"");
388  mehDtMuonTimevLayer[j]->setAxisTitle("4 * (SuperLayer - 1) + Layer",1);
389  mehDtMuonTimevLayer[j]->setAxisTitle("Time",2);
390  }
391 
392  //CSC
393  mehCSCStripn = 0;
394  hcharname = "hCSCStripn";
395  hchartitle = "CSC Strip digis";
396  sprintf(hname,hcharname.c_str());
397  sprintf(htitle,hchartitle.c_str());
398  mehCSCStripn = dbe->book1D(hname,htitle,250, 0., 500.);
399  mehCSCStripn->setAxisTitle("Number of Digis",1);
400  mehCSCStripn->setAxisTitle("Count",2);
401 
402  mehCSCStripADC = 0;
403  hcharname = "hCSCStripADC";
404  hchartitle = "CSC Strip ADC";
405  sprintf(hname,hcharname.c_str());
406  sprintf(htitle,hchartitle.c_str());
407  mehCSCStripADC = dbe->book1D(hname,htitle, 110, 0., 1100.);
408  mehCSCStripADC->setAxisTitle("ADC",1);
409  mehCSCStripADC->setAxisTitle("Count",2);
410 
411  mehCSCWiren = 0;
412  hcharname = "hCSCWiren";
413  hchartitle = "CSC Wire digis";
414  sprintf(hname,hcharname.c_str());
415  sprintf(htitle,hchartitle.c_str());
416  mehCSCWiren = dbe->book1D(hname,htitle,250, 0., 500.);
417  mehCSCWiren->setAxisTitle("Number of Digis",1);
418  mehCSCWiren->setAxisTitle("Count",2);
419 
420  mehCSCWireTime = 0;
421  hcharname = "hCSCWireTime";
422  hchartitle = "CSC Wire Time";
423  sprintf(hname,hcharname.c_str());
424  sprintf(htitle,hchartitle.c_str());
425  mehCSCWireTime = dbe->book1D(hname,htitle,10, 0., 10.);
426  mehCSCWireTime->setAxisTitle("Time",1);
427  mehCSCWireTime->setAxisTitle("Count",2);
428 
429  // RPC
430  mehRPCMuonn = 0;
431  hcharname = "hRPCMuonn";
432  hchartitle = "RPC digis";
433  sprintf(hname,hcharname.c_str());
434  sprintf(htitle,hchartitle.c_str());
435  mehCSCStripn = dbe->book1D(hname,htitle,250, 0., 500.);
436  mehCSCStripn->setAxisTitle("Number of Digis",1);
437  mehCSCStripn->setAxisTitle("Count",2);
438 
439  std::string MuonRPCString[5] = {"Wmin2", "Wmin1", "W0", "Wpu1", "Wpu2"};
440  for(int i =0; i < 5; ++i) {
441  mehRPCRes[i] = 0;
442  }
443 
444  for(int j = 0; j < 5; ++j) {
445  hcharname = "hRPCRes_"+MuonRPCString[j];
446  hchartitle= MuonRPCString[j]+" Digi - Sim";
447  sprintf(hname,hcharname.c_str());
448  sprintf(htitle,hchartitle.c_str());
449  mehRPCRes[j] = dbe->book1D(hname,htitle,200, -8., 8.);
450  mehRPCRes[j]->setAxisTitle("Digi - Sim center of strip x",1);
451  mehRPCRes[j]->setAxisTitle("Count",2);
452  }
453  }
454 
455  // set default constants
456  // ECal
457 
458  ECalgainConv_[0] = 0.;
459  ECalgainConv_[1] = 1.;
460  ECalgainConv_[2] = 2.;
461  ECalgainConv_[3] = 12.;
462  ECalbarrelADCtoGeV_ = 0.035;
463  ECalendcapADCtoGeV_ = 0.06;
464 }
465 
467 
469 {
470  std::string MsgLoggerCat = "GlobalDigisAnalyzer_beginJob";
471 
472  EcalMGPAGainRatio * defaultRatios = new EcalMGPAGainRatio();
473 
474  ECalgainConv_[0] = 0.;
475  ECalgainConv_[1] = 1.;
476  ECalgainConv_[2] = defaultRatios->gain12Over6() ;
477  ECalgainConv_[3] = ECalgainConv_[2]*(defaultRatios->gain6Over1()) ;
478 
479  delete defaultRatios;
480 
481  if (verbosity >= 0) {
482  edm::LogInfo(MsgLoggerCat)
483  << "Modified Calorimeter gain constants: g0 = " << ECalgainConv_[0]
484  << ", g1 = " << ECalgainConv_[1] << ", g2 = " << ECalgainConv_[2]
485  << ", g3 = " << ECalgainConv_[3];
486  }
487 
488  return;
489 }
490 
491 
493 {
494  std::string MsgLoggerCat = "GlobalDigisAnalyzer_endJob";
495  if (verbosity >= 0)
496  edm::LogInfo(MsgLoggerCat)
497  << "Terminating having processed " << count << " events.";
498  return;
499 }
500 
502  const edm::EventSetup& iSetup)
503 {
504  std::string MsgLoggerCat = "GlobalDigisAnalyzer_analyze";
505 
506  // keep track of number of events processed
507  ++count;
508 
509 
510 
511  // THIS BLOCK MIGRATED HERE FROM beginJob:
512  // setup calorimeter constants from service
514  iSetup.get<EcalADCToGeVConstantRcd>().get(pAgc);
515  const EcalADCToGeVConstant* agc = pAgc.product();
518  if (verbosity >= 0) {
519  edm::LogInfo(MsgLoggerCat)
520  << "Modified Calorimeter ADCtoGeV constants: barrel = "
521  << ECalbarrelADCtoGeV_ << ", endcap = " << ECalendcapADCtoGeV_;
522  }
523 
524 
525 
526  // get event id information
527  int nrun = iEvent.id().run();
528  int nevt = iEvent.id().event();
529 
530  if (verbosity > 0) {
531  edm::LogInfo(MsgLoggerCat)
532  << "Processing run " << nrun << ", event " << nevt
533  << " (" << count << " events total)";
534  } else if (verbosity == 0) {
535  if (nevt%frequency == 0 || nevt == 1) {
536  edm::LogInfo(MsgLoggerCat)
537  << "Processing run " << nrun << ", event " << nevt
538  << " (" << count << " events total)";
539  }
540  }
541 
542  // look at information available in the event
543  if (getAllProvenances) {
544 
545  std::vector<const edm::Provenance*> AllProv;
546  iEvent.getAllProvenance(AllProv);
547 
548  if (verbosity >= 0)
549  edm::LogInfo(MsgLoggerCat)
550  << "Number of Provenances = " << AllProv.size();
551 
552  if (printProvenanceInfo && (verbosity >= 0)) {
553  TString eventout("\nProvenance info:\n");
554 
555  for (unsigned int i = 0; i < AllProv.size(); ++i) {
556  eventout += "\n ******************************";
557  eventout += "\n Module : ";
558  eventout += AllProv[i]->moduleLabel();
559  eventout += "\n ProductID : ";
560  eventout += AllProv[i]->productID().id();
561  eventout += "\n ClassName : ";
562  eventout += AllProv[i]->className();
563  eventout += "\n InstanceName : ";
564  eventout += AllProv[i]->productInstanceName();
565  eventout += "\n BranchName : ";
566  eventout += AllProv[i]->branchName();
567  }
568  eventout += "\n ******************************\n";
569  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
570  printProvenanceInfo = false;
571  }
572  getAllProvenances = false;
573  }
574 
575  // call fill functions
576  // gather Ecal information from event
577  fillECal(iEvent, iSetup);
578  // gather Hcal information from event
579  fillHCal(iEvent, iSetup);
580  // gather Track information from event
581  fillTrk(iEvent, iSetup);
582  // gather Muon information from event
583  fillMuon(iEvent, iSetup);
584 
585  if (verbosity > 0)
586  edm::LogInfo (MsgLoggerCat)
587  << "Done gathering data from event.";
588 
589  if (verbosity > 2)
590  edm::LogInfo (MsgLoggerCat)
591  << "Saving event contents:";
592 
593  return;
594 }
595 
597  const edm::EventSetup& iSetup)
598 {
599  std::string MsgLoggerCat = "GlobalDigisAnalyzer_fillECal";
600 
601  TString eventout;
602  if (verbosity > 0)
603  eventout = "\nGathering info:";
604 
605  // extract crossing frame from event
606  edm::Handle<CrossingFrame<PCaloHit> > crossingFrame;
607 
609  //extract EB information
611  bool isBarrel = true;
612  edm::Handle<EBDigiCollection> EcalDigiEB;
613  const EBDigiCollection *EBdigis = 0;
614  iEvent.getByLabel(ECalEBSrc_, EcalDigiEB);
615  bool validDigiEB = true;
616  if (!EcalDigiEB.isValid()) {
617  LogDebug(MsgLoggerCat)
618  << "Unable to find EcalDigiEB in event!";
619  validDigiEB = false;
620  }
621  if (validDigiEB) {
622  EBdigis = EcalDigiEB.product();
623  if ( EcalDigiEB->size() == 0) isBarrel = false;
624 
625  if (isBarrel) {
626 
627  // loop over simhits
628  MapType ebSimMap;
629  const std::string barrelHitsName(hitsProducer+"EcalHitsEB");
630  iEvent.getByLabel("mix",barrelHitsName,crossingFrame);
631  bool validXFrame = true;
632  if (!crossingFrame.isValid()) {
633  LogDebug(MsgLoggerCat)
634  << "Unable to find cal barrel crossingFrame in event!";
635  validXFrame = false;
636  }
637  if (validXFrame) {
638  std::auto_ptr<MixCollection<PCaloHit> >
639  barrelHits(new MixCollection<PCaloHit>(crossingFrame.product()));
640 
641  // keep track of sum of simhit energy in each crystal
643  = barrelHits->begin();
644  hitItr != barrelHits->end();
645  ++hitItr) {
646 
647  EBDetId ebid = EBDetId(hitItr->id());
648 
649  uint32_t crystid = ebid.rawId();
650  ebSimMap[crystid] += hitItr->energy();
651  }
652  }
653 
654  // loop over digis
655  const EBDigiCollection *barrelDigi = EcalDigiEB.product();
656 
657  std::vector<double> ebAnalogSignal;
658  std::vector<double> ebADCCounts;
659  std::vector<double> ebADCGains;
660  ebAnalogSignal.reserve(EBDataFrame::MAXSAMPLES);
661  ebADCCounts.reserve(EBDataFrame::MAXSAMPLES);
662  ebADCGains.reserve(EBDataFrame::MAXSAMPLES);
663 
664  int i = 0;
665  for (unsigned int digis=0; digis<EcalDigiEB->size(); ++digis) {
666 
667  ++i;
668 
669  EBDataFrame ebdf = (*barrelDigi)[digis];
670  int nrSamples = ebdf.size();
671 
672  EBDetId ebid = ebdf.id () ;
673 
674  double Emax = 0;
675  int Pmax = 0;
676  double pedestalPreSample = 0.;
677  double pedestalPreSampleAnalog = 0.;
678 
679  for (int sample = 0 ; sample < nrSamples; ++sample) {
680  ebAnalogSignal[sample] = 0.;
681  ebADCCounts[sample] = 0.;
682  ebADCGains[sample] = -1.;
683  }
684 
685  // calculate maximum energy and pedestal
686  for (int sample = 0 ; sample < nrSamples; ++sample) {
687 
688  EcalMGPASample thisSample = ebdf[sample];
689  ebADCCounts[sample] = (thisSample.adc());
690  ebADCGains[sample] = (thisSample.gainId());
691  ebAnalogSignal[sample] =
692  (ebADCCounts[sample] * ECalgainConv_[(int)ebADCGains[sample]]
694  if (Emax < ebAnalogSignal[sample]) {
695  Emax = ebAnalogSignal[sample];
696  Pmax = sample;
697  }
698  if ( sample < 3 ) {
699  pedestalPreSample += ebADCCounts[sample] ;
700  pedestalPreSampleAnalog +=
701  ebADCCounts[sample] * ECalgainConv_[(int)ebADCGains[sample]]
702  * ECalbarrelADCtoGeV_ ;
703  }
704 
705  }
706  pedestalPreSample /= 3. ;
707  pedestalPreSampleAnalog /= 3. ;
708 
709  // calculate pedestal subtracted digi energy in the crystal
710  double Erec = Emax - pedestalPreSampleAnalog
711  * ECalgainConv_[(int)ebADCGains[Pmax]];
712 
713  // gather necessary information
714  mehEcalMaxPos[0]->Fill(Pmax);
715  mehEcalSHE[0]->Fill(ebSimMap[ebid.rawId()]);
716  mehEcalAEE[0]->Fill(Erec);
717  //Adding protection against FPE
718  if (ebSimMap[ebid.rawId()]!=0) {
719  mehEcalSHEvAEESHE[0]->Fill(Erec/ebSimMap[ebid.rawId()],
720  ebSimMap[ebid.rawId()]);
721  }
722  //else {
723  // std::cout<<"Would have been an FPE! with ebSimMap[ebid.rawId()]==0\n";
724  //}
725 
726  mehEcalMultvAEE[0]->Fill(Pmax,(float)i);
727  }
728 
729  if (verbosity > 1) {
730  eventout += "\n Number of EBDigis collected:.............. ";
731  eventout += i;
732  }
733  mehEcaln[0]->Fill((float)i);
734  }
735  }
736 
738  //extract EE information
740  bool isEndCap = true;
741  edm::Handle<EEDigiCollection> EcalDigiEE;
742  const EEDigiCollection *EEdigis = 0;
743  iEvent.getByLabel(ECalEESrc_, EcalDigiEE);
744  bool validDigiEE = true;
745  if (!EcalDigiEE.isValid()) {
746  LogDebug(MsgLoggerCat)
747  << "Unable to find EcalDigiEE in event!";
748  validDigiEE = false;
749  }
750  if (validDigiEE) {
751  EEdigis = EcalDigiEE.product();
752  if (EcalDigiEE->size() == 0) isEndCap = false;
753 
754  if (isEndCap) {
755 
756  // loop over simhits
757  MapType eeSimMap;
758  const std::string endcapHitsName(hitsProducer+"EcalHitsEE");
759  iEvent.getByLabel("mix",endcapHitsName,crossingFrame);
760  bool validXFrame = true;
761  if (!crossingFrame.isValid()) {
762  LogDebug(MsgLoggerCat)
763  << "Unable to find cal endcap crossingFrame in event!";
764  validXFrame = false;
765  }
766  if (validXFrame) {
767  std::auto_ptr<MixCollection<PCaloHit> >
768  endcapHits(new MixCollection<PCaloHit>(crossingFrame.product()));
769 
770  // keep track of sum of simhit energy in each crystal
772  = endcapHits->begin();
773  hitItr != endcapHits->end();
774  ++hitItr) {
775 
776  EEDetId eeid = EEDetId(hitItr->id());
777 
778  uint32_t crystid = eeid.rawId();
779  eeSimMap[crystid] += hitItr->energy();
780  }
781  }
782 
783  // loop over digis
784  const EEDigiCollection *endcapDigi = EcalDigiEE.product();
785 
786  std::vector<double> eeAnalogSignal;
787  std::vector<double> eeADCCounts;
788  std::vector<double> eeADCGains;
789  eeAnalogSignal.reserve(EEDataFrame::MAXSAMPLES);
790  eeADCCounts.reserve(EEDataFrame::MAXSAMPLES);
791  eeADCGains.reserve(EEDataFrame::MAXSAMPLES);
792 
793  int inc = 0;
794  for (unsigned int digis=0; digis<EcalDigiEE->size(); ++digis){
795 
796  ++inc;
797 
798  EEDataFrame eedf = (*endcapDigi)[digis];
799  int nrSamples = eedf.size();
800 
801  EEDetId eeid = eedf.id () ;
802 
803  double Emax = 0;
804  int Pmax = 0;
805  double pedestalPreSample = 0.;
806  double pedestalPreSampleAnalog = 0.;
807 
808  for (int sample = 0 ; sample < nrSamples; ++sample) {
809  eeAnalogSignal[sample] = 0.;
810  eeADCCounts[sample] = 0.;
811  eeADCGains[sample] = -1.;
812  }
813 
814  // calculate maximum enery and pedestal
815  for (int sample = 0 ; sample < nrSamples; ++sample) {
816 
817  EcalMGPASample thisSample = eedf[sample];
818 
819  eeADCCounts[sample] = (thisSample.adc());
820  eeADCGains[sample] = (thisSample.gainId());
821  eeAnalogSignal[sample] =
822  (eeADCCounts[sample] * ECalgainConv_[(int)eeADCGains[sample]]
824  if (Emax < eeAnalogSignal[sample]) {
825  Emax = eeAnalogSignal[sample];
826  Pmax = sample;
827  }
828  if ( sample < 3 ) {
829  pedestalPreSample += eeADCCounts[sample] ;
830  pedestalPreSampleAnalog +=
831  eeADCCounts[sample] * ECalgainConv_[(int)eeADCGains[sample]]
832  * ECalbarrelADCtoGeV_ ;
833  }
834 
835  }
836  pedestalPreSample /= 3. ;
837  pedestalPreSampleAnalog /= 3. ;
838 
839  // calculate pedestal subtracted digi energy in the crystal
840  double Erec = Emax - pedestalPreSampleAnalog
841  * ECalgainConv_[(int)eeADCGains[Pmax]];
842 
843  // gather necessary information
844  mehEcalMaxPos[1]->Fill(Pmax);
845  mehEcalSHE[1]->Fill(eeSimMap[eeid.rawId()]);
846  mehEcalAEE[1]->Fill(Erec);
847  //Adding protection against FPE
848  if (eeSimMap[eeid.rawId()]!=0){
849  mehEcalSHEvAEESHE[1]->Fill(Erec/eeSimMap[eeid.rawId()],
850  eeSimMap[eeid.rawId()]);
851  }
852  //else{
853  // std::cout<<"Would have been an FPE! with eeSimMap[eeid.rawId()]==0\n";
854  //}
855  mehEcalMultvAEE[1]->Fill(Pmax,(float)inc);
856 
857  }
858 
859  if (verbosity > 1) {
860  eventout += "\n Number of EEDigis collected:.............. ";
861  eventout += inc;
862  }
863 
864  mehEcaln[1]->Fill((float)inc);
865  }
866  }
867 
869  //extract ES information
871  bool isPreshower = true;
872  edm::Handle<ESDigiCollection> EcalDigiES;
873  const ESDigiCollection *ESdigis = 0;
874  iEvent.getByLabel(ECalESSrc_, EcalDigiES);
875  bool validDigiES = true;
876  if (!EcalDigiES.isValid()) {
877  LogDebug(MsgLoggerCat)
878  << "Unable to find EcalDigiES in event!";
879  validDigiES = false;
880  }
881 
882  // ONLY WHILE GEOMETRY IS REMOVED
883  validDigiES = false;
884 
885  if (validDigiES) {
886  ESdigis = EcalDigiES.product();
887  if (EcalDigiES->size() == 0) isPreshower = false;
888 
889  if (isPreshower) {
890 
891  // loop over simhits
892  const std::string preshowerHitsName(hitsProducer+"EcalHitsES");
893  iEvent.getByLabel("mix",preshowerHitsName,crossingFrame);
894  bool validXFrame = true;
895  if (!crossingFrame.isValid()) {
896  LogDebug(MsgLoggerCat)
897  << "Unable to find cal preshower crossingFrame in event!";
898  validXFrame = false;
899  }
900  if (validXFrame) {
901  std::auto_ptr<MixCollection<PCaloHit> >
902  preshowerHits(new MixCollection<PCaloHit>(crossingFrame.product()));
903 
904  // keep track of sum of simhit energy in each crystal
905  MapType esSimMap;
907  = preshowerHits->begin();
908  hitItr != preshowerHits->end();
909  ++hitItr) {
910 
911  ESDetId esid = ESDetId(hitItr->id());
912 
913  uint32_t crystid = esid.rawId();
914  esSimMap[crystid] += hitItr->energy();
915  }
916  }
917 
918  // loop over digis
919  const ESDigiCollection *preshowerDigi = EcalDigiES.product();
920 
921  std::vector<double> esADCCounts;
922  esADCCounts.reserve(ESDataFrame::MAXSAMPLES);
923 
924  int i = 0;
925  for (unsigned int digis=0; digis<EcalDigiES->size(); ++digis) {
926 
927  ++i;
928 
929 
930  ESDataFrame esdf = (*preshowerDigi)[digis];
931  int nrSamples = esdf.size();
932 
933  ESDetId esid = esdf.id () ;
934  // ESDetId esid = digis->id();
935 
936  for (int sample = 0 ; sample < nrSamples; ++sample) {
937  esADCCounts[sample] = 0.;
938  }
939 
940  // gether ADC counts
941  for (int sample = 0 ; sample < nrSamples; ++sample) {
942 
943  ESSample thisSample = esdf[sample];
944  esADCCounts[sample] = (thisSample.adc());
945  }
946 
947  mehEScalADC[0]->Fill(esADCCounts[0]);
948  mehEScalADC[1]->Fill(esADCCounts[1]);
949  mehEScalADC[2]->Fill(esADCCounts[2]);
950 
951  }
952 
953  if (verbosity > 1) {
954  eventout += "\n Number of ESDigis collected:.............. ";
955  eventout += i;
956  }
957 
958  mehEScaln->Fill((float)i);
959  }
960  }
961  if (verbosity > 0)
962  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
963 
964  return;
965 }
966 
967 
969  const edm::EventSetup& iSetup)
970 {
971  std::string MsgLoggerCat = "GlobalDigisAnalyzer_fillHCal";
972 
973  TString eventout;
974  if (verbosity > 0)
975  eventout = "\nGathering info:";
976 
977  // get calibration info
978  edm::ESHandle<HcalDbService> HCalconditions;
979  iSetup.get<HcalDbRecord>().get(HCalconditions);
980  if (!HCalconditions.isValid()) {
981  edm::LogWarning(MsgLoggerCat)
982  << "Unable to find HCalconditions in event!";
983  return;
984  }
985  const HcalQIEShape *shape = HCalconditions->getHcalShape();
986  //HcalCalibrations calibrations;
987  CaloSamples tool;
988 
990  // extract simhit info
993  iEvent.getByLabel(HCalSrc_,hcalHits);
994  bool validhcalHits = true;
995  if (!hcalHits.isValid()) {
996  LogDebug(MsgLoggerCat)
997  << "Unable to find hcalHits in event!";
998  validhcalHits = false;
999  }
1000  MapType fHBEnergySimHits;
1001  MapType fHEEnergySimHits;
1002  MapType fHOEnergySimHits;
1003  MapType fHFEnergySimHits;
1004  if (validhcalHits) {
1005  const edm::PCaloHitContainer *simhitResult = hcalHits.product();
1006 
1007  for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin();
1008  simhits != simhitResult->end();
1009  ++simhits) {
1010 
1011  HcalDetId detId(simhits->id());
1012  uint32_t cellid = detId.rawId();
1013 
1014  if (detId.subdet() == sdHcalBrl){
1015  fHBEnergySimHits[cellid] += simhits->energy();
1016  }
1017  if (detId.subdet() == sdHcalEC){
1018  fHEEnergySimHits[cellid] += simhits->energy();
1019  }
1020  if (detId.subdet() == sdHcalOut){
1021  fHOEnergySimHits[cellid] += simhits->energy();
1022  }
1023  if (detId.subdet() == sdHcalFwd){
1024  fHFEnergySimHits[cellid] += simhits->energy();
1025  }
1026  }
1027  }
1028 
1030  // get HBHE information
1033  iEvent.getByLabel(HCalDigi_,hbhe);
1034  bool validHBHE = true;
1035  if (!hbhe.isValid()) {
1036  LogDebug(MsgLoggerCat)
1037  << "Unable to find HBHEDataFrame in event!";
1038  validHBHE = false;
1039  }
1040 
1041  if (validHBHE) {
1043 
1044  int iHB = 0;
1045  int iHE = 0;
1046  for (ihbhe = hbhe->begin(); ihbhe != hbhe->end(); ++ihbhe) {
1047  HcalDetId cell(ihbhe->id());
1048 
1049  if ((cell.subdet() == sdHcalBrl) || (cell.subdet() == sdHcalEC)) {
1050 
1051  //HCalconditions->makeHcalCalibration(cell, &calibrations);
1052  const HcalCalibrations& calibrations =
1053  HCalconditions->getHcalCalibrations(cell);
1054  const HcalQIECoder *channelCoder = HCalconditions->getHcalCoder(cell);
1055  HcalCoderDb coder(*channelCoder, *shape);
1056  coder.adc2fC(*ihbhe, tool);
1057 
1058  // get HB info
1059  if (cell.subdet() == sdHcalBrl) {
1060 
1061  ++iHB;
1062  float fDigiSum = 0.0;
1063  for (int ii = 0; ii < tool.size(); ++ii) {
1064  // default ped is 4.5
1065  int capid = (*ihbhe)[ii].capid();
1066  fDigiSum += (tool[ii] - calibrations.pedestal(capid));
1067  }
1068 
1069  mehHcalSHE[0]->Fill(fHFEnergySimHits[cell.rawId()]);
1070  mehHcalAEE[0]->Fill(fDigiSum);
1071  //Adding protection against FPE
1072  if (fHFEnergySimHits[cell.rawId()]!=0){
1073  mehHcalAEESHE[0]->Fill(fDigiSum/fHFEnergySimHits[cell.rawId()]);
1074  }
1075  //else {
1076  // std::cout<<"It would have been an FPE! with fHFEnergySimHits[cell.rawId()]==0!\n";
1077  //}
1078  mehHcalSHEvAEE[0]->Fill(fDigiSum, fHFEnergySimHits[cell.rawId()]);
1079  }
1080 
1081  // get HE info
1082  if (cell.subdet() == sdHcalEC) {
1083 
1084  ++iHE;
1085  float fDigiSum = 0.0;
1086  for (int ii = 0; ii < tool.size(); ++ii) {
1087  int capid = (*ihbhe)[ii].capid();
1088  fDigiSum += (tool[ii]-calibrations.pedestal(capid));
1089  }
1090 
1091  mehHcalSHE[1]->Fill(fHFEnergySimHits[cell.rawId()]);
1092  mehHcalAEE[1]->Fill(fDigiSum);
1093  //Adding protection against FPE
1094  if (fHFEnergySimHits[cell.rawId()]!=0){
1095  mehHcalAEESHE[1]->Fill(fDigiSum/fHFEnergySimHits[cell.rawId()]);
1096  }
1097  //else{
1098  // std::cout<<"It would have been an FPE! with fHFEnergySimHits[cell.rawId()]==0!\n";
1099  //}
1100  mehHcalSHEvAEE[1]->Fill(fDigiSum, fHFEnergySimHits[cell.rawId()]);
1101  }
1102  }
1103  }
1104 
1105  if (verbosity > 1) {
1106  eventout += "\n Number of HBDigis collected:.............. ";
1107  eventout += iHB;
1108  }
1109  mehHcaln[0]->Fill((float)iHB);
1110 
1111  if (verbosity > 1) {
1112  eventout += "\n Number of HEDigis collected:.............. ";
1113  eventout += iHE;
1114  }
1115  mehHcaln[1]->Fill((float)iHE);
1116  }
1117 
1119  // get HO information
1122  iEvent.getByLabel(HCalDigi_,ho);
1123  bool validHO = true;
1124  if (!ho.isValid()) {
1125  LogDebug(MsgLoggerCat)
1126  << "Unable to find HODataFrame in event!";
1127  validHO = false;
1128  }
1129  if (validHO) {
1131 
1132  int iHO = 0;
1133  for (iho = ho->begin(); iho != ho->end(); ++iho) {
1134  HcalDetId cell(iho->id());
1135 
1136  if (cell.subdet() == sdHcalOut) {
1137 
1138  //HCalconditions->makeHcalCalibration(cell, &calibrations);
1139  const HcalCalibrations& calibrations =
1140  HCalconditions->getHcalCalibrations(cell);
1141  const HcalQIECoder *channelCoder = HCalconditions->getHcalCoder(cell);
1142  HcalCoderDb coder (*channelCoder, *shape);
1143  coder.adc2fC(*iho, tool);
1144 
1145  ++iHO;
1146  float fDigiSum = 0.0;
1147  for (int ii = 0; ii < tool.size(); ++ii) {
1148  // default ped is 4.5
1149  int capid = (*iho)[ii].capid();
1150  fDigiSum += (tool[ii] - calibrations.pedestal(capid));
1151  }
1152 
1153  mehHcalSHE[2]->Fill(fHFEnergySimHits[cell.rawId()]);
1154  mehHcalAEE[2]->Fill(fDigiSum);
1155  //Adding protection against FPE
1156  if (fHFEnergySimHits[cell.rawId()]!=0){
1157  mehHcalAEESHE[2]->Fill(fDigiSum/fHFEnergySimHits[cell.rawId()]);
1158  }
1159  //else{
1160  // std::cout<<"It would have been an FPE! with fHFEnergySimHits[cell.rawId()]==0!\n";
1161  //}
1162  mehHcalSHEvAEE[2]->Fill(fDigiSum, fHFEnergySimHits[cell.rawId()]);
1163  }
1164  }
1165 
1166  if (verbosity > 1) {
1167  eventout += "\n Number of HODigis collected:.............. ";
1168  eventout += iHO;
1169  }
1170  mehHcaln[2]->Fill((float)iHO);
1171  }
1172 
1174  // get HF information
1177  iEvent.getByLabel(HCalDigi_,hf);
1178  bool validHF = true;
1179  if (!hf.isValid()) {
1180  LogDebug(MsgLoggerCat)
1181  << "Unable to find HFDataFrame in event!";
1182  validHF = false;
1183  }
1184  if (validHF) {
1186 
1187  int iHF = 0;
1188  for (ihf = hf->begin(); ihf != hf->end(); ++ihf) {
1189  HcalDetId cell(ihf->id());
1190 
1191  if (cell.subdet() == sdHcalFwd) {
1192 
1193  //HCalconditions->makeHcalCalibration(cell, &calibrations);
1194  const HcalCalibrations& calibrations =
1195  HCalconditions->getHcalCalibrations(cell);
1196  const HcalQIECoder *channelCoder = HCalconditions->getHcalCoder(cell);
1197  HcalCoderDb coder (*channelCoder, *shape);
1198  coder.adc2fC(*ihf, tool);
1199 
1200  ++iHF;
1201  float fDigiSum = 0.0;
1202  for (int ii = 0; ii < tool.size(); ++ii) {
1203  // default ped is 1.73077
1204  int capid = (*ihf)[ii].capid();
1205  fDigiSum += (tool[ii] - calibrations.pedestal(capid));
1206  }
1207 
1208  mehHcalSHE[3]->Fill(fHFEnergySimHits[cell.rawId()]);
1209  mehHcalAEE[3]->Fill(fDigiSum);
1210  //Adding protection against FPE
1211  if (fHFEnergySimHits[cell.rawId()]!=0){
1212  mehHcalAEESHE[3]->Fill(fDigiSum/fHFEnergySimHits[cell.rawId()]);
1213  }
1214  //else{
1215  // std::cout<<"It would have been an FPE! with fHFEnergySimHits[cell.rawId()]==0!\n";
1216  //}
1217  mehHcalSHEvAEE[3]->Fill(fDigiSum, fHFEnergySimHits[cell.rawId()]);
1218  }
1219  }
1220 
1221  if (verbosity > 1) {
1222  eventout += "\n Number of HFDigis collected:.............. ";
1223  eventout += iHF;
1224  }
1225  mehHcaln[3]->Fill((float)iHF);
1226  }
1227 
1228  if (verbosity > 0)
1229  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1230 
1231  return;
1232 }
1233 
1235  const edm::EventSetup& iSetup)
1236 {
1237  std::string MsgLoggerCat = "GlobalDigisAnalyzer_fillTrk";
1238 
1239  TString eventout;
1240  if (verbosity > 0)
1241  eventout = "\nGathering info:";
1242 
1243  // get strip information
1245  iEvent.getByLabel(SiStripSrc_, stripDigis);
1246  bool validstripDigis = true;
1247  if (!stripDigis.isValid()) {
1248  LogDebug(MsgLoggerCat)
1249  << "Unable to find stripDigis in event!";
1250  validstripDigis = false;
1251  }
1252 
1253  if (validstripDigis) {
1254  int nStripBrl = 0, nStripFwd = 0;
1256  for (DSViter = stripDigis->begin(); DSViter != stripDigis->end();
1257  ++DSViter) {
1258  unsigned int id = DSViter->id;
1259  DetId detId(id);
1263 
1264  // get TIB
1265  if (detId.subdetId() == sdSiTIB) {
1266  TIBDetId tibid(id);
1267  for (iter = begin; iter != end; ++iter) {
1268  ++nStripBrl;
1269  if (tibid.layer() == 1) {
1270  mehSiStripADC[0]->Fill((*iter).adc());
1271  mehSiStripStrip[0]->Fill((*iter).strip());
1272  }
1273  if (tibid.layer() == 2) {
1274  mehSiStripADC[1]->Fill((*iter).adc());
1275  mehSiStripStrip[1]->Fill((*iter).strip());
1276  }
1277  if (tibid.layer() == 3) {
1278  mehSiStripADC[2]->Fill((*iter).adc());
1279  mehSiStripStrip[2]->Fill((*iter).strip());
1280  }
1281  if (tibid.layer() == 4) {
1282  mehSiStripADC[3]->Fill((*iter).adc());
1283  mehSiStripStrip[3]->Fill((*iter).strip());
1284  }
1285  }
1286  }
1287 
1288  // get TOB
1289  if (detId.subdetId() == sdSiTOB) {
1290  TOBDetId tobid(id);
1291  for (iter = begin; iter != end; ++iter) {
1292  ++nStripBrl;
1293  if (tobid.layer() == 1) {
1294  mehSiStripADC[4]->Fill((*iter).adc());
1295  mehSiStripStrip[4]->Fill((*iter).strip());
1296  }
1297  if (tobid.layer() == 2) {
1298  mehSiStripADC[5]->Fill((*iter).adc());
1299  mehSiStripStrip[5]->Fill((*iter).strip());
1300  }
1301  if (tobid.layer() == 3) {
1302  mehSiStripADC[6]->Fill((*iter).adc());
1303  mehSiStripStrip[6]->Fill((*iter).strip());
1304  }
1305  if (tobid.layer() == 4) {
1306  mehSiStripADC[7]->Fill((*iter).adc());
1307  mehSiStripStrip[7]->Fill((*iter).strip());
1308  }
1309  }
1310  }
1311 
1312  // get TID
1313  if (detId.subdetId() == sdSiTID) {
1314  TIDDetId tidid(id);
1315  for (iter = begin; iter != end; ++iter) {
1316  ++nStripFwd;
1317  if (tidid.wheel() == 1) {
1318  mehSiStripADC[8]->Fill((*iter).adc());
1319  mehSiStripStrip[8]->Fill((*iter).strip());
1320  }
1321  if (tidid.wheel() == 2) {
1322  mehSiStripADC[9]->Fill((*iter).adc());
1323  mehSiStripStrip[9]->Fill((*iter).strip());
1324  }
1325  if (tidid.wheel() == 3) {
1326  mehSiStripADC[10]->Fill((*iter).adc());
1327  mehSiStripStrip[10]->Fill((*iter).strip());
1328  }
1329  }
1330  }
1331 
1332  // get TEC
1333  if (detId.subdetId() == sdSiTEC) {
1334  TECDetId tecid(id);
1335  for (iter = begin; iter != end; ++iter) {
1336  ++nStripFwd;
1337  if (tecid.wheel() == 1) {
1338  mehSiStripADC[11]->Fill((*iter).adc());
1339  mehSiStripStrip[11]->Fill((*iter).strip());
1340  }
1341  if (tecid.wheel() == 2) {
1342  mehSiStripADC[12]->Fill((*iter).adc());
1343  mehSiStripStrip[12]->Fill((*iter).strip());
1344  }
1345  if (tecid.wheel() == 3) {
1346  mehSiStripADC[13]->Fill((*iter).adc());
1347  mehSiStripStrip[13]->Fill((*iter).strip());
1348  }
1349  if (tecid.wheel() == 4) {
1350  mehSiStripADC[14]->Fill((*iter).adc());
1351  mehSiStripStrip[14]->Fill((*iter).strip());
1352  }
1353  if (tecid.wheel() == 5) {
1354  mehSiStripADC[15]->Fill((*iter).adc());
1355  mehSiStripStrip[15]->Fill((*iter).strip());
1356  }
1357  if (tecid.wheel() == 6) {
1358  mehSiStripADC[16]->Fill((*iter).adc());
1359  mehSiStripStrip[16]->Fill((*iter).strip());
1360  }
1361  if (tecid.wheel() == 7) {
1362  mehSiStripADC[17]->Fill((*iter).adc());
1363  mehSiStripStrip[17]->Fill((*iter).strip());
1364  }
1365  if (tecid.wheel() == 8) {
1366  mehSiStripADC[18]->Fill((*iter).adc());
1367  mehSiStripStrip[18]->Fill((*iter).strip());
1368  }
1369  }
1370  }
1371  } // end loop over DataSetVector
1372 
1373  if (verbosity > 1) {
1374  eventout += "\n Number of BrlStripDigis collected:........ ";
1375  eventout += nStripBrl;
1376  }
1377  for(int i = 0; i < 8; ++i) {
1378  mehSiStripn[i]->Fill((float)nStripBrl);
1379  }
1380 
1381  if (verbosity > 1) {
1382  eventout += "\n Number of FrwdStripDigis collected:....... ";
1383  eventout += nStripFwd;
1384  }
1385  for(int i = 8; i < 19; ++i) {
1386  mehSiStripn[i]->Fill((float)nStripFwd);
1387  }
1388  }
1389 
1390  // get pixel information
1392  iEvent.getByLabel(SiPxlSrc_, pixelDigis);
1393  bool validpixelDigis = true;
1394  if (!pixelDigis.isValid()) {
1395  LogDebug(MsgLoggerCat)
1396  << "Unable to find pixelDigis in event!";
1397  validpixelDigis = false;
1398  }
1399  if (validpixelDigis) {
1400  int nPxlBrl = 0, nPxlFwd = 0;
1402  for (DPViter = pixelDigis->begin(); DPViter != pixelDigis->end();
1403  ++DPViter) {
1404  unsigned int id = DPViter->id;
1405  DetId detId(id);
1409 
1410  // get Barrel pixels
1411  if (detId.subdetId() == sdPxlBrl) {
1412  PXBDetId bdetid(id);
1413  for (iter = begin; iter != end; ++iter) {
1414  ++nPxlBrl;
1415  if (bdetid.layer() == 1) {
1416  mehSiPixelADC[0]->Fill((*iter).adc());
1417  mehSiPixelRow[0]->Fill((*iter).row());
1418  mehSiPixelCol[0]->Fill((*iter).column());
1419  }
1420  if (bdetid.layer() == 2) {
1421  mehSiPixelADC[1]->Fill((*iter).adc());
1422  mehSiPixelRow[1]->Fill((*iter).row());
1423  mehSiPixelCol[1]->Fill((*iter).column());
1424  }
1425  if (bdetid.layer() == 3) {
1426  mehSiPixelADC[2]->Fill((*iter).adc());
1427  mehSiPixelRow[2]->Fill((*iter).row());
1428  mehSiPixelCol[2]->Fill((*iter).column());
1429  }
1430  }
1431  }
1432 
1433  // get Forward pixels
1434  if (detId.subdetId() == sdPxlFwd) {
1435  PXFDetId fdetid(id);
1436  for (iter = begin; iter != end; ++iter) {
1437  ++nPxlFwd;
1438  if (fdetid.disk() == 1) {
1439  if (fdetid.side() == 1) {
1440  mehSiPixelADC[4]->Fill((*iter).adc());
1441  mehSiPixelRow[4]->Fill((*iter).row());
1442  mehSiPixelCol[4]->Fill((*iter).column());
1443  }
1444  if (fdetid.side() == 2) {
1445  mehSiPixelADC[3]->Fill((*iter).adc());
1446  mehSiPixelRow[3]->Fill((*iter).row());
1447  mehSiPixelCol[3]->Fill((*iter).column());
1448  }
1449  }
1450  if (fdetid.disk() == 2) {
1451  if (fdetid.side() == 1) {
1452 
1453  mehSiPixelADC[6]->Fill((*iter).adc());
1454  mehSiPixelRow[6]->Fill((*iter).row());
1455  mehSiPixelCol[6]->Fill((*iter).column());
1456  }
1457  if (fdetid.side() == 2) {
1458  mehSiPixelADC[5]->Fill((*iter).adc());
1459  mehSiPixelRow[5]->Fill((*iter).row());
1460  mehSiPixelCol[5]->Fill((*iter).column());
1461  }
1462  }
1463  }
1464  }
1465  }
1466 
1467  if (verbosity > 1) {
1468  eventout += "\n Number of BrlPixelDigis collected:........ ";
1469  eventout += nPxlBrl;
1470  }
1471  for(int i = 0; i < 3; ++i) {
1472  mehSiPixeln[i]->Fill((float)nPxlBrl);
1473  }
1474 
1475  if (verbosity > 1) {
1476  eventout += "\n Number of FrwdPixelDigis collected:....... ";
1477  eventout += nPxlFwd;
1478  }
1479 
1480  for(int i = 3; i < 7; ++i) {
1481  mehSiPixeln[i]->Fill((float)nPxlFwd);
1482  }
1483  }
1484 
1485  if (verbosity > 0)
1486  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1487 
1488  return;
1489 }
1490 
1492  const edm::EventSetup& iSetup)
1493 {
1494  std::string MsgLoggerCat = "GlobalDigisAnalyzer_fillMuon";
1495 
1496  TString eventout;
1497  if (verbosity > 0)
1498  eventout = "\nGathering info:";
1499 
1500  // get DT information
1502  iEvent.getByLabel(MuDTSrc_, dtDigis);
1503  bool validdtDigis = true;
1504  if (!dtDigis.isValid()) {
1505  LogDebug(MsgLoggerCat)
1506  << "Unable to find dtDigis in event!";
1507  validdtDigis = false;
1508  }
1509  if (validdtDigis) {
1510  int nDt0 = 0; int nDt1 = 0; int nDt2 = 0; int nDt3 = 0;
1511  int nDt = 0;
1513  for (detUnitIt = dtDigis->begin(); detUnitIt != dtDigis->end();
1514  ++detUnitIt) {
1515 
1516  const DTLayerId& id = (*detUnitIt).first;
1517  const DTDigiCollection::Range& range = (*detUnitIt).second;
1518  for (DTDigiCollection::const_iterator digiIt = range.first;
1519  digiIt != range.second;
1520  ++digiIt) {
1521 
1522  ++nDt;
1523 
1524  DTWireId wireId(id,(*digiIt).wire());
1525  if (wireId.station() == 1) {
1526  mehDtMuonLayer[0]->Fill(id.layer());
1527  mehDtMuonTime[0]->Fill((*digiIt).time());
1528  mehDtMuonTimevLayer[0]->Fill(id.layer(),(*digiIt).time());
1529  ++nDt0;
1530  }
1531  if (wireId.station() == 2) {
1532  mehDtMuonLayer[1]->Fill(id.layer());
1533  mehDtMuonTime[1]->Fill((*digiIt).time());
1534  mehDtMuonTimevLayer[1]->Fill(id.layer(),(*digiIt).time());
1535  ++nDt1;
1536  }
1537  if (wireId.station() == 3) {
1538  mehDtMuonLayer[2]->Fill(id.layer());
1539  mehDtMuonTime[2]->Fill((*digiIt).time());
1540  mehDtMuonTimevLayer[2]->Fill(id.layer(),(*digiIt).time());
1541  ++nDt2;
1542  }
1543  if (wireId.station() == 4) {
1544  mehDtMuonLayer[3]->Fill(id.layer());
1545  mehDtMuonTime[3]->Fill((*digiIt).time());
1546  mehDtMuonTimevLayer[3]->Fill(id.layer(),(*digiIt).time());
1547  ++nDt3;
1548  }
1549  }
1550  }
1551  mehDtMuonn[0]->Fill((float)nDt0);
1552  mehDtMuonn[1]->Fill((float)nDt1);
1553  mehDtMuonn[2]->Fill((float)nDt2);
1554  mehDtMuonn[3]->Fill((float)nDt3);
1555 
1556 
1557  if (verbosity > 1) {
1558  eventout += "\n Number of DtMuonDigis collected:.......... ";
1559  eventout += nDt;
1560  }
1561  }
1562 
1563  // get CSC Strip information
1565  iEvent.getByLabel(MuCSCStripSrc_, strips);
1566  bool validstrips = true;
1567  if (!strips.isValid()) {
1568  LogDebug(MsgLoggerCat)
1569  << "Unable to find muon strips in event!";
1570  validstrips = false;
1571  }
1572 
1573  if (validstrips) {
1574  int nStrips = 0;
1575  for (CSCStripDigiCollection::DigiRangeIterator j = strips->begin();
1576  j != strips->end();
1577  ++j) {
1578 
1579  std::vector<CSCStripDigi>::const_iterator digiItr = (*j).second.first;
1580  std::vector<CSCStripDigi>::const_iterator last = (*j).second.second;
1581 
1582  for ( ; digiItr != last; ++digiItr) {
1583  ++nStrips;
1584 
1585  // average pedestals
1586  std::vector<int> adcCounts = digiItr->getADCCounts();
1587  theCSCStripPedestalSum += adcCounts[0];
1588  theCSCStripPedestalSum += adcCounts[1];
1590 
1591  // if there are enough pedestal statistics
1592  if (theCSCStripPedestalCount > 100) {
1594  if (adcCounts[5] > (pedestal + 100))
1595  mehCSCStripADC->Fill(adcCounts[4] - pedestal);
1596  }
1597  }
1598  }
1599 
1600  if (verbosity > 1) {
1601  eventout += "\n Number of CSCStripDigis collected:........ ";
1602  eventout += nStrips;
1603  }
1604  mehCSCStripn->Fill((float)nStrips);
1605  }
1606 
1607  // get CSC Wire information
1609  iEvent.getByLabel(MuCSCWireSrc_, wires);
1610  bool validwires = true;
1611  if (!wires.isValid()) {
1612  LogDebug(MsgLoggerCat)
1613  << "Unable to find muon wires in event!";
1614  validwires = false;
1615  }
1616 
1617  if (validwires) {
1618  int nWires = 0;
1619  for (CSCWireDigiCollection::DigiRangeIterator j = wires->begin();
1620  j != wires->end();
1621  ++j) {
1622 
1623  std::vector<CSCWireDigi>::const_iterator digiItr = (*j).second.first;
1624  std::vector<CSCWireDigi>::const_iterator endDigi = (*j).second.second;
1625 
1626  for ( ; digiItr != endDigi; ++digiItr) {
1627  ++nWires;
1628  mehCSCWireTime->Fill(digiItr->getTimeBin());
1629  }
1630  }
1631 
1632  if (verbosity > 1) {
1633  eventout += "\n Number of CSCWireDigis collected:......... ";
1634  eventout += nWires;
1635  }
1636  mehCSCWiren->Fill((float)nWires);
1637  }
1638 
1639  // get RPC information
1640  // Get the RPC Geometry
1642  iSetup.get<MuonGeometryRecord>().get(rpcGeom);
1643  if (!rpcGeom.isValid()) {
1644  edm::LogWarning(MsgLoggerCat)
1645  << "Unable to find RPCGeometryRecord in event!";
1646  return;
1647  }
1648 
1650  iEvent.getByLabel("g4SimHits", "MuonRPCHits", rpcsimHit);
1651  bool validrpcsim = true;
1652  if (!rpcsimHit.isValid()) {
1653  LogDebug(MsgLoggerCat)
1654  << "Unable to find rpcsimHit in event!";
1655  validrpcsim = false;
1656  }
1657 
1659  iEvent.getByLabel(MuRPCSrc_, rpcDigis);
1660  bool validrpcdigi = true;
1661  if (!rpcDigis.isValid()) {
1662  LogDebug(MsgLoggerCat)
1663  << "Unable to find rpcDigis in event!";
1664  validrpcdigi = false;
1665  }
1666 
1667  // ONLY UNTIL PROBLEM WITH RPC DIGIS IS FIGURED OUT
1668  validrpcdigi = false;
1669 
1670  // Loop on simhits
1671  edm::PSimHitContainer::const_iterator rpcsimIt;
1672  std::map<RPCDetId, std::vector<double> > allsims;
1673 
1674  if (validrpcsim) {
1675  for (rpcsimIt = rpcsimHit->begin(); rpcsimIt != rpcsimHit->end();
1676  rpcsimIt++) {
1677  RPCDetId Rsid = (RPCDetId)(*rpcsimIt).detUnitId();
1678  int ptype = rpcsimIt->particleType();
1679 
1680  if (ptype == 13 || ptype == -13) {
1681  std::vector<double> buff;
1682  if (allsims.find(Rsid) != allsims.end() ){
1683  buff= allsims[Rsid];
1684  }
1685  buff.push_back(rpcsimIt->localPosition().x());
1686  allsims[Rsid]=buff;
1687  }
1688  }
1689  }
1690 
1691  // CRASH HAPPENS SOMEWHERE HERE IN FOR DECLARATION
1692  // WHAT IS WRONG WITH rpcDigis?????
1693  if (validrpcdigi) {
1694  int nRPC = 0;
1696  for (rpcdetUnitIt = rpcDigis->begin(); rpcdetUnitIt != rpcDigis->end();
1697  ++rpcdetUnitIt) {
1698 
1699  const RPCDetId Rsid = (*rpcdetUnitIt).first;
1700  const RPCRoll* roll =
1701  dynamic_cast<const RPCRoll* >( rpcGeom->roll(Rsid));
1702  const RPCDigiCollection::Range& range = (*rpcdetUnitIt).second;
1703 
1704  std::vector<double> sims;
1705  if (allsims.find(Rsid) != allsims.end() ){
1706  sims = allsims[Rsid];
1707  }
1708 
1709  int ndigi = 0;
1710  for (RPCDigiCollection::const_iterator rpcdigiIt = range.first;
1711  rpcdigiIt != range.second;
1712  ++rpcdigiIt) {
1713 
1714  ++ndigi;
1715  ++nRPC;
1716  }
1717 
1718  if (sims.size() == 1 && ndigi == 1){
1719  double dis = roll->centreOfStrip(range.first->strip()).x()-sims[0];
1720 
1721  if (Rsid.region() == 0 ){
1722  if (Rsid.ring() == -2)
1723  mehRPCRes[0]->Fill((float)dis);
1724  else if (Rsid.ring() == -1)
1725  mehRPCRes[1]->Fill((float)dis);
1726  else if (Rsid.ring() == 0)
1727  mehRPCRes[2]->Fill((float)dis);
1728  else if (Rsid.ring() == 1)
1729  mehRPCRes[3]->Fill((float)dis);
1730  else if (Rsid.ring() == 2)
1731  mehRPCRes[4]->Fill((float)dis);
1732  }
1733  }
1734  }
1735 
1736  if (verbosity > 1) {
1737  eventout += "\n Number of RPCDigis collected:.............. ";
1738  eventout += nRPC;
1739  }
1740  mehRPCMuonn->Fill(float(nRPC));
1741  }
1742 
1743  if (verbosity > 0)
1744  edm::LogInfo(MsgLoggerCat) << eventout << "\n";
1745 
1746  return;
1747 }
#define LogDebug(id)
GlobalDigisAnalyzer(const edm::ParameterSet &)
RunNumber_t run() const
Definition: EventID.h:42
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:44
T getUntrackedParameter(std::string const &, T const &) const
void getAllProvenance(std::vector< Provenance const * > &provenances) const
Definition: Event.cc:71
int i
Definition: DBlmapReader.cc:9
LocalPoint centreOfStrip(int strip) const
Definition: RPCRoll.cc:52
std::vector< PCaloHit > PCaloHitContainer
MonitorElement * mehEScalADC[3]
key_type id() const
Definition: EBDataFrame.h:32
MonitorElement * mehDtMuonLayer[4]
unsigned int layer() const
layer id
Definition: TOBDetId.h:39
const std::string & label
Definition: MVAComputer.cc:186
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:514
static const int sdHcalOut
const ESDetId & id() const
Definition: ESDataFrame.h:18
MonitorElement * mehEcaln[2]
void fillECal(const edm::Event &, const edm::EventSetup &)
static const int sdSiTID
MonitorElement * mehEScaln
std::vector< T >::const_iterator const_iterator
MonitorElement * mehSiPixelRow[7]
MonitorElement * mehRPCRes[5]
double pedestal(int fCapId) const
get pedestal for capid=0..3
MonitorElement * mehSiStripADC[19]
int size() const
Definition: ESDataFrame.h:20
MonitorElement * mehDtMuonTimevLayer[4]
MonitorElement * mehSiStripn[19]
int gainId() const
get the gainId (2 bits)
MonitorElement * mehCSCWireTime
int size() const
Definition: EcalDataFrame.h:25
unsigned int layer() const
layer id
Definition: PXBDetId.h:35
void Fill(long long x)
virtual void beginJob(void)
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
MonitorElement * mehEcalMaxPos[2]
MonitorElement * mehDtMuonTime[4]
int iEvent
Definition: GenABIO.cc:243
static const int sdSiTIB
static const int sdPxlBrl
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
virtual void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const
Definition: HcalCoderDb.cc:37
int ring() const
Definition: RPCDetId.h:74
edm::InputTag MuCSCStripSrc_
static const int MAXSAMPLES
Definition: ESDataFrame.h:29
MonitorElement * mehHcalAEE[4]
int j
Definition: DBlmapReader.cc:9
std::map< uint32_t, float, std::less< uint32_t > > MapType
static const int sdSiTOB
float gain6Over1() const
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:828
#define end
Definition: vmac.h:38
void setVerbose(unsigned level)
Definition: DQMStore.cc:196
bool isValid() const
Definition: HandleBase.h:76
std::map< int, double, std::less< int > > ECalgainConv_
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:356
unsigned int disk() const
disk id
Definition: PXFDetId.h:43
void fillHCal(const edm::Event &, const edm::EventSetup &)
key_type id() const
Definition: EEDataFrame.h:29
MonitorElement * mehRPCMuonn
MonitorElement * mehEcalSHE[2]
const int verbosity
Definition: DetId.h:20
void fillMuon(const edm::Event &, const edm::EventSetup &)
MonitorElement * mehEcalAEE[2]
MonitorElement * mehHcalSHEvAEE[4]
MonitorElement * mehCSCStripn
int size() const
get the size
Definition: CaloSamples.h:24
MonitorElement * mehCSCStripADC
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
static const int sdHcalFwd
float gain12Over6() const
std::vector< DigiType >::const_iterator const_iterator
T const * product() const
Definition: Handle.h:74
unsigned int wheel() const
wheel id
Definition: TECDetId.h:52
static const int sdHcalBrl
MonitorElement * mehSiPixelCol[7]
MonitorElement * mehHcaln[4]
unsigned int layer() const
layer id
Definition: TIBDetId.h:41
std::string const & label() const
Definition: InputTag.h:25
MonitorElement * mehHcalAEESHE[4]
MonitorElement * mehEcalSHEvAEESHE[2]
edm::EventID id() const
Definition: EventBase.h:56
static const int sdSiTEC
#define begin
Definition: vmac.h:31
MonitorElement * mehHcalSHE[4]
unsigned int side() const
positive or negative id
Definition: PXFDetId.h:38
MonitorElement * mehCSCWiren
std::pair< const_iterator, const_iterator > Range
int adc() const
get the ADC sample (singed 16 bits)
Definition: ESSample.h:18
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:341
static const int sdPxlFwd
void showDirStructure(void) const
Definition: DQMStore.cc:2554
Definition: DDAxes.h:10
MonitorElement * mehEcalMultvAEE[2]
MonitorElement * mehSiPixeln[7]
MonitorElement * mehSiStripStrip[19]
collection_type::const_iterator const_iterator
Definition: DetSet.h:32
bool isValid() const
Definition: ESHandle.h:37
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:106
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void fillTrk(const edm::Event &, const edm::EventSetup &)
std::string const & instance() const
Definition: InputTag.h:26
static const int sdHcalEC
static const int MAXSAMPLES
Definition: EcalDataFrame.h:44
MonitorElement * mehSiPixelADC[7]
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
int adc() const
get the ADC sample (12 bits)
MonitorElement * mehDtMuonn[4]
unsigned int wheel() const
wheel id
Definition: TIDDetId.h:50
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:65
virtual void analyze(const edm::Event &, const edm::EventSetup &)