CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
SimplePhotonAnalyzer Class Reference
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
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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_
 
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
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
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<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

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 40 of file SimplePhotonAnalyzer.cc.

Member Typedef Documentation

Definition at line 42 of file SimplePhotonAnalyzer.cc.

Definition at line 43 of file SimplePhotonAnalyzer.cc.

Constructor & Destructor Documentation

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

Definition at line 98 of file SimplePhotonAnalyzer.cc.

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

100 {
102  photonCollection_ = ps.getParameter<std::string>("photonCollection");
103 
104  barrelEcalHits_ = ps.getParameter<edm::InputTag>("barrelEcalHits");
105  endcapEcalHits_ = ps.getParameter<edm::InputTag>("endcapEcalHits");
106 
107  pfEgammaCandidates_ = ps.getParameter<edm::InputTag>("pfEgammaCandidates");
108  valueMapPFCandPhoton_ = ps.getParameter<std::string>("valueMapPhotons");
109 
110  mcProducer_ = ps.getParameter<std::string>("mcProducer");
111  //mcCollection_ = ps.getParameter<std::string>("mcCollection");
112  vertexProducer_ = ps.getParameter<std::string>("primaryVertexProducer");
113  sample_ = ps.getParameter<int>("sample");
114 }
edm::InputTag pfEgammaCandidates_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::string photonCollectionProducer_
SimplePhotonAnalyzer::~SimplePhotonAnalyzer ( )
override

Definition at line 117 of file SimplePhotonAnalyzer.cc.

119 {}

Member Function Documentation

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 202 of file SimplePhotonAnalyzer.cc.

References gather_cfg::cout, CommonMethods::delta(), spr::deltaEta, srCondWrite_cfg::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::Event::getByLabel(), 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(), edm::EventBase::id(), edm::Ref< C, T, F >::isNonnull(), edm::InputTag::label(), mcProducer_, AlCaHLTBitMon_ParallelJobs::p, parents, pfEgammaCandidates_, reco::LeafCandidate::phi(), configurableAnalysis::Photon, photonCollection_, photonCollectionProducer_, pi, funct::pow(), reco::Photon::r9(), reco::Photon::sigmaIetaIeta(), mathSSE::sqrt(), reco::Photon::superCluster(), reco::Photon::trkSumPtSolidConeDR04(), and valueMapPFCandPhoton_.

