CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
SimplePhotonAnalyzer Class Reference

#include <SimplePhotonAnalyzer.h>

Inheritance diagram for SimplePhotonAnalyzer:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 
 SimplePhotonAnalyzer (const edm::ParameterSet &)
 
 ~SimplePhotonAnalyzer () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

float etaTransformation (float a, float b)
 

Private Attributes

edm::InputTag barrelEcalHits_
 
DQMStoredbe_
 
edm::InputTag endcapEcalHits_
 
MonitorElementh1_deltaEta_
 
MonitorElementh1_deltaEtaSC_
 
MonitorElementh1_deltaPhi_
 
MonitorElementh1_pho_E_
 
MonitorElementh1_pho_ecalIsoBarrel_
 
MonitorElementh1_pho_ecalIsoEndcap_
 
MonitorElementh1_pho_Et_
 
MonitorElementh1_pho_Eta_
 
MonitorElementh1_pho_hcalIsoBarrel_
 
MonitorElementh1_pho_hcalIsoEndcap_
 
MonitorElementh1_pho_hOverEBarrel_
 
MonitorElementh1_pho_hOverEEndcap_
 
MonitorElementh1_pho_Phi_
 
MonitorElementh1_pho_R9Barrel_
 
MonitorElementh1_pho_R9Endcap_
 
MonitorElementh1_pho_sigmaIetaIetaBarrel_
 
MonitorElementh1_pho_sigmaIetaIetaEndcap_
 
MonitorElementh1_pho_trkIsoBarrel_
 
MonitorElementh1_pho_trkIsoEndcap_
 
MonitorElementh1_recEoverTrueEBarrel_
 
MonitorElementh1_recEoverTrueEEndcap_
 
MonitorElementh1_scEta_
 
std::string mcCollection_
 
std::string mcProducer_
 
edm::InputTag pfEgammaCandidates_
 
std::string photonCollection_
 
std::string photonCollectionProducer_
 
float sample_
 
edm::ESHandle< CaloTopologytheCaloTopo_
 
std::string valueMapPFCandPhoton_
 
std::string vertexProducer_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Description: Get Photon collection from the event and make very basic histos

Author
Nancy Marinelli, U. of Notre Dame, US

Definition at line 34 of file SimplePhotonAnalyzer.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 36 of file SimplePhotonAnalyzer.h.

◆ MonitorElement

Definition at line 37 of file SimplePhotonAnalyzer.h.

Constructor & Destructor Documentation

◆ SimplePhotonAnalyzer()

SimplePhotonAnalyzer::SimplePhotonAnalyzer ( const edm::ParameterSet ps)
explicit

Definition at line 33 of file SimplePhotonAnalyzer.cc.

35 {
37  photonCollection_ = ps.getParameter<std::string>("photonCollection");
38 
39  barrelEcalHits_ = ps.getParameter<edm::InputTag>("barrelEcalHits");
40  endcapEcalHits_ = ps.getParameter<edm::InputTag>("endcapEcalHits");
41 
42  pfEgammaCandidates_ = ps.getParameter<edm::InputTag>("pfEgammaCandidates");
43  valueMapPFCandPhoton_ = ps.getParameter<std::string>("valueMapPhotons");
44 
45  mcProducer_ = ps.getParameter<std::string>("mcProducer");
46  //mcCollection_ = ps.getParameter<std::string>("mcCollection");
47  vertexProducer_ = ps.getParameter<std::string>("primaryVertexProducer");
48  sample_ = ps.getParameter<int>("sample");
49 }

References barrelEcalHits_, endcapEcalHits_, edm::ParameterSet::getParameter(), mcProducer_, pfEgammaCandidates_, photonCollection_, photonCollectionProducer_, sample_, AlCaHLTBitMon_QueryRunRegistry::string, valueMapPFCandPhoton_, and vertexProducer_.

◆ ~SimplePhotonAnalyzer()

SimplePhotonAnalyzer::~SimplePhotonAnalyzer ( )
override

Definition at line 52 of file SimplePhotonAnalyzer.cc.

54 {}

Member Function Documentation

◆ analyze()

void SimplePhotonAnalyzer::analyze ( const edm::Event evt,
const edm::EventSetup es 
)
overridevirtual

Match reconstructed photon candidates with the nearest generated photonPho;

Plot kinematic disctributions for matched photons

Implements edm::one::EDAnalyzerBase.

Definition at line 137 of file SimplePhotonAnalyzer.cc.

