20 barrelRawSuperClusterCollectionToken_(
22 barrelCorSuperClusterCollectionToken_(
24 endcapRawSuperClusterCollectionToken_(
26 endcapPreSuperClusterCollectionToken_(
28 endcapCorSuperClusterCollectionToken_(
30 barrelRecHitCollectionToken_(
32 endcapRecHitCollectionToken_(
35 hsNumBC_(ps,
"NumBC"),
39 hsS1toS9_(ps,
"S1toS9"),
40 hsS25toE_(ps,
"S25toE"),
41 hsEoverTruth_(ps,
"EoverTruth"),
42 hsdeltaR_(ps,
"deltaR"),
43 hsphiWidth_(ps,
"phiWidth"),
44 hsetaWidth_(ps,
"etaWidth"),
45 hspreshowerE_(ps,
"preshowerE"),
47 hist_EB_RawSC_Size_(nullptr),
48 hist_EE_RawSC_Size_(nullptr),
49 hist_EB_CorSC_Size_(nullptr),
50 hist_EE_CorSC_Size_(nullptr),
51 hist_EE_PreSC_Size_(nullptr),
52 hist_EB_RawSC_NumBC_(nullptr),
53 hist_EE_RawSC_NumBC_(nullptr),
54 hist_EB_CorSC_NumBC_(nullptr),
55 hist_EE_CorSC_NumBC_(nullptr),
56 hist_EE_PreSC_NumBC_(nullptr),
57 hist_EB_RawSC_ET_(nullptr),
58 hist_EE_RawSC_ET_(nullptr),
59 hist_EB_CorSC_ET_(nullptr),
60 hist_EE_CorSC_ET_(nullptr),
61 hist_EE_PreSC_ET_(nullptr),
62 hist_EB_RawSC_Eta_(nullptr),
63 hist_EE_RawSC_Eta_(nullptr),
64 hist_EB_CorSC_Eta_(nullptr),
65 hist_EE_CorSC_Eta_(nullptr),
66 hist_EE_PreSC_Eta_(nullptr),
67 hist_EB_RawSC_Phi_(nullptr),
68 hist_EE_RawSC_Phi_(nullptr),
69 hist_EB_CorSC_Phi_(nullptr),
70 hist_EE_CorSC_Phi_(nullptr),
71 hist_EE_PreSC_Phi_(nullptr),
72 hist_EB_RawSC_S1toS9_(nullptr),
73 hist_EE_RawSC_S1toS9_(nullptr),
74 hist_EB_CorSC_S1toS9_(nullptr),
75 hist_EE_CorSC_S1toS9_(nullptr),
76 hist_EE_PreSC_S1toS9_(nullptr),
77 hist_EB_RawSC_S25toE_(nullptr),
78 hist_EE_RawSC_S25toE_(nullptr),
79 hist_EB_CorSC_S25toE_(nullptr),
80 hist_EE_CorSC_S25toE_(nullptr),
81 hist_EE_PreSC_S25toE_(nullptr),
82 hist_EB_RawSC_EoverTruth_(nullptr),
83 hist_EE_RawSC_EoverTruth_(nullptr),
84 hist_EB_CorSC_EoverTruth_(nullptr),
85 hist_EE_CorSC_EoverTruth_(nullptr),
86 hist_EE_PreSC_EoverTruth_(nullptr),
87 hist_EB_RawSC_deltaR_(nullptr),
88 hist_EE_RawSC_deltaR_(nullptr),
89 hist_EB_CorSC_deltaR_(nullptr),
90 hist_EE_CorSC_deltaR_(nullptr),
91 hist_EE_PreSC_deltaR_(nullptr),
92 hist_EE_PreSC_preshowerE_(nullptr),
93 hist_EE_CorSC_preshowerE_(nullptr),
94 hist_EE_CorSC_phiWidth_(nullptr),
95 hist_EB_CorSC_phiWidth_(nullptr),
96 hist_EE_CorSC_etaWidth_(nullptr),
97 hist_EB_CorSC_etaWidth_(nullptr),
98 hist_EB_CorSC_ET_vs_Eta_(nullptr),
99 hist_EB_CorSC_ET_vs_Phi_(nullptr),
100 hist_EE_CorSC_ET_vs_Eta_(nullptr),
101 hist_EE_CorSC_ET_vs_Phi_(nullptr),
102 hist_EE_CorSC_ET_vs_R_(nullptr) {}
125 "# of Basic Clusters in Raw Super Clusters in Barrel",
130 "# of Basic Clusters in Raw Super Clusters in Endcap",
135 "# of Basic Clusters in Corrected SuperClusters in Barrel",
140 "# of Basic Clusters in Corrected SuperClusters in Endcap",
145 "# of Basic Clusters in SuperClusters with Preshower in Endcap",
196 "S1/S9 of Corrected SuperClusters in Barrel",
201 "S1/S9 of Corrected SuperClusters in Endcap",
206 "S1/S9 of SuperClusters with Preshower in Endcap",
218 "S25/E of Corrected SuperClusters in Barrel",
223 "S25/E of Corrected SuperClusters in Endcap",
228 "S25/E of SuperClusters with Preshower in Endcap",
236 "E/True E of Raw SuperClusters in Barrel",
241 "E/True E of Raw SuperClusters in Endcap",
246 "E/True E of Corrected SuperClusters in Barrel",
251 "E/True E of Corrected SuperClusters in Endcap",
256 "E/True E of SuperClusters with Preshower in Endcap",
264 "dR to MC truth of Raw Super Clusters in Barrel",
269 "dR to MC truth of Raw Super Clusters in Endcap",
274 "dR to MC truth of Corrected SuperClusters in Barrel",
279 "dR to MC truth of Corrected SuperClusters in Endcap",
284 "dR to MC truth of SuperClusters with Preshower in Endcap",
291 "phiWidth of Corrected Super Clusters in Barrel",
296 "phiWidth of Corrected Super Clusters in Endcap",
303 "etaWidth of Corrected Super Clusters in Barrel",
308 "etaWidth of Corrected Super Clusters in Endcap",
315 "preshower energy in Super Clusters with Preshower in Endcap",
320 "preshower energy in Corrected Super Clusters with Preshower in Endcap",
327 "Corr Super Cluster ET versus Eta in Barrel",
336 "Corr Super Cluster ET versus Phi in Barrel",
345 "Corr Super Cluster ET versus Eta in Endcap",
354 "Corr Super Cluster ET versus Phi in Endcap",
363 "Corr Super Cluster ET versus Radius in Endcap",
374 bool skipBarrel =
false;
375 bool skipEndcap =
false;
383 edm::LogError(
"EgammaSuperClusters") <<
"Error! can't get MC collection ";
396 if (!pBarrelRawSuperClusters.
isValid()) {
397 edm::LogError(
"EgammaSuperClusters") <<
"Error! can't get collection Raw SC";
403 if (!pBarrelCorSuperClusters.
isValid()) {
404 edm::LogError(
"EgammaSuperClusters") <<
"Error! can't get collection Cor SC";
410 if (!pBarrelRecHitCollection.
isValid()) {
415 if (!pEndcapRecHitCollection.
isValid()) {
419 if (skipBarrel || skipEndcap)
433 for (reco::SuperClusterCollection::const_iterator aClus = barrelRawSuperClusters->begin();
434 aClus != barrelRawSuperClusters->end();
448 double dRClosest = 999.9;
449 double energyClosest = 0;
452 if (dRClosest < 0.1) {
459 for (reco::SuperClusterCollection::const_iterator aClus = barrelCorSuperClusters->begin();
460 aClus != barrelCorSuperClusters->end();
481 double dRClosest = 999.9;
482 double energyClosest = 0;
485 if (dRClosest < 0.1) {
496 if (!pEndcapRawSuperClusters.
isValid()) {
497 edm::LogError(
"EgammaSuperClusters") <<
"Error! can't get collection Raw EE SC";
502 if (!pEndcapPreSuperClusters.
isValid()) {
503 edm::LogError(
"EgammaSuperClusters") <<
"Error! can't get collection Pre EE SC";
508 if (!pEndcapCorSuperClusters.
isValid()) {
509 edm::LogError(
"EgammaSuperClusters") <<
"Error! can't get collection Cor EE SC";
523 for (reco::SuperClusterCollection::const_iterator aClus = endcapRawSuperClusters->begin();
524 aClus != endcapRawSuperClusters->end();
536 double dRClosest = 999.9;
537 double energyClosest = 0;
540 if (dRClosest < 0.1) {
547 for (reco::SuperClusterCollection::const_iterator aClus = endcapPreSuperClusters->begin();
548 aClus != endcapPreSuperClusters->end();
561 double dRClosest = 999.9;
562 double energyClosest = 0;
565 if (dRClosest < 0.1) {
572 for (reco::SuperClusterCollection::const_iterator aClus = endcapCorSuperClusters->begin();
573 aClus != endcapCorSuperClusters->end();
595 double dRClosest = 999.9;
596 double energyClosest = 0;
599 if (dRClosest < 0.1) {
612 double &energyClosest)
const {
614 double scEta = sc.
eta();
615 double scPhi = sc.
phi();
622 for (HepMC::GenEvent::particle_const_iterator currentParticle =
genEvent->particles_begin();
623 currentParticle !=
genEvent->particles_end();
625 if ((*currentParticle)->status() == 1) {
627 HepMC::FourVector
vtx = (*currentParticle)->production_vertex()->position();
628 double phiTrue = (*currentParticle)->momentum().phi();
629 double etaTrue =
ecalEta((*currentParticle)->momentum().eta(),
vtx.z() / 10.,
vtx.perp() / 10.);
632 double dEta = scEta - etaTrue;
637 energyClosest = (*currentParticle)->momentum().e();
649 const float R_ECAL = 136.5;
653 if (EtaParticle != 0.) {
655 float ZEcal = (
R_ECAL - plane_Radius) * sinh(EtaParticle) + Zvertex;
666 if (EtaParticle < 0.0)
668 float Zlen = Zend - Zvertex;
669 float RR = Zlen / sinh(EtaParticle);
670 Theta = atan((RR + plane_Radius) / Zend);
678 edm::LogWarning(
"") <<
"[EgammaSuperClusters::ecalEta] Warning: Eta equals "
679 "to zero, not correcting";