CMS 3D CMS Logo

V0Validator.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: V0Validator
4 // Class: V0Validator
5 //
14 //
15 // Original Author: Brian Drell
16 // Created: Wed Feb 18 17:21:04 MST 2009
17 //
18 //
19 
20 // system include files
21 #include <memory>
22 #include <array>
23 
24 // user include files
26 
29 
33 
36 
38 
49 
54 
57 
63 
66 
69 
70 #include "HepMC/GenVertex.h"
71 #include "HepMC/GenParticle.h"
72 
73 #include "TROOT.h"
74 #include "TMath.h"
75 #include "TH1F.h"
76 #include "TH1I.h"
77 #include "TH2F.h"
78 
79 class V0Validator : public DQMEDAnalyzer {
80 public:
81  explicit V0Validator(const edm::ParameterSet &);
82  ~V0Validator() override;
83  enum V0Type { KSHORT, LAMBDA };
84  struct V0Couple {
87  explicit V0Couple(reco::TrackRef first_daughter, reco::TrackRef second_daughter) {
88  one = first_daughter.key() < second_daughter.key() ? first_daughter : second_daughter;
89  two = first_daughter.key() > second_daughter.key() ? first_daughter : second_daughter;
90  assert(one != two);
91  }
92  bool operator<(const V0Couple &rh) const { return one.key() < rh.one.key(); }
93  bool operator==(const V0Couple &rh) const { return ((one.key() == rh.one.key()) && (two.key() == rh.two.key())); }
94  };
95 
96 private:
97  void analyze(const edm::Event &, const edm::EventSetup &) override;
98  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
100  const reco::RecoToSimCollection &recotosimCollection,
101  V0Type t,
102  int particle_pdgid,
103  int misreconstructed_particle_pdgid);
104 
105  void doEfficiencies(const TrackingVertexCollection &gen_vertices,
106  V0Type t,
107  int parent_particle_id,
108  int first_daughter_id, /* give only positive charge */
109  int second_daughter_id, /* give only positive charge */
111  const reco::SimToRecoCollection &simtorecoCollection);
112 
113  // MonitorElements for final histograms
114 
115  std::array<MonitorElement *, 2> candidateEffVsR_num_;
116  std::array<MonitorElement *, 2> candidateEffVsEta_num_;
117  std::array<MonitorElement *, 2> candidateEffVsPt_num_;
118  std::array<MonitorElement *, 2> candidateTkEffVsR_num_;
119  std::array<MonitorElement *, 2> candidateTkEffVsEta_num_;
120  std::array<MonitorElement *, 2> candidateTkEffVsPt_num_;
121  std::array<MonitorElement *, 2> candidateFakeVsR_num_;
122  std::array<MonitorElement *, 2> candidateFakeVsEta_num_;
123  std::array<MonitorElement *, 2> candidateFakeVsPt_num_;
124  std::array<MonitorElement *, 2> candidateTkFakeVsR_num_;
125  std::array<MonitorElement *, 2> candidateTkFakeVsEta_num_;
126  std::array<MonitorElement *, 2> candidateTkFakeVsPt_num_;
127 
128  std::array<MonitorElement *, 2> candidateFakeVsR_denom_;
129  std::array<MonitorElement *, 2> candidateFakeVsEta_denom_;
130  std::array<MonitorElement *, 2> candidateFakeVsPt_denom_;
131  std::array<MonitorElement *, 2> candidateEffVsR_denom_;
132  std::array<MonitorElement *, 2> candidateEffVsEta_denom_;
133  std::array<MonitorElement *, 2> candidateEffVsPt_denom_;
134 
135  std::array<MonitorElement *, 2> nCandidates_;
136  std::array<MonitorElement *, 2> candidateStatus_;
137  std::array<MonitorElement *, 2> fakeCandidateMass_;
138  std::array<MonitorElement *, 2> candidateFakeDauRadDist_;
139  std::array<MonitorElement *, 2> candidateMassAll;
140  std::array<MonitorElement *, 2> goodCandidateMass;
141 
150 };
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: V0Validator.cc:45
std::vector< VertexCompositeCandidate > VertexCompositeCandidateCollection
collection of Candidate objects
edm::EDGetTokenT< reco::SimToRecoCollection > recoSimToRecoCollectionToken_
Definition: V0Validator.h:145
V0Validator(const edm::ParameterSet &)
Definition: V0Validator.cc:27
edm::EDGetTokenT< reco::VertexCompositeCandidateCollection > recoVertexCompositeCandidateCollection_k0s_Token_
Definition: V0Validator.h:148
std::array< MonitorElement *, 2 > candidateStatus_
Definition: V0Validator.h:136
std::array< MonitorElement *, 2 > candidateEffVsEta_num_
Definition: V0Validator.h:116
std::array< MonitorElement *, 2 > candidateFakeVsEta_num_
Definition: V0Validator.h:122
std::array< MonitorElement *, 2 > candidateFakeVsR_denom_
Definition: V0Validator.h:128
std::array< MonitorElement *, 2 > goodCandidateMass
Definition: V0Validator.h:140
std::array< MonitorElement *, 2 > candidateTkEffVsPt_num_
Definition: V0Validator.h:120
std::array< MonitorElement *, 2 > fakeCandidateMass_
Definition: V0Validator.h:137
std::array< MonitorElement *, 2 > candidateEffVsPt_num_
Definition: V0Validator.h:117
std::array< MonitorElement *, 2 > candidateEffVsR_denom_
Definition: V0Validator.h:131
std::array< MonitorElement *, 2 > candidateFakeVsR_num_
Definition: V0Validator.h:121
reco::TrackRef two
Definition: V0Validator.h:86
assert(be >=bs)
key_type key() const
Accessor for product key.
Definition: Ref.h:250
std::array< MonitorElement *, 2 > candidateFakeDauRadDist_
Definition: V0Validator.h:138
std::array< MonitorElement *, 2 > candidateTkFakeVsEta_num_
Definition: V0Validator.h:125
std::array< MonitorElement *, 2 > candidateTkEffVsEta_num_
Definition: V0Validator.h:119
reco::TrackRef one
Definition: V0Validator.h:85
bool operator==(const V0Couple &rh) const
Definition: V0Validator.h:93
std::array< MonitorElement *, 2 > candidateTkEffVsR_num_
Definition: V0Validator.h:118
~V0Validator() override
Definition: V0Validator.cc:43
std::array< MonitorElement *, 2 > candidateFakeVsPt_num_
Definition: V0Validator.h:123
V0Couple(reco::TrackRef first_daughter, reco::TrackRef second_daughter)
Definition: V0Validator.h:87
std::array< MonitorElement *, 2 > candidateTkFakeVsR_num_
Definition: V0Validator.h:124
edm::EDGetTokenT< TrackingVertexCollection > trackingVertexCollection_Token_
Definition: V0Validator.h:146
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: V0Validator.cc:380
std::array< MonitorElement *, 2 > candidateTkFakeVsPt_num_
Definition: V0Validator.h:126
edm::EDGetTokenT< std::vector< reco::Vertex > > vec_recoVertex_Token_
Definition: V0Validator.h:147
std::array< MonitorElement *, 2 > nCandidates_
Definition: V0Validator.h:135
void doFakeRates(const reco::VertexCompositeCandidateCollection &collection, const reco::RecoToSimCollection &recotosimCollection, V0Type t, int particle_pdgid, int misreconstructed_particle_pdgid)
Definition: V0Validator.cc:172
std::array< MonitorElement *, 2 > candidateFakeVsPt_denom_
Definition: V0Validator.h:130
std::vector< TrackingVertex > TrackingVertexCollection
std::array< MonitorElement *, 2 > candidateFakeVsEta_denom_
Definition: V0Validator.h:129
std::string theDQMRootFileName
Definition: V0Validator.h:142
std::array< MonitorElement *, 2 > candidateEffVsPt_denom_
Definition: V0Validator.h:133
std::array< MonitorElement *, 2 > candidateMassAll
Definition: V0Validator.h:139
bool operator<(const V0Couple &rh) const
Definition: V0Validator.h:92
edm::EDGetTokenT< reco::RecoToSimCollection > recoRecoToSimCollectionToken_
Definition: V0Validator.h:144
edm::EDGetTokenT< reco::VertexCompositeCandidateCollection > recoVertexCompositeCandidateCollection_lambda_Token_
Definition: V0Validator.h:148
std::array< MonitorElement *, 2 > candidateEffVsR_num_
Definition: V0Validator.h:115
std::array< MonitorElement *, 2 > candidateEffVsEta_denom_
Definition: V0Validator.h:132
std::string dirName
Definition: V0Validator.h:143
void doEfficiencies(const TrackingVertexCollection &gen_vertices, V0Type t, int parent_particle_id, int first_daughter_id, int second_daughter_id, const reco::VertexCompositeCandidateCollection &collection, const reco::SimToRecoCollection &simtorecoCollection)
Definition: V0Validator.cc:294
Definition: Run.h:45