12 edm::LogInfo(
"OutputInfo") <<
" Hcal RecHit Task histograms will NOT be saved";
48 if (eventype_ ==
"multi")
etype_ = 2;
51 if(sign_ ==
"-")
iz = -1;
52 if(sign_ ==
"*")
iz = 0;
55 if(mc_ ==
"no")
imc = 0;
70 sprintf (histo,
"N_HB" );
71 Nhb = ib.
book1D(histo, histo, 2600,0.,2600.);
72 sprintf (histo,
"N_HE" );
73 Nhe = ib.
book1D(histo, histo, 2600,0.,2600.);
74 sprintf (histo,
"N_HO" );
75 Nho = ib.
book1D(histo, histo, 2200,0.,2200.);
76 sprintf (histo,
"N_HF" );
77 Nhf = ib.
book1D(histo, histo, 1800,0., 1800.);
82 for (
unsigned int i1 = 0; i1 < 82; i1++) {
83 for (
unsigned int i2 = 0; i2 < 72; i2++) {
84 for (
unsigned int i3 = 0; i3 < 4; i3++) {
85 for (
unsigned int i4 = 0; i4 < 4; i4++) {
94 sprintf (histo,
"ZSmin_map_depth1" );
96 sprintf (histo,
"ZSmin_map_depth2" );
98 sprintf (histo,
"ZSmin_map_depth3" );
100 sprintf (histo,
"ZSmin_map_depth4" );
104 sprintf (histo,
"ZS_Nreco_HB1" );
106 sprintf (histo,
"ZS_Nreco_HB2" );
108 sprintf (histo,
"ZS_Nreco_HE1" );
110 sprintf (histo,
"ZS_Nreco_HE2" );
112 sprintf (histo,
"ZS_Nreco_HE3" );
114 sprintf (histo,
"ZS_Nreco_HO" );
116 sprintf (histo,
"ZS_Nreco_HF1" );
118 sprintf (histo,
"ZS_Nreco_HF2" );
121 sprintf (histo,
"ZSmin_simple1D_HB1" );
123 sprintf (histo,
"ZSmin_simple1D_HB2" );
125 sprintf (histo,
"ZSmin_simple1D_HE1" );
127 sprintf (histo,
"ZSmin_simple1D_HE2" );
129 sprintf (histo,
"ZSmin_simple1D_HE3" );
131 sprintf (histo,
"ZSmin_simple1D_HO" );
133 sprintf (histo,
"ZSmin_simple1D_HF1" );
135 sprintf (histo,
"ZSmin_simple1D_HF2" );
138 sprintf (histo,
"ZSmin_sequential1D_HB1" );
140 sprintf (histo,
"ZSmin_sequential1D_HB2" );
142 sprintf (histo,
"ZSmin_sequential1D_HE1" );
144 sprintf (histo,
"ZSmin_sequential1D_HE2" );
146 sprintf (histo,
"ZSmin_sequential1D_HE3" );
148 sprintf (histo,
"ZSmin_sequential1D_HO" );
150 sprintf (histo,
"ZSmin_sequential1D_HF1" );
152 sprintf (histo,
"ZSmin_sequential1D_HF2" );
160 sprintf (histo,
"emap_depth1" );
162 sprintf (histo,
"emap_depth2" );
164 sprintf (histo,
"emap_depth3" );
166 sprintf (histo,
"emap_depth4" );
172 sprintf (histo,
"map_ecal" );
173 map_ecal = ib.
book2D(histo, histo, 70, -3.045, 3.045, 72, -3.1415926536, 3.1415926536);
178 sprintf (histo,
"emean_vs_ieta_HB1" );
180 sprintf (histo,
"emean_vs_ieta_HB2" );
182 sprintf (histo,
"emean_vs_ieta_HE1" );
184 sprintf (histo,
"emean_vs_ieta_HE2" );
186 sprintf (histo,
"emean_vs_ieta_HE3" );
188 sprintf (histo,
"emean_vs_ieta_HO" );
190 sprintf (histo,
"emean_vs_ieta_HF1" );
192 sprintf (histo,
"emean_vs_ieta_HF2" );
196 sprintf (histo,
"RMS_vs_ieta_HB1" );
198 sprintf (histo,
"RMS_vs_ieta_HB2" );
200 sprintf (histo,
"RMS_vs_ieta_HE1" );
202 sprintf (histo,
"RMS_vs_ieta_HE2" );
204 sprintf (histo,
"RMS_vs_ieta_HE3" );
206 sprintf (histo,
"RMS_vs_ieta_HO" );
208 sprintf (histo,
"RMS_vs_ieta_HF1" );
210 sprintf (histo,
"RMS_vs_ieta_HF2" );
214 sprintf (histo,
"emean_seq_HB1" );
216 sprintf (histo,
"emean_seq_HB2" );
218 sprintf (histo,
"emean_seq_HE1" );
220 sprintf (histo,
"emean_seq_HE2" );
222 sprintf (histo,
"emean_seq_HE3" );
224 sprintf (histo,
"emean_seq_HO" );
226 sprintf (histo,
"emean_seq_HF1" );
228 sprintf (histo,
"emean_seq_HF2" );
231 sprintf (histo,
"RMS_seq_HB1" );
233 sprintf (histo,
"RMS_seq_HB2" );
235 sprintf (histo,
"RMS_seq_HE1" );
237 sprintf (histo,
"RMS_seq_HE2" );
239 sprintf (histo,
"RMS_seq_HE3" );
241 sprintf (histo,
"RMS_seq_HO" );
243 sprintf (histo,
"RMS_seq_HF1" );
245 sprintf (histo,
"RMS_seq_HF2" );
251 sprintf (histo,
"occupancy_map_HB1" );
253 sprintf (histo,
"occupancy_map_HB2" );
255 sprintf (histo,
"occupancy_map_HE1" );
257 sprintf (histo,
"occupancy_map_HE2" );
259 sprintf (histo,
"occupancy_map_HE3" );
261 sprintf (histo,
"occupancy_map_HO" );
263 sprintf (histo,
"occupancy_map_HF1" );
265 sprintf (histo,
"occupancy_map_HF2" );
269 sprintf (histo,
"occupancy_vs_ieta_HB1" );
271 sprintf (histo,
"occupancy_vs_ieta_HB2" );
273 sprintf (histo,
"occupancy_vs_ieta_HE1" );
275 sprintf (histo,
"occupancy_vs_ieta_HE2" );
277 sprintf (histo,
"occupancy_vs_ieta_HE3" );
279 sprintf (histo,
"occupancy_vs_ieta_HO" );
281 sprintf (histo,
"occupancy_vs_ieta_HF1" );
283 sprintf (histo,
"occupancy_vs_ieta_HF2" );
288 sprintf (histo,
"occ_sequential1D_HB1" );
290 sprintf (histo,
"occ_sequential1D_HB2" );
292 sprintf (histo,
"occ_sequential1D_HE1" );
294 sprintf (histo,
"occ_sequential1D_HE2" );
296 sprintf (histo,
"occ_sequential1D_HE3" );
298 sprintf (histo,
"occ_sequential1D_HO" );
300 sprintf (histo,
"occ_sequential1D_HF1" );
302 sprintf (histo,
"occ_sequential1D_HF2" );
307 sprintf (histo,
"HcalRecHitTask_RecHit_StatusWord_HB" ) ;
310 sprintf (histo,
"HcalRecHitTask_RecHit_StatusWord_HE" ) ;
313 sprintf (histo,
"HcalRecHitTask_RecHit_StatusWord_HF" ) ;
317 sprintf (histo,
"HcalRecHitTask_RecHit_StatusWord_HF67" ) ;
320 sprintf (histo,
"HcalRecHitTask_RecHit_StatusWord_HO" ) ;
324 sprintf (histo,
"HcalRecHitTask_RecHit_Aux_StatusWord_HB" ) ;
327 sprintf (histo,
"HcalRecHitTask_RecHit_Aux_StatusWord_HE" ) ;
330 sprintf (histo,
"HcalRecHitTask_RecHit_Aux_StatusWord_HF" ) ;
333 sprintf (histo,
"HcalRecHitTask_RecHit_Aux_StatusWord_HO" ) ;
338 sprintf (histo,
"map_econe_depth1" );
340 ib.
book2D(histo, histo, 520, -5.2, 5.2, 72, -3.1415926536, 3.1415926536);
341 sprintf (histo,
"map_econe_depth2" );
343 ib.
book2D(histo, histo, 520, -5.2, 5.2, 72, -3.1415926536, 3.1415926536);
344 sprintf (histo,
"map_econe_depth3" );
346 ib.
book2D(histo, histo, 520, -5.2, 5.2, 72, -3.1415926536, 3.1415926536);
347 sprintf (histo,
"map_econe_depth4" );
349 ib.
book2D(histo, histo, 520, -5.2, 5.2, 72, -3.1415926536, 3.1415926536);
357 sprintf (histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths");
360 sprintf (histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths_E");
363 sprintf (histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths_EH");
372 sprintf (histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_depth1");
375 sprintf (histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_depth2");
378 sprintf (histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_depth3");
381 sprintf (histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_depth4");
388 sprintf (histo,
"Delta_phi_cluster-MC");
391 sprintf (histo,
"Delta_eta_cluster-MC");
394 sprintf (histo,
"Delta_phi_simcluster-MC");
397 sprintf (histo,
"Delta_eta_simcluster-MC");
404 sprintf (histo,
"e_hb" ) ;
406 sprintf (histo,
"e_he" ) ;
408 sprintf (histo,
"e_ho" ) ;
410 sprintf (histo,
"e_hfl" ) ;
412 sprintf (histo,
"e_hfs" ) ;
423 sprintf (histo,
"HcalRecHitTask_number_of_rechits_in_cone_HB" ) ;
426 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_in_cone_HB" ) ;
430 sprintf (histo,
"HcalRecHitTask_number_of_rechits_above_1GeV_HB");
433 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_HB" ) ;
438 sprintf (histo,
"HcalRecHitTask_number_of_ecalrechits_in_cone_HB");
440 sprintf (histo,
"HcalRecHitTask_energy_ecal_plus_hcal_in_cone_HB");
444 sprintf (histo,
"HcalRecHitTask_energy_hcal_vs_ecal_HB");
446 sprintf (histo,
"HcalRecHitTask_energy_ecal_plus_hcal_HB" ) ;
452 sprintf(histo,
"HcalRecHitTask_severityLevel_HB");
455 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_HB" ) ;
458 sprintf (histo,
"HcalRecHitTask_timing_HB" ) ;
462 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_Low_HB" ) ;
465 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HB" ) ;
466 meTE_HB = ib.
book2D(histo, histo, 150, -5., 295., 70, -48., 92.);
468 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_High_HB" ) ;
471 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_Low_HB" ) ;
474 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_HB" ) ;
477 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_High_HB" ) ;
482 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HB_depth1" ) ;
483 meTE_HB1 = ib.
book2D(histo, histo, 3000, -5., 2995., 70, -48., 92.);
485 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HB_depth2" ) ;
486 meTE_HB2 = ib.
book2D(histo, histo, 3000, -5., 2995., 70, -48., 92.);
489 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HB");
491 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HB");
505 sprintf (histo,
"HcalRecHitTask_number_of_rechits_in_cone_HE" ) ;
508 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_in_cone_HE" ) ;
512 sprintf (histo,
"HcalRecHitTask_number_of_rechits_above_1GeV_HE");
515 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_HE" ) ;
519 sprintf (histo,
"HcalRecHitTask_energy_ecal_plus_hcal_HE" ) ;
522 sprintf (histo,
"HcalRecHitTask_energy_hcal_vs_ecal_HE");
525 sprintf (histo,
"HcalRecHitTask_number_of_ecalrechits_in_cone_HE");
527 sprintf (histo,
"HcalRecHitTask_energy_ecal_plus_hcal_in_cone_HE");
535 sprintf(histo,
"HcalRecHitTask_severityLevel_HE");
538 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_HE" ) ;
541 sprintf (histo,
"HcalRecHitTask_timing_HE" ) ;
544 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_Low_HE" ) ;
547 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HE" ) ;
548 meTE_HE = ib.
book2D(histo, histo, 200, -5., 395., 70, -48., 92.);
550 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_Low_HE" ) ;
553 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_HE" ) ;
558 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HE_depth1" ) ;
559 meTE_HE1 = ib.
book2D(histo, histo, 1000, -5., 995., 70, -48., 92.);
561 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HE_depth2" ) ;
562 meTE_HE2 = ib.
book2D(histo, histo, 1000, -5., 995., 70, -48., 92.);
565 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HE");
567 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HE");
581 sprintf (histo,
"HcalRecHitTask_number_of_rechits_in_cone_HO" ) ;
584 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_in_cone_HO" ) ;
588 sprintf (histo,
"HcalRecHitTask_number_of_rechits_above_1GeV_HO");
591 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_HO" ) ;
596 sprintf(histo,
"HcalRecHitTask_severityLevel_HO");
599 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_HO" ) ;
602 sprintf (histo,
"HcalRecHitTask_timing_HO" ) ;
605 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HO" ) ;
606 meTE_HO= ib.
book2D(histo, histo, 60, -5., 55., 70, -48., 92.);
608 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_High_HO" ) ;
611 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_HO" ) ;
614 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_High_HO" ) ;
620 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HO");
622 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HO");
636 sprintf (histo,
"HcalRecHitTask_number_of_rechits_in_cone_HF" ) ;
639 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_in_cone_HF" ) ;
642 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_in_cone_HFL" );
645 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_in_cone_HFS");
648 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_HF" ) ;
653 sprintf(histo,
"HcalRecHitTask_severityLevel_HF");
656 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_HF" ) ;
659 sprintf (histo,
"HcalRecHitTask_timing_HF" ) ;
662 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_Low_HF" ) ;
665 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HF" ) ;
666 meTE_HF = ib.
book2D(histo, histo, 200, -5., 995., 70, -48., 92.);
668 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_Low_HF" ) ;
671 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_HF" ) ;
676 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HFL" ) ;
677 meTE_HFL = ib.
book2D(histo, histo, 1000, -5., 995., 70, -48., 92.);
679 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HFS" ) ;
680 meTE_HFS = ib.
book2D(histo, histo, 1000, -5., 995., 70, -48., 92.);
683 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HF");
685 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HFL");
687 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HFS");
689 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HF");
691 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HFL");
693 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HFS");
710 double eHcalCone = 0.;
711 double eHcalConeHB = 0.;
712 double eHcalConeHE = 0.;
713 double eHcalConeHO = 0.;
714 double eHcalConeHF = 0.;
715 double eHcalConeHFL = 0.;
716 double eHcalConeHFS = 0.;
719 int nrechitsCone = 0;
720 int nrechitsThresh = 0;
726 double eEcalCone = 0.;
727 int numrechitsEcal = 0;
730 double phi_MC = -999999.;
731 double eta_MC = -999999.;
735 double ehcal_coneMC_1 = 0.;
736 double ehcal_coneMC_2 = 0.;
737 double ehcal_coneMC_3 = 0.;
738 double ehcal_coneMC_4 = 0.;
741 double searchR = 1.0;
746 double etaHot = 99999.;
747 double phiHot = 99999.;
759 std::cout <<
"no HepMCProduct found" << std::endl;
765 double maxPt = -99999.;
767 const HepMC::GenEvent * myGenEvent = evtMC->GetEvent();
768 for ( HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
769 p != myGenEvent->particles_end(); ++
p ) {
770 double phip = (*p)->momentum().phi();
771 double etap = (*p)->momentum().eta();
774 double pt = (*p)->momentum().perp();
775 if(pt > maxPt) { npart++; maxPt =
pt; phi_MC = phip; eta_MC = etap; }
841 for (; RecHit != RecHitEnd ; ++RecHit) {
845 geometry->getSubdetectorGeometry (EBid)->getGeometry (EBid) ;
846 double eta = cellGeometry->getPosition ().eta () ;
847 double phi = cellGeometry->getPosition ().phi () ;
848 double en = RecHit->energy();
854 double r =
dR(eta_MC, phi_MC, eta, phi);
866 RecHit = rhitEE.
product()->begin();
867 RecHitEnd = rhitEE.
product()->end();
869 for (; RecHit != RecHitEnd ; ++RecHit) {
873 geometry->getSubdetectorGeometry (EEid)->getGeometry (EEid) ;
874 double eta = cellGeometry->getPosition ().eta () ;
875 double phi = cellGeometry->getPosition ().phi () ;
876 double en = RecHit->energy();
882 double r =
dR(eta_MC, phi_MC, eta, phi);
896 double maxE = -99999.;
907 for (
unsigned int i = 0;
i <
cen.size();
i++) {
920 int index = ieta * 72 + iphi;
929 if( sub == 1 && depth == 1) nhb1++;
930 if( sub == 1 && depth == 2) nhb2++;
931 if( sub == 2 && depth == 1) nhe1++;
932 if( sub == 2 && depth == 2) nhe2++;
933 if( sub == 2 && depth == 3) nhe3++;
934 if( sub == 3 && depth == 4) nho++;
935 if( sub == 4 && depth == 1) nhf1++;
936 if( sub == 4 && depth == 2) nhf2++;
939 if( en <
emap_min[ieta+41][iphi][depth-1][sub-1] )
940 emap_min[ieta+41][iphi][depth-1][sub-1] = en;
944 if(fabs(eta) > 3.) emin = 5.;
946 double r =
dR(eta_MC, phi_MC, eta, phi);
948 if(maxE < en && en > emin) {
969 if( depth == 1 || depth == 2 ) {
972 if (ieta1 < 0) ieta1--;
982 if (depth == 1 && sub == 1 ) {
989 if (depth == 2 && sub == 1) {
996 if (depth == 1 && sub == 2) {
1003 if (depth == 2 && sub == 2) {
1010 if (depth == 3 && sub == 2) {
1024 if (depth == 1 && sub == 4) {
1031 if (depth == 2 && sub == 4) {
1042 if (depth == 1) ehcal_coneMC_1 += en;
1043 if (depth == 2) ehcal_coneMC_2 += en;
1044 if (depth == 3) ehcal_coneMC_3 += en;
1045 if (depth == 4) ehcal_coneMC_4 += en;
1050 unsigned int isw67 = 0;
1051 for (
unsigned int isw = 0; isw < 32; isw++){
1052 statadd = 0x1<<(isw);
1053 if (stwd & statadd){
1059 if (isw == 6) isw67 += 1;
1060 if (isw == 7) isw67 += 2;
1066 for (
unsigned int isw =0; isw < 32; isw++){
1067 statadd = 0x1<<(isw);
1068 if( auxstwd & statadd ){
1092 Nhb->
Fill(
double(nhb1 + nhb2));
1093 Nhe->
Fill(
double(nhe1 + nhe2 + nhe3));
1095 Nhf->
Fill(
double(nhf1 + nhf2));
1112 for (
unsigned int i = 0;
i <
cen.size();
i++) {
1139 double clusEta = 999.;
1140 double clusPhi = 999.;
1143 double HcalCone_d1 = 0.;
1144 double HcalCone_d2 = 0.;
1145 double HcalCone_d3 = 0.;
1146 double HcalCone_d4 = 0.;
1147 double HcalCone = 0.;
1149 int ietaMax1 = 9999;
1150 int ietaMax2 = 9999;
1151 int ietaMax3 = 9999;
1152 int ietaMax4 = 9999;
1154 double enMax1 = -9999.;
1155 double enMax2 = -9999.;
1156 double enMax3 = -9999.;
1157 double enMax4 = -9999.;
1159 double etaMax = 9999.;
1170 for (
unsigned int i = 0;
i <
cen.size();
i++) {
1179 double rhot =
dR(etaHot, phiHot, eta, phi);
1180 if(rhot < partR && en > 1.) {
1181 clusEta = (clusEta * clusEn + eta * en)/(clusEn + en);
1182 clusPhi =
phi12(clusPhi, clusEn, phi, en);
1188 if(en > 1. ) nrechitsThresh++;
1190 double r =
dR(eta_MC, phi_MC, eta, phi);
1192 if(sub == 1) eHcalConeHB += en;
1193 if(sub == 2) eHcalConeHE += en;
1194 if(sub == 3) eHcalConeHO += en;
1197 if (depth == 1) eHcalConeHFL += en;
1198 else eHcalConeHFS += en;
1249 float eta_diff = fabs(eta_MC - eta);
1250 if(eta_diff < etaMax) {
1341 double phidev =
dPhiWsign(clusPhi, phi_MC);
1343 double etadev = clusEta - eta_MC;
1368 if(eHcalConeHF > eps ) {
1435 double maxES = -9999.;
1436 double etaHotS = 1000.;
1437 double phiHotS = 1000.;
1443 double enSimHits = 0.;
1444 double enSimHitsHB = 0.;
1445 double enSimHitsHE = 0.;
1446 double enSimHitsHO = 0.;
1447 double enSimHitsHF = 0.;
1448 double enSimHitsHFL = 0.;
1449 double enSimHitsHFS = 0.;
1452 for (std::vector<PCaloHit>::const_iterator SimHits = SimHitResult->begin () ; SimHits != SimHitResult->end(); ++SimHits) {
1456 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
1459 double en = SimHits->energy();
1462 if(fabs(etaS) > 3.) emin = 1.;
1464 double r =
dR(eta_MC, phi_MC, etaS, phiS);
1466 if(maxES < en && en > emin ) {
1475 if(sub == 1) enSimHitsHB += en;
1476 if(sub == 2) enSimHitsHE += en;
1477 if(sub == 3) enSimHitsHO += en;
1480 int depth = cell.depth();
1481 if(depth == 1) enSimHitsHFL += en;
1482 else enSimHitsHFS += en;
1490 double clusEta = 999.;
1491 double clusPhi = 999.;
1494 for (std::vector<PCaloHit>::const_iterator SimHits = SimHitResult->begin () ; SimHits != SimHitResult->end(); ++SimHits) {
1498 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
1499 double etaS = cellGeometry->getPosition().eta () ;
1500 double phiS = cellGeometry->getPosition().phi () ;
1501 double en = SimHits->energy();
1504 if(fabs(etaS) > 3.) emin = 1.;
1506 double rhot =
dR(etaHotS, phiHotS, etaS, phiS);
1507 if(rhot < partR && en > emin) {
1508 clusEta = (clusEta * clusEn + etaS * en)/(clusEn + en);
1509 clusPhi =
phi12(clusPhi, clusEn, phiS, en);
1518 double phidev =
dPhiWsign(clusPhi, phi_MC);
1520 double etadev = clusEta - eta_MC;
1526 if(eHcalConeHF > eps) {
1558 using namespace edm;
1578 if( subdet_ == 1 || subdet_ == 2 || subdet_ == 5 || subdet_ == 6 || subdet_ == 0) {
1587 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
1588 double eta = cellGeometry->getPosition().eta () ;
1589 double phi = cellGeometry->getPosition().phi () ;
1590 double zc = cellGeometry->getPosition().z ();
1591 int sub = cell.subdet();
1592 int depth = cell.depth();
1593 int inteta = cell.ieta();
1594 if(inteta > 0) inteta -= 1;
1595 int intphi = cell.iphi()-1;
1596 double en =
j->energy();
1597 double t =
j->time();
1598 int stwd =
j->flags();
1599 int auxstwd =
j->aux();
1608 if((
iz > 0 && eta > 0.) || (
iz < 0 && eta <0.) ||
iz == 0) {
1610 csub.push_back(sub);
1612 ceta.push_back(eta);
1613 cphi.push_back(phi);
1615 cieta.push_back(inteta);
1616 ciphi.push_back(intphi);
1619 cstwd.push_back(stwd);
1626 if( subdet_ == 4 || subdet_ == 5 || subdet_ == 6 || subdet_ == 0) {
1635 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
1636 double eta = cellGeometry->getPosition().eta () ;
1637 double phi = cellGeometry->getPosition().phi () ;
1638 double zc = cellGeometry->getPosition().z ();
1639 int sub = cell.subdet();
1640 int depth = cell.depth();
1641 int inteta = cell.ieta();
1642 if(inteta > 0) inteta -= 1;
1643 int intphi = cell.iphi()-1;
1644 double en =
j->energy();
1645 double t =
j->time();
1646 int stwd =
j->flags();
1647 int auxstwd =
j->aux();
1654 if((
iz > 0 && eta > 0.) || (
iz < 0 && eta <0.) ||
iz == 0) {
1656 csub.push_back(sub);
1658 ceta.push_back(eta);
1659 cphi.push_back(phi);
1661 cieta.push_back(inteta);
1662 ciphi.push_back(intphi);
1665 cstwd.push_back(stwd);
1672 if( subdet_ == 3 || subdet_ == 5 || subdet_ == 6 || subdet_ == 0) {
1680 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
1681 double eta = cellGeometry->getPosition().eta () ;
1682 double phi = cellGeometry->getPosition().phi () ;
1683 double zc = cellGeometry->getPosition().z ();
1684 int sub = cell.subdet();
1685 int depth = cell.depth();
1686 int inteta = cell.ieta();
1687 if(inteta > 0) inteta -= 1;
1688 int intphi = cell.iphi()-1;
1689 double t =
j->time();
1690 double en =
j->energy();
1691 int stwd =
j->flags();
1692 int auxstwd =
j->aux();
1699 if((
iz > 0 && eta > 0.) || (
iz < 0 && eta <0.) ||
iz == 0) {
1700 csub.push_back(sub);
1702 ceta.push_back(eta);
1703 cphi.push_back(phi);
1705 cieta.push_back(inteta);
1706 ciphi.push_back(intphi);
1709 cstwd.push_back(stwd);
1717 double PI = 3.1415926535898;
1718 double deltaphi= phi1 - phi2;
1719 if( phi2 > phi1 ) { deltaphi= phi2 - phi1;}
1720 if(deltaphi > PI) { deltaphi = 2.*PI - deltaphi;}
1721 double deltaeta = eta2 - eta1;
1722 double tmp =
sqrt(deltaeta* deltaeta + deltaphi*deltaphi);
1730 double PI = 3.1415926535898;
1731 double a1 = phi1;
double a2 = phi2;
1733 if( a1 > 0.5*PI && a2 < 0.) a2 += 2*
PI;
1734 if( a2 > 0.5*PI && a1 < 0.) a1 += 2*
PI;
1735 tmp = (a1 * en1 + a2 * en2)/(en1 + en2);
1736 if(tmp > PI) tmp -= 2.*
PI;
1746 double PI = 3.1415926535898;
1747 double a1 = phi1;
double a2 = phi2;
1748 double tmp = a2 - a1;
1750 if(a1 > 0.5 * PI) tmp += 2.*
PI;
1751 if(a2 > 0.5 * PI) tmp -= 2.*
PI;
1761 const uint32_t recHitFlag = hit->
flags();
1766 return severityLevel;
MonitorElement * emean_vs_ieta_HB2
MonitorElement * emap_depth2
MonitorElement * RMS_seq_HB1
MonitorElement * RMS_vs_ieta_HB1
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * emean_seqHE2
MonitorElement * occupancy_vs_ieta_HO
MonitorElement * meTimeHO
const HcalSeverityLevelComputer * theHcalSevLvlComputer
MonitorElement * meSumRecHitsEnergyConeHE
MonitorElement * occupancy_seqHB1
const HcalChannelQuality * theHcalChStatus
std::vector< PCaloHit > PCaloHitContainer
MonitorElement * occupancy_map_HB1
MonitorElement * occupancy_vs_ieta_HE3
MonitorElement * map_depth2
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hh_
MonitorElement * meRecHitsEnergyHF
MonitorElement * map_depth1
MonitorElement * meTE_High_HB
MonitorElement * occupancy_vs_ieta_HF1
MonitorElement * RMS_vs_ieta_HF1
HcalSubdetector subdet() const
get the subdetector
MonitorElement * ZS_seqHE3
double phi12(double phi1, double en1, double phi2, double en2)
MonitorElement * meDeltaPhiS
MonitorElement * bookProfile(Args &&...args)
const DetId & detid() const
std::vector< int > hcalHBSevLvlVec
MonitorElement * RMS_seq_HE2
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * meNumRecHitsConeHE
MonitorElement * meSumRecHitsEnergyConeHB
MonitorElement * meTEprofileHE_Low
std::string hcalselector_
#define DEFINE_FWK_MODULE(type)
MonitorElement * emap_depth4
std::vector< uint32_t > cstwd
MonitorElement * RMS_vs_ieta_HE3
MonitorElement * RecHit_Aux_StatusWord_HB
Geom::Phi< T > phi() const
MonitorElement * RMS_vs_ieta_HE1
MonitorElement * emean_vs_ieta_HB1
edm::EDGetTokenT< HFRecHitCollection > tok_hf_
std::vector< EcalRecHit >::const_iterator const_iterator
MonitorElement * occupancy_seqHO
MonitorElement * meTE_HB2
MonitorElement * ZS_seqHE1
MonitorElement * occupancy_seqHE3
MonitorElement * meEnConeEtaProfile
MonitorElement * RMS_seq_HB2
MonitorElement * occupancy_map_HE3
double dPhiWsign(double phi1, double phi2)
MonitorElement * meRecHitSimHitProfileHF
const Item * getValues(DetId fId, bool throwOnFail=true) const
MonitorElement * meEcalHcalEnergyHB
int hcalSevLvl(const CaloRecHit *hit)
MonitorElement * meRecHitSimHitProfileHFS
MonitorElement * meEnergyHcalVsEcalHE
MonitorElement * occupancy_map_HF1
MonitorElement * meEcalHcalEnergyConeHE
MonitorElement * meRecHitsEnergyHB
MonitorElement * meSumRecHitsEnergyHF
double emap_min[82][72][4][4]
MonitorElement * emap_depth1
MonitorElement * ZS_seqHB2
MonitorElement * meNumRecHitsConeHO
std::vector< double > ceta
MonitorElement * ZS_seqHO
std::string ecalselector_
MonitorElement * occupancy_seqHF2
MonitorElement * meNumRecHitsConeHB
MonitorElement * RMS_vs_ieta_HB2
MonitorElement * meRecHitSimHitHF
MonitorElement * meRecHitsEnergyHE
MonitorElement * occupancy_map_HE1
MonitorElement * meRecHitSimHitProfileHE
MonitorElement * RMS_seq_HE3
MonitorElement * ZS_seqHE2
MonitorElement * meSumRecHitsEnergyHB
edm::EDGetTokenT< HORecHitCollection > tok_ho_
MonitorElement * RMS_seq_HO
MonitorElement * meEnConeEtaProfile_E
MonitorElement * meDeltaEtaS
MonitorElement * meRecHitSimHitHB
MonitorElement * meRecHitSimHitHFS
MonitorElement * RMS_vs_ieta_HO
MonitorElement * meSumRecHitsEnergyConeHFS
MonitorElement * RecHit_Aux_StatusWord_HO
MonitorElement * RMS_seq_HE1
std::vector< double > cphi
MonitorElement * meTE_Low_HF
MonitorElement * meNumEcalRecHitsConeHB
MonitorElement * meNumRecHitsThreshHB
MonitorElement * meSumRecHitsEnergyHO
MonitorElement * meTE_Low_HB
std::vector< int > hcalHESevLvlVec
MonitorElement * meEnergyHcalVsEcalHB
MonitorElement * map_depth3
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * meTE_Low_HE
MonitorElement * RecHit_StatusWord_HF
MonitorElement * RecHit_Aux_StatusWord_HE
MonitorElement * emean_seqHE3
edm::ESHandle< CaloGeometry > geometry
MonitorElement * meSumRecHitsEnergyConeHO
MonitorElement * meTEprofileHB
MonitorElement * meTE_HFL
MonitorElement * ZS_seqHB1
MonitorElement * map_econe_depth1
MonitorElement * book1D(Args &&...args)
virtual void fillRecHitsTmp(int subdet_, edm::Event const &ev)
MonitorElement * map_depth4
MonitorElement * map_econe_depth4
double dR(double eta1, double phi1, double eta2, double phi2)
MonitorElement * emean_seqHF1
MonitorElement * emean_vs_ieta_HE3
MonitorElement * meNumRecHitsThreshHO
MonitorElement * meEcalHcalEnergyConeHB
MonitorElement * RMS_seq_HF2
MonitorElement * meNumRecHitsThreshHE
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
std::vector< int > hcalHFSevLvlVec
MonitorElement * meTimeHF
MonitorElement * occupancy_map_HE2
MonitorElement * occupancy_vs_ieta_HB2
MonitorElement * meSumRecHitsEnergyConeHF
MonitorElement * RecHit_Aux_StatusWord_HF
MonitorElement * meRecHitSimHitHO
MonitorElement * meRecHitSimHitProfileHB
MonitorElement * RecHit_StatusWord_HO
MonitorElement * meEnConeEtaProfile_depth1
MonitorElement * emean_vs_ieta_HF2
virtual void analyze(edm::Event const &ev, edm::EventSetup const &c)
MonitorElement * sevLvl_HE
MonitorElement * meTimeHB
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
MonitorElement * occupancy_map_HO
MonitorElement * meTE_HE2
MonitorElement * occupancy_vs_ieta_HE2
MonitorElement * meTEprofileHF_Low
edm::EDGetTokenT< EBRecHitCollection > tok_EB_
MonitorElement * occupancy_map_HF2
MonitorElement * RecHit_StatusWord_HF67
MonitorElement * meTEprofileHO_High
MonitorElement * meTEprofileHE
MonitorElement * emap_depth3
MonitorElement * occupancy_seqHB2
MonitorElement * occupancy_map_HB2
MonitorElement * meTE_HE1
void setCurrentFolder(const std::string &fullpath)
MonitorElement * RMS_vs_ieta_HE2
MonitorElement * meTE_HB1
T const * product() const
MonitorElement * meNumRecHitsConeHF
MonitorElement * book2D(Args &&...args)
MonitorElement * meTEprofileHF
MonitorElement * meEnConeEtaProfile_depth3
MonitorElement * emean_vs_ieta_HE1
MonitorElement * meRecHitSimHitProfileHO
MonitorElement * emean_seqHO
std::vector< int > hcalHOSevLvlVec
MonitorElement * emean_vs_ieta_HE2
MonitorElement * occupancy_vs_ieta_HF2
edm::EDGetTokenT< EERecHitCollection > tok_EE_
MonitorElement * map_ecal
std::vector< double > ctime
MonitorElement * emean_seqHE1
MonitorElement * map_econe_depth2
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
MonitorElement * RecHit_StatusWord_HE
MonitorElement * meEnConeEtaProfile_EH
MonitorElement * emean_seqHF2
MonitorElement * meRecHitSimHitProfileHFL
std::vector< int > cdepth
MonitorElement * meEnConeEtaProfile_depth2
MonitorElement * RMS_vs_ieta_HF2
std::vector< std::vector< double > > tmp
MonitorElement * meRecHitsEnergyHO
std::vector< uint32_t > cauxstwd
MonitorElement * sevLvl_HF
MonitorElement * emean_seqHB1
MonitorElement * meTE_HFS
MonitorElement * emean_vs_ieta_HO
MonitorElement * occupancy_seqHF1
MonitorElement * meSumRecHitsEnergyHE
MonitorElement * meRecHitSimHitHFL
MonitorElement * meSumRecHitsEnergyConeHFL
MonitorElement * meNumEcalRecHitsConeHE
MonitorElement * emean_seqHB2
MonitorElement * meTE_High_HO
MonitorElement * meEcalHcalEnergyHE
MonitorElement * emean_vs_ieta_HF1
MonitorElement * meTEprofileHO
MonitorElement * sevLvl_HO
MonitorElement * sevLvl_HB
MonitorElement * meTimeHE
MonitorElement * RMS_seq_HF1
MonitorElement * meDeltaPhi
edm::EDGetTokenT< edm::HepMCProduct > tok_evt_
MonitorElement * meDeltaEta
MonitorElement * meTEprofileHB_Low
MonitorElement * occupancy_vs_ieta_HB1
uint32_t getValue() const
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
MonitorElement * occupancy_seqHE2
MonitorElement * ZS_seqHF1
MonitorElement * meRecHitSimHitHE
HcalRecHitsValidation(edm::ParameterSet const &conf)
MonitorElement * map_econe_depth3
MonitorElement * occupancy_seqHE1
MonitorElement * meTEprofileHB_High
std::vector< double > cen
MonitorElement * meEnConeEtaProfile_depth4
MonitorElement * occupancy_vs_ieta_HE1
MonitorElement * RecHit_StatusWord_HB
MonitorElement * ZS_seqHF2