CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
SimplePhotonAnalyzer Class Reference

#include <SimplePhotonAnalyzer.h>

Inheritance diagram for SimplePhotonAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void endJob ()
 
 SimplePhotonAnalyzer (const edm::ParameterSet &)
 
 ~SimplePhotonAnalyzer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

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 38 of file SimplePhotonAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 33 of file SimplePhotonAnalyzer.cc.

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

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 
50 
51 }
T getParameter(std::string const &) const
edm::InputTag pfEgammaCandidates_
std::string photonCollectionProducer_
SimplePhotonAnalyzer::~SimplePhotonAnalyzer ( )

Definition at line 55 of file SimplePhotonAnalyzer.cc.

57 {
58 
59 
60 }

Member Function Documentation

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

Match reconstructed photon candidates with the nearest generated photonPho;

Plot kinematic disctributions for matched photons

Implements edm::EDAnalyzer.

Definition at line 154 of file SimplePhotonAnalyzer.cc.

References gather_cfg::cout, delta, HLTFastRecoForTau_cff::deltaEta, SiPixelRawToDigiRegional_cfi::deltaPhi, reco::Photon::ecalRecHitSumEtConeDR04(), reco::LeafCandidate::energy(), reco::LeafCandidate::et(), eta(), reco::LeafCandidate::eta(), etaTransformation(), MonitorElement::Fill(), HcalObjRepresent::Fill(), reco::PFCandidate::gamma, configurableAnalysis::GenParticle, edm::EventSetup::get(), 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(), cmsHarvester::index, edm::Ref< C, T, F >::isNonnull(), edm::InputTag::label(), mcProducer_, AlCaHLTBitMon_ParallelJobs::p, parents, pfEgammaCandidates_, reco::LeafCandidate::phi(), photonCollection_, photonCollectionProducer_, pi, funct::pow(), reco::Photon::r9(), reco::Photon::sigmaIetaIeta(), mathSSE::sqrt(), reco::Photon::superCluster(), theCaloTopo_, reco::Photon::trkSumPtSolidConeDR04(), and valueMapPFCandPhoton_.

