CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
muonisolation::TrackExtractor Class Reference

#include <TrackExtractor.h>

Inheritance diagram for muonisolation::TrackExtractor:
reco::isodeposit::IsoDepositExtractor

Public Member Functions

reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &muon) const override
 
void fillVetos (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackCollection &track) override
 
 TrackExtractor ()
 
 TrackExtractor (const edm::ParameterSet &par, edm::ConsumesCollector &&iC)
 
virtual reco::IsoDeposit::Vetos vetos (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const
 
 ~TrackExtractor () override
 
- 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::Candidate &track) const
 
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::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 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 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

std::string theBeamlineOption
 Veto cone angle. More...
 
edm::EDGetTokenT< reco::BeamSpottheBeamSpotToken
 "NONE", "BeamSpotFromEvent" More...
 
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
 name for deposit 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< reco::TrackCollectiontheTrackCollectionToken
 

Detailed Description

Definition at line 18 of file TrackExtractor.h.

Constructor & Destructor Documentation

◆ TrackExtractor() [1/2]

muonisolation::TrackExtractor::TrackExtractor ( )
inline

Definition at line 20 of file TrackExtractor.h.

20 {};

◆ TrackExtractor() [2/2]

TrackExtractor::TrackExtractor ( const edm::ParameterSet par,
edm::ConsumesCollector &&  iC 
)

Definition at line 15 of file TrackExtractor.cc.

16  : theTrackCollectionToken(iC.consumes<TrackCollection>(par.getParameter<edm::InputTag>("inputTrackCollection"))),
17  theDepositLabel(par.getUntrackedParameter<string>("DepositLabel")),
18  theDiff_r(par.getParameter<double>("Diff_r")),
19  theDiff_z(par.getParameter<double>("Diff_z")),
20  theDR_Max(par.getParameter<double>("DR_Max")),
21  theDR_Veto(par.getParameter<double>("DR_Veto")),
22  theBeamlineOption(par.getParameter<string>("BeamlineOption")),
24  theNHits_Min(par.getParameter<unsigned int>("NHits_Min")),
25  theChi2Ndof_Max(par.getParameter<double>("Chi2Ndof_Max")),
26  theChi2Prob_Min(par.getParameter<double>("Chi2Prob_Min")),
27  thePt_Min(par.getParameter<double>("Pt_Min")) {}
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
unsigned int theNHits_Min
BeamSpot name.
double theDR_Max
z distance to vertex
T getUntrackedParameter(std::string const &, T const &) const
double theDiff_r
name for deposit
edm::EDGetTokenT< reco::TrackCollection > theTrackCollectionToken
std::string theDepositLabel
Track Collection Label.
double theChi2Ndof_Max
trk.numberOfValidHits >= theNHits_Min
double theDiff_z
transverse distance to vertex
std::string theBeamlineOption
Veto cone angle.
double thePt_Min
ChiSquaredProbability(trk.chi2,trk.ndof) > theChi2Prob_Min.
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotToken
"NONE", "BeamSpotFromEvent"
double theDR_Veto
Maximum cone angle for deposits.
double theChi2Prob_Min
trk.normalizedChi2 < theChi2Ndof_Max

◆ ~TrackExtractor()

muonisolation::TrackExtractor::~TrackExtractor ( )
inlineoverride

Definition at line 23 of file TrackExtractor.h.

23 {}

Member Function Documentation

◆ deposit()

IsoDeposit TrackExtractor::deposit ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Track track 
) const
overridevirtual

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

Implements reco::isodeposit::IsoDepositExtractor.

Definition at line 43 of file TrackExtractor.cc.

