108 =
dbe_->
book1D(
"hist_EB_RawSC_Size_",
"# Raw SuperClusters in Barrel",
111 =
dbe_->
book1D(
"hist_EE_RawSC_Size_",
"# Raw SuperClusters in Endcap",
114 =
dbe_->
book1D(
"hist_EB_CorSC_Size_",
"# Corrected SuperClusters in Barrel",
117 =
dbe_->
book1D(
"hist_EE_CorSC_Size_",
"# Corrected SuperClusters in Endcap",
120 =
dbe_->
book1D(
"hist_EE_PreSC_Size_",
"# SuperClusters with Preshower in Endcap",
126 =
dbe_->
book1D(
"hist_EB_RawSC_NumBC_",
"# of Basic Clusters in Raw Super Clusters in Barrel",
129 =
dbe_->
book1D(
"hist_EE_RawSC_NumBC_",
"# of Basic Clusters in Raw Super Clusters in Endcap",
132 =
dbe_->
book1D(
"hist_EB_CorSC_NumBC_",
"# of Basic Clusters in Corrected SuperClusters in Barrel",
135 =
dbe_->
book1D(
"hist_EE_CorSC_NumBC_",
"# of Basic Clusters in Corrected SuperClusters in Endcap",
138 =
dbe_->
book1D(
"hist_EE_PreSC_NumBC_",
"# of Basic Clusters in SuperClusters with Preshower in Endcap",
144 =
dbe_->
book1D(
"hist_EB_RawSC_ET_",
"ET of Raw SuperClusters in Barrel",
147 =
dbe_->
book1D(
"hist_EE_RawSC_ET_",
"ET of Raw SuperClusters in Endcap",
150 =
dbe_->
book1D(
"hist_EB_CorSC_ET_",
"ET of Corrected SuperClusters in Barrel",
153 =
dbe_->
book1D(
"hist_EE_CorSC_ET_",
"ET of Corrected SuperClusters in Endcap",
156 =
dbe_->
book1D(
"hist_EE_PreSC_ET_",
"ET of SuperClusters with Preshower in Endcap",
162 =
dbe_->
book1D(
"hist_EB_RawSC_Eta_",
"Eta of Raw SuperClusters in Barrel",
165 =
dbe_->
book1D(
"hist_EE_RawSC_Eta_",
"Eta of Raw SuperClusters in Endcap",
168 =
dbe_->
book1D(
"hist_EB_CorSC_Eta_",
"Eta of Corrected SuperClusters in Barrel",
171 =
dbe_->
book1D(
"hist_EE_CorSC_Eta_",
"Eta of Corrected SuperClusters in Endcap",
174 =
dbe_->
book1D(
"hist_EE_PreSC_Eta_",
"Eta of SuperClusters with Preshower in Endcap",
180 =
dbe_->
book1D(
"hist_EB_RawSC_Phi_",
"Phi of Raw SuperClusters in Barrel",
183 =
dbe_->
book1D(
"hist_EE_RawSC_Phi_",
"Phi of Raw SuperClusters in Endcap",
186 =
dbe_->
book1D(
"hist_EB_CorSC_Phi_",
"Phi of Corrected SuperClusters in Barrel",
189 =
dbe_->
book1D(
"hist_EE_CorSC_Phi_",
"Phi of Corrected SuperClusters in Endcap",
192 =
dbe_->
book1D(
"hist_EE_PreSC_Phi_",
"Phi of SuperClusters with Preshower in Endcap",
198 =
dbe_->
book1D(
"hist_EB_RawSC_S1toS9_",
"S1/S9 of Raw Super Clusters in Barrel",
201 =
dbe_->
book1D(
"hist_EE_RawSC_S1toS9_",
"S1/S9 of Raw Super Clusters in Endcap",
204 =
dbe_->
book1D(
"hist_EB_CorSC_S1toS9_",
"S1/S9 of Corrected SuperClusters in Barrel",
207 =
dbe_->
book1D(
"hist_EE_CorSC_S1toS9_",
"S1/S9 of Corrected SuperClusters in Endcap",
210 =
dbe_->
book1D(
"hist_EE_PreSC_S1toS9_",
"S1/S9 of SuperClusters with Preshower in Endcap",
216 =
dbe_->
book1D(
"hist_EB_RawSC_S25toE_",
"S25/E of Raw Super Clusters in Barrel",
219 =
dbe_->
book1D(
"hist_EE_RawSC_S25toE_",
"S25/E of Raw Super Clusters in Endcap",
222 =
dbe_->
book1D(
"hist_EB_CorSC_S25toE_",
"S25/E of Corrected SuperClusters in Barrel",
225 =
dbe_->
book1D(
"hist_EE_CorSC_S25toE_",
"S25/E of Corrected SuperClusters in Endcap",
228 =
dbe_->
book1D(
"hist_EE_PreSC_S25toE_",
"S25/E of SuperClusters with Preshower in Endcap",
234 =
dbe_->
book1D(
"hist_EB_RawSC_EoverTruth_",
"E/True E of Raw SuperClusters in Barrel",
237 =
dbe_->
book1D(
"hist_EE_RawSC_EoverTruth_",
"E/True E of Raw SuperClusters in Endcap",
240 =
dbe_->
book1D(
"hist_EB_CorSC_EoverTruth_",
"E/True E of Corrected SuperClusters in Barrel",
243 =
dbe_->
book1D(
"hist_EE_CorSC_EoverTruth_",
"E/True E of Corrected SuperClusters in Endcap",
246 =
dbe_->
book1D(
"hist_EE_PreSC_EoverTruth_",
"E/True E of SuperClusters with Preshower in Endcap",
252 =
dbe_->
book1D(
"hist_EB_RawSC_deltaR_",
"dR to MC truth of Raw Super Clusters in Barrel",
255 =
dbe_->
book1D(
"hist_EE_RawSC_deltaR_",
"dR to MC truth of Raw Super Clusters in Endcap",
258 =
dbe_->
book1D(
"hist_EB_CorSC_deltaR_",
"dR to MC truth of Corrected SuperClusters in Barrel",
261 =
dbe_->
book1D(
"hist_EE_CorSC_deltaR_",
"dR to MC truth of Corrected SuperClusters in Endcap",
264 =
dbe_->
book1D(
"hist_EE_PreSC_deltaR_",
"dR to MC truth of SuperClusters with Preshower in Endcap",
269 =
dbe_->
book1D(
"hist_EB_CorSC_phiWidth_",
"phiWidth of Corrected Super Clusters in Barrel",
272 =
dbe_->
book1D(
"hist_EE_CorSC_phiWidth_",
"phiWidth of Corrected Super Clusters in Endcap",
277 =
dbe_->
book1D(
"hist_EB_CorSC_etaWidth_",
"etaWidth of Corrected Super Clusters in Barrel",
280 =
dbe_->
book1D(
"hist_EE_CorSC_etaWidth_",
"etaWidth of Corrected Super Clusters in Endcap",
286 =
dbe_->
book1D(
"hist_EE_PreSC_preshowerE_",
"preshower energy in Super Clusters with Preshower in Endcap",
289 =
dbe_->
book1D(
"hist_EE_CorSC_preshowerE_",
"preshower energy in Corrected Super Clusters with Preshower in Endcap",
321 bool skipBarrel =
false;
322 bool skipEndcap =
false;
330 edm::LogError(
"EgammaSuperClusters") <<
"Error! can't get MC collection ";
333 const HepMC::GenEvent*
genEvent = pMCTruth->GetEvent();
342 if (!pBarrelRawSuperClusters.
isValid()) {
343 edm::LogError(
"EgammaSuperClusters") <<
"Error! can't get collection Raw SC";
349 if (!pBarrelCorSuperClusters.
isValid()) {
350 edm::LogError(
"EgammaSuperClusters") <<
"Error! can't get collection Cor SC";
356 if ( ! pBarrelRecHitCollection.
isValid() ) {
361 if ( ! pEndcapRecHitCollection.
isValid() ) {
365 if( skipBarrel || skipEndcap )
return;
378 for(reco::SuperClusterCollection::const_iterator aClus = barrelRawSuperClusters->begin();
379 aClus != barrelRawSuperClusters->end(); aClus++)
393 double dRClosest = 999.9;
394 double energyClosest = 0;
407 for(reco::SuperClusterCollection::const_iterator aClus = barrelCorSuperClusters->begin();
408 aClus != barrelCorSuperClusters->end(); aClus++)
430 double dRClosest = 999.9;
431 double energyClosest = 0;
448 if (!pEndcapRawSuperClusters.
isValid()) {
449 edm::LogError(
"EgammaSuperClusters") <<
"Error! can't get collection Raw EE SC";
454 if (!pEndcapPreSuperClusters.
isValid()) {
455 edm::LogError(
"EgammaSuperClusters") <<
"Error! can't get collection Pre EE SC";
460 if (!pEndcapCorSuperClusters.
isValid()) {
461 edm::LogError(
"EgammaSuperClusters") <<
"Error! can't get collection Cor EE SC";
475 for(reco::SuperClusterCollection::const_iterator aClus = endcapRawSuperClusters->begin();
476 aClus != endcapRawSuperClusters->end(); aClus++)
488 double dRClosest = 999.9;
489 double energyClosest = 0;
501 for(reco::SuperClusterCollection::const_iterator aClus = endcapPreSuperClusters->begin();
502 aClus != endcapPreSuperClusters->end(); aClus++)
515 double dRClosest = 999.9;
516 double energyClosest = 0;
528 for(reco::SuperClusterCollection::const_iterator aClus = endcapCorSuperClusters->begin();
529 aClus != endcapCorSuperClusters->end(); aClus++)
552 double dRClosest = 999.9;
553 double energyClosest = 0;
575 double &dRClosest,
double &energyClosest)
579 double scEta = sc.
eta();
580 double scPhi = sc.
phi();
587 for(HepMC::GenEvent::particle_const_iterator currentParticle = genEvent->particles_begin();
588 currentParticle != genEvent->particles_end(); currentParticle++ )
590 if((*currentParticle)->status() == 1)
593 HepMC::FourVector vtx = (*currentParticle)->production_vertex()->position();
594 double phiTrue = (*currentParticle)->momentum().phi();
595 double etaTrue =
ecalEta((*currentParticle)->momentum().eta(), vtx.z()/10., vtx.perp()/10.);
598 double dEta = scEta - etaTrue;
601 if(deltaR < dRClosest)
604 energyClosest = (*currentParticle)->momentum().e();
619 const float R_ECAL = 136.5;
623 if(EtaParticle != 0.)
626 float ZEcal = (R_ECAL-plane_Radius)*sinh(EtaParticle)+Zvertex;
628 if(ZEcal != 0.0) Theta = atan(R_ECAL/ZEcal);
629 if(Theta<0.0) Theta = Theta+
Geom::pi() ;
633 if( fabs(ETA) > etaBarrelEndcap )
636 if(EtaParticle<0.0 ) Zend = -Zend ;
637 float Zlen = Zend - Zvertex ;
638 float RR = Zlen/sinh(EtaParticle);
639 Theta = atan((RR+plane_Radius)/Zend);
640 if(Theta<0.0) Theta = Theta+
Geom::pi() ;
641 ETA = -
log(
tan(0.5*Theta));
648 edm::LogWarning(
"") <<
"[EgammaSuperClusters::ecalEta] Warning: Eta equals to zero, not correcting" ;
T getParameter(std::string const &) const
MonitorElement * hist_EE_CorSC_ET_vs_Phi_
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * hist_EE_CorSC_ET_vs_R_
MonitorElement * hist_EE_PreSC_ET_
static std::vector< std::string > checklist log
edm::EDGetTokenT< reco::SuperClusterCollection > endcapRawSuperClusterCollectionToken_
MonitorElement * hist_EB_CorSC_ET_
MonitorElement * hist_EB_CorSC_NumBC_
MonitorElement * hist_EE_CorSC_etaWidth_
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * hist_EE_PreSC_EoverTruth_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * hist_EE_CorSC_Eta_
MonitorElement * hist_EB_RawSC_Size_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * hist_EE_RawSC_NumBC_
MonitorElement * hist_EB_RawSC_S1toS9_
MonitorElement * hist_EB_RawSC_ET_
MonitorElement * hist_EE_CorSC_EoverTruth_
MonitorElement * hist_EE_CorSC_deltaR_
double hist_min_preshowerE_
MonitorElement * hist_EB_RawSC_Phi_
MonitorElement * hist_EE_RawSC_ET_
double eta() const
pseudorapidity of cluster centroid
double hist_min_phiWidth_
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_
double hist_min_etaWidth_
MonitorElement * hist_EB_CorSC_S25toE_
double dPhi(double phi1, double phi2)
int hist_bins_EoverTruth_
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_
Tan< T >::type tan(const T &t)
MonitorElement * hist_EB_CorSC_ET_vs_Eta_
edm::EDGetTokenT< reco::SuperClusterCollection > barrelRawSuperClusterCollectionToken_
MonitorElement * hist_EB_CorSC_EoverTruth_
MonitorElement * hist_EB_CorSC_etaWidth_
void setVerbose(unsigned level)
MonitorElement * hist_EE_CorSC_ET_
double hist_max_etaWidth_
edm::EDGetTokenT< reco::SuperClusterCollection > endcapCorSuperClusterCollectionToken_
MonitorElement * hist_EE_PreSC_deltaR_
MonitorElement * hist_EE_CorSC_Size_
double deltaR(double eta1, double eta2, double phi1, double phi2)
double deltaPhi(double phi1, double phi2)
MonitorElement * hist_EE_PreSC_preshowerE_
double hist_max_phiWidth_
MonitorElement * hist_EB_CorSC_Phi_
float ecalEta(float EtaParticle, float Zvertex, float plane_Radius)
MonitorElement * hist_EB_CorSC_S1toS9_
double hist_min_EoverTruth_
MonitorElement * hist_EB_CorSC_Size_
MonitorElement * hist_EE_CorSC_Phi_
edm::EDGetTokenT< reco::SuperClusterCollection > barrelCorSuperClusterCollectionToken_
int hist_bins_preshowerE_
void closestMCParticle(const HepMC::GenEvent *genEvent, const reco::SuperCluster &sc, double &dRClosest, double &energyClosest)
MonitorElement * hist_EB_RawSC_EoverTruth_
static const float etaBarrelEndcap
T const * product() const
MonitorElement * hist_EE_RawSC_EoverTruth_
EgammaSuperClusters(const edm::ParameterSet &)
static const float Z_Endcap
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_
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
static const float R_ECAL
MonitorElement * hist_EE_RawSC_Size_
MonitorElement * hist_EE_CorSC_NumBC_
MonitorElement * hist_EE_CorSC_S25toE_
void showDirStructure(void) const
double phi() const
azimuthal angle of cluster centroid
MonitorElement * hist_EE_RawSC_S25toE_
edm::EDGetTokenT< EcalRecHitCollection > barrelRecHitCollectionToken_
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
MonitorElement * hist_EE_CorSC_ET_vs_Eta_
double hist_max_EoverTruth_
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)
void setCurrentFolder(const std::string &fullpath)
MonitorElement * hist_EB_RawSC_deltaR_
MonitorElement * hist_EE_RawSC_Phi_
MonitorElement * hist_EB_CorSC_ET_vs_Phi_
double hist_max_preshowerE_
MonitorElement * hist_EE_CorSC_phiWidth_