154  {
155 //========================================================================
156 
157  using namespace edm; // needed for all fwk related classes
158  edm::LogInfo("PhotonAnalyzer") << "Analyzing event number: " << evt.id() << "\n";
159 
160 
161  // get the calo topology from the event setup:
162  edm::ESHandle<CaloTopology> pTopology;
164 
165 
166 
167  // Get the corrected photon collection (set in the configuration) which also contains infos about conversions
168 
169  Handle<reco::PhotonCollection> photonHandle;
171  const reco::PhotonCollection photonCollection = *(photonHandle.product());
172 
173  Handle< HepMCProduct > hepProd ;
174  evt.getByLabel( mcProducer_.c_str(), hepProd ) ;
175  const HepMC::GenEvent * myGenEvent = hepProd->GetEvent();
176 
177 
178  // Get the PF refined cluster collection
179  Handle<reco::PFCandidateCollection> pfCandidateHandle;
180  evt.getByLabel(pfEgammaCandidates_,pfCandidateHandle);
181  if (!pfCandidateHandle.isValid()) {
182  edm::LogError("SimplePhotonAnalyzer") << "Error! Can't get the product "<<pfEgammaCandidates_.label();
183  }
184 
185  edm::Handle<edm::ValueMap<reco::PhotonRef> > pfCandToPhotonMapHandle;
186  edm::ValueMap<reco::PhotonRef> pfCandToPhotonMap;
187  evt.getByLabel("gedPhotons",valueMapPFCandPhoton_,pfCandToPhotonMapHandle);
188  if ( ! pfCandToPhotonMapHandle.isValid()) {
189  edm::LogInfo("SimplePhotonAnalyzer") << "Error! Can't get the product: valueMapPhotons " << std::endl;
190  }
191  pfCandToPhotonMap = *(pfCandToPhotonMapHandle.product());
192 
193  std::cout << " SimplePhotonAnalyzer valueMap size" << pfCandToPhotonMap.size() << std::endl;
194  unsigned nObj = pfCandidateHandle->size();
195  for(unsigned int lCand=0; lCand < nObj; lCand++) {
196  reco::PFCandidateRef pfCandRef (reco::PFCandidateRef(pfCandidateHandle,lCand));
197  if(pfCandRef->particleId()!=reco::PFCandidate::gamma) continue;
198  reco::PhotonRef myPho= (pfCandToPhotonMap)[pfCandRef];
199  if ( myPho.isNonnull() ) std::cout << " PF SC " << pfCandRef->superClusterRef()->energy() << " Photon SC " << myPho->superCluster()->energy() << std::endl;
200  }
201 
202 
203 
204  for ( HepMC::GenEvent::particle_const_iterator p = myGenEvent->particles_begin(); p != myGenEvent->particles_end(); ++p ) {
205  if ( !( (*p)->pdg_id() == 22 && (*p)->status()==1 ) ) continue;
206 
207  // single primary photons or photons from Higgs or RS Graviton
208  HepMC::GenParticle* mother = 0;
209  if ( (*p)->production_vertex() ) {
210  if ( (*p)->production_vertex()->particles_begin(HepMC::parents) !=
211  (*p)->production_vertex()->particles_end(HepMC::parents))
212  mother = *((*p)->production_vertex()->particles_begin(HepMC::parents));
213  }
214  if ( ((mother == 0) || ((mother != 0) && (mother->pdg_id() == 25))
215  || ((mother != 0) && (mother->pdg_id() == 22)))) {
216 
217  float minDelta=10000.;
218  std::vector<reco::Photon> localPhotons;
219  int index=0;
220  int iMatch=-1;
221 
222  float phiPho=(*p)->momentum().phi();
223  float etaPho=(*p)->momentum().eta();
224  etaPho = etaTransformation(etaPho, (*p)->production_vertex()->position().z()/10. );
225 
226  bool matched=false;
227  // loop Photon candidates
228  for( reco::PhotonCollection::const_iterator iPho = photonCollection.begin(); iPho != photonCollection.end(); iPho++) {
229  reco::Photon localPho = reco::Photon(*iPho);
230  localPhotons.push_back(localPho);
231 
233  float phiClu=localPho.phi();
234  float etaClu=localPho.eta();
235  float deltaPhi = phiClu-phiPho;
236  float deltaEta = etaClu-etaPho;
237 
238  if ( deltaPhi > pi ) deltaPhi -= twopi;
239  if ( deltaPhi < -pi) deltaPhi += twopi;
240  deltaPhi=std::pow(deltaPhi,2);
241  deltaEta=std::pow(deltaEta,2);
242  float delta = sqrt( deltaPhi+deltaEta);
243  if ( delta<0.1 && delta < minDelta ) {
244  minDelta=delta;
245  iMatch=index;
246 
247  }
248  index++;
249  } // End loop over photons
250 
251 
252  if ( iMatch>-1 ) matched = true;
253 
255  if (matched ) {
256 
257  reco::Photon matchingPho = localPhotons[iMatch];
258 
259  bool phoIsInBarrel=false;
260  if ( fabs(matchingPho.superCluster()->position().eta() ) < 1.479 ) {
261  phoIsInBarrel=true;
262  }
263  edm::Handle<EcalRecHitCollection> ecalRecHitHandle;
264 
265 
266  h1_scEta_->Fill( matchingPho.superCluster()->position().eta() );
267  float trueEta= (*p)->momentum().eta() ;
268  trueEta = etaTransformation(trueEta, (*p)->production_vertex()->position().z()/10. );
269  h1_deltaEtaSC_ -> Fill( localPhotons[iMatch].superCluster()->eta()- trueEta );
270 
271  float photonE = matchingPho.energy();
272  float photonEt= matchingPho.et() ;
273  float photonEta= matchingPho.eta() ;
274  float photonPhi= matchingPho.phi() ;
275 
276  float r9 = matchingPho.r9();
277  float sigmaIetaIeta = matchingPho.sigmaIetaIeta();
278  float hOverE = matchingPho.hadronicOverEm();
279  float ecalIso = matchingPho.ecalRecHitSumEtConeDR04();
280  float hcalIso = matchingPho.hcalTowerSumEtConeDR04();
281  float trkIso = matchingPho.trkSumPtSolidConeDR04();
282 
283 
284  h1_pho_E_->Fill( photonE );
285  h1_pho_Et_->Fill( photonEt );
286  h1_pho_Eta_->Fill( photonEta );
287  h1_pho_Phi_->Fill( photonPhi );
288 
289  h1_deltaEta_ -> Fill( photonEta - (*p)->momentum().eta() );
290  h1_deltaPhi_ -> Fill( photonPhi - (*p)->momentum().phi() );
291 
292  if ( phoIsInBarrel ) {
293  h1_recEoverTrueEBarrel_ -> Fill ( photonE / (*p)->momentum().e() );
294  h1_pho_R9Barrel_->Fill( r9 );
295  h1_pho_sigmaIetaIetaBarrel_->Fill ( sigmaIetaIeta );
296  h1_pho_hOverEBarrel_-> Fill ( hOverE );
297  h1_pho_ecalIsoBarrel_-> Fill ( ecalIso );
298  h1_pho_hcalIsoBarrel_-> Fill ( hcalIso );
299  h1_pho_trkIsoBarrel_-> Fill ( trkIso );
300 
301  } else {
302  h1_recEoverTrueEEndcap_ -> Fill ( photonE / (*p)->momentum().e() );
303  h1_pho_R9Endcap_->Fill( r9 );
304  h1_pho_sigmaIetaIetaEndcap_->Fill ( sigmaIetaIeta );
305  h1_pho_hOverEEndcap_-> Fill ( hOverE );
306  h1_pho_ecalIsoEndcap_-> Fill ( ecalIso );
307  h1_pho_hcalIsoEndcap_-> Fill ( hcalIso );
308  h1_pho_trkIsoEndcap_-> Fill ( trkIso );
309 
310 
311  }
312 
313 
314  } // reco photon matching MC truth
315 
316 
317 
318 
319  } // End loop over MC particles
320 
321  }
322 
323 
324 }
dbl * delta
Definition: mlp_gen.cc:36
float hcalTowerSumEtConeDR04() const
Hcal isolation sum.
Definition: Photon.h:342
TPRegexp parents
Definition: eve_filter.cc:24
float etaTransformation(float a, float b)
MonitorElement * h1_scEta_
MonitorElement * h1_deltaPhi_
virtual double et() const
transverse energy
virtual float phi() const
momentum azimuthal angle
float trkSumPtSolidConeDR04() const
Definition: Photon.h:354
edm::InputTag pfEgammaCandidates_
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
Definition: Photon.cc:58
float ecalRecHitSumEtConeDR04() const
Definition: Photon.h:340
MonitorElement * h1_pho_R9Barrel_
MonitorElement * h1_pho_Eta_
MonitorElement * h1_pho_hcalIsoEndcap_
T eta() const
MonitorElement * h1_recEoverTrueEEndcap_
MonitorElement * h1_recEoverTrueEBarrel_
void Fill(long long x)
const Double_t pi
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
virtual double energy() const
energy
edm::ESHandle< CaloTopology > theCaloTopo_
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
virtual float eta() const
momentum pseudorapidity
T sqrt(T t)
Definition: SSEVec.h:48
MonitorElement * h1_pho_trkIsoBarrel_
float sigmaIetaIeta() const
Definition: Photon.h:190
MonitorElement * h1_pho_E_
MonitorElement * h1_deltaEta_
MonitorElement * h1_pho_trkIsoEndcap_
float hadronicOverEm() const
the total hadronic over electromagnetic fraction
Definition: Photon.h:169
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
MonitorElement * h1_pho_hcalIsoBarrel_
MonitorElement * h1_pho_Phi_
MonitorElement * h1_pho_sigmaIetaIetaBarrel_
const T & get() const
Definition: EventSetup.h:55
MonitorElement * h1_pho_hOverEEndcap_
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
std::string const & label() const
Definition: InputTag.h:42
MonitorElement * h1_pho_R9Endcap_
edm::EventID id() const
Definition: EventBase.h:56
float r9() const
Definition: Photon.h:193
MonitorElement * h1_pho_ecalIsoBarrel_
tuple cout
Definition: gather_cfg.py:121
MonitorElement * h1_pho_ecalIsoEndcap_
MonitorElement * h1_pho_sigmaIetaIetaEndcap_
MonitorElement * h1_deltaEtaSC_
MonitorElement * h1_pho_Et_
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
std::string photonCollectionProducer_
MonitorElement * h1_pho_hOverEBarrel_
void SimplePhotonAnalyzer::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 64 of file SimplePhotonAnalyzer.cc.