137  {
138  //========================================================================
139 
140  using namespace edm; // needed for all fwk related classes
141  edm::LogInfo("PhotonAnalyzer") << "Analyzing event number: " << evt.id() << "\n";
142 
143  // get the calo topology from the event setup:
144  edm::ESHandle<CaloTopology> pTopology;
146 
147  // Get the corrected photon collection (set in the configuration) which also contains infos about conversions
148 
149  Handle<reco::PhotonCollection> photonHandle;
151  const reco::PhotonCollection photonCollection = *(photonHandle.product());
152 
153  Handle<HepMCProduct> hepProd;
154  evt.getByLabel(mcProducer_, hepProd);
155  const HepMC::GenEvent* myGenEvent = hepProd->GetEvent();
156 
157  // Get the PF refined cluster collection
158  Handle<reco::PFCandidateCollection> pfCandidateHandle;
159  evt.getByLabel(pfEgammaCandidates_, pfCandidateHandle);
160  if (!pfCandidateHandle.isValid()) {
161  edm::LogError("SimplePhotonAnalyzer") << "Error! Can't get the product " << pfEgammaCandidates_.label();
162  }
163 
164  edm::Handle<edm::ValueMap<reco::PhotonRef> > pfCandToPhotonMapHandle;
165  edm::ValueMap<reco::PhotonRef> pfCandToPhotonMap;
166  evt.getByLabel("gedPhotons", valueMapPFCandPhoton_, pfCandToPhotonMapHandle);
167  if (!pfCandToPhotonMapHandle.isValid()) {
168  edm::LogInfo("SimplePhotonAnalyzer") << "Error! Can't get the product: valueMapPhotons " << std::endl;
169  }
170  pfCandToPhotonMap = *(pfCandToPhotonMapHandle.product());
171 
172  std::cout << " SimplePhotonAnalyzer valueMap size" << pfCandToPhotonMap.size() << std::endl;
173  unsigned nObj = pfCandidateHandle->size();
174  for (unsigned int lCand = 0; lCand < nObj; lCand++) {
175  reco::PFCandidateRef pfCandRef(reco::PFCandidateRef(pfCandidateHandle, lCand));
176  if (pfCandRef->particleId() != reco::PFCandidate::gamma)
177  continue;
178  reco::PhotonRef myPho = (pfCandToPhotonMap)[pfCandRef];
179  if (myPho.isNonnull())
180  std::cout << " PF SC " << pfCandRef->superClusterRef()->energy() << " Photon SC "
181  << myPho->superCluster()->energy() << std::endl;
182  }
183 
184  for (HepMC::GenEvent::particle_const_iterator p = myGenEvent->particles_begin(); p != myGenEvent->particles_end();
185  ++p) {
186  if (!((*p)->pdg_id() == 22 && (*p)->status() == 1))
187  continue;
188 
189  // single primary photons or photons from Higgs or RS Graviton
190  HepMC::GenParticle* mother = nullptr;
191  if ((*p)->production_vertex()) {
192  if ((*p)->production_vertex()->particles_begin(HepMC::parents) !=
193  (*p)->production_vertex()->particles_end(HepMC::parents))
194  mother = *((*p)->production_vertex()->particles_begin(HepMC::parents));
195  }
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;
200  int index = 0;
201  int iMatch = -1;
202 
203  float phiPho = (*p)->momentum().phi();
204  float etaPho = (*p)->momentum().eta();
205  etaPho = etaTransformation(etaPho, (*p)->production_vertex()->position().z() / 10.);
206 
207  bool matched = false;
208  // loop Photon candidates
209  for (reco::PhotonCollection::const_iterator iPho = photonCollection.begin(); iPho != photonCollection.end();
210  iPho++) {
211  reco::Photon localPho = reco::Photon(*iPho);
212  localPhotons.push_back(localPho);
213 
215  float phiClu = localPho.phi();
216  float etaClu = localPho.eta();
217  float deltaPhi = phiClu - phiPho;
218  float deltaEta = etaClu - etaPho;
219 
220  if (deltaPhi > pi)
221  deltaPhi -= twopi;
222  if (deltaPhi < -pi)
223  deltaPhi += twopi;
224  deltaPhi = std::pow(deltaPhi, 2);
225  deltaEta = std::pow(deltaEta, 2);
226  float delta = sqrt(deltaPhi + deltaEta);
227  if (delta < 0.1 && delta < minDelta) {
228  minDelta = delta;
229  iMatch = index;
230  }
231  index++;
232  } // End loop over photons
233 
234  if (iMatch > -1)
235  matched = true;
236 
238  if (matched) {
239  reco::Photon matchingPho = localPhotons[iMatch];
240 
241  bool phoIsInBarrel = false;
242  if (fabs(matchingPho.superCluster()->position().eta()) < 1.479) {
243  phoIsInBarrel = true;
244  }
245  edm::Handle<EcalRecHitCollection> ecalRecHitHandle;
246 
247  h1_scEta_->Fill(matchingPho.superCluster()->position().eta());
248  float trueEta = (*p)->momentum().eta();
249  trueEta = etaTransformation(trueEta, (*p)->production_vertex()->position().z() / 10.);
250  h1_deltaEtaSC_->Fill(localPhotons[iMatch].superCluster()->eta() - trueEta);
251 
252  float photonE = matchingPho.energy();
253  float photonEt = matchingPho.et();
254  float photonEta = matchingPho.eta();
255  float photonPhi = matchingPho.phi();
256 
257  float r9 = matchingPho.r9();
258  float sigmaIetaIeta = matchingPho.sigmaIetaIeta();
259  float hOverE = matchingPho.hadronicOverEm();
260  float ecalIso = matchingPho.ecalRecHitSumEtConeDR04();
261  float hcalIso = matchingPho.hcalTowerSumEtConeDR04();
262  float trkIso = matchingPho.trkSumPtSolidConeDR04();
263 
264  h1_pho_E_->Fill(photonE);
265  h1_pho_Et_->Fill(photonEt);
268 
269  h1_deltaEta_->Fill(photonEta - (*p)->momentum().eta());
270  h1_deltaPhi_->Fill(photonPhi - (*p)->momentum().phi());
271 
272  if (phoIsInBarrel) {
273  h1_recEoverTrueEBarrel_->Fill(photonE / (*p)->momentum().e());
275  h1_pho_sigmaIetaIetaBarrel_->Fill(sigmaIetaIeta);
277  h1_pho_ecalIsoBarrel_->Fill(ecalIso);
278  h1_pho_hcalIsoBarrel_->Fill(hcalIso);
280 
281  } else {
282  h1_recEoverTrueEEndcap_->Fill(photonE / (*p)->momentum().e());
284  h1_pho_sigmaIetaIetaEndcap_->Fill(sigmaIetaIeta);
286  h1_pho_ecalIsoEndcap_->Fill(ecalIso);
287  h1_pho_hcalIsoEndcap_->Fill(hcalIso);
289  }
290 
291  } // reco photon matching MC truth
292 
293  } // End loop over MC particles
294  }
295 }

