75 e9 =
new TH1F(
"e9",
"E9 energy", 300, 0., 150.);
76 e25 =
new TH1F(
"e25",
"E25 energy", 300, 0., 150.);
77 scE =
new TH1F(
"scE",
"SC energy", 300, 0., 150.);
78 trP =
new TH1F(
"trP",
"Trk momentum", 300, 0., 150.);
79 EoP =
new TH1F(
"EoP",
"EoP", 600, 0., 3.);
80 EoP_all =
new TH1F(
"EoP_all",
"EoP_all", 600, 0., 3.);
83 calibs =
new TH1F(
"calib",
"Calibration constants", 4000, 0.5, 2.);
85 calibs =
new TH1F(
"calib",
"Calibration constants", 800, 0.5, 2.);
88 e25OverScE =
new TH1F(
"e25OverscE",
"E25 / SC energy", 400, 0., 2.);
89 E25oP =
new TH1F(
"E25oP",
"E25 / P", 1200, 0., 1.5);
91 Map =
new TH2F(
"Map",
"Nb Events in Crystal", 85, 1, 85, 70, 5, 75);
92 e9Overe25 =
new TH1F(
"e9Overe25",
"E9 / E25", 400, 0., 2.);
93 Map3Dcalib =
new TH2F(
"3Dcalib",
"3Dcalib", 85, 1, 85, 70, 5, 75);
95 MapCor1 =
new TH2F(
"MapCor1",
"Correlation E25/Pcalo versus E25/Pin", 100, 0., 5., 100, 0., 5.);
96 MapCor2 =
new TH2F(
"MapCor2",
"Correlation E25/Pcalo versus E/P", 100, 0., 5., 100, 0., 5.);
97 MapCor3 =
new TH2F(
"MapCor3",
"Correlation E25/Pcalo versus Pout/Pin", 100, 0., 5., 100, 0., 5.);
98 MapCor4 =
new TH2F(
"MapCor4",
"Correlation E25/Pcalo versus E25/highestP", 100, 0., 5., 100, 0., 5.);
99 MapCor5 =
new TH2F(
"MapCor5",
"Correlation E25/Pcalo versus Pcalo/Pout", 100, 0., 5., 100, 0., 5.);
100 MapCor6 =
new TH2F(
"MapCor6",
"Correlation Pout/Pin versus E25/Pin", 100, 0., 5., 100, 0., 5.);
101 MapCor7 =
new TH2F(
"MapCor7",
"Correlation Pout/Pin versus Pcalo/Pout", 100, 0., 5., 100, 0., 5.);
102 MapCor8 =
new TH2F(
"MapCor8",
"Correlation E25/Pin versus Pcalo/Pout", 100, 0., 5., 100, 0., 5.);
103 MapCor9 =
new TH2F(
"MapCor9",
"Correlation E25/Pcalo versus Eseed/Pout", 100, 0., 5., 100, 0., 5.);
104 MapCor10 =
new TH2F(
"MapCor10",
"Correlation Eseed/Pout versus Pout/Pin", 100, 0., 5., 100, 0., 5.);
105 MapCor11 =
new TH2F(
"MapCor11",
"Correlation Eseed/Pout versus E25/Pin", 100, 0., 5., 100, 0., 5.);
107 new TH2F(
"MapCorCalib",
"Correlation Miscalibration versus Calibration constants", 100, 0.5, 1.5, 100, 0.5, 1.5);
109 PinMinPout =
new TH1F(
"PinMinPout",
"(Pin - Pout)/Pin", 600, -2.0, 2.0);
112 calibinter =
new TH1F(
"calibinter",
"internal calibration constants", 2000, 0.5, 2.);
113 PinOverPout =
new TH1F(
"PinOverPout",
"pinOverpout", 600, 0., 3.);
114 eSeedOverPout =
new TH1F(
"eSeedOverPout",
"eSeedOverpout ", 600, 0., 3.);
115 MisCalibs =
new TH1F(
"MisCalibs",
"Miscalibration constants", 4000, 0.5, 2.);
116 RatioCalibs =
new TH1F(
"RatioCalibs",
"Ratio in Calibration Constants", 4000, 0.5, 2.0);
117 DiffCalibs =
new TH1F(
"DiffCalibs",
"Difference in Calibration constants", 4000, -1.0, 1.0);
119 calibinter =
new TH1F(
"calibinter",
"internal calibration constants", 400, 0.5, 2.);
120 PinOverPout =
new TH1F(
"PinOverPout",
"pinOverpout", 600, 0., 3.);
121 eSeedOverPout =
new TH1F(
"eSeedOverPout",
"eSeedOverpout ", 600, 0., 3.);
122 MisCalibs =
new TH1F(
"MisCalibs",
"Miscalibration constants", 800, 0.5, 2.);
123 RatioCalibs =
new TH1F(
"RatioCalibs",
"Ratio in Calibration Constants", 800, 0.5, 2.0);
124 DiffCalibs =
new TH1F(
"DiffCalibs",
"Difference in Calibration constants", 800, -1.0, 1.0);
126 Error1 =
new TH1F(
"Error1",
"DeltaP/Pin", 800, -1.0, 1.0);
127 Error2 =
new TH1F(
"Error2",
"DeltaP/Pout", 800, -1.0, 1.0);
128 Error3 =
new TH1F(
"Error3",
"DeltaP/Pcalo", 800, -1.0, 1.0);
129 eSeedOverPout2 =
new TH1F(
"eSeedOverPout2",
"eSeedOverpout (No Supercluster)", 600, 0., 4.);
130 hadOverEm =
new TH1F(
"hadOverEm",
"Had/EM distribution", 600, -2., 2.);
133 Map3DcalibNoCuts =
new TH2F(
"3DcalibNoCuts",
"3Dcalib (Before Cuts)", 85, 1, 85, 70, 5, 75);
134 e9NoCuts =
new TH1F(
"e9NoCuts",
"E9 energy (Before Cuts)", 300, 0., 150.);
135 e25NoCuts =
new TH1F(
"e25NoCuts",
"E25 energy (Before Cuts)", 300, 0., 150.);
136 scENoCuts =
new TH1F(
"scENoCuts",
"SC energy (Before Cuts)", 300, 0., 150.);
137 trPNoCuts =
new TH1F(
"trPNoCuts",
"Trk momentum (Before Cuts)", 300, 0., 150.);
138 EoPNoCuts =
new TH1F(
"EoPNoCuts",
"EoP (Before Cuts)", 600, 0., 3.);
140 calibsNoCuts =
new TH1F(
"calibNoCuts",
"Calibration constants (Before Cuts)", 4000, 0., 2.);
142 calibsNoCuts =
new TH1F(
"calibNoCuts",
"Calibration constants (Before Cuts)", 800, 0., 2.);
144 e25OverScENoCuts =
new TH1F(
"e25OverscENoCuts",
"E25 / SC energy (Before Cuts)", 400, 0., 2.);
145 E25oPNoCuts =
new TH1F(
"E25oPNoCuts",
"E25 / P (Before Cuts)", 1200, 0., 1.5);
146 MapNoCuts =
new TH2F(
"MapNoCuts",
"Nb Events in Crystal (Before Cuts)", 85, 1, 85, 70, 5, 75);
147 e9Overe25NoCuts =
new TH1F(
"e9Overe25NoCuts",
"E9 / E25 (Before Cuts)", 400, 0., 2.);
148 PinOverPoutNoCuts =
new TH1F(
"PinOverPoutNoCuts",
"pinOverpout (Before Cuts)", 600, 0., 3.);
149 eSeedOverPoutNoCuts =
new TH1F(
" eSeedOverPoutNoCuts",
"eSeedOverpout (Before Cuts) ", 600, 0., 4.);
150 PinMinPoutNoCuts =
new TH1F(
"PinMinPoutNoCuts",
"(Pin - Pout)/Pin (Before Cuts)", 600, -2.0, 2.0);
152 RatioCalibsNoCuts =
new TH1F(
"RatioCalibsNoCuts",
"Ratio in Calibration Constants (Before Cuts)", 4000, 0.5, 2.0);
153 DiffCalibsNoCuts =
new TH1F(
"DiffCalibsNoCuts",
"Difference in Calibration constants (Before Cuts)", 4000, -1.0, 1.0);
154 calibinterNoCuts =
new TH1F(
"calibinterNoCuts",
"internal calibration constants", 2000, 0.5, 2.);
157 new TH2F(
"MapCor1NoCuts",
"Correlation E25/PatCalo versus E25/Pin (Before Cuts)", 100, 0., 5., 100, 0., 5.);
159 new TH2F(
"MapCor2NoCuts",
"Correlation E25/PatCalo versus E/P (Before Cuts)", 100, 0., 5., 100, 0., 5.);
161 new TH2F(
"MapCor3NoCuts",
"Correlation E25/PatCalo versus Pout/Pin (Before Cuts)", 100, 0., 5., 100, 0., 5.);
163 new TH2F(
"MapCor4NoCuts",
"Correlation E25/PatCalo versus E25/highestP (Before Cuts)", 100, 0., 5., 100, 0., 5.);
165 new TH2F(
"MapCor5NoCuts",
"Correlation E25/Pcalo versus Pcalo/Pout (Before Cuts)", 100, 0., 5., 100, 0., 5.);
167 new TH2F(
"MapCor6NoCuts",
"Correlation Pout/Pin versus E25/Pin (Before Cuts)", 100, 0., 5., 100, 0., 5.);
169 new TH2F(
"MapCor7NoCuts",
"Correlation Pout/Pin versus Pcalo/Pout (Before Cuts)", 100, 0., 5., 100, 0., 5.);
171 new TH2F(
"MapCor8NoCuts",
"Correlation E25/Pin versus Pcalo/Pout (Before Cuts)", 100, 0., 5., 100, 0., 5.);
173 new TH2F(
"MapCor9NoCuts",
"Correlation E25/Pcalo versus Eseed/Pout (Before Cuts)", 100, 0., 5., 100, 0., 5.);
175 new TH2F(
"MapCor10NoCuts",
"Correlation Eseed/Pout versus Pout/Pin (Before Cuts)", 100, 0., 5., 100, 0., 5.);
177 new TH2F(
"MapCor11NoCuts",
"Correlation Eseed/Pout versus E25/Pin (Before Cuts)", 100, 0., 5., 100, 0., 5.);
179 "Correlation Miscalibration versus Calibration constants (Before Cuts)",
187 Error1NoCuts =
new TH1F(
"Eror1NoCuts",
"DeltaP/Pin (Before Cuts)", 800, -1.0, 1.0);
188 Error2NoCuts =
new TH1F(
"Error2NoCuts",
"DeltaP/Pout (Before Cuts)", 800, -1.0, 1.0);
189 Error3NoCuts =
new TH1F(
"Error3NoCuts",
"DeltaP/Pcalo (Before Cuts)", 800, -1.0, 1.0);
190 eSeedOverPout2NoCuts =
new TH1F(
"eSeedOverPout2NoCuts",
"eSeedOverpout (No Supercluster, Before Cuts)", 600, 0., 4.);
191 hadOverEmNoCuts =
new TH1F(
"hadOverEmNoCuts",
"Had/EM distribution (Before Cuts)", 600, -2., 2.);
195 new TH2F(
"MapCor1ESeed",
"Correlation E25/Pcalo versus E25/Pin (after Eseed/Pout cut)", 100, 0., 5., 100, 0., 5.);
197 new TH2F(
"MapCor2ESeed",
"Correlation E25/Pcalo versus E/P (after Eseed/Pout cut)", 100, 0., 5., 100, 0., 5.);
199 "MapCor3ESeed",
"Correlation E25/Pcalo versus Pout/Pin (after Eseed/Pout cut)", 100, 0., 5., 100, 0., 5.);
201 "MapCor4ESeed",
"Correlation E25/Pcalo versus E25/highestP (after Eseed/Pout cut)", 100, 0., 5., 100, 0., 5.);
203 "MapCor5ESeed",
"Correlation E25/Pcalo versus Pcalo/Pout (after Eseed/Pout cut)", 100, 0., 5., 100, 0., 5.);
205 new TH2F(
"MapCor6ESeed",
"Correlation Pout/Pin versus E25/Pin (after Eseed/Pout cut)", 100, 0., 5., 100, 0., 5.);
207 "MapCor7ESeed",
"Correlation Pout/Pin versus Pcalo/Pout (after Eseed/Pout cut)", 100, 0., 5., 100, 0., 5.);
209 "MapCor8ESeed",
"Correlation E25/Pin versus Pcalo/Pout (after Eseed/Pout cut)", 100, 0., 5., 100, 0., 5.);
211 "MapCor9ESeed",
"Correlation E25/Pcalo versus Eseed/Pout (after Eseed/Pout cut)", 100, 0., 5., 100, 0., 5.);
213 "MapCor10ESeed",
"Correlation Eseed/Pout versus Pout/Pin (after Eseed/Pout cut)", 100, 0., 5., 100, 0., 5.);
215 "MapCor11ESeed",
"Correlation Eseed/Pout versus E25/Pin (after Eseed/Pout cut)", 100, 0., 5., 100, 0., 5.);
218 new TH1F(
"eSeedOverPout2ESeed",
"eSeedOverpout (No Supercluster, after Eseed/Pout cut)", 600, 0., 4.);
220 hadOverEmESeed =
new TH1F(
"hadOverEmESeed",
"Had/EM distribution (after Eseed/Pout cut)", 600, -2., 2.);
223 GeneralMap =
new TH2F(
"GeneralMap",
"Map without any cuts", 85, 1, 85, 70, 5, 75);
236 std::cout <<
" Name of Algorithm is not recognize " <<
calibAlgo_ <<
" Should be either L3, HH or HHReg. Abort! "
262 int nIterations = 10;
272 std::cout <<
" Calibration not run due to problem in Algo Choice..." << std::endl;
293 std::map<EBDetId, float> OldCoeff;
295 while (fileStatus != EOF) {
296 fileStatus = fscanf(MisCalib,
"%d %d %f\n", &
eta, &
phi, &coeff);
297 if (
eta != -1 &&
phi != -1 && coeff != -1) {
306 CalibrationCluster::CalibMap::iterator itmap;
312 std::map<EBDetId, float>::iterator iter = OldCoeff.find(itmap->first);
313 if (iter != OldCoeff.end())
314 Compare = iter->second;
321 if ((itmap->first).ieta() <
mineta_ + 2) {
325 if ((itmap->first).ieta() >
maxeta_ - 2) {
329 if ((itmap->first).iphi() <
minphi_ + 2) {
333 if ((itmap->first).iphi() >
maxphi_ - 2) {
355 std::cout <<
" Calibration not run due to problem in AlgoChoice..." << std::endl;
364 CalibrationCluster::CalibMap::iterator itmapp;
368 std::map<EBDetId, float>::iterator iter2 = OldCoeff.find(itmapp->first);
369 if (iter2 != OldCoeff.end())
370 Compare2 = iter2->second;
375 if ((itmapp->first).ieta() <
mineta_ + 2) {
379 if ((itmapp->first).ieta() >
maxeta_ - 2) {
383 if ((itmapp->first).iphi() <
minphi_ + 2) {
387 if ((itmapp->first).iphi() >
maxphi_ - 2) {
401 std::cout <<
"************* STATISTICS **************" << std::endl;
420 for (it = ecrh.
begin(); it != ecrh.
end(); it++) {
422 if (it->energy() > en_save) {
423 en_save = it->energy();
435 double currEnergy = 0.;
438 for (std::vector<DetId>::const_iterator idsIt = v1.begin(); idsIt != v1.end(); ++idsIt) {
439 if (idsIt->subdetId() != 1)
442 itrechit =
hits->find(*idsIt);
444 if (itrechit ==
hits->end()) {
445 std::cout <<
"ElectronCalibration::findMaxHit2: rechit not found! " << std::endl;
448 if (itrechit->energy() > currEnergy) {
449 currEnergy = itrechit->energy();
466 std::cerr <<
"Error! can't get the product EBRecHitCollection: " << std::endl;
476 std::cerr <<
"Error! can't get the product ElectronCollection: " << std::endl;
500 float highestElePt = 0.;
504 if (fabs(eleIt->eta()) > (
maxeta_ + 3) * 0.0175)
506 if (eleIt->eta() < (
mineta_ - 3) * 0.0175)
509 if (eleIt->pt() > highestElePt) {
510 highestElePt = eleIt->pt();
511 highPtElectron = *eleIt;
515 if (highestElePt <
ElePt_)
520 if (fabs(sc.
eta()) > (
maxeta_ + 3) * 0.0175) {
521 std::cout <<
"++++ Problem with electron, electron eta is " << highPtElectron.
eta() <<
" while SC is " << sc.
eta()
528 std::vector<DetId> v1;
533 v1.push_back(idsIt->first);
541 if (maxHitId.
null()) {
546 int maxCC_Eta = maxHitId.
ieta();
547 int maxCC_Phi = maxHitId.
iphi();
571 std::vector<float>
energy;
572 float energy3x3 = 0.;
573 float energy5x5 = 0.;
577 if (Xtals5x5[icry].subdetId() != 1)
579 itrechit =
hits->find(Xtals5x5[icry]);
580 if (itrechit ==
hits->end()) {
581 std::cout <<
"DetId not is e25" << std::endl;
587 energy.push_back(itrechit->energy());
588 energy5x5 +=
energy[icry];
590 if (icry == 6 || icry == 7 || icry == 8 || icry == 11 || icry == 12 || icry == 13 || icry == 16 || icry == 17 ||
592 energy3x3 +=
energy[icry];
608 float UncorrectedPatCalo =
645 MapCor1NoCuts->Fill(energy5x5 / UncorrectedPatCalo, energy5x5 / Ptrack_in);
647 MapCor3NoCuts->Fill(energy5x5 / UncorrectedPatCalo, Ptrack_out / Ptrack_in);
648 MapCor4NoCuts->Fill(energy5x5 / UncorrectedPatCalo, energy5x5 / highPtElectron.
p());
649 MapCor5NoCuts->Fill(energy5x5 / UncorrectedPatCalo, UncorrectedPatCalo / Ptrack_out);
650 MapCor6NoCuts->Fill(Ptrack_out / Ptrack_in, energy5x5 / Ptrack_in);
651 MapCor7NoCuts->Fill(Ptrack_out / Ptrack_in, UncorrectedPatCalo / Ptrack_out);
652 MapCor8NoCuts->Fill(energy5x5 / Ptrack_in, UncorrectedPatCalo / Ptrack_out);
668 if ((energy3x3 / energy5x5) <
cut1_)
671 if ((Ptrack_out / Ptrack_in) <
cut2_ || (Ptrack_out / Ptrack_in) >
cut3_)
677 e25->Fill(energy5x5);
680 trP->Fill(UncorrectedPatCalo);
685 E25oP->Fill(energy5x5 / UncorrectedPatCalo);
687 Map->Fill(maxCC_Eta, maxCC_Phi);
695 MapCor1->Fill(energy5x5 / UncorrectedPatCalo, energy5x5 / Ptrack_in);
697 MapCor3->Fill(energy5x5 / UncorrectedPatCalo, Ptrack_out / Ptrack_in);
698 MapCor4->Fill(energy5x5 / UncorrectedPatCalo, energy5x5 / highPtElectron.
p());
699 MapCor5->Fill(energy5x5 / UncorrectedPatCalo, UncorrectedPatCalo / Ptrack_out);
700 MapCor6->Fill(Ptrack_out / Ptrack_in, energy5x5 / Ptrack_in);
701 MapCor7->Fill(Ptrack_out / Ptrack_in, UncorrectedPatCalo / Ptrack_out);
702 MapCor8->Fill(energy5x5 / Ptrack_in, UncorrectedPatCalo / Ptrack_out);
707 PinMinPout->Fill((Ptrack_in - Ptrack_out) / Ptrack_in);
727 MapCor1ESeed->Fill(energy5x5 / UncorrectedPatCalo, energy5x5 / Ptrack_in);
729 MapCor3ESeed->Fill(energy5x5 / UncorrectedPatCalo, Ptrack_out / Ptrack_in);
730 MapCor4ESeed->Fill(energy5x5 / UncorrectedPatCalo, energy5x5 / highPtElectron.
p());
731 MapCor5ESeed->Fill(energy5x5 / UncorrectedPatCalo, UncorrectedPatCalo / Ptrack_out);
732 MapCor6ESeed->Fill(Ptrack_out / Ptrack_in, energy5x5 / Ptrack_in);
733 MapCor7ESeed->Fill(Ptrack_out / Ptrack_in, UncorrectedPatCalo / Ptrack_out);
734 MapCor8ESeed->Fill(energy5x5 / Ptrack_in, UncorrectedPatCalo / Ptrack_out);