CMS 3D CMS Logo

TP.h
Go to the documentation of this file.
1 #ifndef __L1Trigger_VertexFinder_TP_h__
2 #define __L1Trigger_VertexFinder_TP_h__
3 
8 
9 namespace l1tVertexFinder {
10 
11  class AnalysisSettings;
12  class Stub;
13 
15 
16  class TP {
17  public:
18  // Fill useful info about tracking particle.
19  TP();
20  TP(const TrackingParticlePtr& tpPtr, const AnalysisSettings& settings);
21  ~TP() {}
22 
23  // Need the operator== to compare 2 TP types.
24  bool operator==(const TP& rhs) const {
25  return (trackingParticle_ == rhs.trackingParticle_ && settings_ == rhs.settings_ && inTimeBx_ == rhs.inTimeBx_ &&
29  }
30 
31  // Fill truth info with association from tracking particle to stubs.
32  void setMatchingStubs(const std::vector<Stub>& vMatchingStubs);
33 
34  // == Functions for returning info about tracking particles ===
35 
36  // Count number of tracker layers a given list of stubs are in.
37  // By default, considers both PS+2S modules, but optionally considers only the PS ones if onlyPS = true.
38  unsigned int countLayers(bool onlyPS = false);
39  // Return a C++ pointer to the tracking particle
41  // Did it come from the main physics collision or from pileup?
42  bool physicsCollision() const { return physicsCollision_; }
43  // Functions returning stubs produced by tracking particle.
44  unsigned int numAssocStubs() const { return assocStubs_.size(); }
45  // Overload operator-> to return a C++ pointer to the underlying TrackingParticle
47  // TP is worth keeping (e.g. for fake rate measurement)
48  bool use() const { return use_; }
49  // TP can be used to measure the L1 tracking efficiency
50  bool useForEff() const { return useForEff_; }
51  // TP can be used for algorithmic efficiency measurement (also requires stubs in enough layers).
52  bool useForAlgEff() const { return useForAlgEff_; }
53  // TP can be used for vertex reconstruction measuremetn
54  bool useForVertexReco() const { return useForVertexReco_; }
55 
56  private:
57  void fillUse(); // Fill the use_ flag.
58  void fillUseForEff(); // Fill the useForEff_ flag.
59  void fillUseForAlgEff(); // Fill the useforAlgEff_ flag.
60  void fillUseForVertexReco();
61 
62  private:
63  TrackingParticlePtr trackingParticle_; // Underlying TrackingParticle pointer
64  const AnalysisSettings* settings_; // Configuration parameters
65 
66  bool inTimeBx_; // TP came from in-time bunch crossing.
67  bool physicsCollision_; // True if TP from physics collision rather than pileup.
68  bool use_; // TP is worth keeping (e.g. for fake rate measurement)
69  bool useForEff_; // TP can be used for tracking efficiency measurement.
70  bool useForAlgEff_; // TP can be used for tracking algorithmic efficiency measurement.
72 
73  std::vector<Stub> assocStubs_;
74  unsigned int nLayersWithStubs_; // Number of tracker layers with stubs from this TP.
75  };
76 
77 } // end namespace l1tVertexFinder
78 
79 #endif
TrackingParticlePtr trackingParticle_
Definition: TP.h:63
bool useForAlgEff() const
Definition: TP.h:52
unsigned int nLayersWithStubs_
Definition: TP.h:74
unsigned int countLayers(bool onlyPS=false)
Definition: TP.cc:39
bool inTimeBx_
Definition: TP.h:66
bool operator==(const TP &rhs) const
Definition: TP.h:24
void fillUse()
Definition: TP.cc:99
edm::Ptr< TrackingParticle > TrackingParticlePtr
Definition: InputData.h:23
void setMatchingStubs(const std::vector< Stub > &vMatchingStubs)
Definition: TP.cc:27
const AnalysisSettings * settings_
Definition: TP.h:64
void fillUseForVertexReco()
Definition: TP.cc:87
bool useForEff() const
Definition: TP.h:50
std::vector< Stub > assocStubs_
Definition: TP.h:73
bool useForVertexReco_
Definition: TP.h:71
bool useForEff_
Definition: TP.h:69
void fillUseForEff()
Definition: TP.cc:106
const TrackingParticlePtr getTrackingParticle() const
Definition: TP.h:40
const TrackingParticlePtr operator->() const
Definition: TP.h:46
bool useForAlgEff_
Definition: TP.h:70
void fillUseForAlgEff()
Definition: TP.cc:114
bool physicsCollision_
Definition: TP.h:67
bool physicsCollision() const
Definition: TP.h:42
bool useForVertexReco() const
Definition: TP.h:54
unsigned int numAssocStubs() const
Definition: TP.h:44
bool use() const
Definition: TP.h:48