19 : MCTruthCollectionToken_(consumes<
edm::
HepMCProduct>(ps.getParameter<
edm::InputTag>(
"MCTruthCollection"))),
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"),
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),
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;
635 if (deltaR < dRClosest) {
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;
658 Theta = atan(R_ECAL / ZEcal);
664 if (fabs(ETA) > etaBarrelEndcap) {
666 if (EtaParticle < 0.0)
668 float Zlen = Zend - Zvertex;
669 float RR = Zlen / sinh(EtaParticle);
670 Theta = atan((RR + plane_Radius) / Zend);
673 ETA = -
log(
tan(0.5 * Theta));
678 edm::LogWarning(
"") <<
"[EgammaSuperClusters::ecalEta] Warning: Eta equals " 679 "to zero, not correcting";
constexpr double deltaPhi(double phi1, double phi2)
MonitorElement * hist_EE_CorSC_ET_vs_Phi_
MonitorElement * hist_EE_CorSC_ET_vs_R_
MonitorElement * hist_EE_PreSC_ET_
edm::EDGetTokenT< reco::SuperClusterCollection > endcapRawSuperClusterCollectionToken_
MonitorElement * hist_EB_CorSC_ET_
MonitorElement * hist_EB_CorSC_NumBC_
MonitorElement * hist_EE_CorSC_etaWidth_
MonitorElement * hist_EE_PreSC_EoverTruth_
MonitorElement * hist_EE_CorSC_Eta_
MonitorElement * hist_EB_RawSC_Size_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * hist_EE_RawSC_NumBC_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * hist_EB_RawSC_S1toS9_
MonitorElement * hist_EB_RawSC_ET_
MonitorElement * hist_EE_CorSC_EoverTruth_
MonitorElement * hist_EE_CorSC_deltaR_
MonitorElement * hist_EB_RawSC_Phi_
MonitorElement * hist_EE_RawSC_ET_
double eta() const
pseudorapidity of cluster centroid
float ecalEta(float, float, float) const
MonitorElement * hist_EB_CorSC_phiWidth_
MonitorElement * hist_EE_PreSC_S1toS9_
edm::EDGetTokenT< reco::SuperClusterCollection > endcapPreSuperClusterCollectionToken_
MonitorElement * hist_EB_RawSC_Eta_
MonitorElement * hist_EB_CorSC_deltaR_
MonitorElement * hist_EE_RawSC_S1toS9_
void setCurrentFolder(std::string const &fullpath)
MonitorElement * hist_EB_CorSC_S25toE_
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
MonitorElement * hist_EE_CorSC_S1toS9_
edm::EDGetTokenT< EcalRecHitCollection > endcapRecHitCollectionToken_
MonitorElement * hist_EE_RawSC_deltaR_
edm::EDGetTokenT< edm::HepMCProduct > MCTruthCollectionToken_
MonitorElement * hist_EE_PreSC_Phi_
~EgammaSuperClusters() override
MonitorElement * book1D(Args &&...args)
Tan< T >::type tan(const T &t)
static float etaBarrelEndcap
MonitorElement * hist_EB_CorSC_ET_vs_Eta_
edm::EDGetTokenT< reco::SuperClusterCollection > barrelRawSuperClusterCollectionToken_
MonitorElement * hist_EB_CorSC_EoverTruth_
MonitorElement * hist_EB_CorSC_etaWidth_
MonitorElement * hist_EE_CorSC_ET_
void analyze(const edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< reco::SuperClusterCollection > endcapCorSuperClusterCollectionToken_
MonitorElement * hist_EE_PreSC_deltaR_
MonitorElement * hist_EE_CorSC_Size_
MonitorElement * hist_EE_PreSC_preshowerE_
MonitorElement * hist_EB_CorSC_Phi_
const HepMC::GenEvent * GetEvent() const
T const * product() const
MonitorElement * hist_EB_CorSC_S1toS9_
MonitorElement * book2D(Args &&...args)
MonitorElement * hist_EB_CorSC_Size_
MonitorElement * hist_EE_CorSC_Phi_
edm::EDGetTokenT< reco::SuperClusterCollection > barrelCorSuperClusterCollectionToken_
MonitorElement * hist_EB_RawSC_EoverTruth_
MonitorElement * hist_EE_RawSC_EoverTruth_
EgammaSuperClusters(const edm::ParameterSet &)
MonitorElement * hist_EB_RawSC_S25toE_
MonitorElement * hist_EE_PreSC_Eta_
MonitorElement * hist_EB_CorSC_Eta_
MonitorElement * hist_EB_RawSC_NumBC_
MonitorElement * hist_EE_CorSC_preshowerE_
MonitorElement * hist_EE_RawSC_Size_
MonitorElement * hist_EE_CorSC_NumBC_
MonitorElement * hist_EE_CorSC_S25toE_
double phi() const
azimuthal angle of cluster centroid
MonitorElement * hist_EE_RawSC_S25toE_
edm::EDGetTokenT< EcalRecHitCollection > barrelRecHitCollectionToken_
MonitorElement * hist_EE_CorSC_ET_vs_Eta_
void closestMCParticle(HepMC::GenEvent const *, reco::SuperCluster const &, double &, double &) const
MonitorElement * hist_EE_PreSC_NumBC_
MonitorElement * hist_EE_PreSC_S25toE_
MonitorElement * hist_EE_RawSC_Eta_
MonitorElement * hist_EE_PreSC_Size_
Power< A, B >::type pow(const A &a, const B &b)
MonitorElement * hist_EB_RawSC_deltaR_
MonitorElement * hist_EE_RawSC_Phi_
MonitorElement * hist_EB_CorSC_ET_vs_Phi_
MonitorElement * hist_EE_CorSC_phiWidth_