CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
egammaisolation::EgammaTrackExtractor Class Reference

#include <EgammaTrackExtractor.h>

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

Public Member Functions

reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Candidate &muon) const override
 
reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &muon) const override
 
 EgammaTrackExtractor ()
 
 EgammaTrackExtractor (const edm::ParameterSet &par, edm::ConsumesCollector &&iC)
 
 EgammaTrackExtractor (const edm::ParameterSet &par, edm::ConsumesCollector &iC)
 
void fillVetos (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackCollection &track) override
 
virtual reco::IsoDeposit::Vetos vetos (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const
 
 ~EgammaTrackExtractor () override
 
- Public Member Functions inherited from reco::isodeposit::IsoDepositExtractor
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 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 std::vector< reco::IsoDepositdeposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Candidate &track) const
 
virtual std::vector< reco::IsoDepositdeposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::CandidateBaseRef &track) const
 
virtual std::vector< reco::IsoDepositdeposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const
 
virtual std::vector< reco::IsoDepositdeposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackBaseRef &track) const
 
virtual void initEvent (const edm::Event &, const edm::EventSetup &)
 perform some constly initialization More...
 
virtual ~IsoDepositExtractor ()
 Destructor. More...
 

Private Member Functions

reco::IsoDeposit::Veto veto (const reco::IsoDeposit::Direction &dir) const
 

Private Attributes

edm::InputTag barrelEcalHitsTag_
 "NONE", "BeamSpotFromEvent" More...
 
int dzOption
 
std::string dzOptionString
 Endcap requirements to determine if isolated for selective filling. More...
 
edm::InputTag endcapEcalHitsTag_
 
double minCandEt_
 name for deposit More...
 
std::vector< double > paramForIsolBarrel_
 min track pt to include into iso deposit More...
 
std::vector< double > paramForIsolEndcap_
 Barrel requirements to determine if isolated for selective filling. More...
 
std::string theBeamlineOption
 Veto cone angle. More...
 
edm::EDGetTokenT< reco::BeamSpottheBeamSpotToken
 
double theChi2Ndof_Max
 trk.numberOfValidHits >= theNHits_Min More...
 
double theChi2Prob_Min
 trk.normalizedChi2 < theChi2Ndof_Max More...
 
std::string theDepositLabel
 Track Collection Label. More...
 
double theDiff_r
 minimum candidate et More...
 
double theDiff_z
 transverse distance to vertex More...
 
double theDR_Max
 z distance to vertex More...
 
double theDR_Veto
 Maximum cone angle for deposits. More...
 
unsigned int theNHits_Min
 BeamSpot name. More...
 
double thePt_Min
 ChiSquaredProbability(trk.chi2,trk.ndof) > theChi2Prob_Min. More...
 
edm::EDGetTokenT< edm::View< reco::Track > > theTrackCollectionToken
 

Detailed Description

Definition at line 18 of file EgammaTrackExtractor.h.

Constructor & Destructor Documentation

◆ EgammaTrackExtractor() [1/3]

egammaisolation::EgammaTrackExtractor::EgammaTrackExtractor ( )
inline

Definition at line 20 of file EgammaTrackExtractor.h.

20 {};

◆ EgammaTrackExtractor() [2/3]

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

Definition at line 21 of file EgammaTrackExtractor.h.

21 : EgammaTrackExtractor(par, iC) {}

◆ EgammaTrackExtractor() [3/3]

EgammaTrackExtractor::EgammaTrackExtractor ( const edm::ParameterSet par,
edm::ConsumesCollector iC 
)

Definition at line 28 of file EgammaTrackExtractor.cc.

29  : theTrackCollectionToken(iC.consumes<View<Track> >(par.getParameter<edm::InputTag>("inputTrackCollection"))),
31  theDiff_r(par.getParameter<double>("Diff_r")),
32  theDiff_z(par.getParameter<double>("Diff_z")),
33  theDR_Max(par.getParameter<double>("DR_Max")),
34  theDR_Veto(par.getParameter<double>("DR_Veto")),
35  theBeamlineOption(par.getParameter<std::string>("BeamlineOption")),
37  theNHits_Min(par.getParameter<unsigned int>("NHits_Min")),
38  theChi2Ndof_Max(par.getParameter<double>("Chi2Ndof_Max")),
39  theChi2Prob_Min(par.getParameter<double>("Chi2Prob_Min")),
40  thePt_Min(par.getParameter<double>("Pt_Min")),
41  dzOptionString(par.getParameter<std::string>("dzOption")) {
42  if (!dzOptionString.compare("dz"))
44  else if (!dzOptionString.compare("vz"))
46  else if (!dzOptionString.compare("bs"))
48  else if (!dzOptionString.compare("vtx"))
50  else
52 }

