CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackClassMatch.h
Go to the documentation of this file.
1 #ifndef TrackClassMatch_H
2 #define TrackClassMatch_H
3 
9 
13 {
14  public:
15 
17 
18  class Input
19  {
20  public:
21  Input(const reco::Track & t,const reco::Jet &j, const reco::Vertex & v) :
22  track(t), jet(j), vertex(v) {}
23 
24  const reco::Track & track;
25  const reco::Jet & jet;
27  };
28 
31  typedef bool result_type;
32 
34 {
35  const reco::Track & track = input.track;
36 // const reco::Jet & jet = input.jet;
37 // const reco::Vertex & pv = input.vertex;
38  const TrackProbabilityCategoryData & d = category.category;
39  //Track Data
40  double p=track.p();
41  double eta=track.eta();
42  double nhit=track.numberOfValidHits();
43  double npix=track.hitPattern().numberOfValidPixelHits();
44  bool firstPixel=track.hitPattern().hasValidHitInFirstPixelBarrel();
45  double chi=track.normalizedChi2();
46  //Chi^2 cut if used
47  bool chicut=(chi >= d.chiMin && chi < d.chiMax );
48  if(d.chiMin<=0.01 && d.chiMax<=0.01) chicut=true;
49 
50  //First Pixel Hit cut 1=there should be an hit in first layer, -1=there should not be an hit, 0 = I do not care
51  bool fisrtPixelCut = ( (firstPixel && d.withFirstPixel == 1) || (!firstPixel && d.withFirstPixel == -1) || d.withFirstPixel == 0 );
52 
53  //the AND of everything
54  bool result=( p > d.pMin && p < d.pMax &&
55  fabs(eta) > d.etaMin && fabs(eta) < d.etaMax &&
56  nhit >= d.nHitsMin && nhit <= d.nHitsMax &&
57  npix >= d.nPixelHitsMin && npix <= d.nPixelHitsMax &&
58  chicut && fisrtPixelCut );
59  return result;
60  }
61 
62 
63 
64 };
65 
66 
67 #endif
68 
69 
70 
71 
72 
73 
74 
75 
double p() const
momentum vector magnitude
Definition: TrackBase.h:129
bool operator()(const first_argument_type &input, const second_argument_type &category) const
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
Base class for all types of Jets.
Definition: Jet.h:21
Input(const reco::Track &t, const reco::Jet &j, const reco::Vertex &v)
T eta() const
const reco::Track & track
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:141
tuple result
Definition: query.py:137
int j
Definition: DBlmapReader.cc:9
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:232
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:223
const reco::Vertex & vertex
int numberOfValidPixelHits() const
Definition: HitPattern.h:582
const reco::Jet & jet
bool hasValidHitInFirstPixelBarrel() const
Definition: HitPattern.cc:183
TrackProbabilityCalibration::Entry second_argument_type