References gather_cfg::cout, dumpMFGeometry_cfg::delta, spr::deltaEta, SiPixelRawToDigiRegional_cfi::deltaPhi, reco::Photon::ecalRecHitSumEtConeDR04(), reco::LeafCandidate::energy(), reco::LeafCandidate::et(), PVValHelper::eta, reco::LeafCandidate::eta(), etaTransformation(), dqm::impl::MonitorElement::Fill(), reco::PFCandidate::gamma, GenParticle::GenParticle, edm::EventSetup::get(), get, edm::Event::getByLabel(), edm::HepMCProduct::GetEvent(), h1_deltaEta_, h1_deltaEtaSC_, h1_deltaPhi_, h1_pho_E_, h1_pho_ecalIsoBarrel_, h1_pho_ecalIsoEndcap_, h1_pho_Et_, h1_pho_Eta_, h1_pho_hcalIsoBarrel_, h1_pho_hcalIsoEndcap_, h1_pho_hOverEBarrel_, h1_pho_hOverEEndcap_, h1_pho_Phi_, h1_pho_R9Barrel_, h1_pho_R9Endcap_, h1_pho_sigmaIetaIetaBarrel_, h1_pho_sigmaIetaIetaEndcap_, h1_pho_trkIsoBarrel_, h1_pho_trkIsoEndcap_, h1_recEoverTrueEBarrel_, h1_recEoverTrueEEndcap_, h1_scEta_, reco::Photon::hadronicOverEm(), reco::Photon::hcalTowerSumEtConeDR04(), EgHLTOffHistBins_cfi::hOverE, edm::EventBase::id(), edm::Ref< C, T, F >::isNonnull(), edm::HandleBase::isValid(), edm::InputTag::label(), muonTagProbeFilters_cff::matched, mcProducer_, AlCaHLTBitMon_ParallelJobs::p, parents, pfEgammaCandidates_, reco::LeafCandidate::phi(), nanoDQM_cff::Photon, ExoticaDQM_cfi::photonCollection, photonCollection_, photonCollectionProducer_, HLTObjectMonitor_cfi::photonEta, HLTObjectMonitor_cfi::photonPhi, pi, funct::pow(), edm::Handle< T >::product(), reco::Photon::r9(), electrons_cff::r9, reco::Photon::sigmaIetaIeta(), edm::ValueMap< T >::size(), mathSSE::sqrt(), reco::Photon::superCluster(), theCaloTopo_, ZMuMuCategoriesSequences_cff::trkIso, reco::Photon::trkSumPtSolidConeDR04(), and valueMapPFCandPhoton_.