202  {
203  //========================================================================
204 
205  using namespace edm; // needed for all fwk related classes
206  edm::LogInfo("PhotonAnalyzer") << "Analyzing event number: " << evt.id() << "\n";
207 
208  // Get the corrected photon collection (set in the configuration) which also contains infos about conversions
209 
210  Handle<reco::PhotonCollection> photonHandle;
212  const reco::PhotonCollection photonCollection = *(photonHandle.product());
213 
214  Handle<HepMCProduct> hepProd;
215  evt.getByLabel(mcProducer_, hepProd);
216  const HepMC::GenEvent* myGenEvent = hepProd->GetEvent();
217 
218  // Get the PF refined cluster collection
219  Handle<reco::PFCandidateCollection> pfCandidateHandle;
220  evt.getByLabel(pfEgammaCandidates_, pfCandidateHandle);
221  if (!pfCandidateHandle.isValid()) {
222  edm::LogError("SimplePhotonAnalyzer") << "Error! Can't get the product " << pfEgammaCandidates_.label();
223  }
224 
225  edm::Handle<edm::ValueMap<reco::PhotonRef> > pfCandToPhotonMapHandle;
226  edm::ValueMap<reco::PhotonRef> pfCandToPhotonMap;
227  evt.getByLabel("gedPhotons", valueMapPFCandPhoton_, pfCandToPhotonMapHandle);
228  if (!pfCandToPhotonMapHandle.isValid()) {
229  edm::LogInfo("SimplePhotonAnalyzer") << "Error! Can't get the product: valueMapPhotons " << std::endl;
230  }
231  pfCandToPhotonMap = *(pfCandToPhotonMapHandle.product());
232 
233  std::cout << " SimplePhotonAnalyzer valueMap size" << pfCandToPhotonMap.size() << std::endl;
234  unsigned nObj = pfCandidateHandle->size();
235  for (unsigned int lCand = 0; lCand < nObj; lCand++) {
236  reco::PFCandidateRef pfCandRef(reco::PFCandidateRef(pfCandidateHandle, lCand));
237  if (pfCandRef->particleId() != reco::PFCandidate::gamma)
238  continue;
239  reco::PhotonRef myPho = (pfCandToPhotonMap)[pfCandRef];
240  if (myPho.isNonnull())
241  std::cout << " PF SC " << pfCandRef->superClusterRef()->energy() << " Photon SC "
242  << myPho->superCluster()->energy() << std::endl;
243  }
244 
245  for (HepMC::GenEvent::particle_const_iterator p = myGenEvent->particles_begin(); p != myGenEvent->particles_end();
246  ++p) {
247  if (!((*p)->pdg_id() == 22 && (*p)->status() == 1))
248  continue;
249 
250  // single primary photons or photons from Higgs or RS Graviton
251  HepMC::GenParticle* mother = nullptr;
252  if ((*p)->production_vertex()) {
253  if ((*p)->production_vertex()->particles_begin(HepMC::parents) !=
254  (*p)->production_vertex()->particles_end(HepMC::parents))
255  mother = *((*p)->production_vertex()->particles_begin(HepMC::parents));
256  }
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;
261  int index = 0;
262  int iMatch = -1;
263 
264  float phiPho = (*p)->momentum().phi();
265  float etaPho = (*p)->momentum().eta();
266  etaPho = etaTransformation(etaPho, (*p)->production_vertex()->position().z() / 10.);
267 
268  bool matched = false;
269  // loop Photon candidates
270  for (reco::PhotonCollection::const_iterator iPho = photonCollection.begin(); iPho != photonCollection.end();
271  iPho++) {
272  reco::Photon localPho = reco::Photon(*iPho);
273  localPhotons.push_back(localPho);
274 
276  float phiClu = localPho.phi();
277  float etaClu = localPho.eta();
278  float deltaPhi = phiClu - phiPho;
279  float deltaEta = etaClu - etaPho;
280 
281  if (deltaPhi > pi)
282  deltaPhi -= twopi;
283  if (deltaPhi < -pi)
284  deltaPhi += twopi;
285  deltaPhi = std::pow(deltaPhi, 2);
286  deltaEta = std::pow(deltaEta, 2);
287  float delta = sqrt(deltaPhi + deltaEta);
288  if (delta < 0.1 && delta < minDelta) {
289  minDelta = delta;
290  iMatch = index;
291  }
292  index++;
293  } // End loop over photons
294 
295  if (iMatch > -1)
296  matched = true;
297 
299  if (matched) {
300  reco::Photon matchingPho = localPhotons[iMatch];
301 
302  bool phoIsInBarrel = false;
303  if (fabs(matchingPho.superCluster()->position().eta()) < 1.479) {
304  phoIsInBarrel = true;
305  }
306  edm::Handle<EcalRecHitCollection> ecalRecHitHandle;
307 
308  h1_scEta_->Fill(matchingPho.superCluster()->position().eta());
309  float trueEta = (*p)->momentum().eta();
310  trueEta = etaTransformation(trueEta, (*p)->production_vertex()->position().z() / 10.);
311  h1_deltaEtaSC_->Fill(localPhotons[iMatch].superCluster()->eta() - trueEta);
312 
313  float photonE = matchingPho.energy();
314  float photonEt = matchingPho.et();
315  float photonEta = matchingPho.eta();
316  float photonPhi = matchingPho.phi();
317 
318  float r9 = matchingPho.r9();
319  float sigmaIetaIeta = matchingPho.sigmaIetaIeta();
320  float hOverE = matchingPho.hadronicOverEm();
321  float ecalIso = matchingPho.ecalRecHitSumEtConeDR04();
322  float hcalIso = matchingPho.hcalTowerSumEtConeDR04();
323  float trkIso = matchingPho.trkSumPtSolidConeDR04();
324 
325  h1_pho_E_->Fill(photonE);
326  h1_pho_Et_->Fill(photonEt);
327  h1_pho_Eta_->Fill(photonEta);
328  h1_pho_Phi_->Fill(photonPhi);
329 
330  h1_deltaEta_->Fill(photonEta - (*p)->momentum().eta());
331  h1_deltaPhi_->Fill(photonPhi - (*p)->momentum().phi());
332 
333  if (phoIsInBarrel) {
334  h1_recEoverTrueEBarrel_->Fill(photonE / (*p)->momentum().e());
335  h1_pho_R9Barrel_->Fill(r9);
336  h1_pho_sigmaIetaIetaBarrel_->Fill(sigmaIetaIeta);
337  h1_pho_hOverEBarrel_->Fill(hOverE);
338  h1_pho_ecalIsoBarrel_->Fill(ecalIso);
339  h1_pho_hcalIsoBarrel_->Fill(hcalIso);
340  h1_pho_trkIsoBarrel_->Fill(trkIso);
341 
342  } else {
343  h1_recEoverTrueEEndcap_->Fill(photonE / (*p)->momentum().e());
344  h1_pho_R9Endcap_->Fill(r9);
345  h1_pho_sigmaIetaIetaEndcap_->Fill(sigmaIetaIeta);
346  h1_pho_hOverEEndcap_->Fill(hOverE);
347  h1_pho_ecalIsoEndcap_->Fill(ecalIso);
348  h1_pho_hcalIsoEndcap_->Fill(hcalIso);
349  h1_pho_trkIsoEndcap_->Fill(trkIso);
350  }
351 
352  } // reco photon matching MC truth
353 
354  } // End loop over MC particles
355  }
356 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
TPRegexp parents
Definition: eve_filter.cc:21
float etaTransformation(float a, float b)
constexpr char Photon[]
Definition: modules.cc:14
MonitorElement * h1_scEta_
MonitorElement * h1_deltaPhi_
float hcalTowerSumEtConeDR04(int depth=0) const
Definition: Photon.h:475
float trkSumPtSolidConeDR04() const
Definition: Photon.h:495
edm::InputTag pfEgammaCandidates_
float ecalRecHitSumEtConeDR04() const
Definition: Photon.h:457
MonitorElement * h1_pho_R9Barrel_
MonitorElement * h1_pho_Eta_
MonitorElement * h1_pho_hcalIsoEndcap_
Log< level::Error, false > LogError
MonitorElement * h1_recEoverTrueEEndcap_
static const double deltaEta
Definition: CaloConstants.h:8
MonitorElement * h1_recEoverTrueEBarrel_
const Double_t pi
void Fill(long long x)
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
T sqrt(T t)
Definition: SSEVec.h:19
MonitorElement * h1_pho_trkIsoBarrel_
float sigmaIetaIeta() const
Definition: Photon.h:273
MonitorElement * h1_pho_E_
MonitorElement * h1_deltaEta_
MonitorElement * h1_pho_trkIsoEndcap_
float hadronicOverEm(int depth=0) const
Definition: Photon.h:236
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:500
MonitorElement * h1_pho_hcalIsoBarrel_
Log< level::Info, false > LogInfo
MonitorElement * h1_pho_Phi_
MonitorElement * h1_pho_sigmaIetaIetaBarrel_
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
MonitorElement * h1_pho_hOverEEndcap_
std::string const & label() const
Definition: InputTag.h:36
MonitorElement * h1_pho_R9Endcap_
edm::EventID id() const
Definition: EventBase.h:59
double et() const final
transverse energy
float r9() const
Definition: Photon.h:276
MonitorElement * h1_pho_ecalIsoBarrel_
tuple cout
Definition: gather_cfg.py:144
MonitorElement * h1_pho_ecalIsoEndcap_
MonitorElement * h1_pho_sigmaIetaIetaEndcap_
MonitorElement * h1_deltaEtaSC_
MonitorElement * h1_pho_Et_
double phi() const final
momentum azimuthal angle
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
std::string photonCollectionProducer_
MonitorElement * h1_pho_hOverEBarrel_
double energy() const final
energy
double eta() const final
momentum pseudorapidity
void SimplePhotonAnalyzer::beginJob ( void  )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 122 of file SimplePhotonAnalyzer.cc.

