test
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::PixelTrackExtractor Class Reference

#include <PixelTrackExtractor.h>

Inheritance diagram for muonisolation::PixelTrackExtractor:
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)
 
 PixelTrackExtractor ()
 
 PixelTrackExtractor (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
 
virtual ~PixelTrackExtractor ()
 
- 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::Direction directionAtPresetRadius (const reco::Track &tk, double bz) const
 
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 Token. 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...
 
double theDR_VetoPt
 .. it is above this threshold More...
 
unsigned int theNHits_Min
 BeamSpot name. More...
 
bool thePropagateTracksToRadius
 min track pt to include into iso deposit More...
 
double thePt_Min
 ChiSquaredProbability(trk.chi2,trk.ndof) > theChi2Prob_Min. More...
 
double thePtVeto_Min
 will veto leading track if More...
 
double theReferenceRadius
 If set to true will compare track eta-phi at ... More...
 
edm::EDGetTokenT< edm::View
< reco::Track > > 
theTrackCollectionToken
 
bool theVetoLeadingTrack
 ... this radius More...
 

Detailed Description

Definition at line 18 of file PixelTrackExtractor.h.

Constructor & Destructor Documentation

muonisolation::PixelTrackExtractor::PixelTrackExtractor ( )
inline

Definition at line 22 of file PixelTrackExtractor.h.

22 {};
PixelTrackExtractor::PixelTrackExtractor ( const edm::ParameterSet par,
edm::ConsumesCollector &&  iC 
)

Definition at line 22 of file PixelTrackExtractor.cc.

22  :
23  theTrackCollectionToken(iC.consumes<View<Track> >(par.getParameter<edm::InputTag>("inputTrackCollection"))),
24  theDepositLabel(par.getUntrackedParameter<string>("DepositLabel")),
25  theDiff_r(par.getParameter<double>("Diff_r")),
26  theDiff_z(par.getParameter<double>("Diff_z")),
27  theDR_Max(par.getParameter<double>("DR_Max")),
28  theDR_Veto(par.getParameter<double>("DR_Veto")),
29  theBeamlineOption(par.getParameter<string>("BeamlineOption")),
31  theNHits_Min(par.getParameter<unsigned int>("NHits_Min")),
32  theChi2Ndof_Max(par.getParameter<double>("Chi2Ndof_Max")),
33  theChi2Prob_Min(par.getParameter<double>("Chi2Prob_Min")),
34  thePt_Min(par.getParameter<double>("Pt_Min")),
35  thePropagateTracksToRadius(par.getParameter<bool>("PropagateTracksToRadius")),
36  theReferenceRadius(par.getParameter<double>("ReferenceRadius")),
37  theVetoLeadingTrack(par.getParameter<bool>("VetoLeadingTrack")),
38  thePtVeto_Min(par.getParameter<double>("PtVeto_Min")),
39  theDR_VetoPt(par.getParameter<double>("DR_VetoPt"))
40 {
41 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
double theReferenceRadius
If set to true will compare track eta-phi at ...
double theChi2Ndof_Max
trk.numberOfValidHits &gt;= theNHits_Min
double theDR_Veto
Maximum cone angle for deposits.
bool thePropagateTracksToRadius
min track pt to include into iso deposit
double thePtVeto_Min
will veto leading track if
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotToken
&quot;NONE&quot;, &quot;BeamSpotFromEvent&quot;
double theDR_Max
z distance to vertex
double thePt_Min
ChiSquaredProbability(trk.chi2,trk.ndof) &gt; theChi2Prob_Min.
std::string theDepositLabel
Track Collection Token.
double theDiff_z
transverse distance to vertex
std::string theBeamlineOption
Veto cone angle.
edm::EDGetTokenT< edm::View< reco::Track > > theTrackCollectionToken
double theDR_VetoPt
.. it is above this threshold
unsigned int theNHits_Min
BeamSpot name.
double theChi2Prob_Min
trk.normalizedChi2 &lt; theChi2Ndof_Max
virtual muonisolation::PixelTrackExtractor::~PixelTrackExtractor ( )
inlinevirtual

Definition at line 25 of file PixelTrackExtractor.h.

25 {}

Member Function Documentation

IsoDeposit PixelTrackExtractor::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

Note, this can be reset below if theVetoLeadingTrack is set and conditions are met

Implements reco::isodeposit::IsoDepositExtractor.

Definition at line 74 of file PixelTrackExtractor.cc.

References reco::IsoDeposit::addCandEnergy(), reco::IsoDeposit::addDeposit(), SiPixelRawToDigiRegional_cfi::beamSpot, ecalTB2006H4_GenSimDigiReco_cfg::bField, deltaR(), directionAtPresetRadius(), reco::isodeposit::Direction::eta(), reco::TrackBase::eta(), edm::EventSetup::get(), edm::HandleBase::isValid(), LogTrace, metname, reco::isodeposit::Direction::phi(), reco::TrackBase::phi(), reco::TrackBase::pt(), corrVsCorr::selection, reco::IsoDeposit::setVeto(), AlCaHLTBitMon_QueryRunRegistry::string, theBeamlineOption, theBeamSpotToken, theChi2Ndof_Max, theChi2Prob_Min, theDiff_r, theDiff_z, theDR_Max, theDR_VetoPt, theNHits_Min, thePt_Min, thePtVeto_Min, theTrackCollectionToken, theVetoLeadingTrack, veto(), and reco::TrackBase::vz().

75 {
76  static const std::string metname = "MuonIsolation|PixelTrackExtractor";
77 
79  eventSetup.get<IdealMagneticFieldRecord>().get(bField);
80  double bz = bField->inInverseGeV(GlobalPoint(0.,0.,0.)).z();
81 
83  IsoDeposit deposit(muonDir );
85  deposit.setVeto( veto(muonDir) );
86 
88 
89  Handle<View<Track> > tracksH;
90  event.getByToken(theTrackCollectionToken, tracksH);
91  // const TrackCollection tracks = *(tracksH.product());
92  LogTrace(metname)<<"***** TRACK COLLECTION SIZE: "<<tracksH->size();
93 
94  double vtx_z = muon.vz();
95  LogTrace(metname)<<"***** Muon vz: "<<vtx_z;
96  reco::TrackBase::Point beamPoint(0,0, 0);
97 
98  if (theBeamlineOption.compare("BeamSpotFromEvent") == 0){
99  //pick beamSpot
101  edm::Handle<reco::BeamSpot> beamSpotH;
102 
103  event.getByToken(theBeamSpotToken,beamSpotH);
104 
105  if (beamSpotH.isValid()){
106  beamPoint = beamSpotH->position();
107  LogTrace(metname)<<"Extracted beam point at "<<beamPoint<<std::endl;
108  }
109  }
110 
111  LogTrace(metname)<<"Using beam point at "<<beamPoint<<std::endl;
112 
114  theDiff_r, muonDir, theDR_Max, beamPoint);
115 
116  pars.nHitsMin = theNHits_Min;
117  pars.chi2NdofMax = theChi2Ndof_Max;
118  pars.chi2ProbMin = theChi2Prob_Min;
119  pars.ptMin = thePt_Min;
120 
121  TrackSelector selection(pars);
122  TrackSelector::result_type sel_tracks = selection(*tracksH);
123  LogTrace(metname)<<"all tracks: "<<tracksH->size()<<" selected: "<<sel_tracks.size();
124 
125 
126  double maxPt = -1;
127  Direction maxPtDir;
128  TrackSelector::result_type::const_iterator tkI = sel_tracks.begin();
129  for (; tkI != sel_tracks.end(); ++tkI) {
130  const reco::Track* tk = *tkI;
131  LogTrace(metname) << "This track has: pt= " << tk->pt() << ", eta= "
132  << tk->eta() <<", phi= "<<tk->phi();
133  Direction dirTrk(directionAtPresetRadius(*tk, bz));
134  deposit.addDeposit(dirTrk, tk->pt());
135  double tkDr = (muonDir-dirTrk).deltaR;
136  double tkPt = tk->pt();
137  if (theVetoLeadingTrack && tkPt > thePtVeto_Min
138  && tkDr < theDR_VetoPt
139  && maxPt < tkPt ){
140  maxPt = tkPt;
141  maxPtDir = dirTrk;
142  }
143  }
144  if (maxPt > 0){
145  deposit.setVeto(veto(maxPtDir));
146  LogTrace(metname)<<" Set track veto the leading track with pt "
147  <<maxPt<<" in direction (eta,phi) "
148  <<maxPtDir.eta()<<", "<<maxPtDir.phi();
149  }
150 
151  return deposit;
152 }
void setVeto(const Veto &aVeto)
Set veto.
Definition: IsoDeposit.h:80
double theChi2Ndof_Max
trk.numberOfValidHits &gt;= theNHits_Min
reco::IsoDeposit::Veto veto(const reco::IsoDeposit::Direction &dir) const
const std::string metname
std::list< const reco::Track * > result_type
Definition: TrackSelector.h:17
selection
main part
Definition: corrVsCorr.py:98
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:137
void addDeposit(double dr, double deposit)
Add deposit (ie. transverse energy or pT)
Definition: IsoDeposit.cc:23
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:139
vector< ParameterSet > Parameters
double thePtVeto_Min
will veto leading track if
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotToken
&quot;NONE&quot;, &quot;BeamSpotFromEvent&quot;
double pt() const
track transverse momentum
Definition: TrackBase.h:129
double theDR_Max
z distance to vertex
void addCandEnergy(double et)
Set energy or pT attached to cand trajectory.
Definition: IsoDeposit.h:139
double thePt_Min
ChiSquaredProbability(trk.chi2,trk.ndof) &gt; theChi2Prob_Min.
math::XYZPoint Point
point in the space
Definition: TrackBase.h:74
bool isValid() const
Definition: HandleBase.h:76
#define LogTrace(id)
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
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.
edm::EDGetTokenT< edm::View< reco::Track > > theTrackCollectionToken
reco::isodeposit::Direction directionAtPresetRadius(const reco::Track &tk, double bz) const
double theDR_VetoPt
.. it is above this threshold
unsigned int theNHits_Min
BeamSpot name.
muonisolation::Range< float > Range
Definition: TrackSelector.h:16
double theChi2Prob_Min
trk.normalizedChi2 &lt; theChi2Ndof_Max
Direction PixelTrackExtractor::directionAtPresetRadius ( const reco::Track tk,
double  bz 
) const
private

Definition at line 58 of file PixelTrackExtractor.cc.

References reco::TrackBase::charge(), dPhi(), reco::TrackBase::dxy(), reco::TrackBase::eta(), reco::TrackBase::phi(), reco::TrackBase::pt(), mathSSE::sqrt(), thePropagateTracksToRadius, and theReferenceRadius.

Referenced by deposit().

58  {
60  return Direction(tk.eta(), tk.phi());
61  }
62 
63  // this should represent a cylinder in global frame at R=refRadius cm, roughly where mid-layer of pixels is
64  double psRadius = theReferenceRadius;
65  double tkDxy = tk.dxy();
66  double s2D = fabs(tk.dxy()) < psRadius ? sqrt(psRadius*psRadius - tkDxy*tkDxy) : 0;
67 
68  // the field we get from the caller is already in units of GeV/cm
69  double dPhi = -s2D*tk.charge()*bz/tk.pt();
70 
71  return Direction(tk.eta(), tk.phi()+dPhi);
72 }
double theReferenceRadius
If set to true will compare track eta-phi at ...
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:137
bool thePropagateTracksToRadius
min track pt to include into iso deposit
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:139
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
T sqrt(T t)
Definition: SSEVec.h:48
double pt() const
track transverse momentum
Definition: TrackBase.h:129
int charge() const
track electric charge
Definition: TrackBase.h:111
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:119
virtual void muonisolation::PixelTrackExtractor::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 27 of file PixelTrackExtractor.h.