References egammaisolation::EgammaTrackSelector::bs, egammaisolation::EgammaTrackSelector::dz, dzOption, dzOptionString, egammaisolation::EgammaTrackSelector::vtx, and egammaisolation::EgammaTrackSelector::vz.

◆ ~EgammaTrackExtractor()

egammaisolation::EgammaTrackExtractor::~EgammaTrackExtractor ( )
inlineoverride

Definition at line 24 of file EgammaTrackExtractor.h.

24 {}

Member Function Documentation

◆ deposit() [1/2]

IsoDeposit EgammaTrackExtractor::deposit ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Candidate track 
) const
overridevirtual

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 68 of file EgammaTrackExtractor.cc.

70  {
71  static const std::string metname = "EgammaIsolationAlgos|EgammaTrackExtractor";
72 
74  double dzCut = 0;
75 
76  reco::TrackBase::Point beamPoint(0, 0, 0);
77  if (theBeamlineOption == "BeamSpotFromEvent") {
78  //pick beamSpot
81 
82  event.getByToken(theBeamSpotToken, beamSpotH);
83 
84  if (beamSpotH.isValid()) {
85  beamPoint = beamSpotH->position();
86  }
87  }
88 
89  Handle<View<Track> > tracksH;
90  event.getByToken(theTrackCollectionToken, tracksH);
91 
92  if (candTk.isElectron()) {
93  const reco::GsfElectron* elec = dynamic_cast<const reco::GsfElectron*>(&candTk);
94  candDir = reco::isodeposit::Direction(elec->gsfTrack()->eta(), elec->gsfTrack()->phi());
95  } else {
96  candDir = reco::isodeposit::Direction(candTk.eta(), candTk.phi());
97  }
98 
99  IsoDeposit deposit(candDir);
100  deposit.setVeto(veto(candDir));
101  deposit.addCandEnergy(candTk.et());
102 
103  View<Track>::const_iterator itrTr = tracksH->begin();
104  View<Track>::const_iterator trEnd = tracksH->end();
105  for (itrTr = tracksH->begin(); itrTr != trEnd; ++itrTr) {
106  if (candDir.deltaR(reco::isodeposit::Direction(itrTr->eta(), itrTr->phi())) > theDR_Max)
107  continue;
108 
109  if (itrTr->normalizedChi2() > theChi2Ndof_Max)
110  continue;
111 
112  if (itrTr->pt() < thePt_Min)
113  continue;
114 
115  if (theChi2Prob_Min > 0 && ChiSquaredProbability(itrTr->chi2(), itrTr->ndof()) < theChi2Prob_Min)
116  continue;
117 
118  if (theNHits_Min > 0 && itrTr->numberOfValidHits() < theNHits_Min)
119  continue;
120 
121  if (candTk.isElectron()) {
122  const reco::GsfElectron* elec = dynamic_cast<const reco::GsfElectron*>(&candTk);
123  switch (dzOption) {
125  dzCut = elec->gsfTrack()->dz() - itrTr->dz();
126  break;
128  dzCut = elec->gsfTrack()->vz() - itrTr->vz();
129  break;
131  dzCut = elec->gsfTrack()->dz(beamPoint) - itrTr->dz(beamPoint);
132  break;
134  dzCut = itrTr->dz(elec->gsfTrack()->vertex());
135  break;
136  default:
137  dzCut = elec->gsfTrack()->vz() - itrTr->vz();
138  break;
139  }
140  } else {
141  switch (dzOption) {
143  dzCut = (*itrTr).dz() - candTk.vertex().z();
144  break;
146  dzCut = (*itrTr).vz() - candTk.vertex().z();
147  break;
149  dzCut = (*itrTr).dz(beamPoint) - candTk.vertex().z();
150  break;
152  dzCut = (*itrTr).dz(candTk.vertex());
153  break;
154  default:
155  dzCut = (*itrTr).vz() - candTk.vertex().z();
156  break;
157  }
158  }
159 
160  if (fabs(dzCut) > theDiff_z)
161  continue;
162 
163  if (fabs(itrTr->dxy(beamPoint)) > theDiff_r)
164  continue;
165 
166  deposit.addDeposit(reco::isodeposit::Direction(itrTr->eta(), itrTr->phi()), itrTr->pt());
167  }
168 
169  return deposit;
170 }

