31 #include "CLHEP/Units/GlobalPhysicalConstants.h" 181 "recEoverTrueEBarrel",
" Reco photon Energy over Generated photon Energy: Barrel ", 100, loRes,
hiRes);
183 "recEoverTrueEEndcap",
" Reco photon Energy over Generated photon Energy: Endcap ", 100, loRes,
hiRes);
206 edm::LogInfo(
"PhotonAnalyzer") <<
"Analyzing event number: " << evt.
id() <<
"\n";
221 if (!pfCandidateHandle.
isValid()) {
228 if (!pfCandToPhotonMapHandle.
isValid()) {
229 edm::LogInfo(
"SimplePhotonAnalyzer") <<
"Error! Can't get the product: valueMapPhotons " << std::endl;
231 pfCandToPhotonMap = *(pfCandToPhotonMapHandle.
product());
233 std::cout <<
" SimplePhotonAnalyzer valueMap size" << pfCandToPhotonMap.
size() << std::endl;
234 unsigned nObj = pfCandidateHandle->size();
235 for (
unsigned int lCand = 0; lCand < nObj; lCand++) {
241 std::cout <<
" PF SC " << pfCandRef->superClusterRef()->energy() <<
" Photon SC " 242 << myPho->superCluster()->energy() << std::endl;
245 for (HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
p != myGenEvent->particles_end();
247 if (!((*p)->pdg_id() == 22 && (*p)->status() == 1))
252 if ((*p)->production_vertex()) {
255 mother = *((*p)->production_vertex()->particles_begin(
HepMC::parents));
257 if (((mother ==
nullptr) || ((mother !=
nullptr) && (mother->pdg_id() == 25)) ||
258 ((mother !=
nullptr) && (mother->pdg_id() == 22)))) {
259 float minDelta = 10000.;
260 std::vector<reco::Photon> localPhotons;
264 float phiPho = (*p)->momentum().phi();
265 float etaPho = (*p)->momentum().eta();
266 etaPho =
etaTransformation(etaPho, (*p)->production_vertex()->position().z() / 10.);
273 localPhotons.push_back(localPho);
276 float phiClu = localPho.
phi();
277 float etaClu = localPho.
eta();
302 bool phoIsInBarrel =
false;
303 if (fabs(matchingPho.
superCluster()->position().eta()) < 1.479) {
304 phoIsInBarrel =
true;
309 float trueEta = (*p)->momentum().eta();
310 trueEta =
etaTransformation(trueEta, (*p)->production_vertex()->position().z() / 10.);
313 float photonE = matchingPho.
energy();
314 float photonEt = matchingPho.
et();
318 float r9 = matchingPho.
r9();
360 const float PI = 3.1415927;
364 const float R_ECAL = 136.5;
371 float ZEcal =
R_ECAL * sinh(EtaParticle) + Zvertex;
381 if (EtaParticle < 0.0)
383 float Zlen = Zend - Zvertex;
384 float RR = Zlen / sinh(EtaParticle);
385 Theta = atan(RR / Zend);
edm::InputTag barrelEcalHits_
T getParameter(std::string const &) const
float etaTransformation(float a, float b)
MonitorElement * h1_scEta_
MonitorElement * h1_deltaPhi_
float ecalRecHitSumEtConeDR04() const
#define DEFINE_FWK_MODULE(type)
T const * product() const
std::string vertexProducer_
edm::InputTag pfEgammaCandidates_
bool isNonnull() const
Checks for non-null.
MonitorElement * h1_pho_R9Barrel_
std::string photonCollection_
MonitorElement * h1_pho_Eta_
MonitorElement * h1_pho_hcalIsoEndcap_
Log< level::Error, false > LogError
static constexpr float R_ECAL
edm::InputTag endcapEcalHits_
std::string mcCollection_
MonitorElement * h1_recEoverTrueEEndcap_
static const double deltaEta
MonitorElement * h1_recEoverTrueEBarrel_
float trkSumPtSolidConeDR04() const
void analyze(const edm::Event &, const edm::EventSetup &) override
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
float hcalTowerSumEtConeDR04(int depth=0) const
float sigmaIetaIeta() const
MonitorElement * h1_pho_trkIsoBarrel_
Tan< T >::type tan(const T &t)
MonitorElement * h1_pho_E_
static constexpr float etaBarrelEndcap
MonitorElement * h1_deltaEta_
MonitorElement * h1_pho_trkIsoEndcap_
const HepMC::GenEvent * GetEvent() const
SimplePhotonAnalyzer(const edm::ParameterSet &)
MonitorElement * h1_pho_hcalIsoBarrel_
Log< level::Info, false > LogInfo
float hadronicOverEm(int depth=0) const
MonitorElement * h1_pho_Phi_
MonitorElement * h1_pho_sigmaIetaIetaBarrel_
dqm::legacy::MonitorElement MonitorElement
std::vector< Photon > PhotonCollection
collectin of Photon objects
MonitorElement * h1_pho_hOverEEndcap_
dqm::legacy::DQMStore DQMStore
MonitorElement * h1_pho_R9Endcap_
double et() const final
transverse energy
static constexpr float ZEcal
MonitorElement * h1_pho_ecalIsoBarrel_
MonitorElement * h1_pho_ecalIsoEndcap_
~SimplePhotonAnalyzer() override
MonitorElement * h1_pho_sigmaIetaIetaEndcap_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
MonitorElement * h1_deltaEtaSC_
MonitorElement * h1_pho_Et_
double phi() const final
momentum azimuthal angle
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Power< A, B >::type pow(const A &a, const B &b)
std::string photonCollectionProducer_
std::string valueMapPFCandPhoton_
static constexpr float Z_Endcap
MonitorElement * h1_pho_hOverEBarrel_
double energy() const final
energy
double eta() const final
momentum pseudorapidity