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 | Protected Attributes
RecoTrackSelector Class Reference

#include <RecoTrackSelector.h>

Inheritance diagram for RecoTrackSelector:
RecoTrackRefSelector

Public Types

typedef reco::TrackCollection collection
 
typedef container::const_iterator const_iterator
 
typedef std::vector< const
reco::Track * > 
container
 

Public Member Functions

const_iterator begin () const
 
const_iterator end () const
 
bool operator() (const reco::Track &t, const reco::BeamSpot *bs)
 Operator() performs the selection: e.g. if (recoTrackSelector(track)) {...}. More...
 
 RecoTrackSelector ()
 Constructors. More...
 
 RecoTrackSelector (const edm::ParameterSet &cfg)
 
 RecoTrackSelector (double ptMin, double minRapidity, double maxRapidity, double tip, double lip, int minHit, int min3DHit, double maxChi2, std::vector< std::string > quality, std::vector< std::string > algorithm)
 
void select (const edm::Handle< collection > &c, const edm::Event &event, const edm::EventSetup &)
 
size_t size () const
 

Protected Attributes

std::vector
< reco::TrackBase::TrackAlgorithm
algorithm_
 
edm::InputTag bsSrc_
 
double lip_
 
double maxChi2_
 
double maxRapidity_
 
int min3DHit_
 
int minHit_
 
double minRapidity_
 
double ptMin_
 
std::vector
< reco::TrackBase::TrackQuality
quality_
 
container selected_
 
double tip_
 

Detailed Description

Definition at line 16 of file RecoTrackSelector.h.

Member Typedef Documentation

Definition at line 18 of file RecoTrackSelector.h.

typedef container::const_iterator RecoTrackSelector::const_iterator

Definition at line 20 of file RecoTrackSelector.h.

typedef std::vector<const reco::Track *> RecoTrackSelector::container

Definition at line 19 of file RecoTrackSelector.h.

Constructor & Destructor Documentation

RecoTrackSelector::RecoTrackSelector ( )
inline

Constructors.

Definition at line 23 of file RecoTrackSelector.h.

23 {}
RecoTrackSelector::RecoTrackSelector ( const edm::ParameterSet cfg)
inline

Definition at line 24 of file RecoTrackSelector.h.

References reco::TrackBase::algoByName(), algorithm(), algorithm_, edm::ParameterSet::getParameter(), j, quality_, and reco::TrackBase::qualityByName().

24  :
25  ptMin_(cfg.getParameter<double>("ptMin")),
26  minRapidity_(cfg.getParameter<double>("minRapidity")),
27  maxRapidity_(cfg.getParameter<double>("maxRapidity")),
28  tip_(cfg.getParameter<double>("tip")),
29  lip_(cfg.getParameter<double>("lip")),
30  minHit_(cfg.getParameter<int>("minHit")),
31  min3DHit_(cfg.getParameter<int>("min3DHit")),
32  maxChi2_(cfg.getParameter<double>("maxChi2")),
33  bsSrc_(cfg.getParameter<edm::InputTag>("beamSpot"))
34  {
35  std::vector<std::string> quality = cfg.getParameter<std::vector<std::string> >("quality");
36  for (unsigned int j=0;j<quality.size();j++) quality_.push_back(reco::TrackBase::qualityByName(quality[j]));
37  std::vector<std::string> algorithm = cfg.getParameter<std::vector<std::string> >("algorithm");
38  for (unsigned int j=0;j<algorithm.size();j++) algorithm_.push_back(reco::TrackBase::algoByName(algorithm[j]));
39  }
T getParameter(std::string const &) const
< trclass="colgroup">< tdclass="colgroup"colspan=5 > Ecal cluster collections</td ></tr >< tr >< td >< ahref="classreco_1_1BasicCluster.html"> reco::BasicCluster</a ></td >< td >< ahref="DataFormats_EgammaReco.html"> reco::BasicClusterCollection</a ></td >< td >< ahref="#"> hybridSuperClusters</a ></td >< tdclass="description"> Basic clusters reconstructed with hybrid algorithm(barrel only)</td >< td >S.Rahatlou</td ></tr >< tr >< td >< a href
edm::InputTag bsSrc_
std::vector< reco::TrackBase::TrackQuality > quality_
int j
Definition: DBlmapReader.cc:9
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:46
std::vector< reco::TrackBase::TrackAlgorithm > algorithm_
static TrackAlgorithm algoByName(const std::string &name)
Definition: TrackBase.cc:55
RecoTrackSelector::RecoTrackSelector ( double  ptMin,
double  minRapidity,
double  maxRapidity,
double  tip,
double  lip,
int  minHit,
int  min3DHit,
double  maxChi2,
std::vector< std::string >  quality,
std::vector< std::string >  algorithm 
)
inline