References reco::IsoDeposit::addCandEnergy(), reco::IsoDeposit::addDeposit(), pwdgSkimBPark_cfi::beamSpot, egammaisolation::EgammaTrackSelector::bs, ChiSquaredProbability(), reco::isodeposit::Direction::deltaR(), deposit(), egammaisolation::EgammaTrackSelector::dz, TrackSplittingMonitor_cfi::dzCut, dzOption, reco::Candidate::et(), reco::Candidate::eta(), reco::GsfElectron::gsfTrack(), reco::Candidate::isElectron(), edm::HandleBase::isValid(), metname, reco::Candidate::phi(), reco::BeamSpot::position(), reco::IsoDeposit::setVeto(), AlCaHLTBitMon_QueryRunRegistry::string, theBeamlineOption, theBeamSpotToken, theChi2Ndof_Max, theChi2Prob_Min, theDiff_r, theDiff_z, theDR_Max, theNHits_Min, thePt_Min, theTrackCollectionToken, reco::Candidate::vertex(), veto(), egammaisolation::EgammaTrackSelector::vtx, and egammaisolation::EgammaTrackSelector::vz.

◆ deposit() [2/2]

reco::IsoDeposit egammaisolation::EgammaTrackExtractor::deposit ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Track track 
) const
inlineoverridevirtual

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

Implements reco::isodeposit::IsoDepositExtractor.

Definition at line 32 of file EgammaTrackExtractor.h.

34  {
35  edm::LogWarning("EgammaIsolationAlgos|EgammaTrackExtractor")
36  << "This Function is not implemented, bad IsoDeposit Returned";
38  }

Referenced by deposit().

◆ fillVetos()

void egammaisolation::EgammaTrackExtractor::fillVetos ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::TrackCollection tracks 
)
inlineoverridevirtual

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

Implements reco::isodeposit::IsoDepositExtractor.

Definition at line 26 of file EgammaTrackExtractor.h.

26 {}

◆ veto()

reco::IsoDeposit::Veto EgammaTrackExtractor::veto ( const reco::IsoDeposit::Direction dir) const
private

Definition at line 61 of file EgammaTrackExtractor.cc.

61  {
63  result.vetoDir = dir;
64  result.dR = theDR_Veto;
65  return result;
66 }

References DeadROC_duringRun::dir, mps_fire::result, and theDR_Veto.

Referenced by deposit(), and vetos().

◆ vetos()

reco::IsoDeposit::Vetos EgammaTrackExtractor::vetos ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Track track 
) const
virtual

Definition at line 54 of file EgammaTrackExtractor.cc.

56  {
58  return reco::IsoDeposit::Vetos(1, veto(dir));
59 }

References DeadROC_duringRun::dir, HLT_2018_cff::track, and veto().

Member Data Documentation

◆ barrelEcalHitsTag_

edm::InputTag egammaisolation::EgammaTrackExtractor::barrelEcalHitsTag_
private

"NONE", "BeamSpotFromEvent"

Definition at line 57 of file EgammaTrackExtractor.h.

◆ dzOption

int egammaisolation::EgammaTrackExtractor::dzOption
private

Definition at line 67 of file EgammaTrackExtractor.h.

Referenced by deposit(), and EgammaTrackExtractor().

◆ dzOptionString

std::string egammaisolation::EgammaTrackExtractor::dzOptionString
private

Endcap requirements to determine if isolated for selective filling.

Definition at line 66 of file EgammaTrackExtractor.h.

Referenced by EgammaTrackExtractor().

◆ endcapEcalHitsTag_

edm::InputTag egammaisolation::EgammaTrackExtractor::endcapEcalHitsTag_
private

Definition at line 58 of file EgammaTrackExtractor.h.

◆ minCandEt_

double egammaisolation::EgammaTrackExtractor::minCandEt_
private

name for deposit

Definition at line 51 of file EgammaTrackExtractor.h.

◆ paramForIsolBarrel_

std::vector<double> egammaisolation::EgammaTrackExtractor::paramForIsolBarrel_
private

min track pt to include into iso deposit