References reco::IsoDeposit::addCandEnergy(), reco::IsoDeposit::addDeposit(), pwdgSkimBPark_cfi::beamSpot, reco::TrackBase::eta(), edm::HandleBase::isValid(), LogTrace, metname, reco::TrackBase::phi(), reco::BeamSpot::position(), reco::TrackBase::pt(), corrVsCorr::selection, reco::IsoDeposit::setVeto(), AlCaHLTBitMon_QueryRunRegistry::string, theBeamlineOption, theBeamSpotToken, theChi2Ndof_Max, theChi2Prob_Min, theDiff_r, theDiff_z, theDR_Max, theNHits_Min, thePt_Min, theTrackCollectionToken, and veto().

43  {
44  static const std::string metname = "MuonIsolation|TrackExtractor";
45 
46  reco::isodeposit::Direction muonDir(muon.eta(), muon.phi());
47  IsoDeposit deposit(muonDir);
48  deposit.setVeto(veto(muonDir));
50 
52  event.getByToken(theTrackCollectionToken, tracksH);
53  // const TrackCollection tracks = *(tracksH.product());
54  LogTrace(metname) << "***** TRACK COLLECTION SIZE: " << tracksH->size();
55 
56  double vtx_z = muon.vz();
57  LogTrace(metname) << "***** Muon vz: " << vtx_z;
58  reco::TrackBase::Point beamPoint(0, 0, 0);
59 
60  if (theBeamlineOption == "BeamSpotFromEvent") {
61  //pick beamSpot
64 
65  event.getByToken(theBeamSpotToken, beamSpotH);
66 
67  if (beamSpotH.isValid()) {
68  beamPoint = beamSpotH->position();
69  LogTrace(metname) << "Extracted beam point at " << beamPoint << std::endl;
70  }
71  }
72 
73  LogTrace(metname) << "Using beam point at " << beamPoint << std::endl;
74 
76  TrackSelector::Range(vtx_z - theDiff_z, vtx_z + theDiff_z), theDiff_r, muonDir, theDR_Max, beamPoint);
77 
78  pars.nHitsMin = theNHits_Min;
79  pars.chi2NdofMax = theChi2Ndof_Max;
80  pars.chi2ProbMin = theChi2Prob_Min;
81  pars.ptMin = thePt_Min;
82 
84  TrackSelector::result_type sel_tracks = selection(*tracksH);
85  LogTrace(metname) << "all tracks: " << tracksH->size() << " selected: " << sel_tracks.size();
86 
87  TrackSelector::result_type::const_iterator tkI = sel_tracks.begin();
88  for (; tkI != sel_tracks.end(); ++tkI) {
89  const reco::Track* tk = *tkI;
90  LogTrace(metname) << "This track has: pt= " << tk->pt() << ", eta= " << tk->eta() << ", phi= " << tk->phi();
91  reco::isodeposit::Direction dirTrk(tk->eta(), tk->phi());
92  deposit.addDeposit(dirTrk, tk->pt());
93  }
94 
95  return deposit;
96 }
void setVeto(const Veto &aVeto)
Set veto.
Definition: IsoDeposit.h:82
const Point & position() const
position
Definition: BeamSpot.h:59
const std::string metname
std::list< const reco::Track * > result_type
Definition: TrackSelector.h:16
selection
main part
Definition: corrVsCorr.py:100
unsigned int theNHits_Min
BeamSpot name.
double theDR_Max
z distance to vertex
reco::IsoDeposit::Veto veto(const reco::IsoDeposit::Direction &dir) const
void addDeposit(double dr, double deposit)
Add deposit (ie. transverse energy or pT)
Definition: IsoDeposit.cc:19
#define LogTrace(id)
double pt() const
track transverse momentum
Definition: TrackBase.h:637
double theDiff_r
name for deposit
edm::EDGetTokenT< reco::TrackCollection > theTrackCollectionToken
void addCandEnergy(double et)
Set energy or pT attached to cand trajectory.
Definition: IsoDeposit.h:132
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:649
math::XYZPoint Point
point in the space
Definition: TrackBase.h:80
double theChi2Ndof_Max
trk.numberOfValidHits >= theNHits_Min
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
double theDiff_z
transverse distance to vertex
std::string theBeamlineOption
Veto cone angle.
double thePt_Min
ChiSquaredProbability(trk.chi2,trk.ndof) > theChi2Prob_Min.
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotToken
"NONE", "BeamSpotFromEvent"
std::vector< AlignmentParameters * > Parameters
Definition: Utilities.h:32
muonisolation::Range< float > Range
Definition: TrackSelector.h:15
reco::IsoDeposit deposit(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &muon) const override
double theChi2Prob_Min
trk.normalizedChi2 < theChi2Ndof_Max