References DQMStore::book1D(), dbe_, 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_, cppFunctionSkipper::operator, and sample_.

64  {
65 //========================================================================
66 
67 
68  dbe_ = 0;
70 
71 
72 
73  float hiE=0;
74  float loE=0;
75  float hiEt=0;
76  float loEt=0;
77  float dPhi=0;
78  float loRes=0;
79  float hiRes=0;
80  if ( sample_ ==1 ) {
81  loE=0.;
82  hiE=30.;
83  loEt=0.;
84  hiEt=30.;
85  dPhi=0.2;
86  loRes=0.;
87  hiRes=1.2;
88  } else if ( sample_ ==2 ) {
89  loE=0.;
90  hiE=200.;
91  loEt=0.;
92  hiEt=50.;
93  dPhi=0.05;
94  loRes=0.7;
95  hiRes=1.2;
96  } else if ( sample_ ==3 ) {
97  loE=0.;
98  hiE=500.;
99  loEt=0.;
100  hiEt=500.;
101  dPhi=0.05;
102  loRes=0.7;
103  hiRes=1.2;
104  } else if (sample_==4) {
105  loE=0.;
106  hiE=6000.;
107  loEt=0.;
108  hiEt=1200.;
109  dPhi=0.05;
110  loRes=0.7;
111  hiRes=1.2;
112  }
113 
114 
115 
116  h1_deltaEta_ = dbe_->book1D("deltaEta"," Reco photon Eta minus Generated photon Eta ",100,-0.2, 0.2);
117  h1_deltaPhi_ = dbe_->book1D("deltaPhi","Reco photon Phi minus Generated photon Phi ",100,-dPhi, dPhi);
118  h1_pho_Eta_ = dbe_->book1D("phoEta","Photon Eta ",40,-3., 3.);
119  h1_pho_Phi_ = dbe_->book1D("phoPhi","Photon Phi ",40,-3.14, 3.14);
120  h1_pho_E_ = dbe_->book1D("phoE","Photon Energy ",100,loE,hiE);
121  h1_pho_Et_ = dbe_->book1D("phoEt","Photon Et ",100,loEt,hiEt);
122 
123  h1_scEta_ = dbe_->book1D("scEta"," SC Eta ",40,-3., 3.);
124  h1_deltaEtaSC_ = dbe_->book1D("deltaEtaSC"," SC Eta minus Generated photon Eta ",100,-0.02, 0.02);
125 
126  //
127  h1_recEoverTrueEBarrel_ = dbe_->book1D("recEoverTrueEBarrel"," Reco photon Energy over Generated photon Energy: Barrel ",100,loRes, hiRes);
128  h1_recEoverTrueEEndcap_ = dbe_->book1D("recEoverTrueEEndcap"," Reco photon Energy over Generated photon Energy: Endcap ",100,loRes, hiRes);
129 
130  //
131 
132  h1_pho_R9Barrel_ = dbe_->book1D("phoR9Barrel","Photon 3x3 energy / SuperCluster energy : Barrel ",100,0.,1.2);
133  h1_pho_R9Endcap_ = dbe_->book1D("phoR9Endcap","Photon 3x3 energy / SuperCluster energy : Endcap ",100,0.,1.2);
134  h1_pho_sigmaIetaIetaBarrel_ = dbe_->book1D("sigmaIetaIetaBarrel", "sigmaIetaIeta: Barrel",100,0., 0.05) ;
135  h1_pho_sigmaIetaIetaEndcap_ = dbe_->book1D("sigmaIetaIetaEndcap" , "sigmaIetaIeta: Endcap",100,0., 0.1) ;
136  h1_pho_hOverEBarrel_ = dbe_->book1D("hOverEBarrel", "H/E: Barrel",100,0., 0.1) ;
137  h1_pho_hOverEEndcap_ = dbe_->book1D("hOverEEndcap", "H/E: Endcap",100,0., 0.1) ;
138  h1_pho_ecalIsoBarrel_ = dbe_->book1D("ecalIsolBarrel", "isolation et sum in Ecal: Barrel",100,0., 100.) ;
139  h1_pho_ecalIsoEndcap_ = dbe_->book1D("ecalIsolEndcap", "isolation et sum in Ecal: Endcap",100,0., 100.) ;
140  h1_pho_hcalIsoBarrel_ = dbe_->book1D("hcalIsolBarrel", "isolation et sum in Hcal: Barrel",100,0., 100.) ;
141  h1_pho_hcalIsoEndcap_ = dbe_->book1D("hcalIsolEndcap", "isolation et sum in Hcal: Endcap",100,0., 100.) ;
142  h1_pho_trkIsoBarrel_ = dbe_->book1D("trkIsolBarrel", "isolation pt sum in the tracker: Barrel",100,0., 100.) ;
143  h1_pho_trkIsoEndcap_ = dbe_->book1D("trkIsolEndcap", "isolation pt sum in the tracker: Endcap",100,0., 100.) ;
144 
145 
146 
147 
148 
149 }
MonitorElement * h1_scEta_
MonitorElement * h1_deltaPhi_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:954
MonitorElement * h1_pho_R9Barrel_
MonitorElement * h1_pho_Eta_
MonitorElement * h1_pho_hcalIsoEndcap_
MonitorElement * h1_recEoverTrueEEndcap_
MonitorElement * h1_recEoverTrueEBarrel_
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
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 * h1_deltaEtaSC_
MonitorElement * h1_pho_Et_
MonitorElement * h1_pho_hOverEBarrel_
void SimplePhotonAnalyzer::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 367 of file SimplePhotonAnalyzer.cc.

