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
l1tVertexFinder
Definition: AlgoSettings.h:10
l1tVertexFinder::AnalysisSettings
Definition: AnalysisSettings.h:15
AnalysisSettings.h
l1tVertexFinder::TP::fillUseForEff
void fillUseForEff()
Definition: TP.cc:106
l1tVertexFinder::TP::setMatchingStubs
void setMatchingStubs(const std::vector< Stub > &vMatchingStubs)
Definition: TP.cc:27
l1tVertexFinder::TP::useForVertexReco_
bool useForVertexReco_
Definition: TP.h:71
l1tVertexFinder::TP::fillUseForVertexReco
void fillUseForVertexReco()
Definition: TP.cc:87
l1tVertexFinder::TP::fillUseForAlgEff
void fillUseForAlgEff()
Definition: TP.cc:114
l1tVertexFinder::TP::fillUse
void fillUse()
Definition: TP.cc:99
l1tVertexFinder::TP
Definition: TP.h:16
l1tVertexFinder::TP::useForEff
bool useForEff() const
Definition: TP.h:50
l1tVertexFinder::TP::nLayersWithStubs_
unsigned int nLayersWithStubs_
Definition: TP.h:74
l1tVertexFinder::TP::useForEff_
bool useForEff_
Definition: TP.h:69
l1tVertexFinder::TrackingParticlePtr
edm::Ptr< TrackingParticle > TrackingParticlePtr
Definition: InputData.h:26
l1tVertexFinder::TP::operator==
bool operator==(const TP &rhs) const
Definition: TP.h:24
l1tVertexFinder::TP::numAssocStubs
unsigned int numAssocStubs() const
Definition: TP.h:44
l1tVertexFinder::TP::useForVertexReco
bool useForVertexReco() const
Definition: TP.h:54
l1tVertexFinder::TP::trackingParticle_
TrackingParticlePtr trackingParticle_
Definition: TP.h:63
l1tVertexFinder::TP::use
bool use() const
Definition: TP.h:48
l1tVertexFinder::TP::getTrackingParticle
const TrackingParticlePtr getTrackingParticle() const
Definition: TP.h:40
l1tVertexFinder::TP::useForAlgEff_
bool useForAlgEff_
Definition: TP.h:70
l1tVertexFinder::TP::countLayers
unsigned int countLayers(bool onlyPS=false)
Definition: TP.cc:39
l1tVertexFinder::TP::settings_
const AnalysisSettings * settings_
Definition: TP.h:64
edm::Ptr< TrackingParticle >
TrackingParticle.h
l1tVertexFinder::TP::inTimeBx_
bool inTimeBx_
Definition: TP.h:66
l1tVertexFinder::TP::operator->
const TrackingParticlePtr operator->() const
Definition: TP.h:46
l1tVertexFinder::TP::use_
bool use_
Definition: TP.h:68
Exception.h
l1tVertexFinder::TP::TP
TP()
Definition: TP.cc:5
l1tVertexFinder::TP::assocStubs_
std::vector< Stub > assocStubs_
Definition: TP.h:73
l1tVertexFinder::TP::physicsCollision
bool physicsCollision() const
Definition: TP.h:42
l1tVertexFinder::TP::physicsCollision_
bool physicsCollision_
Definition: TP.h:67
l1tVertexFinder::TP::~TP
~TP()
Definition: TP.h:21
l1tVertexFinder::TP::useForAlgEff
bool useForAlgEff() const
Definition: TP.h:52
Stub.h