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 Attributes
HighETPhotonsFilterAlgo Class Reference

#include <HighETPhotonsFilterAlgo.h>

Public Member Functions

bool filter (const edm::Event &iEvent)
 
 HighETPhotonsFilterAlgo (const edm::ParameterSet &)
 
 ~HighETPhotonsFilterAlgo ()
 

Private Attributes

float FILTER_ETA_MAX_
 
float isoConeSize_
 
float nonPhotETMax_
 
float seedETThreshold_
 
float sumETThreshold_
 

Detailed Description

HighETPhotonsFilterAlgo a gen-level filter that selects events that will reconstruct an isolated photon only tested with high ET thresholds (aiming for 100 GeV photons)

Author
J Lamb, UCSB

Definition at line 28 of file HighETPhotonsFilterAlgo.h.

Constructor & Destructor Documentation

HighETPhotonsFilterAlgo::HighETPhotonsFilterAlgo ( const edm::ParameterSet iConfig)

Definition at line 8 of file HighETPhotonsFilterAlgo.cc.

References edm::ParameterSet::getParameter().

8  {
9 
10  //set constants
11  FILTER_ETA_MAX_=2.5;
12  //parameters
13  sumETThreshold_=(float)iConfig.getParameter<double>("sumETThreshold");
14  seedETThreshold_=(float)iConfig.getParameter<double>("seedETThreshold");
15  nonPhotETMax_=(float)iConfig.getParameter<double>("nonPhotETMax");
16  isoConeSize_=(float)iConfig.getParameter<double>("isoConeSize");
17 
18 
19 }
T getParameter(std::string const &) const
HighETPhotonsFilterAlgo::~HighETPhotonsFilterAlgo ( )

Definition at line 21 of file HighETPhotonsFilterAlgo.cc.

21  {
22 }

Member Function Documentation

bool HighETPhotonsFilterAlgo::filter ( const edm::Event iEvent)

Definition at line 25 of file HighETPhotonsFilterAlgo.cc.

References deltaR(), reco::LeafCandidate::et(), edm::Event::getByLabel(), reco::LeafCandidate::pdgId(), and reco::LeafCandidate::status().

25  {
26 
28  iEvent.getByLabel("genParticles",genParsHandle);
29  vector<reco::GenParticle> genPars=*genParsHandle;
30 
31  for (uint32_t ig=0;ig<genPars.size();ig++) {
32  reco::GenParticle gp=genPars.at(ig);
33  //look for seeds
34  if (fabs(gp.pdgId())!=22) continue;
35  if (gp.status()!=1) continue;
36  if (gp.et()<seedETThreshold_) continue;
37  //found a seed
38  float photetsum=gp.et();
39  float nonphotetsum=0;
40  for (uint32_t jg=0;jg<genPars.size();jg++) {
41  if (ig==jg) continue;
42  reco::GenParticle opar=genPars.at(jg);
43  if (opar.status()!=1) continue;
44  float dr=deltaR(gp,opar);
45  if (dr>=isoConeSize_) continue;
46  if (fabs(opar.pdgId())==22) {
47  photetsum+=opar.et();
48  } else {
49  nonphotetsum+=opar.et();
50  }
51  }
52  //check that photon energy exceeds threshold, and isolation
53  //energy is below threshold
54  if (photetsum>sumETThreshold_ && nonphotetsum<nonPhotETMax_) return true;
55  }
56  return false;
57 
58 }
virtual int pdgId() const
PDG identifier.
virtual double et() const
transverse energy
virtual int status() const
status word
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:420
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17

Member Data Documentation

float HighETPhotonsFilterAlgo::FILTER_ETA_MAX_
private

Definition at line 42 of file HighETPhotonsFilterAlgo.h.

float HighETPhotonsFilterAlgo::isoConeSize_
private

Definition at line 47 of file HighETPhotonsFilterAlgo.h.

float HighETPhotonsFilterAlgo::nonPhotETMax_
private

Definition at line 46 of file HighETPhotonsFilterAlgo.h.

float HighETPhotonsFilterAlgo::seedETThreshold_
private

Definition at line 45 of file HighETPhotonsFilterAlgo.h.

float HighETPhotonsFilterAlgo::sumETThreshold_
private

Definition at line 44 of file HighETPhotonsFilterAlgo.h.