28  {}
reco::IsoDeposit::Veto PixelTrackExtractor::veto ( const reco::IsoDeposit::Direction dir) const
private

Definition at line 50 of file PixelTrackExtractor.cc.

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

Referenced by deposit(), and vetos().

51 {
53  result.vetoDir = dir;
54  result.dR = theDR_Veto;
55  return result;
56 }
double theDR_Veto
Maximum cone angle for deposits.
tuple result
Definition: query.py:137
dbl *** dir
Definition: mlp_gen.cc:35
reco::IsoDeposit::Vetos PixelTrackExtractor::vetos ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Track track 
) const
virtual

Definition at line 43 of file PixelTrackExtractor.cc.

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

45 {
46  Direction dir(track.eta(),track.phi());
47  return reco::IsoDeposit::Vetos(1,veto(dir));
48 }
reco::IsoDeposit::Veto veto(const reco::IsoDeposit::Direction &dir) const
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:137
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:139
std::vector< Veto > Vetos
Definition: IsoDeposit.h:63
dbl *** dir
Definition: mlp_gen.cc:35

Member Data Documentation

std::string muonisolation::PixelTrackExtractor::theBeamlineOption
private

Veto cone angle.

Definition at line 48 of file PixelTrackExtractor.h.

Referenced by deposit().

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