References dqm::implementation::IBooker::book1D(), dbe_, 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_, Utilities::operator, and sample_.

122  {
123  //========================================================================
124 
125  dbe_ = nullptr;
127 
128  float hiE = 0;
129  float loE = 0;
130  float hiEt = 0;
131  float loEt = 0;
132  float dPhi = 0;
133  float loRes = 0;
134  float hiRes = 0;
135  if (sample_ == 1) {
136  loE = 0.;
137  hiE = 30.;
138  loEt = 0.;
139  hiEt = 30.;
140  dPhi = 0.2;
141  loRes = 0.;
142  hiRes = 1.2;
143  } else if (sample_ == 2) {
144  loE = 0.;
145  hiE = 200.;
146  loEt = 0.;
147  hiEt = 50.;
148  dPhi = 0.05;
149  loRes = 0.7;
150  hiRes = 1.2;
151  } else if (sample_ == 3) {
152  loE = 0.;
153  hiE = 500.;
154  loEt = 0.;
155  hiEt = 500.;
156  dPhi = 0.05;
157  loRes = 0.7;
158  hiRes = 1.2;
159  } else if (sample_ == 4) {
160  loE = 0.;
161  hiE = 6000.;
162  loEt = 0.;
163  hiEt = 1200.;
164  dPhi = 0.05;
165  loRes = 0.7;
166  hiRes = 1.2;
167  }
168 
169  h1_deltaEta_ = dbe_->book1D("deltaEta", " Reco photon Eta minus Generated photon Eta ", 100, -0.2, 0.2);
170  h1_deltaPhi_ = dbe_->book1D("deltaPhi", "Reco photon Phi minus Generated photon Phi ", 100, -dPhi, dPhi);
171  h1_pho_Eta_ = dbe_->book1D("phoEta", "Photon Eta ", 40, -3., 3.);
172  h1_pho_Phi_ = dbe_->book1D("phoPhi", "Photon Phi ", 40, -3.14, 3.14);
173  h1_pho_E_ = dbe_->book1D("phoE", "Photon Energy ", 100, loE, hiE);
174  h1_pho_Et_ = dbe_->book1D("phoEt", "Photon Et ", 100, loEt, hiEt);
175 
176  h1_scEta_ = dbe_->book1D("scEta", " SC Eta ", 40, -3., 3.);
177  h1_deltaEtaSC_ = dbe_->book1D("deltaEtaSC", " SC Eta minus Generated photon Eta ", 100, -0.02, 0.02);
178 
179  //
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);
184 
185  //
186 
187  h1_pho_R9Barrel_ = dbe_->book1D("phoR9Barrel", "Photon 3x3 energy / SuperCluster energy : Barrel ", 100, 0., 1.2);
188  h1_pho_R9Endcap_ = dbe_->book1D("phoR9Endcap", "Photon 3x3 energy / SuperCluster energy : Endcap ", 100, 0., 1.2);
189  h1_pho_sigmaIetaIetaBarrel_ = dbe_->book1D("sigmaIetaIetaBarrel", "sigmaIetaIeta: Barrel", 100, 0., 0.05);
190  h1_pho_sigmaIetaIetaEndcap_ = dbe_->book1D("sigmaIetaIetaEndcap", "sigmaIetaIeta: Endcap", 100, 0., 0.1);
191  h1_pho_hOverEBarrel_ = dbe_->book1D("hOverEBarrel", "H/E: Barrel", 100, 0., 0.1);
192  h1_pho_hOverEEndcap_ = dbe_->book1D("hOverEEndcap", "H/E: Endcap", 100, 0., 0.1);
193  h1_pho_ecalIsoBarrel_ = dbe_->book1D("ecalIsolBarrel", "isolation et sum in Ecal: Barrel", 100, 0., 100.);
194  h1_pho_ecalIsoEndcap_ = dbe_->book1D("ecalIsolEndcap", "isolation et sum in Ecal: Endcap", 100, 0., 100.);
195  h1_pho_hcalIsoBarrel_ = dbe_->book1D("hcalIsolBarrel", "isolation et sum in Hcal: Barrel", 100, 0., 100.);
196  h1_pho_hcalIsoEndcap_ = dbe_->book1D("hcalIsolEndcap", "isolation et sum in Hcal: Endcap", 100, 0., 100.);
197  h1_pho_trkIsoBarrel_ = dbe_->book1D("trkIsolBarrel", "isolation pt sum in the tracker: Barrel", 100, 0., 100.);
198  h1_pho_trkIsoEndcap_ = dbe_->book1D("trkIsolEndcap", "isolation pt sum in the tracker: Endcap", 100, 0., 100.);
199 }
MonitorElement * h1_scEta_
MonitorElement * h1_deltaPhi_
MonitorElement * h1_pho_R9Barrel_
MonitorElement * h1_pho_Eta_
MonitorElement * h1_pho_hcalIsoEndcap_
MonitorElement * h1_recEoverTrueEEndcap_
MonitorElement * h1_recEoverTrueEBarrel_
MonitorElement * h1_pho_trkIsoBarrel_
MonitorElement * h1_pho_E_
MonitorElement * h1_deltaEta_
MonitorElement * h1_pho_trkIsoEndcap_
MonitorElement * h1_pho_hcalIsoBarrel_
MonitorElement * h1_pho_Phi_
MonitorElement * h1_pho_sigmaIetaIetaBarrel_
MonitorElement * h1_pho_hOverEEndcap_
MonitorElement * h1_pho_R9Endcap_
MonitorElement * h1_pho_ecalIsoBarrel_
MonitorElement * h1_pho_ecalIsoEndcap_
MonitorElement * h1_pho_sigmaIetaIetaEndcap_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MonitorElement * h1_deltaEtaSC_
MonitorElement * h1_pho_Et_
MonitorElement * h1_pho_hOverEBarrel_
void SimplePhotonAnalyzer::endJob ( void  )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 396 of file SimplePhotonAnalyzer.cc.