367  {
368 //========================================================================
369 
370 
371 
372 }
float SimplePhotonAnalyzer::etaTransformation ( float  a,
float  b 
)
private

Definition at line 327 of file SimplePhotonAnalyzer.cc.

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

Referenced by analyze().

327  {
328 
329  //---Definitions
330  const float PI = 3.1415927;
331  //UNUSED const float TWOPI = 2.0*PI;
332 
333  //---Definitions for ECAL
334  const float R_ECAL = 136.5;
335  const float Z_Endcap = 328.0;
336  const float etaBarrelEndcap = 1.479;
337 
338  //---ETA correction
339 
340  float Theta = 0.0 ;
341  float ZEcal = R_ECAL*sinh(EtaParticle)+Zvertex;
342 
343  if(ZEcal != 0.0) Theta = atan(R_ECAL/ZEcal);
344  if(Theta<0.0) Theta = Theta+PI ;
345  float ETA = - log(tan(0.5*Theta));
346 
347  if( fabs(ETA) > etaBarrelEndcap )
348  {
349  float Zend = Z_Endcap ;
350  if(EtaParticle<0.0 ) Zend = -Zend ;
351  float Zlen = Zend - Zvertex ;
352  float RR = Zlen/sinh(EtaParticle);
353  Theta = atan(RR/Zend);
354  if(Theta<0.0) Theta = Theta+PI ;
355  ETA = - log(tan(0.5*Theta));
356  }
357  //---Return the result
358  return ETA;
359  //---end
360 }
static std::vector< std::string > checklist log
#define PI
#define ETA
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
static const float etaBarrelEndcap
static const float Z_Endcap
static const float R_ECAL