◆ beginJob()

void SimplePhotonAnalyzer::beginJob ( void  )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 57 of file SimplePhotonAnalyzer.cc.

57  {
58  //========================================================================
59 
60  dbe_ = nullptr;
61  dbe_ = edm::Service<DQMStore>().operator->();
62 
63  float hiE = 0;
64  float loE = 0;
65  float hiEt = 0;
66  float loEt = 0;
67  float dPhi = 0;
68  float loRes = 0;
69  float hiRes = 0;
70  if (sample_ == 1) {
71  loE = 0.;
72  hiE = 30.;
73  loEt = 0.;
74  hiEt = 30.;
75  dPhi = 0.2;
76  loRes = 0.;
77  hiRes = 1.2;
78  } else if (sample_ == 2) {
79  loE = 0.;
80  hiE = 200.;
81  loEt = 0.;
82  hiEt = 50.;
83  dPhi = 0.05;
84  loRes = 0.7;
85  hiRes = 1.2;
86  } else if (sample_ == 3) {
87  loE = 0.;
88  hiE = 500.;
89  loEt = 0.;
90  hiEt = 500.;
91  dPhi = 0.05;
92  loRes = 0.7;
93  hiRes = 1.2;
94  } else if (sample_ == 4) {
95  loE = 0.;
96  hiE = 6000.;
97  loEt = 0.;
98  hiEt = 1200.;
99  dPhi = 0.05;
100  loRes = 0.7;
101  hiRes = 1.2;
102  }
103 
104  h1_deltaEta_ = dbe_->book1D("deltaEta", " Reco photon Eta minus Generated photon Eta ", 100, -0.2, 0.2);
105  h1_deltaPhi_ = dbe_->book1D("deltaPhi", "Reco photon Phi minus Generated photon Phi ", 100, -dPhi, dPhi);
106  h1_pho_Eta_ = dbe_->book1D("phoEta", "Photon Eta ", 40, -3., 3.);
107  h1_pho_Phi_ = dbe_->book1D("phoPhi", "Photon Phi ", 40, -3.14, 3.14);
108  h1_pho_E_ = dbe_->book1D("phoE", "Photon Energy ", 100, loE, hiE);
109  h1_pho_Et_ = dbe_->book1D("phoEt", "Photon Et ", 100, loEt, hiEt);
110 
111  h1_scEta_ = dbe_->book1D("scEta", " SC Eta ", 40, -3., 3.);
112  h1_deltaEtaSC_ = dbe_->book1D("deltaEtaSC", " SC Eta minus Generated photon Eta ", 100, -0.02, 0.02);
113 
114  //
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);
119 
120  //
121 
122  h1_pho_R9Barrel_ = dbe_->book1D("phoR9Barrel", "Photon 3x3 energy / SuperCluster energy : Barrel ", 100, 0., 1.2);
123  h1_pho_R9Endcap_ = dbe_->book1D("phoR9Endcap", "Photon 3x3 energy / SuperCluster energy : Endcap ", 100, 0., 1.2);
124  h1_pho_sigmaIetaIetaBarrel_ = dbe_->book1D("sigmaIetaIetaBarrel", "sigmaIetaIeta: Barrel", 100, 0., 0.05);
125  h1_pho_sigmaIetaIetaEndcap_ = dbe_->book1D("sigmaIetaIetaEndcap", "sigmaIetaIeta: Endcap", 100, 0., 0.1);
126  h1_pho_hOverEBarrel_ = dbe_->book1D("hOverEBarrel", "H/E: Barrel", 100, 0., 0.1);
127  h1_pho_hOverEEndcap_ = dbe_->book1D("hOverEEndcap", "H/E: Endcap", 100, 0., 0.1);
128  h1_pho_ecalIsoBarrel_ = dbe_->book1D("ecalIsolBarrel", "isolation et sum in Ecal: Barrel", 100, 0., 100.);
129  h1_pho_ecalIsoEndcap_ = dbe_->book1D("ecalIsolEndcap", "isolation et sum in Ecal: Endcap", 100, 0., 100.);
130  h1_pho_hcalIsoBarrel_ = dbe_->book1D("hcalIsolBarrel", "isolation et sum in Hcal: Barrel", 100, 0., 100.);
131  h1_pho_hcalIsoEndcap_ = dbe_->book1D("hcalIsolEndcap", "isolation et sum in Hcal: Endcap", 100, 0., 100.);
132  h1_pho_trkIsoBarrel_ = dbe_->book1D("trkIsolBarrel", "isolation pt sum in the tracker: Barrel", 100, 0., 100.);
133  h1_pho_trkIsoEndcap_ = dbe_->book1D("trkIsolEndcap", "isolation pt sum in the tracker: Endcap", 100, 0., 100.);
134 }