396  {
397  //========================================================================
398 }
float SimplePhotonAnalyzer::etaTransformation ( float  a,
float  b 
)
private

Definition at line 358 of file SimplePhotonAnalyzer.cc.

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

Referenced by analyze().

358  {
359  //---Definitions
360  const float PI = 3.1415927;
361  //UNUSED const float TWOPI = 2.0*PI;
362 
363  //---Definitions for ECAL
364  const float R_ECAL = 136.5;
365  const float Z_Endcap = 328.0;
366  const float etaBarrelEndcap = 1.479;
367 
368  //---ETA correction
369 
370  float Theta = 0.0;
371  float ZEcal = R_ECAL * sinh(EtaParticle) + Zvertex;
372 
373  if (ZEcal != 0.0)
374  Theta = atan(R_ECAL / ZEcal);
375  if (Theta < 0.0)
376  Theta = Theta + PI;
377  float ETA = -log(tan(0.5 * Theta));
378 
379  if (fabs(ETA) > etaBarrelEndcap) {
380  float Zend = Z_Endcap;
381  if (EtaParticle < 0.0)
382  Zend = -Zend;
383  float Zlen = Zend - Zvertex;
384  float RR = Zlen / sinh(EtaParticle);
385  Theta = atan(RR / Zend);
386  if (Theta < 0.0)
387  Theta = Theta + PI;
388  ETA = -log(tan(0.5 * Theta));
389  }
390  //---Return the result
391  return ETA;
392  //---end
393 }
static std::vector< std::string > checklist log
static constexpr float R_ECAL
#define ETA
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
static constexpr float etaBarrelEndcap
#define PI
Definition: QcdUeDQM.h:37
static constexpr float ZEcal
static constexpr float Z_Endcap