Definition at line 41 of file RecoTrackSelector.h.

References reco::TrackBase::algoByName(), algorithm_, j, quality_, and reco::TrackBase::qualityByName().

43  :
44  ptMin_( ptMin ), minRapidity_( minRapidity ), maxRapidity_( maxRapidity ),
45  tip_( tip ), lip_( lip ), minHit_( minHit ), min3DHit_( min3DHit), maxChi2_( maxChi2 )
46  {
47  for (unsigned int j=0;j<quality.size();j++) quality_.push_back(reco::TrackBase::qualityByName(quality[j]));
48  for (unsigned int j=0;j<algorithm.size();j++) algorithm_.push_back(reco::TrackBase::algoByName(algorithm[j]));
49  }
< trclass="colgroup">< tdclass="colgroup"colspan=5 > Ecal cluster collections</td ></tr >< tr >< td >< ahref="classreco_1_1BasicCluster.html"> reco::BasicCluster</a ></td >< td >< ahref="DataFormats_EgammaReco.html"> reco::BasicClusterCollection</a ></td >< td >< ahref="#"> hybridSuperClusters</a ></td >< tdclass="description"> Basic clusters reconstructed with hybrid algorithm(barrel only)</td >< td >S.Rahatlou</td ></tr >< tr >< td >< a href
std::vector< reco::TrackBase::TrackQuality > quality_
int j
Definition: DBlmapReader.cc:9
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:46
std::vector< reco::TrackBase::TrackAlgorithm > algorithm_
static TrackAlgorithm algoByName(const std::string &name)
Definition: TrackBase.cc:55

Member Function Documentation

const_iterator RecoTrackSelector::begin ( void  ) const
inline

Definition at line 51 of file RecoTrackSelector.h.

References selected_.

51 { return selected_.begin(); }
const_iterator RecoTrackSelector::end ( void  ) const
inline

Definition at line 52 of file RecoTrackSelector.h.

References selected_.

Referenced by Types.LuminosityBlockRange::cppID(), and Types.EventRange::cppID().

52 { return selected_.end(); }
bool RecoTrackSelector::operator() ( const reco::Track t,
const reco::BeamSpot bs 
)
inline

Operator() performs the selection: e.g. if (recoTrackSelector(track)) {...}.

Definition at line 66 of file RecoTrackSelector.h.

References reco::TrackBase::algo(), algorithm_, reco::TrackBase::dsz(), reco::TrackBase::dxy(), reco::TrackBase::eta(), spr::find(), reco::TrackBase::hitPattern(), i, lip_, maxChi2_, maxRapidity_, min3DHit_, minHit_, minRapidity_, reco::TrackBase::normalizedChi2(), reco::HitPattern::numberOfValidStripLayersWithMonoAndStereo(), reco::HitPattern::pixelLayersWithMeasurement(), reco::BeamSpot::position(), reco::TrackBase::pt(), ptMin_, reco::TrackBase::quality(), quality_, tip_, and reco::HitPattern::trackerLayersWithMeasurement().