References dqm::implementation::IBooker::book1D(), dbe_, HLT_FULL_cff::dPhi, h1_deltaEta_, h1_deltaEtaSC_, h1_deltaPhi_, h1_pho_E_, h1_pho_ecalIsoBarrel_, h1_pho_ecalIsoEndcap_, h1_pho_Et_, h1_pho_Eta_, h1_pho_hcalIsoBarrel_, h1_pho_hcalIsoEndcap_, h1_pho_hOverEBarrel_, h1_pho_hOverEEndcap_, h1_pho_Phi_, h1_pho_R9Barrel_, h1_pho_R9Endcap_, h1_pho_sigmaIetaIetaBarrel_, h1_pho_sigmaIetaIetaEndcap_, h1_pho_trkIsoBarrel_, h1_pho_trkIsoEndcap_, h1_recEoverTrueEBarrel_, h1_recEoverTrueEEndcap_, h1_scEta_, SiPixelOfflineDQM_source_cff::hiRes, and sample_.

◆ endJob()

void SimplePhotonAnalyzer::endJob ( void  )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 335 of file SimplePhotonAnalyzer.cc.

335  {
336  //========================================================================
337 }

◆ etaTransformation()

float SimplePhotonAnalyzer::etaTransformation ( float  a,
float  b 
)
private

Definition at line 297 of file SimplePhotonAnalyzer.cc.

297  {
298  //---Definitions
299  const float PI = 3.1415927;
300  //UNUSED const float TWOPI = 2.0*PI;
301 
302  //---Definitions for ECAL
303  const float R_ECAL = 136.5;
304  const float Z_Endcap = 328.0;
305  const float etaBarrelEndcap = 1.479;
306 
307  //---ETA correction
308 
309  float Theta = 0.0;
310  float ZEcal = R_ECAL * sinh(EtaParticle) + Zvertex;
311 
312  if (ZEcal != 0.0)
313  Theta = atan(R_ECAL / ZEcal);
314  if (Theta < 0.0)
315  Theta = Theta + PI;
316  float ETA = -log(tan(0.5 * Theta));
317 
318  if (fabs(ETA) > etaBarrelEndcap) {
319  float Zend = Z_Endcap;
320  if (EtaParticle < 0.0)
321  Zend = -Zend;
322  float Zlen = Zend - Zvertex;
323  float RR = Zlen / sinh(EtaParticle);
324  Theta = atan(RR / Zend);
325  if (Theta < 0.0)
326  Theta = Theta + PI;
327  ETA = -log(tan(0.5 * Theta));
328  }
329  //---Return the result
330  return ETA;
331  //---end
332 }

References ETA, etaBarrelEndcap, dqm-mbProfile::log, PI, R_ECAL, funct::tan(), Z_Endcap, and ZEcal.

Referenced by analyze().

Member Data Documentation

◆ barrelEcalHits_

edm::InputTag SimplePhotonAnalyzer::barrelEcalHits_
private

Definition at line 55 of file SimplePhotonAnalyzer.h.

Referenced by SimplePhotonAnalyzer().

◆ dbe_

DQMStore* SimplePhotonAnalyzer::dbe_
private

Definition at line 63 of file SimplePhotonAnalyzer.h.

Referenced by beginJob().

◆ endcapEcalHits_

edm::InputTag SimplePhotonAnalyzer::endcapEcalHits_
private

Definition at line 56 of file SimplePhotonAnalyzer.h.

Referenced by SimplePhotonAnalyzer().

◆ h1_deltaEta_

MonitorElement* SimplePhotonAnalyzer::h1_deltaEta_
private

Definition at line 86 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ h1_deltaEtaSC_

MonitorElement* SimplePhotonAnalyzer::h1_deltaEtaSC_
private

Definition at line 66 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ h1_deltaPhi_

MonitorElement* SimplePhotonAnalyzer::h1_deltaPhi_
private

Definition at line 87 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ h1_pho_E_

MonitorElement* SimplePhotonAnalyzer::h1_pho_E_
private

Definition at line 67 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ h1_pho_ecalIsoBarrel_

MonitorElement* SimplePhotonAnalyzer::h1_pho_ecalIsoBarrel_
private

Definition at line 77 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ h1_pho_ecalIsoEndcap_

MonitorElement* SimplePhotonAnalyzer::h1_pho_ecalIsoEndcap_
private

Definition at line 78 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ h1_pho_Et_

MonitorElement* SimplePhotonAnalyzer::h1_pho_Et_
private

Definition at line 68 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ h1_pho_Eta_

MonitorElement* SimplePhotonAnalyzer::h1_pho_Eta_
private