Member Data Documentation

edm::InputTag SimplePhotonAnalyzer::barrelEcalHits_
private

Definition at line 61 of file SimplePhotonAnalyzer.cc.

Referenced by SimplePhotonAnalyzer().

DQMStore* SimplePhotonAnalyzer::dbe_
private

Definition at line 67 of file SimplePhotonAnalyzer.cc.

Referenced by beginJob().

edm::InputTag SimplePhotonAnalyzer::endcapEcalHits_
private

Definition at line 62 of file SimplePhotonAnalyzer.cc.

Referenced by SimplePhotonAnalyzer().

MonitorElement* SimplePhotonAnalyzer::h1_deltaEta_
private

Definition at line 90 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_deltaEtaSC_
private

Definition at line 70 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_deltaPhi_
private

Definition at line 91 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_E_
private

Definition at line 71 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_ecalIsoBarrel_
private

Definition at line 81 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_ecalIsoEndcap_
private

Definition at line 82 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_Et_
private

Definition at line 72 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_Eta_
private

Definition at line 73 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_hcalIsoBarrel_
private

Definition at line 83 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_hcalIsoEndcap_
private

Definition at line 84 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_hOverEBarrel_
private

Definition at line 79 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_hOverEEndcap_
private

Definition at line 80 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_Phi_
private

