|
|
Go to the documentation of this file.
31 #include "CLHEP/Units/GlobalPhysicalConstants.h"
183 "recEoverTrueEBarrel",
" Reco photon Energy over Generated photon Energy: Barrel ", 100, loRes,
hiRes);
185 "recEoverTrueEEndcap",
" Reco photon Energy over Generated photon Energy: Endcap ", 100, loRes,
hiRes);
208 edm::LogInfo(
"PhotonAnalyzer") <<
"Analyzing event number: " << evt.
id() <<
"\n";
227 if (!pfCandidateHandle.
isValid()) {
234 if (!pfCandToPhotonMapHandle.
isValid()) {
235 edm::LogInfo(
"SimplePhotonAnalyzer") <<
"Error! Can't get the product: valueMapPhotons " << std::endl;
237 pfCandToPhotonMap = *(pfCandToPhotonMapHandle.
product());
239 std::cout <<
" SimplePhotonAnalyzer valueMap size" << pfCandToPhotonMap.
size() << std::endl;
240 unsigned nObj = pfCandidateHandle->size();
241 for (
unsigned int lCand = 0; lCand < nObj; lCand++) {
247 std::cout <<
" PF SC " << pfCandRef->superClusterRef()->energy() <<
" Photon SC "
248 << myPho->superCluster()->energy() << std::endl;
251 for (HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
p != myGenEvent->particles_end();
253 if (!((*p)->pdg_id() == 22 && (*p)->status() == 1))
258 if ((*p)->production_vertex()) {
261 mother = *((*p)->production_vertex()->particles_begin(
HepMC::parents));
263 if (((mother ==
nullptr) || ((mother !=
nullptr) && (mother->pdg_id() == 25)) ||
264 ((mother !=
nullptr) && (mother->pdg_id() == 22)))) {
265 float minDelta = 10000.;
266 std::vector<reco::Photon> localPhotons;
270 float phiPho = (*p)->momentum().phi();
271 float etaPho = (*p)->momentum().eta();
272 etaPho =
etaTransformation(etaPho, (*p)->production_vertex()->position().z() / 10.);
279 localPhotons.push_back(localPho);
282 float phiClu = localPho.
phi();
283 float etaClu = localPho.
eta();
308 bool phoIsInBarrel =
false;
309 if (fabs(matchingPho.
superCluster()->position().eta()) < 1.479) {
310 phoIsInBarrel =
true;
315 float trueEta = (*p)->momentum().eta();
316 trueEta =
etaTransformation(trueEta, (*p)->production_vertex()->position().z() / 10.);
319 float photonE = matchingPho.
energy();
320 float photonEt = matchingPho.
et();
324 float r9 = matchingPho.
r9();
366 const float PI = 3.1415927;
370 const float R_ECAL = 136.5;
377 float ZEcal =
R_ECAL * sinh(EtaParticle) + Zvertex;
387 if (EtaParticle < 0.0)
389 float Zlen = Zend - Zvertex;
390 float RR = Zlen / sinh(EtaParticle);
391 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_
dqm::legacy::MonitorElement MonitorElement
#define DEFINE_FWK_MODULE(type)
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_
dqm::legacy::DQMStore DQMStore
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
std::string mcCollection_
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_