Definition at line 69 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ h1_pho_hcalIsoBarrel_

MonitorElement* SimplePhotonAnalyzer::h1_pho_hcalIsoBarrel_
private

Definition at line 79 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ h1_pho_hcalIsoEndcap_

MonitorElement* SimplePhotonAnalyzer::h1_pho_hcalIsoEndcap_
private

Definition at line 80 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ h1_pho_hOverEBarrel_

MonitorElement* SimplePhotonAnalyzer::h1_pho_hOverEBarrel_
private

Definition at line 75 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ h1_pho_hOverEEndcap_

MonitorElement* SimplePhotonAnalyzer::h1_pho_hOverEEndcap_
private

Definition at line 76 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ h1_pho_Phi_

MonitorElement* SimplePhotonAnalyzer::h1_pho_Phi_
private

Definition at line 70 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ h1_pho_R9Barrel_

MonitorElement* SimplePhotonAnalyzer::h1_pho_R9Barrel_
private

Definition at line 71 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ h1_pho_R9Endcap_

MonitorElement* SimplePhotonAnalyzer::h1_pho_R9Endcap_
private

Definition at line 72 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ h1_pho_sigmaIetaIetaBarrel_

MonitorElement* SimplePhotonAnalyzer::h1_pho_sigmaIetaIetaBarrel_
private

Definition at line 73 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ h1_pho_sigmaIetaIetaEndcap_

MonitorElement* SimplePhotonAnalyzer::h1_pho_sigmaIetaIetaEndcap_
private

Definition at line 74 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ h1_pho_trkIsoBarrel_

MonitorElement* SimplePhotonAnalyzer::h1_pho_trkIsoBarrel_
private

Definition at line 81 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ h1_pho_trkIsoEndcap_

MonitorElement* SimplePhotonAnalyzer::h1_pho_trkIsoEndcap_
private

Definition at line 82 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ h1_recEoverTrueEBarrel_

MonitorElement* SimplePhotonAnalyzer::h1_recEoverTrueEBarrel_
private

Definition at line 84 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ h1_recEoverTrueEEndcap_

MonitorElement* SimplePhotonAnalyzer::h1_recEoverTrueEEndcap_
private

Definition at line 85 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ h1_scEta_

MonitorElement* SimplePhotonAnalyzer::h1_scEta_
private

Definition at line 65 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

◆ mcCollection_

std::string SimplePhotonAnalyzer::mcCollection_
private

Definition at line 50 of file SimplePhotonAnalyzer.h.

◆ mcProducer_

std::string SimplePhotonAnalyzer::mcProducer_
private

Definition at line 49 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and SimplePhotonAnalyzer().

◆ pfEgammaCandidates_

edm::InputTag SimplePhotonAnalyzer::pfEgammaCandidates_
private

Definition at line 54 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and SimplePhotonAnalyzer().

◆ photonCollection_

std::string SimplePhotonAnalyzer::photonCollection_
private

Definition at line 52 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and SimplePhotonAnalyzer().

◆ photonCollectionProducer_

std::string SimplePhotonAnalyzer::photonCollectionProducer_
private

Definition at line 51 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and SimplePhotonAnalyzer().

◆ sample_

float SimplePhotonAnalyzer::sample_
private

Definition at line 61 of file SimplePhotonAnalyzer.h.

Referenced by beginJob(), and SimplePhotonAnalyzer().

◆ theCaloTopo_

edm::ESHandle<CaloTopology> SimplePhotonAnalyzer::theCaloTopo_
private

Definition at line 58 of file SimplePhotonAnalyzer.h.

Referenced by analyze().

◆ valueMapPFCandPhoton_

std::string SimplePhotonAnalyzer::valueMapPFCandPhoton_
private

Definition at line 53 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and SimplePhotonAnalyzer().

◆ vertexProducer_

std::string SimplePhotonAnalyzer::vertexProducer_
private

Definition at line 60 of file SimplePhotonAnalyzer.h.

Referenced by SimplePhotonAnalyzer().

