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 Member Functions | Private Attributes
muonisolation::TrackExtractor Class Reference

#include <TrackExtractor.h>

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

Public Member Functions

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

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

Private Attributes

std::string theBeamlineOption
 Veto cone angle. More...
 
edm::InputTag theBeamSpotLabel
 "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::InputTag theTrackCollectionTag
 

Detailed Description

Definition at line 15 of file TrackExtractor.h.

Constructor & Destructor Documentation

muonisolation::TrackExtractor::TrackExtractor ( )
inline

Definition at line 19 of file TrackExtractor.h.

19 {};
TrackExtractor::TrackExtractor ( const edm::ParameterSet par)

Definition at line 19 of file TrackExtractor.cc.

19  :
20  theTrackCollectionTag(par.getParameter<edm::InputTag>("inputTrackCollection")),
21  theDepositLabel(par.getUntrackedParameter<string>("DepositLabel")),
22  theDiff_r(par.getParameter<double>("Diff_r")),
23  theDiff_z(par.getParameter<double>("Diff_z")),
24  theDR_Max(par.getParameter<double>("DR_Max")),
25  theDR_Veto(par.getParameter<double>("DR_Veto")),
26  theBeamlineOption(par.getParameter<string>("BeamlineOption")),
27  theBeamSpotLabel(par.getParameter<edm::InputTag>("BeamSpotLabel")),
28  theNHits_Min(par.getParameter<unsigned int>("NHits_Min")),
29  theChi2Ndof_Max(par.getParameter<double>("Chi2Ndof_Max")),
30  theChi2Prob_Min(par.getParameter<double>("Chi2Prob_Min")),
31  thePt_Min(par.getParameter<double>("Pt_Min"))
32 {
33 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
unsigned int theNHits_Min
BeamSpot name.
double theDR_Max
z distance to vertex
double theDiff_r
name for deposit
edm::InputTag theBeamSpotLabel
&quot;NONE&quot;, &quot;BeamSpotFromEvent&quot;
std::string theDepositLabel
Track Collection Label.
double theChi2Ndof_Max
trk.numberOfValidHits &gt;= theNHits_Min
double theDiff_z
transverse distance to vertex
std::string theBeamlineOption
Veto cone angle.
double thePt_Min
ChiSquaredProbability(trk.chi2,trk.ndof) &gt; theChi2Prob_Min.
double theDR_Veto
Maximum cone angle for deposits.
double theChi2Prob_Min
trk.normalizedChi2 &lt; theChi2Ndof_Max
virtual muonisolation::TrackExtractor::~TrackExtractor ( )
inlinevirtual

Definition at line 22 of file TrackExtractor.h.

22 {}

Member Function Documentation

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

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

Implements reco::isodeposit::IsoDepositExtractor.

Definition at line 50 of file TrackExtractor.cc.

References SiPixelRawToDigiRegional_cfi::beamSpot, reco::TrackBase::eta(), edm::HandleBase::isValid(), LogTrace, metname, reco::TrackBase::phi(), reco::TrackBase::pt(), corrVsCorr::selection, AlCaHLTBitMon_QueryRunRegistry::string, theBeamlineOption, theBeamSpotLabel, theChi2Ndof_Max, theChi2Prob_Min, theDiff_r, theDiff_z, theDR_Max, theNHits_Min, thePt_Min, theTrackCollectionTag, veto(), and reco::TrackBase::vz().

51 {
52  static std::string metname = "MuonIsolation|TrackExtractor";
53 
54  reco::isodeposit::Direction muonDir(muon.eta(), muon.phi());
55  IsoDeposit deposit(muonDir );
56  deposit.setVeto( veto(muonDir) );
58 
59  Handle<View<Track> > tracksH;
60  event.getByLabel(theTrackCollectionTag, tracksH);
61  // const TrackCollection tracks = *(tracksH.product());
62  LogTrace(metname)<<"***** TRACK COLLECTION SIZE: "<<tracksH->size();
63 
64  double vtx_z = muon.vz();
65  LogTrace(metname)<<"***** Muon vz: "<<vtx_z;
66  reco::TrackBase::Point beamPoint(0,0, 0);
67 
68  if (theBeamlineOption.compare("BeamSpotFromEvent") == 0){
69  //pick beamSpot
72 
73  event.getByLabel(theBeamSpotLabel,beamSpotH);
74 
75  if (beamSpotH.isValid()){
76  beamPoint = beamSpotH->position();
77  LogTrace(metname)<<"Extracted beam point at "<<beamPoint<<std::endl;
78  }
79  }
80 
81  LogTrace(metname)<<"Using beam point at "<<beamPoint<<std::endl;
82 
84  theDiff_r, muonDir, theDR_Max, beamPoint);
85 
86  pars.nHitsMin = theNHits_Min;
87  pars.chi2NdofMax = theChi2Ndof_Max;
88  pars.chi2ProbMin = theChi2Prob_Min;
89  pars.ptMin = thePt_Min;
90 
92  TrackSelector::result_type sel_tracks = selection(*tracksH);
93  LogTrace(metname)<<"all tracks: "<<tracksH->size()<<" selected: "<<sel_tracks.size();
94 
95 
96  TrackSelector::result_type::const_iterator tkI = sel_tracks.begin();
97  for (; tkI != sel_tracks.end(); ++tkI) {
98  const reco::Track* tk = *tkI;
99  LogTrace(metname) << "This track has: pt= " << tk->pt() << ", eta= "
100  << tk->eta() <<", phi= "<<tk->phi();
101  reco::isodeposit::Direction dirTrk(tk->eta(), tk->phi());
102  deposit.addDeposit(dirTrk, tk->pt());
103  }
104 
105  return deposit;
106 }
void setVeto(const Veto &aVeto)
Set veto.
Definition: IsoDeposit.h:80
const std::string metname
std::list< const reco::Track * > result_type
Definition: TrackSelector.h:17
selection
main part
Definition: corrVsCorr.py:98
unsigned int theNHits_Min
BeamSpot name.
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:139
double theDR_Max
z distance to vertex
void addDeposit(double dr, double deposit)
Add deposit (ie. transverse energy or pT)
Definition: IsoDeposit.cc:23
reco::IsoDeposit::Veto veto(const reco::IsoDeposit::Direction &dir) const
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:141
vector< ParameterSet > Parameters
double theDiff_r
name for deposit
double pt() const
track transverse momentum
Definition: TrackBase.h:131
void addCandEnergy(double et)
Set energy or pT attached to cand trajectory.
Definition: IsoDeposit.h:139
math::XYZPoint Point
point in the space
Definition: TrackBase.h:76
bool isValid() const
Definition: HandleBase.h:76
#define LogTrace(id)
edm::InputTag theBeamSpotLabel
&quot;NONE&quot;, &quot;BeamSpotFromEvent&quot;
double theChi2Ndof_Max
trk.numberOfValidHits &gt;= theNHits_Min
double theDiff_z
transverse distance to vertex
virtual reco::IsoDeposit deposit(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &muon) const
std::string theBeamlineOption
Veto cone angle.
double thePt_Min
ChiSquaredProbability(trk.chi2,trk.ndof) &gt; theChi2Prob_Min.
muonisolation::Range< float > Range
Definition: TrackSelector.h:16
double theChi2Prob_Min
trk.normalizedChi2 &lt; theChi2Ndof_Max
virtual void muonisolation::TrackExtractor::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 24 of file TrackExtractor.h.

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