◆ fillVetos()

void muonisolation::TrackExtractor::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 25 of file TrackExtractor.h.

25 {}

◆ veto()

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

Definition at line 36 of file TrackExtractor.cc.

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

Referenced by deposit(), and vetos().

36  {
38  result.vetoDir = dir;
39  result.dR = theDR_Veto;
40  return result;
41 }
double theDR_Veto
Maximum cone angle for deposits.

◆ vetos()

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

Definition at line 29 of file TrackExtractor.cc.

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

31  {
33  return reco::IsoDeposit::Vetos(1, veto(dir));
34 }
reco::IsoDeposit::Veto veto(const reco::IsoDeposit::Direction &dir) const
std::vector< Veto > Vetos
Definition: IsoDeposit.h:65

Member Data Documentation

◆ theBeamlineOption

std::string muonisolation::TrackExtractor::theBeamlineOption
private

Veto cone angle.

Definition at line 46 of file TrackExtractor.h.

Referenced by deposit().

◆ theBeamSpotToken

edm::EDGetTokenT<reco::BeamSpot> muonisolation::TrackExtractor::theBeamSpotToken
private

"NONE", "BeamSpotFromEvent"

Definition at line 47 of file TrackExtractor.h.

Referenced by deposit().

◆ theChi2Ndof_Max

double muonisolation::TrackExtractor::theChi2Ndof_Max
private

trk.numberOfValidHits >= theNHits_Min

Definition at line 49 of file TrackExtractor.h.

Referenced by deposit().

◆ theChi2Prob_Min

double muonisolation::TrackExtractor::theChi2Prob_Min
private

trk.normalizedChi2 < theChi2Ndof_Max

Definition at line 50 of file TrackExtractor.h.

Referenced by deposit().

◆ theDepositLabel

std::string muonisolation::TrackExtractor::theDepositLabel
private

Track Collection Label.

Definition at line 41 of file TrackExtractor.h.

◆ theDiff_r

double muonisolation::TrackExtractor::theDiff_r
private

name for deposit

Definition at line 42 of file TrackExtractor.h.

Referenced by deposit().

◆ theDiff_z

double muonisolation::TrackExtractor::theDiff_z
private

transverse distance to vertex

Definition at line 43 of file TrackExtractor.h.

Referenced by deposit().

◆ theDR_Max

double muonisolation::TrackExtractor::theDR_Max
private

z distance to vertex

Definition at line 44 of file TrackExtractor.h.

Referenced by deposit().

◆ theDR_Veto

double muonisolation::TrackExtractor::theDR_Veto
private

Maximum cone angle for deposits.

Definition at line 45 of file TrackExtractor.h.

Referenced by veto().

◆ theNHits_Min

unsigned int muonisolation::TrackExtractor::theNHits_Min
private

BeamSpot name.

Definition at line 48 of file TrackExtractor.h.

Referenced by deposit().

◆ thePt_Min

double muonisolation::TrackExtractor::thePt_Min
private

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

Definition at line 51 of file TrackExtractor.h.

Referenced by deposit().

◆ theTrackCollectionToken

edm::EDGetTokenT<reco::TrackCollection> muonisolation::TrackExtractor::theTrackCollectionToken
private

Definition at line 40 of file TrackExtractor.h.

Referenced by deposit().