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;
61 sprintf (histo,
"N_HB" );
63 sprintf (histo,
"N_HE" );
65 sprintf (histo,
"N_HO" );
67 sprintf (histo,
"N_HF" );
73 for (
unsigned int i1 = 0; i1 < 82; i1++) {
74 for (
unsigned int i2 = 0; i2 < 72; i2++) {
75 for (
unsigned int i3 = 0; i3 < 4; i3++) {
76 for (
unsigned int i4 = 0; i4 < 4; i4++) {
85 sprintf (histo,
"ZSmin_map_depth1" );
87 sprintf (histo,
"ZSmin_map_depth2" );
89 sprintf (histo,
"ZSmin_map_depth3" );
91 sprintf (histo,
"ZSmin_map_depth4" );
95 sprintf (histo,
"ZS_Nreco_HB1" );
97 sprintf (histo,
"ZS_Nreco_HB2" );
99 sprintf (histo,
"ZS_Nreco_HE1" );
101 sprintf (histo,
"ZS_Nreco_HE2" );
103 sprintf (histo,
"ZS_Nreco_HE3" );
105 sprintf (histo,
"ZS_Nreco_HO" );
107 sprintf (histo,
"ZS_Nreco_HF1" );
109 sprintf (histo,
"ZS_Nreco_HF2" );
112 sprintf (histo,
"ZSmin_simple1D_HB1" );
114 sprintf (histo,
"ZSmin_simple1D_HB2" );
116 sprintf (histo,
"ZSmin_simple1D_HE1" );
118 sprintf (histo,
"ZSmin_simple1D_HE2" );
120 sprintf (histo,
"ZSmin_simple1D_HE3" );
122 sprintf (histo,
"ZSmin_simple1D_HO" );
124 sprintf (histo,
"ZSmin_simple1D_HF1" );
126 sprintf (histo,
"ZSmin_simple1D_HF2" );
129 sprintf (histo,
"ZSmin_sequential1D_HB1" );
131 sprintf (histo,
"ZSmin_sequential1D_HB2" );
133 sprintf (histo,
"ZSmin_sequential1D_HE1" );
135 sprintf (histo,
"ZSmin_sequential1D_HE2" );
137 sprintf (histo,
"ZSmin_sequential1D_HE3" );
139 sprintf (histo,
"ZSmin_sequential1D_HO" );
141 sprintf (histo,
"ZSmin_sequential1D_HF1" );
143 sprintf (histo,
"ZSmin_sequential1D_HF2" );
151 sprintf (histo,
"emap_depth1" );
153 sprintf (histo,
"emap_depth2" );
155 sprintf (histo,
"emap_depth3" );
157 sprintf (histo,
"emap_depth4" );
162 if (ecalselector_ ==
"yes") {
163 sprintf (histo,
"map_ecal" );
164 map_ecal =
dbe_->
book2D(histo, histo, 70, -3.045, 3.045, 72, -3.1415926536, 3.1415926536);
169 sprintf (histo,
"emean_vs_ieta_HB1" );
171 sprintf (histo,
"emean_vs_ieta_HB2" );
173 sprintf (histo,
"emean_vs_ieta_HE1" );
175 sprintf (histo,
"emean_vs_ieta_HE2" );
177 sprintf (histo,
"emean_vs_ieta_HE3" );
179 sprintf (histo,
"emean_vs_ieta_HO" );
181 sprintf (histo,
"emean_vs_ieta_HF1" );
183 sprintf (histo,
"emean_vs_ieta_HF2" );
187 sprintf (histo,
"RMS_vs_ieta_HB1" );
189 sprintf (histo,
"RMS_vs_ieta_HB2" );
191 sprintf (histo,
"RMS_vs_ieta_HE1" );
193 sprintf (histo,
"RMS_vs_ieta_HE2" );
195 sprintf (histo,
"RMS_vs_ieta_HE3" );
197 sprintf (histo,
"RMS_vs_ieta_HO" );
199 sprintf (histo,
"RMS_vs_ieta_HF1" );
201 sprintf (histo,
"RMS_vs_ieta_HF2" );
205 sprintf (histo,
"emean_seq_HB1" );
207 sprintf (histo,
"emean_seq_HB2" );
209 sprintf (histo,
"emean_seq_HE1" );
211 sprintf (histo,
"emean_seq_HE2" );
213 sprintf (histo,
"emean_seq_HE3" );
215 sprintf (histo,
"emean_seq_HO" );
217 sprintf (histo,
"emean_seq_HF1" );
219 sprintf (histo,
"emean_seq_HF2" );
222 sprintf (histo,
"RMS_seq_HB1" );
224 sprintf (histo,
"RMS_seq_HB2" );
226 sprintf (histo,
"RMS_seq_HE1" );
228 sprintf (histo,
"RMS_seq_HE2" );
230 sprintf (histo,
"RMS_seq_HE3" );
232 sprintf (histo,
"RMS_seq_HO" );
234 sprintf (histo,
"RMS_seq_HF1" );
236 sprintf (histo,
"RMS_seq_HF2" );
242 sprintf (histo,
"occupancy_map_HB1" );
244 sprintf (histo,
"occupancy_map_HB2" );
246 sprintf (histo,
"occupancy_map_HE1" );
248 sprintf (histo,
"occupancy_map_HE2" );
250 sprintf (histo,
"occupancy_map_HE3" );
252 sprintf (histo,
"occupancy_map_HO" );
254 sprintf (histo,
"occupancy_map_HF1" );
256 sprintf (histo,
"occupancy_map_HF2" );
260 sprintf (histo,
"occupancy_vs_ieta_HB1" );
262 sprintf (histo,
"occupancy_vs_ieta_HB2" );
264 sprintf (histo,
"occupancy_vs_ieta_HE1" );
266 sprintf (histo,
"occupancy_vs_ieta_HE2" );
268 sprintf (histo,
"occupancy_vs_ieta_HE3" );
270 sprintf (histo,
"occupancy_vs_ieta_HO" );
272 sprintf (histo,
"occupancy_vs_ieta_HF1" );
274 sprintf (histo,
"occupancy_vs_ieta_HF2" );
279 sprintf (histo,
"occ_sequential1D_HB1" );
281 sprintf (histo,
"occ_sequential1D_HB2" );
283 sprintf (histo,
"occ_sequential1D_HE1" );
285 sprintf (histo,
"occ_sequential1D_HE2" );
287 sprintf (histo,
"occ_sequential1D_HE3" );
289 sprintf (histo,
"occ_sequential1D_HO" );
291 sprintf (histo,
"occ_sequential1D_HF1" );
293 sprintf (histo,
"occ_sequential1D_HF2" );
298 sprintf (histo,
"HcalRecHitTask_RecHit_StatusWord_HB" ) ;
301 sprintf (histo,
"HcalRecHitTask_RecHit_StatusWord_HE" ) ;
304 sprintf (histo,
"HcalRecHitTask_RecHit_StatusWord_HF" ) ;
308 sprintf (histo,
"HcalRecHitTask_RecHit_StatusWord_HF67" ) ;
311 sprintf (histo,
"HcalRecHitTask_RecHit_StatusWord_HO" ) ;
315 sprintf (histo,
"HcalRecHitTask_RecHit_Aux_StatusWord_HB" ) ;
318 sprintf (histo,
"HcalRecHitTask_RecHit_Aux_StatusWord_HE" ) ;
321 sprintf (histo,
"HcalRecHitTask_RecHit_Aux_StatusWord_HF" ) ;
324 sprintf (histo,
"HcalRecHitTask_RecHit_Aux_StatusWord_HO" ) ;
328 if(
imc !=0 && useAllHistos_) {
329 sprintf (histo,
"map_econe_depth1" );
331 dbe_->
book2D(histo, histo, 520, -5.2, 5.2, 72, -3.1415926536, 3.1415926536);
332 sprintf (histo,
"map_econe_depth2" );
334 dbe_->
book2D(histo, histo, 520, -5.2, 5.2, 72, -3.1415926536, 3.1415926536);
335 sprintf (histo,
"map_econe_depth3" );
337 dbe_->
book2D(histo, histo, 520, -5.2, 5.2, 72, -3.1415926536, 3.1415926536);
338 sprintf (histo,
"map_econe_depth4" );
340 dbe_->
book2D(histo, histo, 520, -5.2, 5.2, 72, -3.1415926536, 3.1415926536);
347 if(subdet_ != 0 &&
imc != 0) {
348 sprintf (histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths");
351 sprintf (histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths_E");
354 sprintf (histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths_EH");
359 if(subdet_ != 0 &&
imc != 0) {
363 sprintf (histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_depth1");
366 sprintf (histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_depth2");
369 sprintf (histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_depth3");
372 sprintf (histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_depth4");
377 if(
etype_ == 1 && subdet_ != 0) {
379 sprintf (histo,
"Delta_phi_cluster-MC");
382 sprintf (histo,
"Delta_eta_cluster-MC");
385 sprintf (histo,
"Delta_phi_simcluster-MC");
388 sprintf (histo,
"Delta_eta_simcluster-MC");
395 sprintf (histo,
"e_hb" ) ;
397 sprintf (histo,
"e_he" ) ;
399 sprintf (histo,
"e_ho" ) ;
401 sprintf (histo,
"e_hfl" ) ;
403 sprintf (histo,
"e_hfs" ) ;
408 if (subdet_ == 1 || subdet_ == 5 ){
412 if(
etype_ == 1 && subdet_ == 1 ) {
414 sprintf (histo,
"HcalRecHitTask_number_of_rechits_in_cone_HB" ) ;
417 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_in_cone_HB" ) ;
421 sprintf (histo,
"HcalRecHitTask_number_of_rechits_above_1GeV_HB");
424 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_HB" ) ;
427 if (ecalselector_ ==
"yes") {
429 sprintf (histo,
"HcalRecHitTask_number_of_ecalrechits_in_cone_HB");
431 sprintf (histo,
"HcalRecHitTask_energy_ecal_plus_hcal_in_cone_HB");
435 sprintf (histo,
"HcalRecHitTask_energy_hcal_vs_ecal_HB");
437 sprintf (histo,
"HcalRecHitTask_energy_ecal_plus_hcal_HB" ) ;
443 sprintf(histo,
"HcalRecHitTask_severityLevel_HB");
446 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_HB" ) ;
449 sprintf (histo,
"HcalRecHitTask_timing_HB" ) ;
453 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_Low_HB" ) ;
456 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HB" ) ;
459 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_High_HB" ) ;
462 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_Low_HB" ) ;
465 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_HB" ) ;
468 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_High_HB" ) ;
473 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HB_depth1" ) ;
476 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HB_depth2" ) ;
480 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HB");
482 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HB");
489 if ( subdet_ == 2 || subdet_ == 5 ){
493 if(
etype_ == 1 && subdet_ == 2 ) {
496 sprintf (histo,
"HcalRecHitTask_number_of_rechits_in_cone_HE" ) ;
499 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_in_cone_HE" ) ;
503 sprintf (histo,
"HcalRecHitTask_number_of_rechits_above_1GeV_HE");
506 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_HE" ) ;
509 if (ecalselector_ ==
"yes") {
510 sprintf (histo,
"HcalRecHitTask_energy_ecal_plus_hcal_HE" ) ;
513 sprintf (histo,
"HcalRecHitTask_energy_hcal_vs_ecal_HE");
516 sprintf (histo,
"HcalRecHitTask_number_of_ecalrechits_in_cone_HE");
518 sprintf (histo,
"HcalRecHitTask_energy_ecal_plus_hcal_in_cone_HE");
526 sprintf(histo,
"HcalRecHitTask_severityLevel_HE");
529 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_HE" ) ;
532 sprintf (histo,
"HcalRecHitTask_timing_HE" ) ;
535 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_Low_HE" ) ;
538 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HE" ) ;
541 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_Low_HE" ) ;
544 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_HE" ) ;
549 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HE_depth1" ) ;
552 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HE_depth2" ) ;
556 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HE");
558 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HE");
566 if ( subdet_ == 3 || subdet_ == 5 ){
570 if(
etype_ == 1 && subdet_ == 3) {
572 sprintf (histo,
"HcalRecHitTask_number_of_rechits_in_cone_HO" ) ;
575 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_in_cone_HO" ) ;
579 sprintf (histo,
"HcalRecHitTask_number_of_rechits_above_1GeV_HO");
582 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_HO" ) ;
587 sprintf(histo,
"HcalRecHitTask_severityLevel_HO");
590 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_HO" ) ;
593 sprintf (histo,
"HcalRecHitTask_timing_HO" ) ;
596 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HO" ) ;
599 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_High_HO" ) ;
602 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_HO" ) ;
605 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_High_HO" ) ;
611 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HO");
613 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HO");
620 if ( subdet_ == 4 || subdet_ == 5 ){
624 if(
etype_ == 1 && subdet_ == 4) {
627 sprintf (histo,
"HcalRecHitTask_number_of_rechits_in_cone_HF" ) ;
630 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_in_cone_HF" ) ;
633 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_in_cone_HFL" );
636 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_in_cone_HFS");
639 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_HF" ) ;
644 sprintf(histo,
"HcalRecHitTask_severityLevel_HF");
647 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_HF" ) ;
650 sprintf (histo,
"HcalRecHitTask_timing_HF" ) ;
653 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_Low_HF" ) ;
656 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HF" ) ;
659 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_Low_HF" ) ;
662 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_HF" ) ;
667 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HFL" ) ;
670 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HFS" ) ;
674 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HF");
676 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HFL");
678 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HFS");
680 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HF");
682 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HFL");
684 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.;
736 double ehcal_coneMC_1 = 0.;
737 double ehcal_coneMC_2 = 0.;
738 double ehcal_coneMC_3 = 0.;
739 double ehcal_coneMC_4 = 0.;
742 double searchR = 1.0;
747 double etaHot = 99999.;
748 double phiHot = 99999.;
763 std::cout <<
"no HepMCProduct found" << std::endl;
770 double maxPt = -99999.;
772 const HepMC::GenEvent * myGenEvent = evtMC->GetEvent();
773 for ( HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
774 p != myGenEvent->particles_end(); ++
p ) {
775 double phip = (*p)->momentum().phi();
776 double etap = (*p)->momentum().eta();
779 double pt = (*p)->momentum().perp();
780 if(pt > maxPt) { npart++; maxPt = pt; phi_MC = phip; eta_MC = etap; }
839 ev.
getByLabel(
"ecalRecHit",
"EcalRecHitsEB", rhitEB);
844 for (; RecHit != RecHitEnd ; ++RecHit) {
848 geometry->getSubdetectorGeometry (EBid)->getGeometry (EBid) ;
849 double eta = cellGeometry->getPosition ().eta () ;
850 double phi = cellGeometry->getPosition ().phi () ;
851 double en = RecHit->energy();
857 double r =
dR(eta_MC, phi_MC, eta, phi);
867 ev.
getByLabel(
"ecalRecHit",
"EcalRecHitsEE", rhitEE);
869 RecHit = rhitEE.
product()->begin();
870 RecHitEnd = rhitEE.
product()->end();
872 for (; RecHit != RecHitEnd ; ++RecHit) {
876 geometry->getSubdetectorGeometry (EEid)->getGeometry (EEid) ;
877 double eta = cellGeometry->getPosition ().eta () ;
878 double phi = cellGeometry->getPosition ().phi () ;
879 double en = RecHit->energy();
885 double r =
dR(eta_MC, phi_MC, eta, phi);
899 double maxE = -99999.;
910 for (
unsigned int i = 0;
i <
cen.size();
i++) {
923 int index = ieta * 72 + iphi;
932 if( sub == 1 && depth == 1) nhb1++;
933 if( sub == 1 && depth == 2) nhb2++;
934 if( sub == 2 && depth == 1) nhe1++;
935 if( sub == 2 && depth == 2) nhe2++;
936 if( sub == 2 && depth == 3) nhe3++;
937 if( sub == 3 && depth == 4) nho++;
938 if( sub == 4 && depth == 1) nhf1++;
939 if( sub == 4 && depth == 2) nhf2++;
942 if( en <
emap_min[ieta+41][iphi][depth-1][sub-1] )
943 emap_min[ieta+41][iphi][depth-1][sub-1] = en;
947 if(fabs(eta) > 3.) emin = 5.;
949 double r =
dR(eta_MC, phi_MC, eta, phi);
951 if(maxE < en && en > emin) {
974 if( depth == 1 || depth == 2 ) {
977 if (ieta1 < 0) ieta1--;
987 if (depth == 1 && sub == 1 ) {
994 if (depth == 2 && sub == 1) {
1001 if (depth == 1 && sub == 2) {
1008 if (depth == 2 && sub == 2) {
1015 if (depth == 3 && sub == 2) {
1029 if (depth == 1 && sub == 4) {
1036 if (depth == 2 && sub == 4) {
1047 if (depth == 1) ehcal_coneMC_1 += en;
1048 if (depth == 2) ehcal_coneMC_2 += en;
1049 if (depth == 3) ehcal_coneMC_3 += en;
1050 if (depth == 4) ehcal_coneMC_4 += en;
1055 unsigned int isw67 = 0;
1056 for (
unsigned int isw = 0; isw < 32; isw++){
1057 statadd = 0x1<<(isw);
1058 if (stwd & statadd){
1064 if (isw == 6) isw67 += 1;
1065 if (isw == 7) isw67 += 2;
1071 for (
unsigned int isw =0; isw < 32; isw++){
1072 statadd = 0x1<<(isw);
1073 if( auxstwd & statadd ){
1097 Nhb->
Fill(
double(nhb1 + nhb2));
1098 Nhe->
Fill(
double(nhe1 + nhe2 + nhe3));
1100 Nhf->
Fill(
double(nhf1 + nhf2));
1117 for (
unsigned int i = 0;
i <
cen.size();
i++) {
1144 double clusEta = 999.;
1145 double clusPhi = 999.;
1148 double HcalCone_d1 = 0.;
1149 double HcalCone_d2 = 0.;
1150 double HcalCone_d3 = 0.;
1151 double HcalCone_d4 = 0.;
1152 double HcalCone = 0.;
1154 int ietaMax1 = 9999;
1155 int ietaMax2 = 9999;
1156 int ietaMax3 = 9999;
1157 int ietaMax4 = 9999;
1159 double enMax1 = -9999.;
1160 double enMax2 = -9999.;
1161 double enMax3 = -9999.;
1162 double enMax4 = -9999.;
1175 for (
unsigned int i = 0;
i <
cen.size();
i++) {
1184 double rhot =
dR(etaHot, phiHot, eta, phi);
1185 if(rhot < partR && en > 1.) {
1186 clusEta = (clusEta * clusEn + eta * en)/(clusEn + en);
1187 clusPhi =
phi12(clusPhi, clusEn, phi, en);
1193 if(en > 1. ) nrechitsThresh++;
1195 double r =
dR(eta_MC, phi_MC, eta, phi);
1197 if(sub == 1) eHcalConeHB += en;
1198 if(sub == 2) eHcalConeHE += en;
1199 if(sub == 3) eHcalConeHO += en;
1202 if (depth == 1) eHcalConeHFL += en;
1203 else eHcalConeHFS += en;
1254 float eta_diff = fabs(eta_MC - eta);
1255 if(eta_diff < etaMax) {
1346 double phidev =
dPhiWsign(clusPhi, phi_MC);
1348 double etadev = clusEta - eta_MC;
1373 if(eHcalConeHF > eps ) {
1440 double maxES = -9999.;
1441 double etaHotS = 1000.;
1442 double phiHotS = 1000.;
1445 ev.
getByLabel(
"g4SimHits",
"HcalHits",hcalHits);
1448 double enSimHits = 0.;
1449 double enSimHitsHB = 0.;
1450 double enSimHitsHE = 0.;
1451 double enSimHitsHO = 0.;
1452 double enSimHitsHF = 0.;
1453 double enSimHitsHFL = 0.;
1454 double enSimHitsHFS = 0.;
1457 for (std::vector<PCaloHit>::const_iterator SimHits = SimHitResult->begin () ; SimHits != SimHitResult->end(); ++SimHits) {
1461 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
1464 double en = SimHits->energy();
1467 if(fabs(etaS) > 3.) emin = 1.;
1469 double r =
dR(eta_MC, phi_MC, etaS, phiS);
1471 if(maxES < en && en > emin ) {
1480 if(sub == 1) enSimHitsHB += en;
1481 if(sub == 2) enSimHitsHE += en;
1482 if(sub == 3) enSimHitsHO += en;
1485 int depth = cell.depth();
1486 if(depth == 1) enSimHitsHFL += en;
1487 else enSimHitsHFS += en;
1495 double clusEta = 999.;
1496 double clusPhi = 999.;
1499 for (std::vector<PCaloHit>::const_iterator SimHits = SimHitResult->begin () ; SimHits != SimHitResult->end(); ++SimHits) {
1503 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
1504 double etaS = cellGeometry->getPosition().eta () ;
1505 double phiS = cellGeometry->getPosition().phi () ;
1506 double en = SimHits->energy();
1509 if(fabs(etaS) > 3.) emin = 1.;
1511 double rhot =
dR(etaHotS, phiHotS, etaS, phiS);
1512 if(rhot < partR && en > emin) {
1513 clusEta = (clusEta * clusEn + etaS * en)/(clusEn + en);
1514 clusPhi =
phi12(clusPhi, clusEn, phiS, en);
1523 double phidev =
dPhiWsign(clusPhi, phi_MC);
1525 double etadev = clusEta - eta_MC;
1531 if(eHcalConeHF > eps) {
1563 using namespace edm;
1583 if( subdet_ == 1 || subdet_ == 2 || subdet_ == 5 || subdet_ == 6 || subdet_ == 0) {
1592 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
1593 double eta = cellGeometry->getPosition().eta () ;
1594 double phi = cellGeometry->getPosition().phi () ;
1595 double zc = cellGeometry->getPosition().z ();
1596 int sub = cell.subdet();
1597 int depth = cell.depth();
1598 int inteta = cell.ieta();
1599 if(inteta > 0) inteta -= 1;
1600 int intphi = cell.iphi()-1;
1601 double en =
j->energy();
1602 double t =
j->time();
1603 int stwd =
j->flags();
1604 int auxstwd =
j->aux();
1613 if((
iz > 0 && eta > 0.) || (
iz < 0 && eta <0.) ||
iz == 0) {
1615 csub.push_back(sub);
1617 ceta.push_back(eta);
1618 cphi.push_back(phi);
1620 cieta.push_back(inteta);
1621 ciphi.push_back(intphi);
1624 cstwd.push_back(stwd);
1631 if( subdet_ == 4 || subdet_ == 5 || subdet_ == 6 || subdet_ == 0) {
1640 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
1641 double eta = cellGeometry->getPosition().eta () ;
1642 double phi = cellGeometry->getPosition().phi () ;
1643 double zc = cellGeometry->getPosition().z ();
1644 int sub = cell.subdet();
1645 int depth = cell.depth();
1646 int inteta = cell.ieta();
1647 if(inteta > 0) inteta -= 1;
1648 int intphi = cell.iphi()-1;
1649 double en =
j->energy();
1650 double t =
j->time();
1651 int stwd =
j->flags();
1652 int auxstwd =
j->aux();
1659 if((
iz > 0 && eta > 0.) || (
iz < 0 && eta <0.) ||
iz == 0) {
1661 csub.push_back(sub);
1663 ceta.push_back(eta);
1664 cphi.push_back(phi);
1666 cieta.push_back(inteta);
1667 ciphi.push_back(intphi);
1670 cstwd.push_back(stwd);
1677 if( subdet_ == 3 || subdet_ == 5 || subdet_ == 6 || subdet_ == 0) {
1685 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
1686 double eta = cellGeometry->getPosition().eta () ;
1687 double phi = cellGeometry->getPosition().phi () ;
1688 double zc = cellGeometry->getPosition().z ();
1689 int sub = cell.subdet();
1690 int depth = cell.depth();
1691 int inteta = cell.ieta();
1692 if(inteta > 0) inteta -= 1;
1693 int intphi = cell.iphi()-1;
1694 double t =
j->time();
1695 double en =
j->energy();
1696 int stwd =
j->flags();
1697 int auxstwd =
j->aux();
1704 if((
iz > 0 && eta > 0.) || (
iz < 0 && eta <0.) ||
iz == 0) {
1705 csub.push_back(sub);
1707 ceta.push_back(eta);
1708 cphi.push_back(phi);
1710 cieta.push_back(inteta);
1711 ciphi.push_back(intphi);
1714 cstwd.push_back(stwd);
1722 double PI = 3.1415926535898;
1723 double deltaphi= phi1 - phi2;
1724 if( phi2 > phi1 ) { deltaphi= phi2 - phi1;}
1725 if(deltaphi > PI) { deltaphi = 2.*PI - deltaphi;}
1726 double deltaeta = eta2 - eta1;
1727 double tmp =
sqrt(deltaeta* deltaeta + deltaphi*deltaphi);
1735 double PI = 3.1415926535898;
1736 double a1 = phi1;
double a2 = phi2;
1738 if( a1 > 0.5*PI && a2 < 0.) a2 += 2*
PI;
1739 if( a2 > 0.5*PI && a1 < 0.) a1 += 2*
PI;
1740 tmp = (a1 * en1 + a2 * en2)/(en1 + en2);
1741 if(tmp > PI) tmp -= 2.*
PI;
1751 double PI = 3.1415926535898;
1752 double a1 = phi1;
double a2 = phi2;
1753 double tmp = a2 - a1;
1755 if(a1 > 0.5 * PI) tmp += 2.*
PI;
1756 if(a2 > 0.5 * PI) tmp -= 2.*
PI;
1766 const uint32_t recHitFlag = hit->
flags();
1771 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
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 * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * ZS_seqHE3
double phi12(double phi1, double en1, double phi2, double en2)
MonitorElement * meDeltaPhiS
const DetId & detid() const
std::vector< int > hcalHBSevLvlVec
MonitorElement * RMS_seq_HE2
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
std::vector< T >::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
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
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
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
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
edm::InputTag theHFRecHitCollectionLabel
std::vector< int > hcalHFSevLvlVec
MonitorElement * meTimeHF
MonitorElement * occupancy_map_HE2
MonitorElement * occupancy_vs_ieta_HB2
MonitorElement * meSumRecHitsEnergyConeHF
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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
MonitorElement * occupancy_map_HO
edm::InputTag theHORecHitCollectionLabel
MonitorElement * meTE_HE2
MonitorElement * occupancy_vs_ieta_HE2
MonitorElement * meTEprofileHF_Low
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
MonitorElement * RMS_vs_ieta_HE2
MonitorElement * meTE_HB1
MonitorElement * meNumRecHitsConeHF
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
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
T const * product() const
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
edm::InputTag theHBHERecHitCollectionLabel
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
MonitorElement * meDeltaEta
MonitorElement * meTEprofileHB_Low
MonitorElement * occupancy_vs_ieta_HB1
uint32_t getValue() const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
const Item * getValues(DetId fId) const
const GlobalPoint & getPosition() const
MonitorElement * occupancy_seqHE2
MonitorElement * ZS_seqHF1
MonitorElement * meRecHitSimHitHE
HcalRecHitsValidation(edm::ParameterSet const &conf)
MonitorElement * map_econe_depth3
MonitorElement * occupancy_seqHE1
MonitorElement * meTEprofileHB_High
void setCurrentFolder(const std::string &fullpath)
std::vector< double > cen
MonitorElement * meEnConeEtaProfile_depth4
MonitorElement * occupancy_vs_ieta_HE1
MonitorElement * RecHit_StatusWord_HB
MonitorElement * ZS_seqHF2