CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PrimaryVertexAnalyzer4PUSlimmed.h
Go to the documentation of this file.
1 #ifndef VALIDATION_RECOVERTEX_INTERFACE_PRIMARYVERTEXANALYZER4PUSLIMMED_H_
2 #define VALIDATION_RECOVERTEX_INTERFACE_PRIMARYVERTEXANALYZER4PUSLIMMED_H_
3 
4 // -*- C++ -*-
5 //
6 // Package: PrimaryVertexAnalyzer4PUSlimmed
7 // Class: PrimaryVertexAnalyzer4PUSlimmed
8 //
16 //
17 // Original Author: Marco Rovere (code adapted from old code by
18 // Wolfram Erdmann)
19 
20 
21 // system include files
22 #include <memory>
23 #include <string>
24 #include <vector>
25 #include <map>
26 #include <algorithm>
27 
28 // user include files
32 
33 // math
36 
37 // reco track
40 
41 // reco vertex
43 
44 // simulated track
47 
48 // pile-up
50 
51 // vertexing
53 
54 // DQM
56 
57 class MonitorElement;
58 
59 // class declaration
62 
67  };
68 
69  // auxiliary class holding simulated vertices
71  simPrimaryVertex(double x1, double y1, double z1)
72  :x(x1), y(y1), z(z1),
74  nGenTrk(0),
78  ptot.setPx(0);
79  ptot.setPy(0);
80  ptot.setPz(0);
81  ptot.setE(0);
82  p4 = LorentzVector(0, 0, 0, 0);
83  r = sqrt(x*x + y*y);
84  };
85  double x, y, z, r;
86  HepMC::FourVector ptot;
88  double ptsq;
90  int nGenTrk;
95  std::vector<const reco::Vertex *> rec_vertices;
96  };
97 
98  // auxiliary class holding reconstructed vertices
101  NONE = 0,
102  MATCHED = 1,
104  MERGED = 4
105  };
106  recoPrimaryVertex(double x1, double y1, double z1)
107  :x(x1), y(y1), z(z1),
109  nRecoTrk(0),
110  kind_of_vertex(0),
111  recVtx(nullptr) {
112  r = sqrt(x*x + y*y);
113  };
114  double x, y, z, r;
115  double ptsq;
117  int nRecoTrk;
119  std::vector<const TrackingVertex *> sim_vertices;
120  std::vector<const simPrimaryVertex *> sim_vertices_internal;
122  };
123 
124  public:
127 
128  virtual void analyze(const edm::Event&, const edm::EventSetup&);
129  virtual void bookHistograms(DQMStore::IBooker &i,
130  edm::Run const&,
131  edm::EventSetup const&) override;
132 
133  private:
134  void resetSimPVAssociation(std::vector<simPrimaryVertex>&);
135  void matchSim2RecoVertices(std::vector<simPrimaryVertex>&,
136  const reco::VertexCollection &);
137  void matchReco2SimVertices(std::vector<recoPrimaryVertex>&,
138  const TrackingVertexCollection &,
139  const std::vector<simPrimaryVertex>&);
141  // void fillGenericRecoVertexHistograms(const std::string &,
142  // const simPrimaryVertex &v);
144  const simPrimaryVertex &v);
146  int,
148 
149  std::vector<PrimaryVertexAnalyzer4PUSlimmed::simPrimaryVertex> getSimPVs(
151 
152  std::vector<PrimaryVertexAnalyzer4PUSlimmed::recoPrimaryVertex> getRecoPVs(
154 
155  template<class T>
157 
158  // ----------member data ---------------------------
159  bool verbose_;
163  double abs_z_match_;
165 
166  std::map<std::string, std::map<std::string, MonitorElement*> > mes_;
169 
170  // TODO(rovere) possibly reuse an object from the event and do not
171  // re-run the associator(s)
173 
175  std::vector<edm::EDGetTokenT<reco::VertexCollection> > reco_vertex_collection_tokens_;
176  std::vector<edm::InputTag > reco_vertex_collections_;
182 };
183 
184 #endif // VALIDATION_RECOVERTEX_INTERFACE_PRIMARYVERTEXANALYZER4PUSLIMMED_H_
void matchSim2RecoVertices(std::vector< simPrimaryVertex > &, const reco::VertexCollection &)
void fillGenAssociatedRecoVertexHistograms(const std::string &, int, recoPrimaryVertex &v)
int i
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< edm::View< reco::Track > > edmView_recoTrack_Token_
void resetSimPVAssociation(std::vector< simPrimaryVertex > &)
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > vecPileupSummaryInfoToken_
void computePairDistance(const T &collection, MonitorElement *me)
const reco::TrackToTrackingParticleAssociator * associatorByHits_
virtual void bookHistograms(DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
PrimaryVertexAnalyzer4PUSlimmed(const edm::ParameterSet &)
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::EDGetTokenT< reco::TrackCollection > recoTrackCollectionToken_
edm::EDGetTokenT< TrackingVertexCollection > trackingVertexCollectionToken_
#define nullptr
std::vector< PrimaryVertexAnalyzer4PUSlimmed::simPrimaryVertex > getSimPVs(const edm::Handle< TrackingVertexCollection >)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
std::vector< PrimaryVertexAnalyzer4PUSlimmed::recoPrimaryVertex > getRecoPVs(const edm::Handle< reco::VertexCollection >)
std::vector< edm::EDGetTokenT< reco::VertexCollection > > reco_vertex_collection_tokens_
T sqrt(T t)
Definition: SSEVec.h:48
void fillGenericGenVertexHistograms(const simPrimaryVertex &v)
void matchReco2SimVertices(std::vector< recoPrimaryVertex > &, const TrackingVertexCollection &, const std::vector< simPrimaryVertex > &)
std::vector< TrackingVertex > TrackingVertexCollection
void fillRecoAssociatedGenVertexHistograms(const std::string &, const simPrimaryVertex &v)
std::vector< edm::InputTag > reco_vertex_collections_
edm::EDGetTokenT< reco::TrackToTrackingParticleAssociator > recoTrackToTrackingParticleAssociatorToken_
std::map< std::string, std::map< std::string, MonitorElement * > > mes_
long double T
Definition: Run.h:41
virtual void analyze(const edm::Event &, const edm::EventSetup &)
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleCollectionToken_