|
|
Go to the documentation of this file.
29 #include "CLHEP/Units/GlobalPhysicalConstants.h"
116 "recEoverTrueEBarrel",
" Reco photon Energy over Generated photon Energy: Barrel ", 100, loRes,
hiRes);
118 "recEoverTrueEEndcap",
" Reco photon Energy over Generated photon Energy: Endcap ", 100, loRes,
hiRes);
141 edm::LogInfo(
"PhotonAnalyzer") <<
"Analyzing event number: " << evt.
id() <<
"\n";
160 if (!pfCandidateHandle.
isValid()) {
167 if (!pfCandToPhotonMapHandle.
isValid()) {
168 edm::LogInfo(
"SimplePhotonAnalyzer") <<
"Error! Can't get the product: valueMapPhotons " << std::endl;
170 pfCandToPhotonMap = *(pfCandToPhotonMapHandle.
product());
172 std::cout <<
" SimplePhotonAnalyzer valueMap size" << pfCandToPhotonMap.
size() << std::endl;
173 unsigned nObj = pfCandidateHandle->size();
174 for (
unsigned int lCand = 0; lCand < nObj; lCand++) {
180 std::cout <<
" PF SC " << pfCandRef->superClusterRef()->energy() <<
" Photon SC "
181 << myPho->superCluster()->energy() << std::endl;
184 for (HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
p != myGenEvent->particles_end();
186 if (!((*p)->pdg_id() == 22 && (*p)->status() == 1))
191 if ((*p)->production_vertex()) {
194 mother = *((*p)->production_vertex()->particles_begin(
HepMC::parents));
196 if (((mother ==
nullptr) || ((mother !=
nullptr) && (mother->pdg_id() == 25)) ||
197 ((mother !=
nullptr) && (mother->pdg_id() == 22)))) {
198 float minDelta = 10000.;
199 std::vector<reco::Photon> localPhotons;
203 float phiPho = (*p)->momentum().phi();
204 float etaPho = (*p)->momentum().eta();
205 etaPho =
etaTransformation(etaPho, (*p)->production_vertex()->position().z() / 10.);
212 localPhotons.push_back(localPho);
215 float phiClu = localPho.
phi();
216 float etaClu = localPho.
eta();
241 bool phoIsInBarrel =
false;
242 if (fabs(matchingPho.
superCluster()->position().eta()) < 1.479) {
243 phoIsInBarrel =
true;
248 float trueEta = (*p)->momentum().eta();
249 trueEta =
etaTransformation(trueEta, (*p)->production_vertex()->position().z() / 10.);
252 float photonE = matchingPho.
energy();
253 float photonEt = matchingPho.
et();
257 float r9 = matchingPho.
r9();
299 const float PI = 3.1415927;
303 const float R_ECAL = 136.5;
310 float ZEcal =
R_ECAL * sinh(EtaParticle) + Zvertex;
320 if (EtaParticle < 0.0)
322 float Zlen = Zend - Zvertex;
323 float RR = Zlen / sinh(EtaParticle);
324 Theta = atan(RR / Zend);
MonitorElement * h1_deltaEta_
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
T const * product() const
float sigmaIetaIeta() const
MonitorElement * h1_pho_Phi_
MonitorElement * h1_pho_Et_
MonitorElement * h1_pho_trkIsoEndcap_
MonitorElement * h1_pho_hcalIsoEndcap_
Log< level::Info, false > LogInfo
edm::InputTag pfEgammaCandidates_
MonitorElement * h1_recEoverTrueEBarrel_
edm::InputTag endcapEcalHits_
MonitorElement * h1_pho_R9Barrel_
MonitorElement * h1_pho_ecalIsoBarrel_
MonitorElement * h1_pho_ecalIsoEndcap_
void analyze(const edm::Event &, const edm::EventSetup &) override
std::string vertexProducer_
static const double deltaEta
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
float etaTransformation(float a, float b)
MonitorElement * h1_pho_hOverEBarrel_
MonitorElement * h1_pho_sigmaIetaIetaBarrel_
double eta() const final
momentum pseudorapidity
MonitorElement * h1_pho_trkIsoBarrel_
MonitorElement * h1_scEta_
MonitorElement * h1_deltaPhi_
bool isNonnull() const
Checks for non-null.
Tan< T >::type tan(const T &t)
SimplePhotonAnalyzer(const edm::ParameterSet &)
const HepMC::GenEvent * GetEvent() const
Log< level::Error, false > LogError
MonitorElement * h1_pho_E_
std::string photonCollectionProducer_
MonitorElement * h1_pho_sigmaIetaIetaEndcap_
std::string valueMapPFCandPhoton_
double et() const final
transverse energy
~SimplePhotonAnalyzer() override
MonitorElement * h1_recEoverTrueEEndcap_
float hadronicOverEm() const
the total hadronic over electromagnetic fraction
double phi() const final
momentum azimuthal angle
float trkSumPtSolidConeDR04() const
MonitorElement * h1_pho_hcalIsoBarrel_
MonitorElement * h1_pho_Eta_
float ecalRecHitSumEtConeDR04() const
T getParameter(std::string const &) const
double energy() const final
energy
MonitorElement * h1_pho_R9Endcap_
std::vector< Photon > PhotonCollection
collectin of Photon objects
Power< A, B >::type pow(const A &a, const B &b)
edm::ESHandle< CaloTopology > theCaloTopo_
MonitorElement * h1_pho_hOverEEndcap_
static constexpr float ZEcal
static constexpr float Z_Endcap
float hcalTowerSumEtConeDR04() const
Hcal isolation sum.
static constexpr float R_ECAL
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
MonitorElement * h1_deltaEtaSC_
static constexpr float etaBarrelEndcap
std::string photonCollection_
edm::InputTag barrelEcalHits_