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, edm::ConsumesCollector &&iC)
 
 EgammaTowerExtractor (const edm::ParameterSet &par, edm::ConsumesCollector &iC)
 
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::EDGetTokenT
< CaloTowerCollection
caloTowerToken
 
int depth_
 
double etLow_
 
double extRadius2_
 
double intRadius_
 

Detailed Description

Definition at line 35 of file EgammaTowerExtractor.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

egammaisolation::EgammaTowerExtractor::EgammaTowerExtractor ( const edm::ParameterSet par,
edm::ConsumesCollector &&  iC 
)
inline

Definition at line 42 of file EgammaTowerExtractor.h.

42  :
43  EgammaTowerExtractor(par, iC) {}
EgammaTowerExtractor(const edm::ParameterSet &par, edm::ConsumesCollector &&iC)
egammaisolation::EgammaTowerExtractor::EgammaTowerExtractor ( const edm::ParameterSet par,
edm::ConsumesCollector iC 
)
inline

Definition at line 44 of file EgammaTowerExtractor.h.

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

44  :
45  extRadius2_(par.getParameter<double>("extRadius")),
46  intRadius_(par.getParameter<double>("intRadius")),
47  etLow_(par.getParameter<double>("etMin")),
49  depth_(par.getParameter<int>("hcalDepth"))
50  {
52  //lets just check we have a valid depth
53  //should we throw an exception or just warn and then fail gracefully later?
55  throw cms::Exception("Configuration Error") << "hcalDepth passed to EgammaTowerExtractor is invalid "<<std::endl;
56  }
57  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::EDGetTokenT< CaloTowerCollection > caloTowerToken
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 63 of file EgammaTowerExtractor.h.

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

64  {
65  throw cms::Exception("Configuration Error") <<
66  "This extractor " << (typeid(this).name()) << " is not made for tracks";
67  }
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::getByToken(), and funct::sin().

34  {
35 
36  edm::Handle<CaloTowerCollection> towercollectionH;
37  iEvent.getByToken(caloTowerToken, 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:80
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:230
void addCandEnergy(double et)
Set energy or pT attached to cand trajectory.
Definition: IsoDeposit.h:139
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:242
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
edm::EDGetTokenT< CaloTowerCollection > caloTowerToken
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 61 of file EgammaTowerExtractor.h.

62  { }

Member Data Documentation

edm::EDGetTokenT<CaloTowerCollection> egammaisolation::EgammaTowerExtractor::caloTowerToken
private

Definition at line 77 of file EgammaTowerExtractor.h.

int egammaisolation::EgammaTowerExtractor::depth_
private

Definition at line 78 of file EgammaTowerExtractor.h.

Referenced by EgammaTowerExtractor().

double egammaisolation::EgammaTowerExtractor::etLow_
private

Definition at line 74 of file EgammaTowerExtractor.h.

double egammaisolation::EgammaTowerExtractor::extRadius2_
private

Definition at line 72 of file EgammaTowerExtractor.h.

Referenced by EgammaTowerExtractor().

double egammaisolation::EgammaTowerExtractor::intRadius_
private

Definition at line 73 of file EgammaTowerExtractor.h.