Definition at line 64 of file EgammaTrackExtractor.h.

◆ paramForIsolEndcap_

std::vector<double> egammaisolation::EgammaTrackExtractor::paramForIsolEndcap_
private

Barrel requirements to determine if isolated for selective filling.

Definition at line 65 of file EgammaTrackExtractor.h.

◆ theBeamlineOption

std::string egammaisolation::EgammaTrackExtractor::theBeamlineOption
private

Veto cone angle.

Definition at line 56 of file EgammaTrackExtractor.h.

Referenced by deposit().

◆ theBeamSpotToken

edm::EDGetTokenT<reco::BeamSpot> egammaisolation::EgammaTrackExtractor::theBeamSpotToken
private

Definition at line 59 of file EgammaTrackExtractor.h.

Referenced by deposit().

◆ theChi2Ndof_Max

double egammaisolation::EgammaTrackExtractor::theChi2Ndof_Max
private

trk.numberOfValidHits >= theNHits_Min

Definition at line 61 of file EgammaTrackExtractor.h.

Referenced by deposit().

◆ theChi2Prob_Min

double egammaisolation::EgammaTrackExtractor::theChi2Prob_Min
private

trk.normalizedChi2 < theChi2Ndof_Max

Definition at line 62 of file EgammaTrackExtractor.h.

Referenced by deposit().

◆ theDepositLabel

std::string egammaisolation::EgammaTrackExtractor::theDepositLabel
private

Track Collection Label.

Definition at line 50 of file EgammaTrackExtractor.h.

◆ theDiff_r

double egammaisolation::EgammaTrackExtractor::theDiff_r
private

minimum candidate et

Definition at line 52 of file EgammaTrackExtractor.h.

Referenced by deposit().

◆ theDiff_z

double egammaisolation::EgammaTrackExtractor::theDiff_z
private

transverse distance to vertex

Definition at line 53 of file EgammaTrackExtractor.h.

Referenced by deposit().

◆ theDR_Max

double egammaisolation::EgammaTrackExtractor::theDR_Max
private

z distance to vertex

Definition at line 54 of file EgammaTrackExtractor.h.

Referenced by deposit().

◆ theDR_Veto

double egammaisolation::EgammaTrackExtractor::theDR_Veto
private

Maximum cone angle for deposits.

Definition at line 55 of file EgammaTrackExtractor.h.

Referenced by veto().

◆ theNHits_Min

unsigned int egammaisolation::EgammaTrackExtractor::theNHits_Min
private

BeamSpot name.

Definition at line 60 of file EgammaTrackExtractor.h.

Referenced by deposit().

◆ thePt_Min

double egammaisolation::EgammaTrackExtractor::thePt_Min
private

ChiSquaredProbability(trk.chi2,trk.ndof) > theChi2Prob_Min.

Definition at line 63 of file EgammaTrackExtractor.h.

Referenced by deposit().

◆ theTrackCollectionToken

edm::EDGetTokenT<edm::View<reco::Track> > egammaisolation::EgammaTrackExtractor::theTrackCollectionToken
private

Definition at line 49 of file EgammaTrackExtractor.h.

Referenced by deposit().

pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
reco::GsfElectron::gsfTrack
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Definition: GsfElectron.h:164
ChiSquaredProbability
float ChiSquaredProbability(double chiSquared, double nrDOF)
Definition: ChiSquaredProbability.cc:13
egammaisolation::EgammaTrackExtractor::theBeamSpotToken
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotToken
Definition: EgammaTrackExtractor.h:59
reco::IsoDeposit::addDeposit
void addDeposit(double dr, double deposit)
Add deposit (ie. transverse energy or pT)
Definition: IsoDeposit.cc:19
pat::IsoDeposit
reco::IsoDeposit IsoDeposit
Definition: Isolation.h:7
egammaisolation::EgammaTrackExtractor::EgammaTrackExtractor
EgammaTrackExtractor()
Definition: EgammaTrackExtractor.h:20
reco::IsoDeposit::Veto
Definition: IsoDeposit.h:59
egammaisolation::EgammaTrackExtractor::theDepositLabel
std::string theDepositLabel
Track Collection Label.
Definition: EgammaTrackExtractor.h:50
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
egammaisolation::EgammaTrackExtractor::theDR_Max
double theDR_Max
z distance to vertex
Definition: EgammaTrackExtractor.h:54
edm::Handle< reco::BeamSpot >
egammaisolation::EgammaTrackExtractor::theChi2Ndof_Max
double theChi2Ndof_Max
trk.numberOfValidHits >= theNHits_Min
Definition: EgammaTrackExtractor.h:61
egammaisolation::EgammaTrackSelector::vz
Definition: EgammaTrackSelector.h:20
egammaisolation::EgammaTrackSelector::bs
Definition: EgammaTrackSelector.h:20
egammaisolation::EgammaTrackExtractor::deposit
reco::IsoDeposit deposit(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &muon) const override
Definition: EgammaTrackExtractor.h:32
reco::BeamSpot
Definition: BeamSpot.h:21
TrackSplittingMonitor_cfi.dzCut
dzCut
Definition: TrackSplittingMonitor_cfi.py:20
egammaisolation::EgammaTrackExtractor::dzOption
int dzOption
Definition: EgammaTrackExtractor.h:67
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
reco::GsfElectron
Definition: GsfElectron.h:35
reco::BeamSpot::position
const Point & position() const
position
Definition: BeamSpot.h:59
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogWarning
Definition: MessageLogger.h:141
egammaisolation::EgammaTrackExtractor::theChi2Prob_Min
double theChi2Prob_Min
trk.normalizedChi2 < theChi2Ndof_Max
Definition: EgammaTrackExtractor.h:62
egammaisolation::EgammaTrackExtractor::theDiff_r
double theDiff_r
minimum candidate et
Definition: EgammaTrackExtractor.h:52
edm::View
Definition: CaloClusterFwd.h:14
reco::isodeposit::Direction::deltaR
double deltaR(const Direction &dir2) const
Definition: IsoDepositDirection.h:47
egammaisolation::EgammaTrackExtractor::theNHits_Min
unsigned int theNHits_Min
BeamSpot name.
Definition: EgammaTrackExtractor.h:60
egammaisolation::EgammaTrackExtractor::theDR_Veto
double theDR_Veto
Maximum cone angle for deposits.
Definition: EgammaTrackExtractor.h:55
egammaisolation::EgammaTrackExtractor::theDiff_z
double theDiff_z
transverse distance to vertex
Definition: EgammaTrackExtractor.h:53
edm::ConsumesCollector::mayConsume
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
Definition: ConsumesCollector.h:61
egammaisolation::EgammaTrackExtractor::thePt_Min
double thePt_Min
ChiSquaredProbability(trk.chi2,trk.ndof) > theChi2Prob_Min.
Definition: EgammaTrackExtractor.h:63
reco::TrackBase::Point
math::XYZPoint Point
point in the space
Definition: TrackBase.h:80
reco::IsoDeposit::addCandEnergy
void addCandEnergy(double et)
Set energy or pT attached to cand trajectory.
Definition: IsoDeposit.h:132
egammaisolation::EgammaTrackSelector::vtx
Definition: EgammaTrackSelector.h:20
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
egammaisolation::EgammaTrackExtractor::theBeamlineOption
std::string theBeamlineOption
Veto cone angle.
Definition: EgammaTrackExtractor.h:56
egammaisolation::EgammaTrackExtractor::dzOptionString
std::string dzOptionString
Endcap requirements to determine if isolated for selective filling.
Definition: EgammaTrackExtractor.h:66
reco::isodeposit::Direction
Definition: IsoDepositDirection.h:19
egammaisolation::EgammaTrackSelector::dz
Definition: EgammaTrackSelector.h:20
reco::IsoDeposit
Definition: IsoDeposit.h:49
edm::View::const_iterator
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
egammaisolation::EgammaTrackExtractor::theTrackCollectionToken
edm::EDGetTokenT< edm::View< reco::Track > > theTrackCollectionToken
Definition: EgammaTrackExtractor.h:49
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
mps_fire.result
result
Definition: mps_fire.py:303
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
reco::IsoDeposit::Vetos
std::vector< Veto > Vetos
Definition: IsoDeposit.h:65
egammaisolation::EgammaTrackExtractor::veto
reco::IsoDeposit::Veto veto(const reco::IsoDeposit::Direction &dir) const
Definition: EgammaTrackExtractor.cc:61
edm::InputTag
Definition: InputTag.h:15
reco::IsoDeposit::setVeto
void setVeto(const Veto &aVeto)
Set veto.
Definition: IsoDeposit.h:82
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:43