Definition at line 42 of file TrackExtractor.cc.

References dir, reco::IsoDeposit::Veto::dR, query::result, theDR_Veto, and reco::IsoDeposit::Veto::vetoDir.

Referenced by deposit(), and vetos().

43 {
45  result.vetoDir = dir;
46  result.dR = theDR_Veto;
47  return result;
48 }
tuple result
Definition: query.py:137
double theDR_Veto
Maximum cone angle for deposits.
dbl *** dir
Definition: mlp_gen.cc:35
reco::IsoDeposit::Vetos TrackExtractor::vetos ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Track track 
) const
virtual

Definition at line 35 of file TrackExtractor.cc.

References dir, reco::TrackBase::eta(), reco::TrackBase::phi(), and veto().

37 {
38  reco::isodeposit::Direction dir(track.eta(),track.phi());
39  return reco::IsoDeposit::Vetos(1,veto(dir));
40 }
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:139
reco::IsoDeposit::Veto veto(const reco::IsoDeposit::Direction &dir) const
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:141
std::vector< Veto > Vetos
Definition: IsoDeposit.h:63
dbl *** dir
Definition: mlp_gen.cc:35

Member Data Documentation

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

Veto cone angle.

Definition at line 43 of file TrackExtractor.h.

Referenced by deposit().

edm::InputTag muonisolation::TrackExtractor::theBeamSpotLabel
private

"NONE", "BeamSpotFromEvent"

Definition at line 44 of file TrackExtractor.h.

Referenced by deposit().

double muonisolation::TrackExtractor::theChi2Ndof_Max
private

trk.numberOfValidHits >= theNHits_Min

Definition at line 46 of file TrackExtractor.h.

Referenced by deposit().

double muonisolation::TrackExtractor::theChi2Prob_Min
private

trk.normalizedChi2 < theChi2Ndof_Max

Definition at line 47 of file TrackExtractor.h.

Referenced by deposit().

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

Track Collection Label.

Definition at line 38 of file TrackExtractor.h.

double muonisolation::TrackExtractor::theDiff_r
private

name for deposit

Definition at line 39 of file TrackExtractor.h.

Referenced by deposit().

double muonisolation::TrackExtractor::theDiff_z
private

transverse distance to vertex

Definition at line 40 of file TrackExtractor.h.

Referenced by deposit().

double muonisolation::TrackExtractor::theDR_Max
private

z distance to vertex

Definition at line 41 of file TrackExtractor.h.

Referenced by deposit().

double muonisolation::TrackExtractor::theDR_Veto
private

Maximum cone angle for deposits.

Definition at line 42 of file TrackExtractor.h.

Referenced by veto().

unsigned int muonisolation::TrackExtractor::theNHits_Min
private

BeamSpot name.

Definition at line 45 of file TrackExtractor.h.

Referenced by deposit().

double muonisolation::TrackExtractor::thePt_Min
private

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

Definition at line 48 of file TrackExtractor.h.

Referenced by deposit().

edm::InputTag muonisolation::TrackExtractor::theTrackCollectionTag
private

Definition at line 37 of file TrackExtractor.h.

Referenced by deposit().