109 =
dbe_->
book1D(
"hist_EB_RawSC_Size_",
"# Raw SuperClusters in Barrel",
112 =
dbe_->
book1D(
"hist_EE_RawSC_Size_",
"# Raw SuperClusters in Endcap",
115 =
dbe_->
book1D(
"hist_EB_CorSC_Size_",
"# Corrected SuperClusters in Barrel",
118 =
dbe_->
book1D(
"hist_EE_CorSC_Size_",
"# Corrected SuperClusters in Endcap",
121 =
dbe_->
book1D(
"hist_EE_PreSC_Size_",
"# SuperClusters with Preshower in Endcap",
127 =
dbe_->
book1D(
"hist_EB_RawSC_NumBC_",
"# of Basic Clusters in Raw Super Clusters in Barrel",
130 =
dbe_->
book1D(
"hist_EE_RawSC_NumBC_",
"# of Basic Clusters in Raw Super Clusters in Endcap",
133 =
dbe_->
book1D(
"hist_EB_CorSC_NumBC_",
"# of Basic Clusters in Corrected SuperClusters in Barrel",
136 =
dbe_->
book1D(
"hist_EE_CorSC_NumBC_",
"# of Basic Clusters in Corrected SuperClusters in Endcap",
139 =
dbe_->
book1D(
"hist_EE_PreSC_NumBC_",
"# of Basic Clusters in SuperClusters with Preshower in Endcap",
145 =
dbe_->
book1D(
"hist_EB_RawSC_ET_",
"ET of Raw SuperClusters in Barrel",
148 =
dbe_->
book1D(
"hist_EE_RawSC_ET_",
"ET of Raw SuperClusters in Endcap",
151 =
dbe_->
book1D(
"hist_EB_CorSC_ET_",
"ET of Corrected SuperClusters in Barrel",
154 =
dbe_->
book1D(
"hist_EE_CorSC_ET_",
"ET of Corrected SuperClusters in Endcap",
157 =
dbe_->
book1D(
"hist_EE_PreSC_ET_",
"ET of SuperClusters with Preshower in Endcap",
163 =
dbe_->
book1D(
"hist_EB_RawSC_Eta_",
"Eta of Raw SuperClusters in Barrel",
166 =
dbe_->
book1D(
"hist_EE_RawSC_Eta_",
"Eta of Raw SuperClusters in Endcap",
169 =
dbe_->
book1D(
"hist_EB_CorSC_Eta_",
"Eta of Corrected SuperClusters in Barrel",
172 =
dbe_->
book1D(
"hist_EE_CorSC_Eta_",
"Eta of Corrected SuperClusters in Endcap",
175 =
dbe_->
book1D(
"hist_EE_PreSC_Eta_",
"Eta of SuperClusters with Preshower in Endcap",
181 =
dbe_->
book1D(
"hist_EB_RawSC_Phi_",
"Phi of Raw SuperClusters in Barrel",
184 =
dbe_->
book1D(
"hist_EE_RawSC_Phi_",
"Phi of Raw SuperClusters in Endcap",
187 =
dbe_->
book1D(
"hist_EB_CorSC_Phi_",
"Phi of Corrected SuperClusters in Barrel",
190 =
dbe_->
book1D(
"hist_EE_CorSC_Phi_",
"Phi of Corrected SuperClusters in Endcap",
193 =
dbe_->
book1D(
"hist_EE_PreSC_Phi_",
"Phi of SuperClusters with Preshower in Endcap",
199 =
dbe_->
book1D(
"hist_EB_RawSC_S1toS9_",
"S1/S9 of Raw Super Clusters in Barrel",
202 =
dbe_->
book1D(
"hist_EE_RawSC_S1toS9_",
"S1/S9 of Raw Super Clusters in Endcap",
205 =
dbe_->
book1D(
"hist_EB_CorSC_S1toS9_",
"S1/S9 of Corrected SuperClusters in Barrel",
208 =
dbe_->
book1D(
"hist_EE_CorSC_S1toS9_",
"S1/S9 of Corrected SuperClusters in Endcap",
211 =
dbe_->
book1D(
"hist_EE_PreSC_S1toS9_",
"S1/S9 of SuperClusters with Preshower in Endcap",
217 =
dbe_->
book1D(
"hist_EB_RawSC_S25toE_",
"S25/E of Raw Super Clusters in Barrel",
220 =
dbe_->
book1D(
"hist_EE_RawSC_S25toE_",
"S25/E of Raw Super Clusters in Endcap",
223 =
dbe_->
book1D(
"hist_EB_CorSC_S25toE_",
"S25/E of Corrected SuperClusters in Barrel",
226 =
dbe_->
book1D(
"hist_EE_CorSC_S25toE_",
"S25/E of Corrected SuperClusters in Endcap",
229 =
dbe_->
book1D(
"hist_EE_PreSC_S25toE_",
"S25/E of SuperClusters with Preshower in Endcap",
235 =
dbe_->
book1D(
"hist_EB_RawSC_EoverTruth_",
"E/True E of Raw SuperClusters in Barrel",
238 =
dbe_->
book1D(
"hist_EE_RawSC_EoverTruth_",
"E/True E of Raw SuperClusters in Endcap",
241 =
dbe_->
book1D(
"hist_EB_CorSC_EoverTruth_",
"E/True E of Corrected SuperClusters in Barrel",
244 =
dbe_->
book1D(
"hist_EE_CorSC_EoverTruth_",
"E/True E of Corrected SuperClusters in Endcap",
247 =
dbe_->
book1D(
"hist_EE_PreSC_EoverTruth_",
"E/True E of SuperClusters with Preshower in Endcap",
253 =
dbe_->
book1D(
"hist_EB_RawSC_deltaR_",
"dR to MC truth of Raw Super Clusters in Barrel",
256 =
dbe_->
book1D(
"hist_EE_RawSC_deltaR_",
"dR to MC truth of Raw Super Clusters in Endcap",
259 =
dbe_->
book1D(
"hist_EB_CorSC_deltaR_",
"dR to MC truth of Corrected SuperClusters in Barrel",
262 =
dbe_->
book1D(
"hist_EE_CorSC_deltaR_",
"dR to MC truth of Corrected SuperClusters in Endcap",
265 =
dbe_->
book1D(
"hist_EE_PreSC_deltaR_",
"dR to MC truth of SuperClusters with Preshower in Endcap",
270 =
dbe_->
book1D(
"hist_EB_CorSC_phiWidth_",
"phiWidth of Corrected Super Clusters in Barrel",
273 =
dbe_->
book1D(
"hist_EE_CorSC_phiWidth_",
"phiWidth of Corrected Super Clusters in Endcap",
278 =
dbe_->
book1D(
"hist_EB_CorSC_etaWidth_",
"etaWidth of Corrected Super Clusters in Barrel",
281 =
dbe_->
book1D(
"hist_EE_CorSC_etaWidth_",
"etaWidth of Corrected Super Clusters in Endcap",
287 =
dbe_->
book1D(
"hist_EE_PreSC_preshowerE_",
"preshower energy in Super Clusters with Preshower in Endcap",
290 =
dbe_->
book1D(
"hist_EE_CorSC_preshowerE_",
"preshower energy in Corrected Super Clusters with Preshower in Endcap",
322 bool skipBarrel =
false;
323 bool skipEndcap =
false;
331 edm::LogError(
"EgammaSuperClusters") <<
"Error! can't get collection with label "
335 const HepMC::GenEvent*
genEvent = pMCTruth->GetEvent();
344 if (!pBarrelRawSuperClusters.
isValid()) {
345 edm::LogError(
"EgammaSuperClusters") <<
"Error! can't get collection with label "
352 if (!pBarrelCorSuperClusters.
isValid()) {
353 edm::LogError(
"EgammaSuperClusters") <<
"Error! can't get collection with label "
360 if ( ! pBarrelRecHitCollection.
isValid() ) {
365 if ( ! pEndcapRecHitCollection.
isValid() ) {
369 if( skipBarrel || skipEndcap )
return;
382 for(reco::SuperClusterCollection::const_iterator aClus = barrelRawSuperClusters->begin();
383 aClus != barrelRawSuperClusters->end(); aClus++)
397 double dRClosest = 999.9;
398 double energyClosest = 0;
411 for(reco::SuperClusterCollection::const_iterator aClus = barrelCorSuperClusters->begin();
412 aClus != barrelCorSuperClusters->end(); aClus++)
434 double dRClosest = 999.9;
435 double energyClosest = 0;
452 if (!pEndcapRawSuperClusters.
isValid()) {
453 edm::LogError(
"EgammaSuperClusters") <<
"Error! can't get collection with label "
459 if (!pEndcapPreSuperClusters.
isValid()) {
460 edm::LogError(
"EgammaSuperClusters") <<
"Error! can't get collection with label "
466 if (!pEndcapCorSuperClusters.
isValid()) {
467 edm::LogError(
"EgammaSuperClusters") <<
"Error! can't get collection with label "
482 for(reco::SuperClusterCollection::const_iterator aClus = endcapRawSuperClusters->begin();
483 aClus != endcapRawSuperClusters->end(); aClus++)
495 double dRClosest = 999.9;
496 double energyClosest = 0;
508 for(reco::SuperClusterCollection::const_iterator aClus = endcapPreSuperClusters->begin();
509 aClus != endcapPreSuperClusters->end(); aClus++)
522 double dRClosest = 999.9;
523 double energyClosest = 0;
535 for(reco::SuperClusterCollection::const_iterator aClus = endcapCorSuperClusters->begin();
536 aClus != endcapCorSuperClusters->end(); aClus++)
559 double dRClosest = 999.9;
560 double energyClosest = 0;
582 double &dRClosest,
double &energyClosest)
586 double scEta = sc.
eta();
587 double scPhi = sc.
phi();
594 for(HepMC::GenEvent::particle_const_iterator currentParticle = genEvent->particles_begin();
595 currentParticle != genEvent->particles_end(); currentParticle++ )
597 if((*currentParticle)->status() == 1)
600 HepMC::FourVector vtx = (*currentParticle)->production_vertex()->position();
601 double phiTrue = (*currentParticle)->momentum().phi();
602 double etaTrue =
ecalEta((*currentParticle)->momentum().eta(), vtx.z()/10., vtx.perp()/10.);
605 double dEta = scEta - etaTrue;
608 if(deltaR < dRClosest)
611 energyClosest = (*currentParticle)->momentum().e();
626 const float R_ECAL = 136.5;
630 if(EtaParticle != 0.)
633 float ZEcal = (R_ECAL-plane_Radius)*sinh(EtaParticle)+Zvertex;
635 if(ZEcal != 0.0) Theta = atan(R_ECAL/ZEcal);
636 if(Theta<0.0) Theta = Theta+
Geom::pi() ;
640 if( fabs(ETA) > etaBarrelEndcap )
643 if(EtaParticle<0.0 ) Zend = -Zend ;
644 float Zlen = Zend - Zvertex ;
645 float RR = Zlen/sinh(EtaParticle);
646 Theta = atan((RR+plane_Radius)/Zend);
647 if(Theta<0.0) Theta = Theta+
Geom::pi() ;
648 ETA = -
log(
tan(0.5*Theta));
655 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_
edm::InputTag barrelRawSuperClusterCollection_
MonitorElement * hist_EB_CorSC_ET_
edm::InputTag endcapCorSuperClusterCollection_
edm::InputTag MCTruthCollection_
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_
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_
MonitorElement * hist_EB_RawSC_Eta_
MonitorElement * hist_EB_CorSC_deltaR_
MonitorElement * hist_EE_RawSC_S1toS9_
double hist_min_etaWidth_
edm::InputTag endcapRecHitCollection_
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_
MonitorElement * hist_EE_RawSC_deltaR_
MonitorElement * hist_EE_PreSC_Phi_
Tan< T >::type tan(const T &t)
MonitorElement * hist_EB_CorSC_ET_vs_Eta_
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
MonitorElement * hist_EB_CorSC_EoverTruth_
MonitorElement * hist_EB_CorSC_etaWidth_
void setVerbose(unsigned level)
edm::InputTag endcapRawSuperClusterCollection_
MonitorElement * hist_EE_CorSC_ET_
double hist_max_etaWidth_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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_
edm::InputTag barrelCorSuperClusterCollection_
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_
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_
edm::InputTag barrelRecHitCollection_
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_
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_
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_
edm::InputTag endcapPreSuperClusterCollection_
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_