CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
InputData.h
Go to the documentation of this file.
1 #ifndef __L1Trigger_VertexFinder_InputData_h__
2 #define __L1Trigger_VertexFinder_InputData_h__
3 
21 
22 #include <vector>
23 
24 namespace l1tVertexFinder {
25 
27  typedef std::map<TrackingParticlePtr, edm::RefToBase<TrackingParticle>> TPPtrToRefMap;
28 
29  class AnalysisSettings;
30  class Stub;
31 
32  //=== Unpacks stub & tracking particle (truth) data into user-friendlier format in Stub & TP classes.
33  //=== Also makes B-field available to Settings class.
34 
35  class InputData {
36  public:
38  InputData();
40  const edm::EventSetup& iSetup,
41  const AnalysisSettings& settings,
42  const edm::EDGetTokenT<edm::HepMCProduct> hepMCToken,
43  const edm::EDGetTokenT<edm::View<reco::GenParticle>> genParticlesToken,
46  const edm::EDGetTokenT<DetSetVec> stubToken,
49  ~InputData();
50 
51  // Sort Tracking Particles by vertex z position
52  struct SortVertexByPt {
53  inline bool operator()(const Vertex vertex0, const Vertex vertex1) { return (vertex0.pT() > vertex1.pT()); }
54  };
55 
56  // Sort Tracking Particles by vertex z position
57  struct SortVertexByZ0 {
58  inline bool operator()(const Vertex vertex0, const Vertex vertex1) { return (vertex0.z0() < vertex1.z0()); }
59  };
60 
62  const TPPtrToRefMap& getTPPtrToRefMap() const { return tpPtrToRefMap_; }
64  const Vertex& getHepMCVertex() const { return hepMCVertex_; }
66  const Vertex& getGenVertex() const { return genVertex_; }
68  const Vertex& getPrimaryVertex() const { return vertex_; }
70  const std::vector<Vertex>& getPileUpVertices() const { return vertices_; }
72  const std::vector<Vertex>& getRecoPileUpVertices() const { return recoVertices_; }
73 
74  const float genPt() const { return genPt_; }
75  const float genPt_PU() const { return genPt_PU_; }
76 
77  private:
78  Vertex hepMCVertex_; // primary vertex from the edm::HepMCProduct
79  Vertex genVertex_; // primary vertex formed from the gen particles collection
80  Vertex vertex_; // primary vertex formed from the tracking particles
81  std::vector<Vertex> vertices_; // pile-up vertices
82  std::vector<Vertex> recoVertices_; // reconstructable pile-up vertices
83  std::vector<Stub>
84  vAllStubs_; // all stubs, even those that would fail any tightened front-end readout electronic cuts specified in section StubCuts of Analyze_Defaults_cfi.py. (Only used to measure
85  // the efficiency of these cuts).
87  float genPt_;
88  float genPt_PU_;
89  };
90 
91 } // end namespace l1tVertexFinder
92 
93 #endif
std::vector< Vertex > vertices_
Definition: InputData.h:81
const float genPt_PU() const
Definition: InputData.h:75
InputData()
Constructor and destructor.
Definition: InputData.cc:21
bool operator()(const Vertex vertex0, const Vertex vertex1)
Definition: InputData.h:58
const std::vector< Vertex > & getRecoPileUpVertices() const
Get reconstructable pile-up vertices information.
Definition: InputData.h:72
std::vector< Stub > vAllStubs_
Definition: InputData.h:84
bool operator()(const Vertex vertex0, const Vertex vertex1)
Definition: InputData.h:53
const Vertex & getGenVertex() const
Get primary vertex information (vertex from gen particles)
Definition: InputData.h:66
edm::Ptr< TrackingParticle > TrackingParticlePtr
Definition: InputData.h:26
int iEvent
Definition: GenABIO.cc:224
TPPtrToRefMap tpPtrToRefMap_
Definition: InputData.h:86
std::map< TrackingParticlePtr, edm::RefToBase< TrackingParticle > > TPPtrToRefMap
Definition: InputData.h:27
const Vertex & getHepMCVertex() const
Get primary vertex information (vertex from HepMCProduct)
Definition: InputData.h:64
const TPPtrToRefMap & getTPPtrToRefMap() const
Get the TrackingParticle to TP translation map.
Definition: InputData.h:62
double pT() const
Sum of fitted tracks transverse momentum [GeV].
Definition: Vertex.h:32
double z0() const
Vertex z0 position [cm].
Definition: Vertex.h:34
const float genPt() const
Definition: InputData.h:74
std::vector< Vertex > recoVertices_
Definition: InputData.h:82
const std::vector< Vertex > & getPileUpVertices() const
Get pile-up vertices information.
Definition: InputData.h:70
const Vertex & getPrimaryVertex() const
Get primary vertex information (vertex from tracking particles)
Definition: InputData.h:68