"NONE", "BeamSpotFromEvent"

Definition at line 49 of file PixelTrackExtractor.h.

Referenced by deposit().

double muonisolation::PixelTrackExtractor::theChi2Ndof_Max
private

trk.numberOfValidHits >= theNHits_Min

Definition at line 51 of file PixelTrackExtractor.h.

Referenced by deposit().

double muonisolation::PixelTrackExtractor::theChi2Prob_Min
private

trk.normalizedChi2 < theChi2Ndof_Max

Definition at line 52 of file PixelTrackExtractor.h.

Referenced by deposit().

std::string muonisolation::PixelTrackExtractor::theDepositLabel
private

Track Collection Token.

Definition at line 43 of file PixelTrackExtractor.h.

double muonisolation::PixelTrackExtractor::theDiff_r
private

name for deposit

Definition at line 44 of file PixelTrackExtractor.h.

Referenced by deposit().

double muonisolation::PixelTrackExtractor::theDiff_z
private

transverse distance to vertex

Definition at line 45 of file PixelTrackExtractor.h.

Referenced by deposit().

double muonisolation::PixelTrackExtractor::theDR_Max
private

z distance to vertex

Definition at line 46 of file PixelTrackExtractor.h.

Referenced by deposit().

double muonisolation::PixelTrackExtractor::theDR_Veto
private

