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 
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
l1tVertexFinder
Definition: AlgoSettings.h:10
TP.h
l1tVertexFinder::InputData::getHepMCVertex
const Vertex & getHepMCVertex() const
Get primary vertex information (vertex from HepMCProduct)
Definition: InputData.h:64
MessageLogger.h
l1tVertexFinder::AnalysisSettings
Definition: AnalysisSettings.h:15
TrackerGeometry.h
EDProducer.h
Vertex.h
edm::EDGetTokenT< edm::HepMCProduct >
l1tVertexFinder::InputData::recoVertices_
std::vector< Vertex > recoVertices_
Definition: InputData.h:82
l1tVertexFinder::Vertex::pT
double pT() const
Sum of fitted tracks transverse momentum [GeV].
Definition: Vertex.h:32
l1tVertexFinder::InputData::SortVertexByZ0
Definition: InputData.h:57
l1tVertexFinder::InputData::getTPPtrToRefMap
const TPPtrToRefMap & getTPPtrToRefMap() const
Get the TrackingParticle to TP translation map.
Definition: InputData.h:62
EDAnalyzer.h
l1tVertexFinder::Vertex::z0
double z0() const
Vertex z0 position [cm].
Definition: Vertex.h:34
ESGetToken.h
l1tVertexFinder::InputData::genPt_
float genPt_
Definition: InputData.h:87
l1tVertexFinder::InputData::getRecoPileUpVertices
const std::vector< Vertex > & getRecoPileUpVertices() const
Get reconstructable pile-up vertices information.
Definition: InputData.h:72
MakerMacros.h
TrackerTopology.h
TrackerTopologyRcd.h
l1tVertexFinder::TrackingParticlePtr
edm::Ptr< TrackingParticle > TrackingParticlePtr
Definition: InputData.h:26
l1tVertexFinder::InputData::vertices_
std::vector< Vertex > vertices_
Definition: InputData.h:81
l1tVertexFinder::Stub
Definition: Stub.h:37
l1tVertexFinder::InputData
Definition: InputData.h:35
edm::View
Definition: CaloClusterFwd.h:14
TrackerDigiGeometryRecord.h
Event.h
l1tVertexFinder::InputData::genPt_PU_
float genPt_PU_
Definition: InputData.h:88
l1tVertexFinder::InputData::SortVertexByPt
Definition: InputData.h:52
l1tVertexFinder::InputData::InputData
InputData()
Constructor and destructor.
Definition: InputData.cc:21
iEvent
int iEvent
Definition: GenABIO.cc:224
l1tVertexFinder::InputData::SortVertexByZ0::operator()
bool operator()(const Vertex vertex0, const Vertex vertex1)
Definition: InputData.h:58
edm::EventSetup
Definition: EventSetup.h:58
l1tVertexFinder::TPPtrToRefMap
std::map< TrackingParticlePtr, edm::RefToBase< TrackingParticle > > TPPtrToRefMap
Definition: InputData.h:27
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd >
l1tVertexFinder::InputData::vAllStubs_
std::vector< Stub > vAllStubs_
Definition: InputData.h:84
InputTag.h
edm::Ptr< TrackingParticle >
l1tVertexFinder::InputData::getPileUpVertices
const std::vector< Vertex > & getPileUpVertices() const
Get pile-up vertices information.
Definition: InputData.h:70
l1tVertexFinder::InputData::vertex_
Vertex vertex_
Definition: InputData.h:80
Frameworkfwd.h
l1tVertexFinder::InputData::hepMCVertex_
Vertex hepMCVertex_
Definition: InputData.h:78
l1tVertexFinder::InputData::tpPtrToRefMap_
TPPtrToRefMap tpPtrToRefMap_
Definition: InputData.h:86
edm::ValueMap
Definition: ValueMap.h:107
EventSetup.h
l1tVertexFinder::Vertex
Definition: Vertex.h:10
l1tVertexFinder::InputData::genVertex_
Vertex genVertex_
Definition: InputData.h:79
l1tVertexFinder::InputData::genPt_PU
const float genPt_PU() const
Definition: InputData.h:75
l1tVertexFinder::InputData::genPt
const float genPt() const
Definition: InputData.h:74
l1tVertexFinder::InputData::getPrimaryVertex
const Vertex & getPrimaryVertex() const
Get primary vertex information (vertex from tracking particles)
Definition: InputData.h:68
edm::Event
Definition: Event.h:73
l1tVertexFinder::InputData::getGenVertex
const Vertex & getGenVertex() const
Get primary vertex information (vertex from gen particles)
Definition: InputData.h:66
l1tVertexFinder::InputData::~InputData
~InputData()
Definition: InputData.cc:185
l1tVertexFinder::InputData::SortVertexByPt::operator()
bool operator()(const Vertex vertex0, const Vertex vertex1)
Definition: InputData.h:53
Stub.h