CMS 3D CMS Logo

InputData.h
Go to the documentation of this file.
1 #ifndef __L1Trigger_VertexFinder_InputData_h__
2 #define __L1Trigger_VertexFinder_InputData_h__
3 
18 
19 #include <vector>
20 
21 namespace l1tVertexFinder {
22 
24  typedef std::map<TrackingParticlePtr, edm::RefToBase<TrackingParticle>> TPPtrToRefMap;
25 
26  class AnalysisSettings;
27  class Stub;
28 
29  //=== Unpacks stub & tracking particle (truth) data into user-friendlier format in Stub & TP classes.
30  //=== Also makes B-field available to Settings class.
31 
32  class InputData {
33  public:
35  InputData();
37  const edm::EventSetup& iSetup,
38  const AnalysisSettings& settings,
39  const edm::EDGetTokenT<edm::HepMCProduct> hepMCToken,
40  const edm::EDGetTokenT<edm::View<reco::GenParticle>> genParticlesToken,
43  const edm::EDGetTokenT<DetSetVec> stubToken,
46  ~InputData();
47 
48  // Sort Tracking Particles by vertex z position
49  struct SortVertexByPt {
50  inline bool operator()(const Vertex vertex0, const Vertex vertex1) { return (vertex0.pT() > vertex1.pT()); }
51  };
52 
53  // Sort Tracking Particles by vertex z position
54  struct SortVertexByZ0 {
55  inline bool operator()(const Vertex vertex0, const Vertex vertex1) { return (vertex0.z0() < vertex1.z0()); }
56  };
57 
59  const TPPtrToRefMap& getTPPtrToRefMap() const { return tpPtrToRefMap_; }
61  const Vertex& getHepMCVertex() const { return hepMCVertex_; }
63  const Vertex& getGenVertex() const { return genVertex_; }
65  const Vertex& getPrimaryVertex() const { return vertex_; }
67  const std::vector<Vertex>& getPileUpVertices() const { return vertices_; }
69  const std::vector<Vertex>& getRecoPileUpVertices() const { return recoVertices_; }
70 
71  const float genPt() const { return genPt_; }
72  const float genPt_PU() const { return genPt_PU_; }
73 
74  private:
75  Vertex hepMCVertex_; // primary vertex from the edm::HepMCProduct
76  Vertex genVertex_; // primary vertex formed from the gen particles collection
77  Vertex vertex_; // primary vertex formed from the tracking particles
78  std::vector<Vertex> vertices_; // pile-up vertices
79  std::vector<Vertex> recoVertices_; // reconstructable pile-up vertices
80  std::vector<Stub>
81  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
82  // the efficiency of these cuts).
84  float genPt_;
85  float genPt_PU_;
86  };
87 
88 } // end namespace l1tVertexFinder
89 
90 #endif
std::vector< Vertex > vertices_
Definition: InputData.h:78
InputData()
Constructor and destructor.
Definition: InputData.cc:20
const std::vector< Vertex > & getPileUpVertices() const
Get pile-up vertices information.
Definition: InputData.h:67
bool operator()(const Vertex vertex0, const Vertex vertex1)
Definition: InputData.h:55
double pT() const
Sum of fitted tracks transverse momentum [GeV].
Definition: Vertex.h:32
std::vector< Stub > vAllStubs_
Definition: InputData.h:81
bool operator()(const Vertex vertex0, const Vertex vertex1)
Definition: InputData.h:50
const float genPt() const
Definition: InputData.h:71
const Vertex & getPrimaryVertex() const
Get primary vertex information (vertex from tracking particles)
Definition: InputData.h:65
edm::Ptr< TrackingParticle > TrackingParticlePtr
Definition: InputData.h:23
const float genPt_PU() const
Definition: InputData.h:72
int iEvent
Definition: GenABIO.cc:224
TPPtrToRefMap tpPtrToRefMap_
Definition: InputData.h:83
std::map< TrackingParticlePtr, edm::RefToBase< TrackingParticle > > TPPtrToRefMap
Definition: InputData.h:24
const Vertex & getGenVertex() const
Get primary vertex information (vertex from gen particles)
Definition: InputData.h:63
const Vertex & getHepMCVertex() const
Get primary vertex information (vertex from HepMCProduct)
Definition: InputData.h:61
double z0() const
Vertex z0 position [cm].
Definition: Vertex.h:34
std::vector< Vertex > recoVertices_
Definition: InputData.h:79
const TPPtrToRefMap & getTPPtrToRefMap() const
Get the TrackingParticle to TP translation map.
Definition: InputData.h:59
const std::vector< Vertex > & getRecoPileUpVertices() const
Get reconstructable pile-up vertices information.
Definition: InputData.h:69