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);
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();
204 float deltaEta = etaClu-etaPho;
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 bool phoIsInEndcap=
false;
232 if ( fabs(matchingPho.
superCluster()->position().eta() ) < 1.479 ) {
241 float trueEta= (*p)->momentum().eta() ;
242 trueEta =
etaTransformation(trueEta, (*p)->production_vertex()->position().z()/10. );
245 float photonE = matchingPho.
energy();
246 float photonEt= matchingPho.
et() ;
247 float photonEta= matchingPho.
eta() ;
248 float photonPhi= matchingPho.
phi() ;
250 float r9 = matchingPho.
r9();
263 h1_deltaEta_ -> Fill( photonEta - (*p)->momentum().eta() );
264 h1_deltaPhi_ -> Fill( photonPhi - (*p)->momentum().phi() );
266 if ( phoIsInBarrel ) {
304 const float PI = 3.1415927;
308 const float R_ECAL = 136.5;
315 float ZEcal = R_ECAL*sinh(EtaParticle)+Zvertex;
317 if(ZEcal != 0.0) Theta = atan(R_ECAL/ZEcal);
318 if(Theta<0.0) Theta = Theta+
PI ;
321 if( fabs(ETA) > etaBarrelEndcap )
324 if(EtaParticle<0.0 ) Zend = -Zend ;
325 float Zlen = Zend - Zvertex ;
326 float RR = Zlen/sinh(EtaParticle);
327 Theta = atan(RR/Zend);
328 if(Theta<0.0) Theta = Theta+
PI ;
329 ETA = -
log(
tan(0.5*Theta));
TH1F * h1_pho_ecalIsoEndcap_
T getParameter(std::string const &) const
float hcalTowerSumEtConeDR04() const
Hcal isolation sum.
edm::InputTag barrelEcalHits_
float etaTransformation(float a, float b)
reco::SuperClusterRef superCluster() const
Retrieve photonCore attributes.
virtual double et() const
transverse energy
TH1F * h1_pho_ecalIsoBarrel_
double deltaPhi(float phi1, float phi2)
float trkSumPtSolidConeDR04() const
std::string vertexProducer_
float ecalRecHitSumEtConeDR04() const
std::string photonCollection_
TH1F * h1_pho_sigmaIetaIetaEndcap_
edm::InputTag endcapEcalHits_
virtual double eta() const
momentum pseudorapidity
virtual double energy() const
energy
edm::ESHandle< CaloTopology > theCaloTopo_
double dPhi(double phi1, double phi2)
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 &)
TH1F * h1_pho_hOverEEndcap_
Log< T >::type log(const T &t)
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 double phi() const
momentum azimuthal angle
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_