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 
37 
39 
50 
55 
58 
65 
68 
71 
72 #include "HepMC/GenVertex.h"
73 #include "HepMC/GenParticle.h"
74 
75 #include "TROOT.h"
76 #include "TMath.h"
77 #include "TH1F.h"
78 #include "TH1I.h"
79 #include "TH2F.h"
80 
81 class V0Validator : public DQMEDAnalyzer {
82  public:
83  explicit V0Validator(const edm::ParameterSet &);
84  ~V0Validator();
85  enum V0Type { KSHORT, LAMBDA };
86  struct V0Couple {
89  explicit V0Couple(reco::TrackRef first_daughter,
90  reco::TrackRef second_daughter) {
91  one = first_daughter.key() < second_daughter.key() ? first_daughter
92  : second_daughter;
93  two = first_daughter.key() > second_daughter.key() ? first_daughter
94  : second_daughter;
95  assert(one != two);
96  }
97  bool operator<(const V0Couple &rh) const {
98  return one.key() < rh.one.key();
99  }
100  bool operator==(const V0Couple &rh) const {
101  return ((one.key() == rh.one.key()) && (two.key() == rh.two.key()));
102  }
103  };
104 
105  private:
106  virtual void analyze(const edm::Event &, const edm::EventSetup &) override;
107  void bookHistograms(DQMStore::IBooker &, edm::Run const &,
108  edm::EventSetup const &) override;
110  const reco::RecoToSimCollection &recotosimCollection,
111  V0Type t, int particle_pdgid,
112  int misreconstructed_particle_pdgid);
113 
114  void doEfficiencies(
115  const TrackingVertexCollection &gen_vertices, V0Type t,
116  int parent_particle_id,
117  int first_daughter_id, /* give only positive charge */
118  int second_daughter_id, /* give only positive charge */
120  const reco::SimToRecoCollection &simtorecoCollection);
121 
122  // MonitorElements for final histograms
123 
124  std::array<MonitorElement *, 2> candidateEffVsR_num_;
125  std::array<MonitorElement *, 2> candidateEffVsEta_num_;
126  std::array<MonitorElement *, 2> candidateEffVsPt_num_;
127  std::array<MonitorElement *, 2> candidateTkEffVsR_num_;
128  std::array<MonitorElement *, 2> candidateTkEffVsEta_num_;
129  std::array<MonitorElement *, 2> candidateTkEffVsPt_num_;
130  std::array<MonitorElement *, 2> candidateFakeVsR_num_;
131  std::array<MonitorElement *, 2> candidateFakeVsEta_num_;
132  std::array<MonitorElement *, 2> candidateFakeVsPt_num_;
133  std::array<MonitorElement *, 2> candidateTkFakeVsR_num_;
134  std::array<MonitorElement *, 2> candidateTkFakeVsEta_num_;
135  std::array<MonitorElement *, 2> candidateTkFakeVsPt_num_;
136 
137  std::array<MonitorElement *, 2> candidateFakeVsR_denom_;
138  std::array<MonitorElement *, 2> candidateFakeVsEta_denom_;
139  std::array<MonitorElement *, 2> candidateFakeVsPt_denom_;
140  std::array<MonitorElement *, 2> candidateEffVsR_denom_;
141  std::array<MonitorElement *, 2> candidateEffVsEta_denom_;
142  std::array<MonitorElement *, 2> candidateEffVsPt_denom_;
143 
144  std::array<MonitorElement *, 2> nCandidates_;
145  std::array<MonitorElement *, 2> candidateStatus_;
146  std::array<MonitorElement *, 2> fakeCandidateMass_;
147  std::array<MonitorElement *, 2> candidateFakeDauRadDist_;
148  std::array<MonitorElement *, 2> candidateMassAll;
149  std::array<MonitorElement *, 2> goodCandidateMass;
150 
160 };
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: V0Validator.cc:52
std::vector< VertexCompositeCandidate > VertexCompositeCandidateCollection
collection of Candidate objects
edm::EDGetTokenT< reco::SimToRecoCollection > recoSimToRecoCollectionToken_
Definition: V0Validator.h:154
V0Validator(const edm::ParameterSet &)
Definition: V0Validator.cc:28
edm::EDGetTokenT< reco::VertexCompositeCandidateCollection > recoVertexCompositeCandidateCollection_k0s_Token_
Definition: V0Validator.h:158
std::array< MonitorElement *, 2 > candidateStatus_
Definition: V0Validator.h:145
std::array< MonitorElement *, 2 > candidateEffVsEta_num_
Definition: V0Validator.h:125
std::array< MonitorElement *, 2 > candidateFakeVsEta_num_
Definition: V0Validator.h:131
bool operator==(const V0Couple &rh) const
Definition: V0Validator.h:100
std::array< MonitorElement *, 2 > candidateFakeVsR_denom_
Definition: V0Validator.h:137
std::array< MonitorElement *, 2 > goodCandidateMass
Definition: V0Validator.h:149
std::array< MonitorElement *, 2 > candidateTkEffVsPt_num_
Definition: V0Validator.h:129
std::array< MonitorElement *, 2 > fakeCandidateMass_
Definition: V0Validator.h:146
std::array< MonitorElement *, 2 > candidateEffVsPt_num_
Definition: V0Validator.h:126
std::array< MonitorElement *, 2 > candidateEffVsR_denom_
Definition: V0Validator.h:140
std::array< MonitorElement *, 2 > candidateFakeVsR_num_
Definition: V0Validator.h:130
key_type key() const
Accessor for product key.
Definition: Ref.h:264
reco::TrackRef two
Definition: V0Validator.h:88
std::array< MonitorElement *, 2 > candidateFakeDauRadDist_
Definition: V0Validator.h:147
std::array< MonitorElement *, 2 > candidateTkFakeVsEta_num_
Definition: V0Validator.h:134
std::array< MonitorElement *, 2 > candidateTkEffVsEta_num_
Definition: V0Validator.h:128
reco::TrackRef one
Definition: V0Validator.h:87
std::array< MonitorElement *, 2 > candidateTkEffVsR_num_
Definition: V0Validator.h:127
std::array< MonitorElement *, 2 > candidateFakeVsPt_num_
Definition: V0Validator.h:132
V0Couple(reco::TrackRef first_daughter, reco::TrackRef second_daughter)
Definition: V0Validator.h:89
std::array< MonitorElement *, 2 > candidateTkFakeVsR_num_
Definition: V0Validator.h:133
edm::EDGetTokenT< TrackingVertexCollection > trackingVertexCollection_Token_
Definition: V0Validator.h:155
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: V0Validator.cc:426
std::array< MonitorElement *, 2 > candidateTkFakeVsPt_num_
Definition: V0Validator.h:135
edm::EDGetTokenT< std::vector< reco::Vertex > > vec_recoVertex_Token_
Definition: V0Validator.h:156
std::array< MonitorElement *, 2 > nCandidates_
Definition: V0Validator.h:144
void doFakeRates(const reco::VertexCompositeCandidateCollection &collection, const reco::RecoToSimCollection &recotosimCollection, V0Type t, int particle_pdgid, int misreconstructed_particle_pdgid)
Definition: V0Validator.cc:199
std::array< MonitorElement *, 2 > candidateFakeVsPt_denom_
Definition: V0Validator.h:139
std::vector< TrackingVertex > TrackingVertexCollection
std::array< MonitorElement *, 2 > candidateFakeVsEta_denom_
Definition: V0Validator.h:138
std::string theDQMRootFileName
Definition: V0Validator.h:151
std::array< MonitorElement *, 2 > candidateEffVsPt_denom_
Definition: V0Validator.h:142
std::array< MonitorElement *, 2 > candidateMassAll
Definition: V0Validator.h:148
edm::EDGetTokenT< reco::RecoToSimCollection > recoRecoToSimCollectionToken_
Definition: V0Validator.h:153
edm::EDGetTokenT< reco::VertexCompositeCandidateCollection > recoVertexCompositeCandidateCollection_lambda_Token_
Definition: V0Validator.h:158
std::array< MonitorElement *, 2 > candidateEffVsR_num_
Definition: V0Validator.h:124
std::array< MonitorElement *, 2 > candidateEffVsEta_denom_
Definition: V0Validator.h:141
std::string dirName
Definition: V0Validator.h:152
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:326
bool operator<(const V0Couple &rh) const
Definition: V0Validator.h:97
Definition: Run.h:42