26 #include "CLHEP/Units/GlobalPhysicalConstants.h"
107 effEta_ = fs->
make<TProfile> (
"effEta",
" Photon reconstruction efficiency",50,-2.5,2.5);
108 effPhi_ = fs->
make<TProfile> (
"effPhi",
" Photon reconstruction efficiency",80, -3.14, 3.14);
110 h1_deltaEta_ = fs->
make<TH1F>(
"deltaEta",
" Reco photon Eta minus Generated photon Eta ",100,-0.2, 0.2);
114 h1_pho_E_ = fs->
make<TH1F>(
"phoE",
"Photon Energy ",100,loE,hiE);
118 h1_deltaEtaSC_ = fs->
make<TH1F>(
"deltaEtaSC",
" SC Eta minus Generated photon Eta ",100,-0.02, 0.02);
121 h1_recEoverTrueEBarrel_ = fs->
make<TH1F>(
"recEoverTrueEBarrel",
" Reco photon Energy over Generated photon Energy: Barrel ",100,loRes, hiRes);
122 h1_recEoverTrueEEndcap_ = fs->
make<TH1F>(
"recEoverTrueEEndcap",
" Reco photon Energy over Generated photon Energy: Endcap ",100,loRes, hiRes);
126 h1_pho_R9Barrel_ = fs->
make<TH1F>(
"phoR9Barrel",
"Photon 3x3 energy / SuperCluster energy : Barrel ",100,0.,1.2);
127 h1_pho_R9Endcap_ = fs->
make<TH1F>(
"phoR9Endcap",
"Photon 3x3 energy / SuperCluster energy : Endcap ",100,0.,1.2);
152 edm::LogInfo(
"PhotonAnalyzer") <<
"Analyzing event number: " << evt.
id() <<
"\n";
169 const HepMC::GenEvent * myGenEvent = hepProd->GetEvent();
172 for ( HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
p != myGenEvent->particles_end(); ++
p ) {
173 if ( !( (*p)->pdg_id() == 22 && (*p)->status()==1 ) )
continue;
177 if ( (*p)->production_vertex() ) {
178 if ( (*p)->production_vertex()->particles_begin(
HepMC::parents) !=
180 mother = *((*p)->production_vertex()->particles_begin(
HepMC::parents));
182 if ( ((mother == 0) || ((mother != 0) && (mother->pdg_id() == 25))
183 || ((mother != 0) && (mother->pdg_id() == 22)))) {
185 float minDelta=10000.;
186 std::vector<reco::Photon> localPhotons;
190 float phiPho=(*p)->momentum().phi();
191 float etaPho=(*p)->momentum().eta();
192 etaPho =
etaTransformation(etaPho, (*p)->production_vertex()->position().z()/10. );
196 for( reco::PhotonCollection::const_iterator iPho = photonCollection.begin(); iPho != photonCollection.end(); iPho++) {
198 localPhotons.push_back(localPho);
201 float phiClu=localPho.
phi();
202 float etaClu=localPho.
eta();
206 if ( deltaPhi >
pi ) deltaPhi -= twopi;
207 if ( deltaPhi < -
pi) deltaPhi += twopi;
211 if ( delta<0.1 && delta < minDelta ) {
220 if ( iMatch>-1 ) matched =
true;
230 bool phoIsInBarrel=
false;
231 if ( fabs(matchingPho.
superCluster()->position().eta() ) < 1.479 ) {
238 float trueEta= (*p)->momentum().eta() ;
239 trueEta =
etaTransformation(trueEta, (*p)->production_vertex()->position().z()/10. );
242 float photonE = matchingPho.
energy();
243 float photonEt= matchingPho.
et() ;
244 float photonEta= matchingPho.
eta() ;
245 float photonPhi= matchingPho.
phi() ;
247 float r9 = matchingPho.
r9();
263 if ( phoIsInBarrel ) {
301 const float PI = 3.1415927;
305 const float R_ECAL = 136.5;
312 float ZEcal = R_ECAL*sinh(EtaParticle)+Zvertex;
314 if(ZEcal != 0.0) Theta = atan(R_ECAL/ZEcal);
315 if(Theta<0.0) Theta = Theta+
PI ;
318 if( fabs(ETA) > etaBarrelEndcap )
321 if(EtaParticle<0.0 ) Zend = -Zend ;
322 float Zlen = Zend - Zvertex ;
323 float RR = Zlen/sinh(EtaParticle);
324 Theta = atan(RR/Zend);
325 if(Theta<0.0) Theta = Theta+
PI ;
326 ETA = -
log(
tan(0.5*Theta));
TH1F * h1_pho_ecalIsoEndcap_
virtual double energy() const GCC11_FINAL
energy
T getParameter(std::string const &) const
virtual double et() const GCC11_FINAL
transverse energy
float hcalTowerSumEtConeDR04() const
Hcal isolation sum.
edm::InputTag barrelEcalHits_
float etaTransformation(float a, float b)
TH1F * h1_pho_ecalIsoBarrel_
float trkSumPtSolidConeDR04() const
std::string vertexProducer_
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
float ecalRecHitSumEtConeDR04() const
std::string photonCollection_
TH1F * h1_pho_sigmaIetaIetaEndcap_
edm::InputTag endcapEcalHits_
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
edm::ESHandle< CaloTopology > theCaloTopo_
double dPhi(double phi1, double phi2)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
float sigmaIetaIeta() const
TH1F * h1_pho_hcalIsoEndcap_
Tan< T >::type tan(const T &t)
TH1F * h1_pho_trkIsoEndcap_
float hadronicOverEm() const
the total hadronic over electromagnetic fraction
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
SimplePhotonAnalyzer(const edm::ParameterSet &)
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
TH1F * h1_pho_hOverEEndcap_
TH1F * h1_pho_trkIsoBarrel_
std::vector< Photon > PhotonCollection
collectin of Photon objects
static const float etaBarrelEndcap
static const float Z_Endcap
TH1F * h1_pho_sigmaIetaIetaBarrel_
T * make() const
make new ROOT object
static const float R_ECAL
TH1F * h1_pho_hOverEBarrel_
TH1F * h1_pho_hcalIsoBarrel_
TH1F * h1_recEoverTrueEEndcap_
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Power< A, B >::type pow(const A &a, const B &b)
std::string photonCollectionProducer_
TH1F * h1_recEoverTrueEBarrel_