12 edm::LogInfo(
"OutputInfo") <<
" Hcal RecHit Task histograms will NOT be saved";
54 if (eventype_ ==
"multi")
etype_ = 2;
57 if(sign_ ==
"-")
iz = -1;
58 if(sign_ ==
"*")
iz = 0;
61 if(mc_ ==
"no")
imc = 0;
67 sprintf (histo,
"N_HB" );
69 sprintf (histo,
"N_HE" );
71 sprintf (histo,
"N_HO" );
73 sprintf (histo,
"N_HF" );
79 for (
unsigned int i1 = 0; i1 < 82; i1++) {
80 for (
unsigned int i2 = 0; i2 < 72; i2++) {
81 for (
unsigned int i3 = 0; i3 < 4; i3++) {
82 for (
unsigned int i4 = 0; i4 < 4; i4++) {
91 sprintf (histo,
"ZSmin_map_depth1" );
93 sprintf (histo,
"ZSmin_map_depth2" );
95 sprintf (histo,
"ZSmin_map_depth3" );
97 sprintf (histo,
"ZSmin_map_depth4" );
101 sprintf (histo,
"ZS_Nreco_HB1" );
103 sprintf (histo,
"ZS_Nreco_HB2" );
105 sprintf (histo,
"ZS_Nreco_HE1" );
107 sprintf (histo,
"ZS_Nreco_HE2" );
109 sprintf (histo,
"ZS_Nreco_HE3" );
111 sprintf (histo,
"ZS_Nreco_HO" );
113 sprintf (histo,
"ZS_Nreco_HF1" );
115 sprintf (histo,
"ZS_Nreco_HF2" );
118 sprintf (histo,
"ZSmin_simple1D_HB1" );
120 sprintf (histo,
"ZSmin_simple1D_HB2" );
122 sprintf (histo,
"ZSmin_simple1D_HE1" );
124 sprintf (histo,
"ZSmin_simple1D_HE2" );
126 sprintf (histo,
"ZSmin_simple1D_HE3" );
128 sprintf (histo,
"ZSmin_simple1D_HO" );
130 sprintf (histo,
"ZSmin_simple1D_HF1" );
132 sprintf (histo,
"ZSmin_simple1D_HF2" );
135 sprintf (histo,
"ZSmin_sequential1D_HB1" );
137 sprintf (histo,
"ZSmin_sequential1D_HB2" );
139 sprintf (histo,
"ZSmin_sequential1D_HE1" );
141 sprintf (histo,
"ZSmin_sequential1D_HE2" );
143 sprintf (histo,
"ZSmin_sequential1D_HE3" );
145 sprintf (histo,
"ZSmin_sequential1D_HO" );
147 sprintf (histo,
"ZSmin_sequential1D_HF1" );
149 sprintf (histo,
"ZSmin_sequential1D_HF2" );
157 sprintf (histo,
"emap_depth1" );
159 sprintf (histo,
"emap_depth2" );
161 sprintf (histo,
"emap_depth3" );
163 sprintf (histo,
"emap_depth4" );
168 if (ecalselector_ ==
"yes") {
169 sprintf (histo,
"map_ecal" );
170 map_ecal =
dbe_->
book2D(histo, histo, 70, -3.045, 3.045, 72, -3.1415926536, 3.1415926536);
175 sprintf (histo,
"emean_vs_ieta_HB1" );
177 sprintf (histo,
"emean_vs_ieta_HB2" );
179 sprintf (histo,
"emean_vs_ieta_HE1" );
181 sprintf (histo,
"emean_vs_ieta_HE2" );
183 sprintf (histo,
"emean_vs_ieta_HE3" );
185 sprintf (histo,
"emean_vs_ieta_HO" );
187 sprintf (histo,
"emean_vs_ieta_HF1" );
189 sprintf (histo,
"emean_vs_ieta_HF2" );
193 sprintf (histo,
"RMS_vs_ieta_HB1" );
195 sprintf (histo,
"RMS_vs_ieta_HB2" );
197 sprintf (histo,
"RMS_vs_ieta_HE1" );
199 sprintf (histo,
"RMS_vs_ieta_HE2" );
201 sprintf (histo,
"RMS_vs_ieta_HE3" );
203 sprintf (histo,
"RMS_vs_ieta_HO" );
205 sprintf (histo,
"RMS_vs_ieta_HF1" );
207 sprintf (histo,
"RMS_vs_ieta_HF2" );
211 sprintf (histo,
"emean_seq_HB1" );
213 sprintf (histo,
"emean_seq_HB2" );
215 sprintf (histo,
"emean_seq_HE1" );
217 sprintf (histo,
"emean_seq_HE2" );
219 sprintf (histo,
"emean_seq_HE3" );
221 sprintf (histo,
"emean_seq_HO" );
223 sprintf (histo,
"emean_seq_HF1" );
225 sprintf (histo,
"emean_seq_HF2" );
228 sprintf (histo,
"RMS_seq_HB1" );
230 sprintf (histo,
"RMS_seq_HB2" );
232 sprintf (histo,
"RMS_seq_HE1" );
234 sprintf (histo,
"RMS_seq_HE2" );
236 sprintf (histo,
"RMS_seq_HE3" );
238 sprintf (histo,
"RMS_seq_HO" );
240 sprintf (histo,
"RMS_seq_HF1" );
242 sprintf (histo,
"RMS_seq_HF2" );
248 sprintf (histo,
"occupancy_map_HB1" );
250 sprintf (histo,
"occupancy_map_HB2" );
252 sprintf (histo,
"occupancy_map_HE1" );
254 sprintf (histo,
"occupancy_map_HE2" );
256 sprintf (histo,
"occupancy_map_HE3" );
258 sprintf (histo,
"occupancy_map_HO" );
260 sprintf (histo,
"occupancy_map_HF1" );
262 sprintf (histo,
"occupancy_map_HF2" );
266 sprintf (histo,
"occupancy_vs_ieta_HB1" );
268 sprintf (histo,
"occupancy_vs_ieta_HB2" );
270 sprintf (histo,
"occupancy_vs_ieta_HE1" );
272 sprintf (histo,
"occupancy_vs_ieta_HE2" );
274 sprintf (histo,
"occupancy_vs_ieta_HE3" );
276 sprintf (histo,
"occupancy_vs_ieta_HO" );
278 sprintf (histo,
"occupancy_vs_ieta_HF1" );
280 sprintf (histo,
"occupancy_vs_ieta_HF2" );
285 sprintf (histo,
"occ_sequential1D_HB1" );
287 sprintf (histo,
"occ_sequential1D_HB2" );
289 sprintf (histo,
"occ_sequential1D_HE1" );
291 sprintf (histo,
"occ_sequential1D_HE2" );
293 sprintf (histo,
"occ_sequential1D_HE3" );
295 sprintf (histo,
"occ_sequential1D_HO" );
297 sprintf (histo,
"occ_sequential1D_HF1" );
299 sprintf (histo,
"occ_sequential1D_HF2" );
304 sprintf (histo,
"HcalRecHitTask_RecHit_StatusWord_HB" ) ;
307 sprintf (histo,
"HcalRecHitTask_RecHit_StatusWord_HE" ) ;
310 sprintf (histo,
"HcalRecHitTask_RecHit_StatusWord_HF" ) ;
314 sprintf (histo,
"HcalRecHitTask_RecHit_StatusWord_HF67" ) ;
317 sprintf (histo,
"HcalRecHitTask_RecHit_StatusWord_HO" ) ;
321 sprintf (histo,
"HcalRecHitTask_RecHit_Aux_StatusWord_HB" ) ;
324 sprintf (histo,
"HcalRecHitTask_RecHit_Aux_StatusWord_HE" ) ;
327 sprintf (histo,
"HcalRecHitTask_RecHit_Aux_StatusWord_HF" ) ;
330 sprintf (histo,
"HcalRecHitTask_RecHit_Aux_StatusWord_HO" ) ;
334 if(
imc !=0 && useAllHistos_) {
335 sprintf (histo,
"map_econe_depth1" );
337 dbe_->
book2D(histo, histo, 520, -5.2, 5.2, 72, -3.1415926536, 3.1415926536);
338 sprintf (histo,
"map_econe_depth2" );
340 dbe_->
book2D(histo, histo, 520, -5.2, 5.2, 72, -3.1415926536, 3.1415926536);
341 sprintf (histo,
"map_econe_depth3" );
343 dbe_->
book2D(histo, histo, 520, -5.2, 5.2, 72, -3.1415926536, 3.1415926536);
344 sprintf (histo,
"map_econe_depth4" );
346 dbe_->
book2D(histo, histo, 520, -5.2, 5.2, 72, -3.1415926536, 3.1415926536);
353 if(subdet_ != 0 &&
imc != 0) {
354 sprintf (histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths");
357 sprintf (histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths_E");
360 sprintf (histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths_EH");
365 if(subdet_ != 0 &&
imc != 0) {
369 sprintf (histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_depth1");
372 sprintf (histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_depth2");
375 sprintf (histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_depth3");
378 sprintf (histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_depth4");
383 if(
etype_ == 1 && subdet_ != 0) {
385 sprintf (histo,
"Delta_phi_cluster-MC");
388 sprintf (histo,
"Delta_eta_cluster-MC");
391 sprintf (histo,
"Delta_phi_simcluster-MC");
394 sprintf (histo,
"Delta_eta_simcluster-MC");
401 sprintf (histo,
"e_hb" ) ;
403 sprintf (histo,
"e_he" ) ;
405 sprintf (histo,
"e_ho" ) ;
407 sprintf (histo,
"e_hfl" ) ;
409 sprintf (histo,
"e_hfs" ) ;
414 if (subdet_ == 1 || subdet_ == 5 ){
418 if(
etype_ == 1 && subdet_ == 1 ) {
420 sprintf (histo,
"HcalRecHitTask_number_of_rechits_in_cone_HB" ) ;
423 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_in_cone_HB" ) ;
427 sprintf (histo,
"HcalRecHitTask_number_of_rechits_above_1GeV_HB");
430 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_HB" ) ;
433 if (ecalselector_ ==
"yes") {
435 sprintf (histo,
"HcalRecHitTask_number_of_ecalrechits_in_cone_HB");
437 sprintf (histo,
"HcalRecHitTask_energy_ecal_plus_hcal_in_cone_HB");
441 sprintf (histo,
"HcalRecHitTask_energy_hcal_vs_ecal_HB");
443 sprintf (histo,
"HcalRecHitTask_energy_ecal_plus_hcal_HB" ) ;
449 sprintf(histo,
"HcalRecHitTask_severityLevel_HB");
452 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_HB" ) ;
455 sprintf (histo,
"HcalRecHitTask_timing_HB" ) ;
459 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_Low_HB" ) ;
462 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HB" ) ;
465 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_High_HB" ) ;
468 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_Low_HB" ) ;
471 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_HB" ) ;
474 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_High_HB" ) ;
479 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HB_depth1" ) ;
482 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HB_depth2" ) ;
486 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HB");
488 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HB");
495 if ( subdet_ == 2 || subdet_ == 5 ){
499 if(
etype_ == 1 && subdet_ == 2 ) {
502 sprintf (histo,
"HcalRecHitTask_number_of_rechits_in_cone_HE" ) ;
505 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_in_cone_HE" ) ;
509 sprintf (histo,
"HcalRecHitTask_number_of_rechits_above_1GeV_HE");
512 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_HE" ) ;
515 if (ecalselector_ ==
"yes") {
516 sprintf (histo,
"HcalRecHitTask_energy_ecal_plus_hcal_HE" ) ;
519 sprintf (histo,
"HcalRecHitTask_energy_hcal_vs_ecal_HE");
522 sprintf (histo,
"HcalRecHitTask_number_of_ecalrechits_in_cone_HE");
524 sprintf (histo,
"HcalRecHitTask_energy_ecal_plus_hcal_in_cone_HE");
532 sprintf(histo,
"HcalRecHitTask_severityLevel_HE");
535 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_HE" ) ;
538 sprintf (histo,
"HcalRecHitTask_timing_HE" ) ;
541 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_Low_HE" ) ;
544 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HE" ) ;
547 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_Low_HE" ) ;
550 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_HE" ) ;
555 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HE_depth1" ) ;
558 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HE_depth2" ) ;
562 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HE");
564 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HE");
572 if ( subdet_ == 3 || subdet_ == 5 ){
576 if(
etype_ == 1 && subdet_ == 3) {
578 sprintf (histo,
"HcalRecHitTask_number_of_rechits_in_cone_HO" ) ;
581 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_in_cone_HO" ) ;
585 sprintf (histo,
"HcalRecHitTask_number_of_rechits_above_1GeV_HO");
588 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_HO" ) ;
593 sprintf(histo,
"HcalRecHitTask_severityLevel_HO");
596 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_HO" ) ;
599 sprintf (histo,
"HcalRecHitTask_timing_HO" ) ;
602 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HO" ) ;
605 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_High_HO" ) ;
608 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_HO" ) ;
611 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_High_HO" ) ;
617 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HO");
619 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HO");
626 if ( subdet_ == 4 || subdet_ == 5 ){
630 if(
etype_ == 1 && subdet_ == 4) {
633 sprintf (histo,
"HcalRecHitTask_number_of_rechits_in_cone_HF" ) ;
636 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_in_cone_HF" ) ;
639 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_in_cone_HFL" );
642 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_in_cone_HFS");
645 sprintf (histo,
"HcalRecHitTask_sum_of_rechits_energy_HF" ) ;
650 sprintf(histo,
"HcalRecHitTask_severityLevel_HF");
653 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_HF" ) ;
656 sprintf (histo,
"HcalRecHitTask_timing_HF" ) ;
659 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_Low_HF" ) ;
662 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HF" ) ;
665 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_Low_HF" ) ;
668 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_HF" ) ;
673 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HFL" ) ;
676 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HFS" ) ;
680 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HF");
682 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HFL");
684 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_HFS");
686 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HF");
688 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HFL");
690 sprintf (histo,
"HcalRecHitTask_energy_rechits_vs_simhits_profile_HFS");
716 double eHcalCone = 0.;
717 double eHcalConeHB = 0.;
718 double eHcalConeHE = 0.;
719 double eHcalConeHO = 0.;
720 double eHcalConeHF = 0.;
721 double eHcalConeHFL = 0.;
722 double eHcalConeHFS = 0.;
725 int nrechitsCone = 0;
726 int nrechitsThresh = 0;
732 double eEcalCone = 0.;
733 int numrechitsEcal = 0;
736 double phi_MC = -999999.;
737 double eta_MC = -999999.;
741 double ehcal_coneMC_1 = 0.;
742 double ehcal_coneMC_2 = 0.;
743 double ehcal_coneMC_3 = 0.;
744 double ehcal_coneMC_4 = 0.;
747 double searchR = 1.0;
752 double etaHot = 99999.;
753 double phiHot = 99999.;
765 std::cout <<
"no HepMCProduct found" << std::endl;
771 double maxPt = -99999.;
773 const HepMC::GenEvent * myGenEvent = evtMC->GetEvent();
774 for ( HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
775 p != myGenEvent->particles_end(); ++
p ) {
776 double phip = (*p)->momentum().phi();
777 double etap = (*p)->momentum().eta();
780 double pt = (*p)->momentum().perp();
781 if(pt > maxPt) { npart++; maxPt =
pt; phi_MC = phip; eta_MC = etap; }
845 for (; RecHit != RecHitEnd ; ++RecHit) {
849 geometry->getSubdetectorGeometry (EBid)->getGeometry (EBid) ;
850 double eta = cellGeometry->getPosition ().eta () ;
851 double phi = cellGeometry->getPosition ().phi () ;
852 double en = RecHit->energy();
858 double r =
dR(eta_MC, phi_MC, eta, phi);
870 RecHit = rhitEE.
product()->begin();
871 RecHitEnd = rhitEE.
product()->end();
873 for (; RecHit != RecHitEnd ; ++RecHit) {
877 geometry->getSubdetectorGeometry (EEid)->getGeometry (EEid) ;
878 double eta = cellGeometry->getPosition ().eta () ;
879 double phi = cellGeometry->getPosition ().phi () ;
880 double en = RecHit->energy();
886 double r =
dR(eta_MC, phi_MC, eta, phi);
900 double maxE = -99999.;
911 for (
unsigned int i = 0;
i <
cen.size();
i++) {
924 int index = ieta * 72 + iphi;
933 if( sub == 1 && depth == 1) nhb1++;
934 if( sub == 1 && depth == 2) nhb2++;
935 if( sub == 2 && depth == 1) nhe1++;
936 if( sub == 2 && depth == 2) nhe2++;
937 if( sub == 2 && depth == 3) nhe3++;
938 if( sub == 3 && depth == 4) nho++;
939 if( sub == 4 && depth == 1) nhf1++;
940 if( sub == 4 && depth == 2) nhf2++;
943 if( en <
emap_min[ieta+41][iphi][depth-1][sub-1] )
944 emap_min[ieta+41][iphi][depth-1][sub-1] = en;
948 if(fabs(eta) > 3.) emin = 5.;
950 double r =
dR(eta_MC, phi_MC, eta, phi);
952 if(maxE < en && en > emin) {
973 if( depth == 1 || depth == 2 ) {
976 if (ieta1 < 0) ieta1--;
986 if (depth == 1 && sub == 1 ) {
993 if (depth == 2 && sub == 1) {
1000 if (depth == 1 && sub == 2) {
1007 if (depth == 2 && sub == 2) {
1014 if (depth == 3 && sub == 2) {
1028 if (depth == 1 && sub == 4) {
1035 if (depth == 2 && sub == 4) {
1046 if (depth == 1) ehcal_coneMC_1 += en;
1047 if (depth == 2) ehcal_coneMC_2 += en;
1048 if (depth == 3) ehcal_coneMC_3 += en;
1049 if (depth == 4) ehcal_coneMC_4 += en;
1054 unsigned int isw67 = 0;
1055 for (
unsigned int isw = 0; isw < 32; isw++){
1056 statadd = 0x1<<(isw);
1057 if (stwd & statadd){
1063 if (isw == 6) isw67 += 1;
1064 if (isw == 7) isw67 += 2;
1070 for (
unsigned int isw =0; isw < 32; isw++){
1071 statadd = 0x1<<(isw);
1072 if( auxstwd & statadd ){
1096 Nhb->
Fill(
double(nhb1 + nhb2));
1097 Nhe->
Fill(
double(nhe1 + nhe2 + nhe3));
1099 Nhf->
Fill(
double(nhf1 + nhf2));
1116 for (
unsigned int i = 0;
i <
cen.size();
i++) {
1143 double clusEta = 999.;
1144 double clusPhi = 999.;
1147 double HcalCone_d1 = 0.;
1148 double HcalCone_d2 = 0.;
1149 double HcalCone_d3 = 0.;
1150 double HcalCone_d4 = 0.;
1151 double HcalCone = 0.;
1153 int ietaMax1 = 9999;
1154 int ietaMax2 = 9999;
1155 int ietaMax3 = 9999;
1156 int ietaMax4 = 9999;
1158 double enMax1 = -9999.;
1159 double enMax2 = -9999.;
1160 double enMax3 = -9999.;
1161 double enMax4 = -9999.;
1163 double etaMax = 9999.;
1174 for (
unsigned int i = 0;
i <
cen.size();
i++) {
1183 double rhot =
dR(etaHot, phiHot, eta, phi);
1184 if(rhot < partR && en > 1.) {
1185 clusEta = (clusEta * clusEn + eta * en)/(clusEn + en);
1186 clusPhi =
phi12(clusPhi, clusEn, phi, en);
1192 if(en > 1. ) nrechitsThresh++;
1194 double r =
dR(eta_MC, phi_MC, eta, phi);
1196 if(sub == 1) eHcalConeHB += en;
1197 if(sub == 2) eHcalConeHE += en;
1198 if(sub == 3) eHcalConeHO += en;
1201 if (depth == 1) eHcalConeHFL += en;
1202 else eHcalConeHFS += en;
1253 float eta_diff = fabs(eta_MC - eta);
1254 if(eta_diff < etaMax) {
1345 double phidev =
dPhiWsign(clusPhi, phi_MC);
1347 double etadev = clusEta - eta_MC;
1372 if(eHcalConeHF > eps ) {
1439 double maxES = -9999.;
1440 double etaHotS = 1000.;
1441 double phiHotS = 1000.;
1447 double enSimHits = 0.;
1448 double enSimHitsHB = 0.;
1449 double enSimHitsHE = 0.;
1450 double enSimHitsHO = 0.;
1451 double enSimHitsHF = 0.;
1452 double enSimHitsHFL = 0.;
1453 double enSimHitsHFS = 0.;
1456 for (std::vector<PCaloHit>::const_iterator SimHits = SimHitResult->begin () ; SimHits != SimHitResult->end(); ++SimHits) {
1460 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
1463 double en = SimHits->energy();
1466 if(fabs(etaS) > 3.) emin = 1.;
1468 double r =
dR(eta_MC, phi_MC, etaS, phiS);
1470 if(maxES < en && en > emin ) {
1479 if(sub == 1) enSimHitsHB += en;
1480 if(sub == 2) enSimHitsHE += en;
1481 if(sub == 3) enSimHitsHO += en;
1484 int depth = cell.depth();
1485 if(depth == 1) enSimHitsHFL += en;
1486 else enSimHitsHFS += en;
1494 double clusEta = 999.;
1495 double clusPhi = 999.;
1498 for (std::vector<PCaloHit>::const_iterator SimHits = SimHitResult->begin () ; SimHits != SimHitResult->end(); ++SimHits) {
1502 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
1503 double etaS = cellGeometry->getPosition().eta () ;
1504 double phiS = cellGeometry->getPosition().phi () ;
1505 double en = SimHits->energy();
1508 if(fabs(etaS) > 3.) emin = 1.;
1510 double rhot =
dR(etaHotS, phiHotS, etaS, phiS);
1511 if(rhot < partR && en > emin) {
1512 clusEta = (clusEta * clusEn + etaS * en)/(clusEn + en);
1513 clusPhi =
phi12(clusPhi, clusEn, phiS, en);
1522 double phidev =
dPhiWsign(clusPhi, phi_MC);
1524 double etadev = clusEta - eta_MC;
1530 if(eHcalConeHF > eps) {
1562 using namespace edm;
1582 if( subdet_ == 1 || subdet_ == 2 || subdet_ == 5 || subdet_ == 6 || subdet_ == 0) {
1591 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
1592 double eta = cellGeometry->getPosition().eta () ;
1593 double phi = cellGeometry->getPosition().phi () ;
1594 double zc = cellGeometry->getPosition().z ();
1595 int sub = cell.subdet();
1596 int depth = cell.depth();
1597 int inteta = cell.ieta();
1598 if(inteta > 0) inteta -= 1;
1599 int intphi = cell.iphi()-1;
1600 double en =
j->energy();
1601 double t =
j->time();
1602 int stwd =
j->flags();
1603 int auxstwd =
j->aux();
1612 if((
iz > 0 && eta > 0.) || (
iz < 0 && eta <0.) ||
iz == 0) {
1614 csub.push_back(sub);
1616 ceta.push_back(eta);
1617 cphi.push_back(phi);
1619 cieta.push_back(inteta);
1620 ciphi.push_back(intphi);
1623 cstwd.push_back(stwd);
1630 if( subdet_ == 4 || subdet_ == 5 || subdet_ == 6 || subdet_ == 0) {
1639 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
1640 double eta = cellGeometry->getPosition().eta () ;
1641 double phi = cellGeometry->getPosition().phi () ;
1642 double zc = cellGeometry->getPosition().z ();
1643 int sub = cell.subdet();
1644 int depth = cell.depth();
1645 int inteta = cell.ieta();
1646 if(inteta > 0) inteta -= 1;
1647 int intphi = cell.iphi()-1;
1648 double en =
j->energy();
1649 double t =
j->time();
1650 int stwd =
j->flags();
1651 int auxstwd =
j->aux();
1658 if((
iz > 0 && eta > 0.) || (
iz < 0 && eta <0.) ||
iz == 0) {
1660 csub.push_back(sub);
1662 ceta.push_back(eta);
1663 cphi.push_back(phi);
1665 cieta.push_back(inteta);
1666 ciphi.push_back(intphi);
1669 cstwd.push_back(stwd);
1676 if( subdet_ == 3 || subdet_ == 5 || subdet_ == 6 || subdet_ == 0) {
1684 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
1685 double eta = cellGeometry->getPosition().eta () ;
1686 double phi = cellGeometry->getPosition().phi () ;
1687 double zc = cellGeometry->getPosition().z ();
1688 int sub = cell.subdet();
1689 int depth = cell.depth();
1690 int inteta = cell.ieta();
1691 if(inteta > 0) inteta -= 1;
1692 int intphi = cell.iphi()-1;
1693 double t =
j->time();
1694 double en =
j->energy();
1695 int stwd =
j->flags();
1696 int auxstwd =
j->aux();
1703 if((
iz > 0 && eta > 0.) || (
iz < 0 && eta <0.) ||
iz == 0) {
1704 csub.push_back(sub);
1706 ceta.push_back(eta);
1707 cphi.push_back(phi);
1709 cieta.push_back(inteta);
1710 ciphi.push_back(intphi);
1713 cstwd.push_back(stwd);
1721 double PI = 3.1415926535898;
1722 double deltaphi= phi1 - phi2;
1723 if( phi2 > phi1 ) { deltaphi= phi2 - phi1;}
1724 if(deltaphi > PI) { deltaphi = 2.*PI - deltaphi;}
1725 double deltaeta = eta2 - eta1;
1726 double tmp =
sqrt(deltaeta* deltaeta + deltaphi*deltaphi);
1734 double PI = 3.1415926535898;
1735 double a1 = phi1;
double a2 = phi2;
1737 if( a1 > 0.5*PI && a2 < 0.) a2 += 2*
PI;
1738 if( a2 > 0.5*PI && a1 < 0.) a1 += 2*
PI;
1739 tmp = (a1 * en1 + a2 * en2)/(en1 + en2);
1740 if(tmp > PI) tmp -= 2.*
PI;
1750 double PI = 3.1415926535898;
1751 double a1 = phi1;
double a2 = phi2;
1752 double tmp = a2 - a1;
1754 if(a1 > 0.5 * PI) tmp += 2.*
PI;
1755 if(a2 > 0.5 * PI) tmp -= 2.*
PI;
1765 const uint32_t recHitFlag = hit->
flags();
1770 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 * 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
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
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::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
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
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
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
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
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
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
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
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