15 printProvenanceInfo(
false), hitsProducer(
""), theCSCStripPedestalSum(0),
16 theCSCStripPedestalCount(0),
count(0)
18 std::string MsgLoggerCat =
"GlobalDigisAnalyzer_GlobalDigisAnalyzer";
27 m_Prov.getUntrackedParameter<
bool>(
"GetAllProvenances");
29 m_Prov.getUntrackedParameter<
bool>(
"PrintProvenanceInfo");
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";
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) {
116 std::string hcharname, hchartitle;
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());
125 mehSiStripn[amend]->setAxisTitle(
"Count",2);
127 hcharname =
"hSiStripADC_"+SiStripString[amend];
128 hchartitle= SiStripString[amend]+
" ADC";
129 sprintf(hname, hcharname.c_str());
130 sprintf(htitle, hchartitle.c_str());
133 mehSiStripADC[amend]->setAxisTitle(
"Count",2);
135 hcharname =
"hSiStripStripADC_"+SiStripString[amend];
136 hchartitle= SiStripString[amend]+
" Strip";
137 sprintf(hname, hcharname.c_str());
138 sprintf(htitle, hchartitle.c_str());
141 mehSiStripStrip[amend]->setAxisTitle(
"Count",2);
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.};
154 for(
int i =0;
i<4; ++
i) {
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());
171 mehHcaln[amend]->setAxisTitle(
"Count",2);
173 hcharname =
"hHcalAEE_"+HCalString[amend];
174 hchartitle= HCalString[amend]+
"Cal AEE";
175 sprintf(hname, hcharname.c_str());
176 sprintf(htitle, hchartitle.c_str());
178 mehHcalAEE[amend]->
setAxisTitle(
"Analog Equivalent Energy",1);
179 mehHcalAEE[amend]->setAxisTitle(
"Count",2);
181 hcharname =
"hHcalSHE_"+HCalString[amend];
182 hchartitle= HCalString[amend]+
"Cal SHE";
183 sprintf(hname, hcharname.c_str());
184 sprintf(htitle, hchartitle.c_str());
187 mehHcalSHE[amend]->
setAxisTitle(
"Simulated Hit Energy",1);
188 mehHcalSHE[amend]->setAxisTitle(
"Count",2);
190 hcharname =
"hHcalAEESHE_"+HCalString[amend];
191 hchartitle= HCalString[amend]+
"Cal AEE/SHE";
192 sprintf(hname, hcharname.c_str());
193 sprintf(htitle, hchartitle.c_str());
196 SHEvAEEUpper[amend]);
198 mehHcalAEESHE[amend]->setAxisTitle(
"Count",2);
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());
206 (
float)ProfileUpper[amend],
"");
208 mehHcalSHEvAEE[amend]->setAxisTitle(
"SHE",2);
213 std::string ECalString[2] = {
"EB",
"EE"};
215 for(
int i =0;
i<2; ++
i) {
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());
232 mehEcaln[amend]->setAxisTitle(
"Count",2);
234 hcharname =
"hEcalAEE_"+ECalString[amend];
235 hchartitle= ECalString[amend]+
"Cal AEE";
236 sprintf(hname, hcharname.c_str());
237 sprintf(htitle, hchartitle.c_str());
239 mehEcalAEE[amend]->
setAxisTitle(
"Analog Equivalent Energy",1);
240 mehEcalAEE[amend]->setAxisTitle(
"Count",2);
242 hcharname =
"hEcalSHE_"+ECalString[amend];
243 hchartitle= ECalString[amend]+
"Cal SHE";
244 sprintf(hname, hcharname.c_str());
245 sprintf(htitle, hchartitle.c_str());
247 mehEcalSHE[amend]->
setAxisTitle(
"Simulated Hit Energy",1);
248 mehEcalSHE[amend]->setAxisTitle(
"Count",2);
250 hcharname =
"hEcalMaxPos_"+ECalString[amend];
251 hchartitle= ECalString[amend]+
"Cal MaxPos";
252 sprintf(hname, hcharname.c_str());
253 sprintf(htitle, hchartitle.c_str());
255 mehEcalMaxPos[amend]->
setAxisTitle(
"Maximum Position",1);
256 mehEcalMaxPos[amend]->setAxisTitle(
"Count",2);
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());
265 mehEcalSHEvAEESHE[amend]->setAxisTitle(
"SHE",2);
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());
272 4000, 0., 40000.,
"");
273 mehEcalMultvAEE[amend]->
setAxisTitle(
"Analog Equivalent Energy",1);
274 mehEcalMultvAEE[amend]->setAxisTitle(
"Number of Digis",2);
278 hcharname =
"hEcaln_ES";
279 hchartitle=
"ESCAL digis";
280 sprintf(hname, hcharname.c_str());
281 sprintf(htitle, hchartitle.c_str());
284 mehEScaln->setAxisTitle(
"Count",2);
286 std::string ADCNumber[3] = {
"0",
"1",
"2"};
287 for(
int i =0;
i<3; ++
i) {
289 hcharname =
"hEcalADC"+ADCNumber[
i]+
"_ES";
290 hchartitle=
"ESCAL ADC"+ADCNumber[
i];
291 sprintf(hname, hcharname.c_str());
292 sprintf(htitle, hchartitle.c_str());
295 mehEScalADC[
i]->setAxisTitle(
"Count",2);
299 std::string SiPixelString[7] = {
"BRL1",
"BRL2",
"BRL3",
"FWD1n",
"FWD1p",
301 for(
int j =0;
j<7; ++
j) {
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());
319 hcharname =
"hSiPixelADC_"+SiPixelString[amend];
320 hchartitle= SiPixelString[amend]+
" ADC";
321 sprintf(hname, hcharname.c_str());
322 sprintf(htitle, hchartitle.c_str());
325 mehSiPixelADC[amend]->setAxisTitle(
"Count",2);
327 hcharname =
"hSiPixelRow_"+SiPixelString[amend];
328 hchartitle= SiPixelString[amend]+
" Row";
329 sprintf(hname, hcharname.c_str());
330 sprintf(htitle, hchartitle.c_str());
333 mehSiPixelRow[amend]->setAxisTitle(
"Count",2);
335 hcharname =
"hSiPixelColumn_"+SiPixelString[amend];
336 hchartitle= SiPixelString[amend]+
" Column";
337 sprintf(hname, hcharname.c_str());
338 sprintf(htitle, hchartitle.c_str());
341 mehSiPixelCol[amend]->setAxisTitle(
"Count",2);
348 std::string MuonString[4] = {
"MB1",
"MB2",
"MB3",
"MB4"};
350 for(
int i =0;
i < 4; ++
i) {
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());
364 mehDtMuonn[
j]->setAxisTitle(
"Count",2);
366 hcharname =
"hDtLayer_"+MuonString[
j];
367 hchartitle= MuonString[
j]+
" Layer";
368 sprintf(hname,hcharname.c_str());
369 sprintf(htitle,hchartitle.c_str());
371 mehDtMuonLayer[
j]->
setAxisTitle(
"4 * (SuperLayer - 1) + Layer",1);
372 mehDtMuonLayer[
j]->setAxisTitle(
"Count",2);
374 hcharname =
"hDtMuonTime_"+MuonString[
j];
375 hchartitle= MuonString[
j]+
" Time";
376 sprintf(hname,hcharname.c_str());
377 sprintf(htitle,hchartitle.c_str());
380 mehDtMuonTime[
j]->setAxisTitle(
"Count",2);
382 hcharname =
"hDtMuonTimevLayer_"+MuonString[
j];
383 hchartitle= MuonString[
j]+
" Time vs. Layer";
384 sprintf(hname,hcharname.c_str());
385 sprintf(htitle,hchartitle.c_str());
388 mehDtMuonTimevLayer[
j]->
setAxisTitle(
"4 * (SuperLayer - 1) + Layer",1);
389 mehDtMuonTimevLayer[
j]->setAxisTitle(
"Time",2);
394 hcharname =
"hCSCStripn";
395 hchartitle =
"CSC Strip digis";
396 sprintf(hname,hcharname.c_str());
397 sprintf(htitle,hchartitle.c_str());
400 mehCSCStripn->setAxisTitle(
"Count",2);
403 hcharname =
"hCSCStripADC";
404 hchartitle =
"CSC Strip ADC";
405 sprintf(hname,hcharname.c_str());
406 sprintf(htitle,hchartitle.c_str());
409 mehCSCStripADC->setAxisTitle(
"Count",2);
412 hcharname =
"hCSCWiren";
413 hchartitle =
"CSC Wire digis";
414 sprintf(hname,hcharname.c_str());
415 sprintf(htitle,hchartitle.c_str());
418 mehCSCWiren->setAxisTitle(
"Count",2);
421 hcharname =
"hCSCWireTime";
422 hchartitle =
"CSC Wire Time";
423 sprintf(hname,hcharname.c_str());
424 sprintf(htitle,hchartitle.c_str());
427 mehCSCWireTime->setAxisTitle(
"Count",2);
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.);
437 mehCSCStripn->setAxisTitle(
"Count",2);
439 std::string MuonRPCString[5] = {
"Wmin2",
"Wmin1",
"W0",
"Wpu1",
"Wpu2"};
440 for(
int i =0;
i < 5; ++
i) {
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());
450 mehRPCRes[
j]->
setAxisTitle(
"Digi - Sim center of strip x",1);
451 mehRPCRes[
j]->setAxisTitle(
"Count",2);
470 std::string MsgLoggerCat =
"GlobalDigisAnalyzer_beginJob";
479 delete defaultRatios;
483 <<
"Modified Calorimeter gain constants: g0 = " <<
ECalgainConv_[0]
494 std::string MsgLoggerCat =
"GlobalDigisAnalyzer_endJob";
497 <<
"Terminating having processed " <<
count <<
" events.";
504 std::string MsgLoggerCat =
"GlobalDigisAnalyzer_analyze";
520 <<
"Modified Calorimeter ADCtoGeV constants: barrel = "
527 int nrun = iEvent.
id().
run();
528 int nevt = iEvent.
id().
event();
532 <<
"Processing run " << nrun <<
", event " << nevt
533 <<
" (" <<
count <<
" events total)";
537 <<
"Processing run " << nrun <<
", event " << nevt
538 <<
" (" <<
count <<
" events total)";
545 std::vector<const edm::Provenance*> AllProv;
550 <<
"Number of Provenances = " << AllProv.size();
553 TString eventout(
"\nProvenance info:\n");
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();
568 eventout +=
"\n ******************************\n";
587 <<
"Done gathering data from event.";
591 <<
"Saving event contents:";
599 std::string MsgLoggerCat =
"GlobalDigisAnalyzer_fillECal";
603 eventout =
"\nGathering info:";
611 bool isBarrel =
true;
615 bool validDigiEB =
true;
618 <<
"Unable to find EcalDigiEB in event!";
622 EBdigis = EcalDigiEB.
product();
623 if ( EcalDigiEB->size() == 0) isBarrel =
false;
629 const std::string barrelHitsName(
hitsProducer+
"EcalHitsEB");
630 iEvent.
getByLabel(
"mix",barrelHitsName,crossingFrame);
631 bool validXFrame =
true;
632 if (!crossingFrame.
isValid()) {
634 <<
"Unable to find cal barrel crossingFrame in event!";
638 std::auto_ptr<MixCollection<PCaloHit> >
643 = barrelHits->begin();
644 hitItr != barrelHits->end();
649 uint32_t crystid = ebid.
rawId();
650 ebSimMap[crystid] += hitItr->energy();
657 std::vector<double> ebAnalogSignal;
658 std::vector<double> ebADCCounts;
659 std::vector<double> ebADCGains;
665 for (
unsigned int digis=0; digis<EcalDigiEB->size(); ++digis) {
670 int nrSamples = ebdf.
size();
676 double pedestalPreSample = 0.;
677 double pedestalPreSampleAnalog = 0.;
679 for (
int sample = 0 ; sample < nrSamples; ++sample) {
680 ebAnalogSignal[sample] = 0.;
681 ebADCCounts[sample] = 0.;
682 ebADCGains[sample] = -1.;
686 for (
int sample = 0 ; sample < nrSamples; ++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];
699 pedestalPreSample += ebADCCounts[sample] ;
700 pedestalPreSampleAnalog +=
702 * ECalbarrelADCtoGeV_ ;
706 pedestalPreSample /= 3. ;
707 pedestalPreSampleAnalog /= 3. ;
710 double Erec = Emax - pedestalPreSampleAnalog
718 if (ebSimMap[ebid.
rawId()]!=0) {
720 ebSimMap[ebid.
rawId()]);
730 eventout +=
"\n Number of EBDigis collected:.............. ";
740 bool isEndCap =
true;
744 bool validDigiEE =
true;
747 <<
"Unable to find EcalDigiEE in event!";
751 EEdigis = EcalDigiEE.
product();
752 if (EcalDigiEE->size() == 0) isEndCap =
false;
758 const std::string endcapHitsName(
hitsProducer+
"EcalHitsEE");
759 iEvent.
getByLabel(
"mix",endcapHitsName,crossingFrame);
760 bool validXFrame =
true;
761 if (!crossingFrame.
isValid()) {
763 <<
"Unable to find cal endcap crossingFrame in event!";
767 std::auto_ptr<MixCollection<PCaloHit> >
772 = endcapHits->begin();
773 hitItr != endcapHits->end();
778 uint32_t crystid = eeid.
rawId();
779 eeSimMap[crystid] += hitItr->energy();
786 std::vector<double> eeAnalogSignal;
787 std::vector<double> eeADCCounts;
788 std::vector<double> eeADCGains;
794 for (
unsigned int digis=0; digis<EcalDigiEE->size(); ++digis){
799 int nrSamples = eedf.
size();
805 double pedestalPreSample = 0.;
806 double pedestalPreSampleAnalog = 0.;
808 for (
int sample = 0 ; sample < nrSamples; ++sample) {
809 eeAnalogSignal[sample] = 0.;
810 eeADCCounts[sample] = 0.;
811 eeADCGains[sample] = -1.;
815 for (
int sample = 0 ; sample < nrSamples; ++sample) {
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];
829 pedestalPreSample += eeADCCounts[sample] ;
830 pedestalPreSampleAnalog +=
832 * ECalbarrelADCtoGeV_ ;
836 pedestalPreSample /= 3. ;
837 pedestalPreSampleAnalog /= 3. ;
840 double Erec = Emax - pedestalPreSampleAnalog
848 if (eeSimMap[eeid.
rawId()]!=0){
850 eeSimMap[eeid.
rawId()]);
860 eventout +=
"\n Number of EEDigis collected:.............. ";
871 bool isPreshower =
true;
875 bool validDigiES =
true;
878 <<
"Unable to find EcalDigiES in event!";
886 ESdigis = EcalDigiES.
product();
887 if (EcalDigiES->size() == 0) isPreshower =
false;
892 const std::string preshowerHitsName(
hitsProducer+
"EcalHitsES");
893 iEvent.
getByLabel(
"mix",preshowerHitsName,crossingFrame);
894 bool validXFrame =
true;
895 if (!crossingFrame.
isValid()) {
897 <<
"Unable to find cal preshower crossingFrame in event!";
901 std::auto_ptr<MixCollection<PCaloHit> >
907 = preshowerHits->begin();
908 hitItr != preshowerHits->end();
913 uint32_t crystid = esid.
rawId();
914 esSimMap[crystid] += hitItr->energy();
921 std::vector<double> esADCCounts;
925 for (
unsigned int digis=0; digis<EcalDigiES->size(); ++digis) {
931 int nrSamples = esdf.
size();
936 for (
int sample = 0 ; sample < nrSamples; ++sample) {
937 esADCCounts[sample] = 0.;
941 for (
int sample = 0 ; sample < nrSamples; ++sample) {
944 esADCCounts[sample] = (thisSample.
adc());
954 eventout +=
"\n Number of ESDigis collected:.............. ";
971 std::string MsgLoggerCat =
"GlobalDigisAnalyzer_fillHCal";
975 eventout =
"\nGathering info:";
980 if (!HCalconditions.
isValid()) {
982 <<
"Unable to find HCalconditions in event!";
985 const HcalQIEShape *shape = HCalconditions->getHcalShape();
994 bool validhcalHits =
true;
997 <<
"Unable to find hcalHits in event!";
998 validhcalHits =
false;
1004 if (validhcalHits) {
1007 for (std::vector<PCaloHit>::const_iterator simhits = simhitResult->begin();
1008 simhits != simhitResult->end();
1012 uint32_t cellid = detId.
rawId();
1015 fHBEnergySimHits[cellid] += simhits->energy();
1018 fHEEnergySimHits[cellid] += simhits->energy();
1021 fHOEnergySimHits[cellid] += simhits->energy();
1024 fHFEnergySimHits[cellid] += simhits->energy();
1034 bool validHBHE =
true;
1037 <<
"Unable to find HBHEDataFrame in event!";
1046 for (ihbhe = hbhe->begin(); ihbhe != hbhe->end(); ++ihbhe) {
1053 HCalconditions->getHcalCalibrations(cell);
1054 const HcalQIECoder *channelCoder = HCalconditions->getHcalCoder(cell);
1056 coder.
adc2fC(*ihbhe, tool);
1062 float fDigiSum = 0.0;
1063 for (
int ii = 0; ii < tool.
size(); ++ii) {
1065 int capid = (*ihbhe)[ii].capid();
1066 fDigiSum += (tool[ii] - calibrations.
pedestal(capid));
1072 if (fHFEnergySimHits[cell.rawId()]!=0){
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));
1094 if (fHFEnergySimHits[cell.rawId()]!=0){
1106 eventout +=
"\n Number of HBDigis collected:.............. ";
1112 eventout +=
"\n Number of HEDigis collected:.............. ";
1123 bool validHO =
true;
1126 <<
"Unable to find HODataFrame in event!";
1133 for (iho = ho->begin(); iho != ho->end(); ++iho) {
1140 HCalconditions->getHcalCalibrations(cell);
1141 const HcalQIECoder *channelCoder = HCalconditions->getHcalCoder(cell);
1143 coder.
adc2fC(*iho, tool);
1146 float fDigiSum = 0.0;
1147 for (
int ii = 0; ii < tool.
size(); ++ii) {
1149 int capid = (*iho)[ii].capid();
1150 fDigiSum += (tool[ii] - calibrations.
pedestal(capid));
1156 if (fHFEnergySimHits[cell.rawId()]!=0){
1167 eventout +=
"\n Number of HODigis collected:.............. ";
1178 bool validHF =
true;
1181 <<
"Unable to find HFDataFrame in event!";
1188 for (ihf = hf->begin(); ihf != hf->end(); ++ihf) {
1195 HCalconditions->getHcalCalibrations(cell);
1196 const HcalQIECoder *channelCoder = HCalconditions->getHcalCoder(cell);
1198 coder.
adc2fC(*ihf, tool);
1201 float fDigiSum = 0.0;
1202 for (
int ii = 0; ii < tool.
size(); ++ii) {
1204 int capid = (*ihf)[ii].capid();
1205 fDigiSum += (tool[ii] - calibrations.
pedestal(capid));
1211 if (fHFEnergySimHits[cell.rawId()]!=0){
1222 eventout +=
"\n Number of HFDigis collected:.............. ";
1237 std::string MsgLoggerCat =
"GlobalDigisAnalyzer_fillTrk";
1241 eventout =
"\nGathering info:";
1246 bool validstripDigis =
true;
1249 <<
"Unable to find stripDigis in event!";
1250 validstripDigis =
false;
1253 if (validstripDigis) {
1254 int nStripBrl = 0, nStripFwd = 0;
1256 for (DSViter = stripDigis->begin(); DSViter != stripDigis->end();
1258 unsigned int id = DSViter->id;
1267 for (iter = begin; iter !=
end; ++iter) {
1269 if (tibid.
layer() == 1) {
1273 if (tibid.
layer() == 2) {
1277 if (tibid.
layer() == 3) {
1281 if (tibid.
layer() == 4) {
1291 for (iter = begin; iter !=
end; ++iter) {
1293 if (tobid.
layer() == 1) {
1297 if (tobid.
layer() == 2) {
1301 if (tobid.
layer() == 3) {
1305 if (tobid.
layer() == 4) {
1315 for (iter = begin; iter !=
end; ++iter) {
1317 if (tidid.
wheel() == 1) {
1321 if (tidid.
wheel() == 2) {
1325 if (tidid.
wheel() == 3) {
1335 for (iter = begin; iter !=
end; ++iter) {
1337 if (tecid.
wheel() == 1) {
1341 if (tecid.
wheel() == 2) {
1345 if (tecid.
wheel() == 3) {
1349 if (tecid.
wheel() == 4) {
1353 if (tecid.
wheel() == 5) {
1357 if (tecid.
wheel() == 6) {
1361 if (tecid.
wheel() == 7) {
1365 if (tecid.
wheel() == 8) {
1374 eventout +=
"\n Number of BrlStripDigis collected:........ ";
1375 eventout += nStripBrl;
1377 for(
int i = 0;
i < 8; ++
i) {
1382 eventout +=
"\n Number of FrwdStripDigis collected:....... ";
1383 eventout += nStripFwd;
1385 for(
int i = 8;
i < 19; ++
i) {
1393 bool validpixelDigis =
true;
1396 <<
"Unable to find pixelDigis in event!";
1397 validpixelDigis =
false;
1399 if (validpixelDigis) {
1400 int nPxlBrl = 0, nPxlFwd = 0;
1402 for (DPViter = pixelDigis->begin(); DPViter != pixelDigis->end();
1404 unsigned int id = DPViter->id;
1413 for (iter = begin; iter !=
end; ++iter) {
1415 if (bdetid.
layer() == 1) {
1420 if (bdetid.
layer() == 2) {
1425 if (bdetid.
layer() == 3) {
1436 for (iter = begin; iter !=
end; ++iter) {
1438 if (fdetid.
disk() == 1) {
1439 if (fdetid.
side() == 1) {
1444 if (fdetid.
side() == 2) {
1450 if (fdetid.
disk() == 2) {
1451 if (fdetid.
side() == 1) {
1457 if (fdetid.
side() == 2) {
1468 eventout +=
"\n Number of BrlPixelDigis collected:........ ";
1469 eventout += nPxlBrl;
1471 for(
int i = 0;
i < 3; ++
i) {
1476 eventout +=
"\n Number of FrwdPixelDigis collected:....... ";
1477 eventout += nPxlFwd;
1480 for(
int i = 3;
i < 7; ++
i) {
1494 std::string MsgLoggerCat =
"GlobalDigisAnalyzer_fillMuon";
1498 eventout =
"\nGathering info:";
1503 bool validdtDigis =
true;
1506 <<
"Unable to find dtDigis in event!";
1507 validdtDigis =
false;
1510 int nDt0 = 0;
int nDt1 = 0;
int nDt2 = 0;
int nDt3 = 0;
1513 for (detUnitIt = dtDigis->begin(); detUnitIt != dtDigis->end();
1516 const DTLayerId&
id = (*detUnitIt).first;
1519 digiIt != range.second;
1524 DTWireId wireId(
id,(*digiIt).wire());
1525 if (wireId.station() == 1) {
1531 if (wireId.station() == 2) {
1537 if (wireId.station() == 3) {
1543 if (wireId.station() == 4) {
1558 eventout +=
"\n Number of DtMuonDigis collected:.......... ";
1566 bool validstrips =
true;
1569 <<
"Unable to find muon strips in event!";
1570 validstrips =
false;
1579 std::vector<CSCStripDigi>::const_iterator digiItr = (*j).second.first;
1580 std::vector<CSCStripDigi>::const_iterator
last = (*j).second.second;
1582 for ( ; digiItr !=
last; ++digiItr) {
1586 std::vector<int> adcCounts = digiItr->getADCCounts();
1594 if (adcCounts[5] > (pedestal + 100))
1601 eventout +=
"\n Number of CSCStripDigis collected:........ ";
1602 eventout += nStrips;
1610 bool validwires =
true;
1613 <<
"Unable to find muon wires in event!";
1623 std::vector<CSCWireDigi>::const_iterator digiItr = (*j).second.first;
1624 std::vector<CSCWireDigi>::const_iterator endDigi = (*j).second.second;
1626 for ( ; digiItr != endDigi; ++digiItr) {
1633 eventout +=
"\n Number of CSCWireDigis collected:......... ";
1645 <<
"Unable to find RPCGeometryRecord in event!";
1650 iEvent.
getByLabel(
"g4SimHits",
"MuonRPCHits", rpcsimHit);
1651 bool validrpcsim =
true;
1654 <<
"Unable to find rpcsimHit in event!";
1655 validrpcsim =
false;
1660 bool validrpcdigi =
true;
1663 <<
"Unable to find rpcDigis in event!";
1664 validrpcdigi =
false;
1668 validrpcdigi =
false;
1671 edm::PSimHitContainer::const_iterator rpcsimIt;
1672 std::map<RPCDetId, std::vector<double> > allsims;
1675 for (rpcsimIt = rpcsimHit->begin(); rpcsimIt != rpcsimHit->end();
1678 int ptype = rpcsimIt->particleType();
1680 if (ptype == 13 || ptype == -13) {
1681 std::vector<double> buff;
1682 if (allsims.find(Rsid) != allsims.end() ){
1683 buff= allsims[Rsid];
1685 buff.push_back(rpcsimIt->localPosition().x());
1696 for (rpcdetUnitIt = rpcDigis->begin(); rpcdetUnitIt != rpcDigis->end();
1699 const RPCDetId Rsid = (*rpcdetUnitIt).first;
1701 dynamic_cast<const RPCRoll*
>( rpcGeom->roll(Rsid));
1704 std::vector<double> sims;
1705 if (allsims.find(Rsid) != allsims.end() ){
1706 sims = allsims[Rsid];
1711 rpcdigiIt != range.second;
1718 if (sims.size() == 1 && ndigi == 1){
1719 double dis = roll->
centreOfStrip(range.first->strip()).
x()-sims[0];
1721 if (Rsid.
region() == 0 ){
1722 if (Rsid.
ring() == -2)
1724 else if (Rsid.
ring() == -1)
1726 else if (Rsid.
ring() == 0)
1728 else if (Rsid.
ring() == 1)
1730 else if (Rsid.
ring() == 2)
1737 eventout +=
"\n Number of RPCDigis collected:.............. ";
GlobalDigisAnalyzer(const edm::ParameterSet &)
T getParameter(std::string const &) const
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
void getAllProvenance(std::vector< Provenance const * > &provenances) const
LocalPoint centreOfStrip(int strip) const
std::vector< PCaloHit > PCaloHitContainer
MonitorElement * mehEScalADC[3]
double ECalbarrelADCtoGeV_
MonitorElement * mehDtMuonLayer[4]
unsigned int layer() const
layer id
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
static const int sdHcalOut
float theCSCStripPedestalSum
const ESDetId & id() const
MonitorElement * mehEcaln[2]
void fillECal(const edm::Event &, const edm::EventSetup &)
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
int theCSCStripPedestalCount
MonitorElement * mehSiStripADC[19]
MonitorElement * mehDtMuonTimevLayer[4]
MonitorElement * mehSiStripn[19]
int gainId() const
get the gainId (2 bits)
MonitorElement * mehCSCWireTime
unsigned int layer() const
layer id
virtual void beginJob(void)
uint32_t rawId() const
get the raw id
MonitorElement * mehEcalMaxPos[2]
MonitorElement * mehDtMuonTime[4]
static const int sdPxlBrl
double ECalendcapADCtoGeV_
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
virtual void adc2fC(const HBHEDataFrame &df, CaloSamples &lf) const
edm::InputTag MuCSCStripSrc_
static const int MAXSAMPLES
MonitorElement * mehHcalAEE[4]
std::map< uint32_t, float, std::less< uint32_t > > MapType
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
void setVerbose(unsigned level)
std::map< int, double, std::less< int > > ECalgainConv_
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
iterator end()
Return the off-the-end iterator.
unsigned int disk() const
disk id
void fillHCal(const edm::Event &, const edm::EventSetup &)
MonitorElement * mehRPCMuonn
MonitorElement * mehEcalSHE[2]
void fillMuon(const edm::Event &, const edm::EventSetup &)
MonitorElement * mehEcalAEE[2]
MonitorElement * mehHcalSHEvAEE[4]
virtual ~GlobalDigisAnalyzer()
MonitorElement * mehCSCStripn
int size() const
get the size
MonitorElement * mehCSCStripADC
T const * product() const
static const int sdHcalFwd
float gain12Over6() const
std::vector< DigiType >::const_iterator const_iterator
T const * product() const
unsigned int wheel() const
wheel id
static const int sdHcalBrl
MonitorElement * mehSiPixelCol[7]
MonitorElement * mehHcaln[4]
unsigned int layer() const
layer id
MonitorElement * mehHcalAEESHE[4]
MonitorElement * mehEcalSHEvAEESHE[2]
MonitorElement * mehHcalSHE[4]
unsigned int side() const
positive or negative id
MonitorElement * mehCSCWiren
std::pair< const_iterator, const_iterator > Range
int adc() const
get the ADC sample (singed 16 bits)
iterator begin()
Return an iterator to the first DetSet.
static const int sdPxlFwd
void showDirStructure(void) const
MonitorElement * mehEcalMultvAEE[2]
MonitorElement * mehSiPixeln[7]
MonitorElement * mehSiStripStrip[19]
collection_type::const_iterator const_iterator
collection_type::const_iterator const_iterator
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 &)
edm::InputTag MuCSCWireSrc_
static const int sdHcalEC
static const int MAXSAMPLES
MonitorElement * mehSiPixelADC[7]
void setCurrentFolder(const std::string &fullpath)
edm::InputTag SiStripSrc_
int adc() const
get the ADC sample (12 bits)
MonitorElement * mehDtMuonn[4]
unsigned int wheel() const
wheel id
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
virtual void analyze(const edm::Event &, const edm::EventSetup &)