66  {
67  bool quality_ok = true;
68  if (quality_.size()!=0) {
69  quality_ok = false;
70  for (unsigned int i = 0; i<quality_.size();++i) {
71  if (t.quality(quality_[i])){
72  quality_ok = true;
73  break;
74  }
75  }
76  }
77  bool algo_ok = true;
78  if (algorithm_.size()!=0) {
79  if (std::find(algorithm_.begin(),algorithm_.end(),t.algo())==algorithm_.end()) algo_ok = false;
80  }
81  return
85  fabs(t.pt()) >= ptMin_ &&
86  t.eta() >= minRapidity_ && t.eta() <= maxRapidity_ &&
87  fabs(t.dxy(bs->position())) <= tip_ &&
88  fabs(t.dsz(bs->position())) <= lip_ &&
89  t.normalizedChi2()<=maxChi2_ &&
90  quality_ok &&
91  algo_ok);
92  }
int i
Definition: DBlmapReader.cc:9
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:111
std::vector< reco::TrackBase::TrackQuality > quality_
int pixelLayersWithMeasurement() const
Definition: HitPattern.h:710
int numberOfValidStripLayersWithMonoAndStereo() const
Definition: HitPattern.cc:224
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
double dsz() const
dsz parameter (THIS IS NOT the SZ impact parameter to (0,0,0) if refPoint is far from (0...
Definition: TrackBase.h:125
TrackAlgorithm algo() const
Definition: TrackBase.h:332
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:141
int trackerLayersWithMeasurement() const
Definition: HitPattern.h:705
double pt() const
track transverse momentum
Definition: TrackBase.h:131
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:223
std::vector< reco::TrackBase::TrackAlgorithm > algorithm_
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:377
const Point & position() const
position
Definition: BeamSpot.h:63
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:121
void RecoTrackSelector::select ( const edm::Handle< collection > &  c,
const edm::Event event,
const edm::EventSetup  
)
inline
size_t RecoTrackSelector::size ( void  ) const
inline

Definition at line 94 of file RecoTrackSelector.h.

References selected_.

94 { return selected_.size(); }

Member Data Documentation

std::vector<reco::TrackBase::TrackAlgorithm> RecoTrackSelector::algorithm_
protected

Definition at line 106 of file RecoTrackSelector.h.

Referenced by operator()(), and RecoTrackSelector().

edm::InputTag RecoTrackSelector::bsSrc_
protected

Definition at line 107 of file RecoTrackSelector.h.

Referenced by RecoTrackRefSelector::select(), and select().

double RecoTrackSelector::lip_
protected

Definition at line 101 of file RecoTrackSelector.h.

Referenced by operator()().

double RecoTrackSelector::maxChi2_
protected

Definition at line 104 of file RecoTrackSelector.h.

Referenced by operator()().

double RecoTrackSelector::maxRapidity_
protected

Definition at line 99 of file RecoTrackSelector.h.

Referenced by operator()().

int RecoTrackSelector::min3DHit_
protected

Definition at line 103 of file RecoTrackSelector.h.

Referenced by operator()().

int RecoTrackSelector::minHit_
protected

Definition at line 102 of file RecoTrackSelector.h.

Referenced by operator()().

double RecoTrackSelector::minRapidity_
protected

Definition at line 98 of file RecoTrackSelector.h.

Referenced by operator()().

double RecoTrackSelector::ptMin_
protected

Definition at line 97 of file RecoTrackSelector.h.

Referenced by operator()().

std::vector<reco::TrackBase::TrackQuality> RecoTrackSelector::quality_
protected

Definition at line 105 of file RecoTrackSelector.h.

Referenced by operator()(), and RecoTrackSelector().

container RecoTrackSelector::selected_
protected

Definition at line 108 of file RecoTrackSelector.h.

Referenced by begin(), end(), select(), and size().

double RecoTrackSelector::tip_
protected

Definition at line 100 of file RecoTrackSelector.h.

Referenced by operator()().