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