CMS 3D CMS Logo

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

#include <EgammaTowerExtractor.h>

Inheritance diagram for egammaisolation::EgammaTowerExtractor:
reco::isodeposit::IsoDepositExtractor

Public Types

enum  HcalDepth { AllDepths =-1, Undefined =0, Depth1 =1, Depth2 =2 }
 

Public Member Functions

virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const
 
virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Candidate &c) const
 
 EgammaTowerExtractor (const edm::ParameterSet &par)
 
virtual void fillVetos (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackCollection &tracks)
 
virtual ~EgammaTowerExtractor ()
 
- Public Member Functions inherited from reco::isodeposit::IsoDepositExtractor
virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackBaseRef &track) const
 make single IsoDeposit based on trackRef as input More...
 
virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::CandidateBaseRef &track) const
 make single IsoDeposit based on a CandidateBaseRef as input More...
 
virtual std::vector
< reco::IsoDeposit
deposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const
 
virtual std::vector
< reco::IsoDeposit
deposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackBaseRef &track) const
 
virtual std::vector
< reco::IsoDeposit
deposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Candidate &track) const
 
virtual std::vector
< reco::IsoDeposit
deposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::CandidateBaseRef &track) const
 
virtual ~IsoDepositExtractor ()
 Destructor. More...
 

Private Attributes

edm::InputTag caloTowerTag_
 
int depth_
 
double etLow_
 
double extRadius2_
 
double intRadius_
 

Detailed Description

Definition at line 34 of file EgammaTowerExtractor.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

egammaisolation::EgammaTowerExtractor::EgammaTowerExtractor ( const edm::ParameterSet par)
inline

Definition at line 41 of file EgammaTowerExtractor.h.

References AllDepths, Depth1, Depth2, depth_, edm::hlt::Exception, and extRadius2_.

41  :
42  extRadius2_(par.getParameter<double>("extRadius")),
43  intRadius_(par.getParameter<double>("intRadius")),
44  etLow_(par.getParameter<double>("etMin")),
45  caloTowerTag_(par.getParameter<edm::InputTag>("caloTowers")),
46  depth_(par.getParameter<int>("hcalDepth"))
47  {
49  //lets just check we have a valid depth
50  //should we throw an exception or just warn and then fail gracefully later?
52  throw cms::Exception("Configuration Error") << "hcalDepth passed to EgammaTowerExtractor is invalid "<<std::endl;
53  }
54  }
T getParameter(std::string const &) const
EgammaTowerExtractor::~EgammaTowerExtractor ( )
virtual

Definition at line 31 of file EgammaTowerExtractor.cc.

31 {}

Member Function Documentation

virtual reco::IsoDeposit egammaisolation::EgammaTowerExtractor::deposit ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Track track 
) const
inlinevirtual

make single IsoDeposit based on track as input purely virtual: have to implement in concrete implementations

Implements reco::isodeposit::IsoDepositExtractor.

Definition at line 60 of file EgammaTowerExtractor.h.

References edm::hlt::Exception, and mergeVDriftHistosByStation::name.

61  {
62  throw cms::Exception("Configuration Error") <<
63  "This extractor " << (typeid(this).name()) << " is not made for tracks";
64  }
reco::IsoDeposit EgammaTowerExtractor::deposit ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Candidate track 
) const
virtual

make single IsoDeposit based on a candidate as input purely virtual: have to implement in concrete implementations

Reimplemented from reco::isodeposit::IsoDepositExtractor.

Definition at line 33 of file EgammaTowerExtractor.cc.

References reco::isodeposit::Direction::deltaR2(), create_public_lumi_plots::exp, reco::Candidate::get(), edm::Event::getByLabel(), and funct::sin().

34  {
35 
36  edm::Handle<CaloTowerCollection> towercollectionH;
37  iEvent.getByLabel(caloTowerTag_, towercollectionH);
38 
39  //Take the SC position
41  math::XYZPoint caloPosition = sc->position();
42 
43  Direction candDir(caloPosition.eta(), caloPosition.phi());
44  reco::IsoDeposit deposit( candDir );
46  deposit.addCandEnergy(sc->energy()*sin(2*atan(exp(-sc->eta()))));
47 
48  //loop over tracks
49  for(CaloTowerCollection::const_iterator trItr = towercollectionH->begin(), trEnd = towercollectionH->end(); trItr != trEnd; ++trItr){
50  double depEt = 0;
51  //the hcal can be seperated into different depths
52  //currently it is setup to check that the depth is valid in constructor
53  //if the depth is not valid it fails gracefully
54  //small bug fix, hadEnergyHeInnerLater returns zero for towers which are only depth 1
55  //but we want Depth1 isolation to include these so we have to manually check for this
56  if(depth_==AllDepths) depEt = trItr->hadEt();
57  else if(depth_==Depth1) depEt = trItr->ietaAbs()<18 || trItr->ietaAbs()>29 ? trItr->hadEt() : trItr->hadEnergyHeInnerLayer()*sin(trItr->p4().theta());
58  else if(depth_==Depth2) depEt = trItr->hadEnergyHeOuterLayer()*sin(trItr->p4().theta());
59 
60  if ( depEt < etLow_ ) continue ;
61 
62 
63  Direction towerDir( trItr->eta(), trItr->phi() );
64  double dR2 = candDir.deltaR2(towerDir);
65 
66  if (dR2 < extRadius2_) {
67  deposit.addDeposit( towerDir, depEt);
68  }
69 
70  }//end loop over tracks
71 
72  return deposit;
73 }
void setVeto(const Veto &aVeto)
Set veto.
Definition: IsoDeposit.h:75
virtual reco::IsoDeposit deposit(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
std::vector< CaloTower >::const_iterator const_iterator
void addDeposit(double dr, double deposit)
Add deposit (ie. transverse energy or pT)
Definition: IsoDeposit.cc:23
double deltaR2(const Direction &dir2) const
int iEvent
Definition: GenABIO.cc:243
void addCandEnergy(double et)
Set energy or pT attached to cand trajectory.
Definition: IsoDeposit.h:134
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:242
virtual void egammaisolation::EgammaTowerExtractor::fillVetos ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::TrackCollection tracks 
)
inlinevirtual

fill vetoes: to exclude deposits at IsoDeposit creation stage check concrete extractors if it's no-op !

Implements reco::isodeposit::IsoDepositExtractor.

Definition at line 58 of file EgammaTowerExtractor.h.

59  { }

Member Data Documentation

edm::InputTag egammaisolation::EgammaTowerExtractor::caloTowerTag_
private

Definition at line 74 of file EgammaTowerExtractor.h.

int egammaisolation::EgammaTowerExtractor::depth_
private

Definition at line 75 of file EgammaTowerExtractor.h.

Referenced by EgammaTowerExtractor().

double egammaisolation::EgammaTowerExtractor::etLow_
private

Definition at line 71 of file EgammaTowerExtractor.h.

double egammaisolation::EgammaTowerExtractor::extRadius2_
private

Definition at line 69 of file EgammaTowerExtractor.h.

Referenced by EgammaTowerExtractor().

double egammaisolation::EgammaTowerExtractor::intRadius_
private

Definition at line 70 of file EgammaTowerExtractor.h.