muonTagProbeFilters_cff.matched
matched
Definition: muonTagProbeFilters_cff.py:62
PI
Definition: PayloadInspector.h:20
SimplePhotonAnalyzer::sample_
float sample_
Definition: SimplePhotonAnalyzer.h:61
SimplePhotonAnalyzer::h1_deltaEta_
MonitorElement * h1_deltaEta_
Definition: SimplePhotonAnalyzer.h:86
electrons_cff.r9
r9
Definition: electrons_cff.py:387
reco::Photon::superCluster
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
edm::Handle::product
T const * product() const
Definition: Handle.h:70
reco::Photon::sigmaIetaIeta
float sigmaIetaIeta() const
Definition: Photon.h:237
PI
#define PI
Definition: QcdUeDQM.h:37
SimplePhotonAnalyzer::h1_pho_Phi_
MonitorElement * h1_pho_Phi_
Definition: SimplePhotonAnalyzer.h:70
edm
HLT enums.
Definition: AlignableModifier.h:19
ZMuMuCategoriesSequences_cff.trkIso
trkIso
Definition: ZMuMuCategoriesSequences_cff.py:140
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
gather_cfg.cout
cout
Definition: gather_cfg.py:144
SimplePhotonAnalyzer::h1_pho_Et_
MonitorElement * h1_pho_Et_
Definition: SimplePhotonAnalyzer.h:68
SimplePhotonAnalyzer::h1_pho_trkIsoEndcap_
MonitorElement * h1_pho_trkIsoEndcap_
Definition: SimplePhotonAnalyzer.h:82
SimplePhotonAnalyzer::h1_pho_hcalIsoEndcap_
MonitorElement * h1_pho_hcalIsoEndcap_
Definition: SimplePhotonAnalyzer.h:80
CaloTopologyRecord
Definition: CaloTopologyRecord.h:10
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
SimplePhotonAnalyzer::pfEgammaCandidates_
edm::InputTag pfEgammaCandidates_
Definition: SimplePhotonAnalyzer.h:54
HLT_FULL_cff.dPhi
dPhi
Definition: HLT_FULL_cff.py:13702
SimplePhotonAnalyzer::h1_recEoverTrueEBarrel_
MonitorElement * h1_recEoverTrueEBarrel_
Definition: SimplePhotonAnalyzer.h:84
HLTObjectMonitor_cfi.photonEta
photonEta
Definition: HLTObjectMonitor_cfi.py:62
edm::Handle< reco::PhotonCollection >
SimplePhotonAnalyzer::endcapEcalHits_
edm::InputTag endcapEcalHits_
Definition: SimplePhotonAnalyzer.h:56
SimplePhotonAnalyzer::h1_pho_R9Barrel_
MonitorElement * h1_pho_R9Barrel_
Definition: SimplePhotonAnalyzer.h:71
SimplePhotonAnalyzer::h1_pho_ecalIsoBarrel_
MonitorElement * h1_pho_ecalIsoBarrel_
Definition: SimplePhotonAnalyzer.h:77
SimplePhotonAnalyzer::h1_pho_ecalIsoEndcap_
MonitorElement * h1_pho_ecalIsoEndcap_
Definition: SimplePhotonAnalyzer.h:78
HepMC::GenEvent
Definition: hepmc_rootio.cc:9
edm::Ref< PFCandidateCollection >
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
SimplePhotonAnalyzer::vertexProducer_
std::string vertexProducer_
Definition: SimplePhotonAnalyzer.h:60
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
spr::deltaEta
static const double deltaEta
Definition: CaloConstants.h:8
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
PVValHelper::eta
Definition: PVValidationHelpers.h:69
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
edm::ESHandle< CaloTopology >
SimplePhotonAnalyzer::mcProducer_
std::string mcProducer_
Definition: SimplePhotonAnalyzer.h:49
edm::Event::getByLabel
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:492
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SimplePhotonAnalyzer::etaTransformation
float etaTransformation(float a, float b)
Definition: SimplePhotonAnalyzer.cc:297
SimplePhotonAnalyzer::h1_pho_hOverEBarrel_
MonitorElement * h1_pho_hOverEBarrel_
Definition: SimplePhotonAnalyzer.h:75
EgHLTOffHistBins_cfi.hOverE
hOverE
Definition: EgHLTOffHistBins_cfi.py:17
SimplePhotonAnalyzer::h1_pho_sigmaIetaIetaBarrel_
MonitorElement * h1_pho_sigmaIetaIetaBarrel_
Definition: SimplePhotonAnalyzer.h:73
reco::Photon::r9
float r9() const
Definition: Photon.h:240
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
SimplePhotonAnalyzer::h1_pho_trkIsoBarrel_
MonitorElement * h1_pho_trkIsoBarrel_
Definition: SimplePhotonAnalyzer.h:81
SimplePhotonAnalyzer::h1_scEta_
MonitorElement * h1_scEta_
Definition: SimplePhotonAnalyzer.h:65
SimplePhotonAnalyzer::h1_deltaPhi_
MonitorElement * h1_deltaPhi_
Definition: SimplePhotonAnalyzer.h:87
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
dumpMFGeometry_cfg.delta
delta
Definition: dumpMFGeometry_cfg.py:25
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
edm::Service
Definition: Service.h:30
SiPixelOfflineDQM_source_cff.hiRes
hiRes
Definition: SiPixelOfflineDQM_source_cff.py:43
reco::PFCandidate::gamma
Definition: PFCandidate.h:49
edm::HepMCProduct::GetEvent
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:34
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
get
#define get
SimplePhotonAnalyzer::h1_pho_E_
MonitorElement * h1_pho_E_
Definition: SimplePhotonAnalyzer.h:67
nanoDQM_cff.Photon
Photon
Definition: nanoDQM_cff.py:63
SimplePhotonAnalyzer::photonCollectionProducer_
std::string photonCollectionProducer_
Definition: SimplePhotonAnalyzer.h:51
SimplePhotonAnalyzer::h1_pho_sigmaIetaIetaEndcap_
MonitorElement * h1_pho_sigmaIetaIetaEndcap_
Definition: SimplePhotonAnalyzer.h:74
SimplePhotonAnalyzer::valueMapPFCandPhoton_
std::string valueMapPFCandPhoton_
Definition: SimplePhotonAnalyzer.h:53
reco::Photon
Definition: Photon.h:21
reco::LeafCandidate::et
double et() const final
transverse energy
Definition: LeafCandidate.h:127
GenParticle.GenParticle
GenParticle
Definition: GenParticle.py:18
SimplePhotonAnalyzer::h1_recEoverTrueEEndcap_
MonitorElement * h1_recEoverTrueEEndcap_
Definition: SimplePhotonAnalyzer.h:85
reco::Photon::hadronicOverEm
float hadronicOverEm() const
the total hadronic over electromagnetic fraction
Definition: Photon.h:208
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
reco::Photon::trkSumPtSolidConeDR04
float trkSumPtSolidConeDR04() const
Definition: Photon.h:424
edm::ValueMap
Definition: ValueMap.h:107
SimplePhotonAnalyzer::dbe_
DQMStore * dbe_
Definition: SimplePhotonAnalyzer.h:63
ETA
#define ETA
Definition: GenericBenchmark.cc:28
edm::EventBase::id
edm::EventID id() const
Definition: EventBase.h:59
SimplePhotonAnalyzer::h1_pho_hcalIsoBarrel_
MonitorElement * h1_pho_hcalIsoBarrel_
Definition: SimplePhotonAnalyzer.h:79
SimplePhotonAnalyzer::h1_pho_Eta_
MonitorElement * h1_pho_Eta_
Definition: SimplePhotonAnalyzer.h:69
reco::Photon::ecalRecHitSumEtConeDR04
float ecalRecHitSumEtConeDR04() const
Definition: Photon.h:410
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
reco::LeafCandidate::energy
double energy() const final
energy
Definition: LeafCandidate.h:125
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
SimplePhotonAnalyzer::h1_pho_R9Endcap_
MonitorElement * h1_pho_R9Endcap_
Definition: SimplePhotonAnalyzer.h:72
reco::PhotonCollection
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
HLTObjectMonitor_cfi.photonPhi
photonPhi
Definition: HLTObjectMonitor_cfi.py:72
pi
const Double_t pi
Definition: trackSplitPlot.h:36
SimplePhotonAnalyzer::theCaloTopo_
edm::ESHandle< CaloTopology > theCaloTopo_
Definition: SimplePhotonAnalyzer.h:58
ExoticaDQM_cfi.photonCollection
photonCollection
Definition: ExoticaDQM_cfi.py:17
SimplePhotonAnalyzer::h1_pho_hOverEEndcap_
MonitorElement * h1_pho_hOverEEndcap_
Definition: SimplePhotonAnalyzer.h:76
parents
TPRegexp parents
Definition: eve_filter.cc:21
ZEcal
static constexpr float ZEcal
Definition: L1TkEmParticleProducer.cc:40
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::InputTag
Definition: InputTag.h:15
Z_Endcap
static constexpr float Z_Endcap
Definition: ECALPositionCalculator.cc:11
reco::Photon::hcalTowerSumEtConeDR04
float hcalTowerSumEtConeDR04() const
Hcal isolation sum.
Definition: Photon.h:412
R_ECAL
static constexpr float R_ECAL
Definition: ECALPositionCalculator.cc:10
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
SimplePhotonAnalyzer::h1_deltaEtaSC_
MonitorElement * h1_deltaEtaSC_
Definition: SimplePhotonAnalyzer.h:66
etaBarrelEndcap
static constexpr float etaBarrelEndcap
Definition: ECALPositionCalculator.cc:12
edm::ValueMap::size
size_t size() const
Definition: ValueMap.h:156
SimplePhotonAnalyzer::photonCollection_
std::string photonCollection_
Definition: SimplePhotonAnalyzer.h:52
SimplePhotonAnalyzer::barrelEcalHits_
edm::InputTag barrelEcalHits_
Definition: SimplePhotonAnalyzer.h:55