Definition at line 74 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_R9Barrel_
private

Definition at line 75 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_R9Endcap_
private

Definition at line 76 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_sigmaIetaIetaBarrel_
private

Definition at line 77 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_sigmaIetaIetaEndcap_
private

Definition at line 78 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_trkIsoBarrel_
private

Definition at line 85 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_trkIsoEndcap_
private

Definition at line 86 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_recEoverTrueEBarrel_
private

Definition at line 88 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_recEoverTrueEEndcap_
private

Definition at line 89 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_scEta_
private

Definition at line 69 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and beginJob().

std::string SimplePhotonAnalyzer::mcCollection_
private

Definition at line 56 of file SimplePhotonAnalyzer.cc.

std::string SimplePhotonAnalyzer::mcProducer_
private

Definition at line 55 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and SimplePhotonAnalyzer().

edm::InputTag SimplePhotonAnalyzer::pfEgammaCandidates_
private

Definition at line 60 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and SimplePhotonAnalyzer().

std::string SimplePhotonAnalyzer::photonCollection_
private

Definition at line 58 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and SimplePhotonAnalyzer().

std::string SimplePhotonAnalyzer::photonCollectionProducer_
private

Definition at line 57 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and SimplePhotonAnalyzer().

float SimplePhotonAnalyzer::sample_
private

Definition at line 65 of file SimplePhotonAnalyzer.cc.

Referenced by beginJob(), and SimplePhotonAnalyzer().

std::string SimplePhotonAnalyzer::valueMapPFCandPhoton_
private

Definition at line 59 of file SimplePhotonAnalyzer.cc.

Referenced by analyze(), and SimplePhotonAnalyzer().

std::string SimplePhotonAnalyzer::vertexProducer_
private

Definition at line 64 of file SimplePhotonAnalyzer.cc.

Referenced by SimplePhotonAnalyzer().