Member Data Documentation

edm::InputTag SimplePhotonAnalyzer::barrelEcalHits_
private

Definition at line 57 of file SimplePhotonAnalyzer.h.

Referenced by SimplePhotonAnalyzer().

DQMStore* SimplePhotonAnalyzer::dbe_
private

Definition at line 65 of file SimplePhotonAnalyzer.h.

Referenced by beginJob().

edm::InputTag SimplePhotonAnalyzer::endcapEcalHits_
private

Definition at line 58 of file SimplePhotonAnalyzer.h.

Referenced by SimplePhotonAnalyzer().

MonitorElement* SimplePhotonAnalyzer::h1_deltaEta_
private

Definition at line 91 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_deltaEtaSC_
private

Definition at line 69 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_deltaPhi_
private

Definition at line 92 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_E_
private

Definition at line 70 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_ecalIsoBarrel_
private

Definition at line 80 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_ecalIsoEndcap_
private

Definition at line 81 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_Et_
private

Definition at line 71 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_Eta_
private

Definition at line 72 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_hcalIsoBarrel_
private

Definition at line 82 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_hcalIsoEndcap_
private

Definition at line 83 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_hOverEBarrel_
private

Definition at line 78 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_hOverEEndcap_
private

Definition at line 79 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_Phi_
private