Maximum cone angle for deposits.

Definition at line 47 of file PixelTrackExtractor.h.

Referenced by veto().

double muonisolation::PixelTrackExtractor::theDR_VetoPt
private

.. it is above this threshold

Definition at line 60 of file PixelTrackExtractor.h.

Referenced by deposit().

unsigned int muonisolation::PixelTrackExtractor::theNHits_Min
private

BeamSpot name.

Definition at line 50 of file PixelTrackExtractor.h.

Referenced by deposit().

bool muonisolation::PixelTrackExtractor::thePropagateTracksToRadius
private

min track pt to include into iso deposit

Definition at line 55 of file PixelTrackExtractor.h.

Referenced by directionAtPresetRadius().

double muonisolation::PixelTrackExtractor::thePt_Min
private

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

Definition at line 53 of file PixelTrackExtractor.h.

Referenced by deposit().

double muonisolation::PixelTrackExtractor::thePtVeto_Min
private

will veto leading track if

Definition at line 59 of file PixelTrackExtractor.h.

Referenced by deposit().

double muonisolation::PixelTrackExtractor::theReferenceRadius
private

If set to true will compare track eta-phi at ...

Definition at line 56 of file PixelTrackExtractor.h.

Referenced by directionAtPresetRadius().

edm::EDGetTokenT<edm::View<reco::Track> > muonisolation::PixelTrackExtractor::theTrackCollectionToken
private

Definition at line 42 of file PixelTrackExtractor.h.

Referenced by deposit().

bool muonisolation::PixelTrackExtractor::theVetoLeadingTrack
private

... this radius

Definition at line 58 of file PixelTrackExtractor.h.

Referenced by deposit().