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 };
V0Validator::V0Couple::V0Couple
V0Couple(reco::TrackRef first_daughter, reco::TrackRef second_daughter)
Definition: V0Validator.h:87
V0Validator::recoSimToRecoCollectionToken_
edm::EDGetTokenT< reco::SimToRecoCollection > recoSimToRecoCollectionToken_
Definition: V0Validator.h:145
V0Validator::V0Validator
V0Validator(const edm::ParameterSet &)
Definition: V0Validator.cc:27
V0Validator::LAMBDA
Definition: V0Validator.h:83
FreeTrajectoryState.h
V0Validator::candidateTkEffVsPt_num_
std::array< MonitorElement *, 2 > candidateTkEffVsPt_num_
Definition: V0Validator.h:120
TrackerGeometry.h
V0Validator::dirName
std::string dirName
Definition: V0Validator.h:143
V0Validator::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: V0Validator.cc:45
V0Validator::candidateEffVsPt_num_
std::array< MonitorElement *, 2 > candidateEffVsPt_num_
Definition: V0Validator.h:117
V0Validator::candidateFakeVsR_num_
std::array< MonitorElement *, 2 > candidateFakeVsR_num_
Definition: V0Validator.h:121
edm::Run
Definition: Run.h:45
edm::EDGetTokenT
Definition: EDGetToken.h:33
V0Candidate.h
V0Validator::candidateTkEffVsEta_num_
std::array< MonitorElement *, 2 > candidateTkEffVsEta_num_
Definition: V0Validator.h:119
V0Validator::V0Couple::two
reco::TrackRef two
Definition: V0Validator.h:86
cms::cuda::assert
assert(be >=bs)
TrackingVertexCollection
std::vector< TrackingVertex > TrackingVertexCollection
Definition: TrackingVertexContainer.h:8
GluedGeomDet.h
TrackingGeometry.h
V0Validator::candidateEffVsR_denom_
std::array< MonitorElement *, 2 > candidateEffVsR_denom_
Definition: V0Validator.h:131
DQMStore.h
TrackingVertex.h
TrackerHitAssociator.h
VertexDistance3D.h
V0Validator::recoVertexCompositeCandidateCollection_k0s_Token_
edm::EDGetTokenT< reco::VertexCompositeCandidateCollection > recoVertexCompositeCandidateCollection_k0s_Token_
Definition: V0Validator.h:148
V0Validator::candidateFakeDauRadDist_
std::array< MonitorElement *, 2 > candidateFakeDauRadDist_
Definition: V0Validator.h:138
V0Validator::goodCandidateMass
std::array< MonitorElement *, 2 > goodCandidateMass
Definition: V0Validator.h:140
edm::Ref< TrackCollection >
V0Validator::candidateTkEffVsR_num_
std::array< MonitorElement *, 2 > candidateTkEffVsR_num_
Definition: V0Validator.h:118
V0Validator::candidateEffVsEta_num_
std::array< MonitorElement *, 2 > candidateEffVsEta_num_
Definition: V0Validator.h:116
V0Validator::candidateFakeVsEta_num_
std::array< MonitorElement *, 2 > candidateFakeVsEta_num_
Definition: V0Validator.h:122
V0Validator::KSHORT
Definition: V0Validator.h:83
dqm::legacy::DQMStore::IBooker
dqm::implementation::IBooker IBooker
Definition: DQMStore.h:729
MakerMacros.h
Track.h
V0Validator::candidateFakeVsR_denom_
std::array< MonitorElement *, 2 > candidateFakeVsR_denom_
Definition: V0Validator.h:128
ClosestApproachInRPhi.h
TrackFwd.h
TrajectoryStateClosestToBeamLineBuilder.h
VertexCompositeCandidate.h
V0Validator::candidateTkFakeVsEta_num_
std::array< MonitorElement *, 2 > candidateTkFakeVsEta_num_
Definition: V0Validator.h:125
V0Validator::fakeCandidateMass_
std::array< MonitorElement *, 2 > fakeCandidateMass_
Definition: V0Validator.h:137
V0Validator::vec_recoVertex_Token_
edm::EDGetTokenT< std::vector< reco::Vertex > > vec_recoVertex_Token_
Definition: V0Validator.h:147
Service.h
V0Validator::V0Couple::one
reco::TrackRef one
Definition: V0Validator.h:85
VolumeBasedMagneticField.h
IdealMagneticFieldRecord.h
V0Validator::doFakeRates
void doFakeRates(const reco::VertexCompositeCandidateCollection &collection, const reco::RecoToSimCollection &recotosimCollection, V0Type t, int particle_pdgid, int misreconstructed_particle_pdgid)
Definition: V0Validator.cc:172
V0Validator::candidateTkFakeVsR_num_
std::array< MonitorElement *, 2 > candidateTkFakeVsR_num_
Definition: V0Validator.h:124
V0Validator::candidateFakeVsPt_denom_
std::array< MonitorElement *, 2 > candidateFakeVsPt_denom_
Definition: V0Validator.h:130
OrderedSet.t
t
Definition: OrderedSet.py:90
DQMEDAnalyzer.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Vertex.h
V0Validator::nCandidates_
std::array< MonitorElement *, 2 > nCandidates_
Definition: V0Validator.h:135
TFileService.h
DQMEDAnalyzer
Definition: DQMEDAnalyzer.py:1
V0Validator::~V0Validator
~V0Validator() override
Definition: V0Validator.cc:43
TrackClassifier.h
TrackerDigiGeometryRecord.h
V0Validator::trackingVertexCollection_Token_
edm::EDGetTokenT< TrackingVertexCollection > trackingVertexCollection_Token_
Definition: V0Validator.h:146
edm::ParameterSet
Definition: ParameterSet.h:36
V0Validator::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: V0Validator.cc:382
Event.h
edm::AssociationMap< edm::OneToManyWithQualityGeneric< edm::View< reco::Track >, TrackingParticleCollection, double > >
universalConfigTemplate.collection
collection
Definition: universalConfigTemplate.py:81
V0Validator::candidateFakeVsPt_num_
std::array< MonitorElement *, 2 > candidateFakeVsPt_num_
Definition: V0Validator.h:123
V0Validator::candidateTkFakeVsPt_num_
std::array< MonitorElement *, 2 > candidateTkFakeVsPt_num_
Definition: V0Validator.h:126
V0Validator::V0Couple::operator<
bool operator<(const V0Couple &rh) const
Definition: V0Validator.h:92
edm::EventSetup
Definition: EventSetup.h:57
V0Validator::V0Couple
Definition: V0Validator.h:84
reco::VertexCompositeCandidateCollection
std::vector< VertexCompositeCandidate > VertexCompositeCandidateCollection
collection of Candidate objects
Definition: VertexCompositeCandidateFwd.h:19
TrackingParticle.h
GeomDet.h
V0Validator::candidateEffVsEta_denom_
std::array< MonitorElement *, 2 > candidateEffVsEta_denom_
Definition: V0Validator.h:132
RecoChargedCandidate.h
TrackingParticleFwd.h
Frameworkfwd.h
V0Validator::candidateEffVsR_num_
std::array< MonitorElement *, 2 > candidateEffVsR_num_
Definition: V0Validator.h:115
V0Validator::candidateFakeVsEta_denom_
std::array< MonitorElement *, 2 > candidateFakeVsEta_denom_
Definition: V0Validator.h:129
edm::Ref::key
key_type key() const
Accessor for product key.
Definition: Ref.h:250
V0Validator::recoRecoToSimCollectionToken_
edm::EDGetTokenT< reco::RecoToSimCollection > recoRecoToSimCollectionToken_
Definition: V0Validator.h:144
Candidate.h
ParameterSet.h
V0Validator
Definition: V0Validator.h:79
V0Validator::theDQMRootFileName
std::string theDQMRootFileName
Definition: V0Validator.h:142
edm::Event
Definition: Event.h:73
V0Validator::candidateStatus_
std::array< MonitorElement *, 2 > candidateStatus_
Definition: V0Validator.h:136
V0Validator::V0Couple::operator==
bool operator==(const V0Couple &rh) const
Definition: V0Validator.h:93
SimTrackContainer.h
V0Validator::candidateEffVsPt_denom_
std::array< MonitorElement *, 2 > candidateEffVsPt_denom_
Definition: V0Validator.h:133
SimVertexContainer.h
V0Validator::candidateMassAll
std::array< MonitorElement *, 2 > candidateMassAll
Definition: V0Validator.h:139
V0Validator::recoVertexCompositeCandidateCollection_lambda_Token_
edm::EDGetTokenT< reco::VertexCompositeCandidateCollection > recoVertexCompositeCandidateCollection_lambda_Token_
Definition: V0Validator.h:148
V0Validator::doEfficiencies
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:296
V0Validator::V0Type
V0Type
Definition: V0Validator.h:83