Definition at line 73 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_R9Barrel_
private

Definition at line 74 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_R9Endcap_
private

Definition at line 75 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_sigmaIetaIetaBarrel_
private

Definition at line 76 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_sigmaIetaIetaEndcap_
private

Definition at line 77 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_trkIsoBarrel_
private

Definition at line 84 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_pho_trkIsoEndcap_
private

Definition at line 85 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_recEoverTrueEBarrel_
private

Definition at line 89 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_recEoverTrueEEndcap_
private

Definition at line 90 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

MonitorElement* SimplePhotonAnalyzer::h1_scEta_
private

Definition at line 68 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and beginJob().

std::string SimplePhotonAnalyzer::mcCollection_
private

Definition at line 52 of file SimplePhotonAnalyzer.h.

std::string SimplePhotonAnalyzer::mcProducer_
private

Definition at line 51 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and SimplePhotonAnalyzer().

edm::InputTag SimplePhotonAnalyzer::pfEgammaCandidates_
private

Definition at line 56 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and SimplePhotonAnalyzer().

std::string SimplePhotonAnalyzer::photonCollection_
private

Definition at line 54 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and SimplePhotonAnalyzer().

std::string SimplePhotonAnalyzer::photonCollectionProducer_
private

Definition at line 53 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and SimplePhotonAnalyzer().

float SimplePhotonAnalyzer::sample_
private

Definition at line 63 of file SimplePhotonAnalyzer.h.

Referenced by beginJob(), and SimplePhotonAnalyzer().

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

Definition at line 60 of file SimplePhotonAnalyzer.h.

Referenced by analyze().

std::string SimplePhotonAnalyzer::valueMapPFCandPhoton_
private

Definition at line 55 of file SimplePhotonAnalyzer.h.

Referenced by analyze(), and SimplePhotonAnalyzer().

std::string SimplePhotonAnalyzer::vertexProducer_
private

Definition at line 62 of file SimplePhotonAnalyzer.h.

Referenced by SimplePhotonAnalyzer().