29 : theDQMRootFileName(iConfig.getUntrackedParameter<std::
string>(
"DQMRootFileName"))
30 ,
dirName(iConfig.getUntrackedParameter<std::
string>(
"dirName"))
34 , vec_recoVertex_Token_( consumes< std::vector<
reco::Vertex> >( iConfig.getUntrackedParameter<edm::
InputTag>(
"vertexCollection") ) )
53 "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
55 "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
57 "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
60 "K^{0}_{S} Tracking Efficiency vs #rho", 40, 0., 40.);
62 "K^{0}_{S} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
64 "K^{0}_{S} Tracking Efficiency vs p_{T}", 70, 0., 20.);
67 "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
69 "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
71 "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
74 "K^{0}_{S} Tracking Efficiency vs #rho", 40, 0., 40.);
76 "K^{0}_{S} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
78 "K^{0}_{S} Tracking Efficiency vs p_{T}", 70, 0., 20.);;
81 "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
83 "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
85 "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
88 "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
90 "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
92 "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
95 "#Lambda^{0} TrackingEfficiency vs #rho", 40, 0., 40.);
97 "#Lambda^{0} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
99 "#Lambda^{0} Tracking Efficiency vs p_{T}", 70, 0., 20.);
102 "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
104 "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
106 "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
109 "#Lambda^{0} TrackingEfficiency vs #rho", 40, 0., 40.);
111 "#Lambda^{0} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
113 "#Lambda^{0} Tracking Efficiency vs p_{T}", 70, 0., 20.);
116 "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
118 "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
120 "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
123 "K^{0}_{S} Fake Rate vs #rho", 40, 0., 40.);
125 "K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
127 "K^{0}_{S} Fake Rate vs p_{T}", 70, 0., 20.);
129 "K^{0}_{S} Tracking Fake Rate vs #rho", 40, 0., 40.);
131 "K^{0}_{S} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
133 "K^{0}_{S} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
136 "K^{0}_{S} Fake Rate vs #rho", 40, 0., 40.);
138 "K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
140 "K^{0}_{S} Fake Rate vs p_{T}", 70, 0., 20.);
142 "K^{0}_{S} Tracking Fake Rate vs #rho", 40, 0., 40.);
144 "K^{0}_{S} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
146 "K^{0}_{S} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
149 "K^{0}_{S} Fake Rate vs #rho", 40, 0., 40.);
151 "K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
153 "K^{0}_{S} Fake Rate vs p_{T}", 70, 0., 20.);
156 "#Lambda^{0} Fake Rate vs #rho", 40, 0., 40.);
158 "#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
160 "#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
162 "#Lambda^{0} Tracking Fake Rate vs #rho", 40, 0., 40.);
164 "#Lambda^{0} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
166 "#Lambda^{0} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
169 "#Lambda^{0} Fake Rate vs #rho", 40, 0., 40.);
171 "#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
173 "#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
175 "#Lambda^{0} Tracking Fake Rate vs #rho", 40, 0., 40.);
177 "#Lambda^{0} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
179 "#Lambda^{0} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
182 "#Lambda^{0} Fake Rate vs #rho", 40, 0., 40.);
184 "#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
186 "#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
189 subDirName =
dirName +
"/Other";
193 "Number of K^{0}_{S} found per event", 60, 0., 60.);
195 "Number of #Lambda^{0} found per event", 60, 0., 60.);
198 "Resolution of V0 decay vertex X coordinate", 50, 0., 50.);
200 "Resolution of V0 decay vertex Y coordinate", 50, 0., 50.);
202 "Resolution of V0 decay vertex Z coordinate", 50, 0., 50.);
204 "Resolution of V0 decay vertex X coordinate", 50, 0., 50.);
206 "Resolution of V0 decay vertex Y coordinate", 50, 0., 50.);
208 "Resolution of V0 decay vertex Z coordinate", 50, 0., 50.);
210 "Resolution of absolute distance from primary vertex to V0 vertex",
213 "Resolution of absolute distance from primary vertex to V0 vertex",
217 "Fake type by cand status",
220 "Fake type by cand status",
223 double minKsMass = 0.49767 - 0.07;
224 double maxKsMass = 0.49767 + 0.07;
225 double minLamMass = 1.1156 - 0.05;
226 double maxLamMass = 1.1156 + 0.05;
227 int ksMassNbins = 100;
228 double ksMassXmin = minKsMass;
229 double ksMassXmax = maxKsMass;
230 int lamMassNbins = 100;
231 double lamMassXmin = minLamMass;
232 double lamMassXmax = maxLamMass;
236 ksMassNbins, minKsMass, maxKsMass);
238 "Mass of good reco K0S",
239 ksMassNbins, minKsMass, maxKsMass);
241 "Mass of fake Lambda",
242 lamMassNbins, minLamMass, maxLamMass);
244 "Mass of good Lambda",
245 lamMassNbins, minLamMass, maxLamMass);
248 "Invariant mass of all K0S",
249 ksMassNbins, ksMassXmin, ksMassXmax);
251 "Invariant mass of all #Lambda^{0}",
252 lamMassNbins, lamMassXmin, lamMassXmax);
255 "Production radius of daughter particle of Ks fake",
258 "Production radius of daughter particle of Lam fake",
290 std::vector<reco::Vertex>::const_iterator iVtxPH = primaryVtxCollectionH->begin();
291 for(std::vector<reco::Vertex>::const_iterator iVtx = primaryVtxCollectionH->begin();
292 iVtx < primaryVtxCollectionH->end();
294 if(primaryVtxCollectionH->size() > 1) {
295 if(iVtx->tracksSize() > iVtxPH->tracksSize()) {
309 std::vector< pair<TrackingParticleRef, TrackingParticleRef> > trueK0s;
310 std::vector< pair<TrackingParticleRef, TrackingParticleRef> > trueLams;
311 std::vector<double> trueKsMasses;
312 std::vector<double> trueLamMasses;
319 double numK0sFound = 0.;
321 std::vector<double> radDist;
322 if ( k0sCollection->size() > 0 ) {
323 vector<reco::TrackRef> theDaughterTracks;
324 for( reco::VertexCompositeCandidateCollection::const_iterator iK0s = k0sCollection->begin();
325 iK0s != k0sCollection->end();
336 theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iK0s->daughter(0)) )).track() );
337 theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iK0s->daughter(1)) )).track() );
339 for (
int itrack = 0; itrack < 2; itrack++) {
343 std::vector< std::pair<TrackingParticleRef, double> > tp;
353 if(recotosimCollectionH->find(track) != recotosimCollectionH->end()) {
354 tp = (*recotosimCollectionH)[track];
355 if (tp.size() != 0) {
357 tpref = tp.begin()->first;
359 if( simtorecoCollectionH->find(tpref) == simtorecoCollectionH->end() ) {
363 if(parentVertex.
isNonnull()) radDist.push_back(parentVertex->position().R());
367 if( k0sVtx->position() == parentVertex->position() ) {
368 if( parentVertex->nDaughterTracks() == 2 ) {
369 if( parentVertex->nSourceTracks() == 0 ) {
375 iTP != parentVertex->sourceTracks_end(); iTP++) {
376 if( (*iTP)->pdgId() == 310 ) {
380 std::pair<TrackingParticleRef, TrackingParticleRef> pair(firstDauTP, tpref);
382 trueK0s.push_back(pair);
383 trueKsMasses.push_back(mass);
387 if( (*iTP)->pdgId() == 3122 ) {
405 k0sVtx = parentVertex;
415 theDaughterTracks.clear();
418 theDaughterTracks.clear();
426 for(
unsigned int ndx = 0; ndx < radDist.size(); ndx++ ) {
440 nKs->
Fill( (
float) numK0sFound );
443 double numLamFound = 0.;
447 if ( lambdaCollection->size() > 0 ) {
448 vector<reco::TrackRef> theDaughterTracks;
449 for( reco::VertexCompositeCandidateCollection::const_iterator iLam = lambdaCollection->begin();
450 iLam != lambdaCollection->end();
462 theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iLam->daughter(0)) )).track() );
463 theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iLam->daughter(1)) )).track() );
465 for (
int itrack = 0; itrack < 2; itrack++) {
469 std::vector< std::pair<TrackingParticleRef, double> > tp;
478 if(recotosimCollectionH->find(track) != recotosimCollectionH->end()) {
479 tp = (*recotosimCollectionH)[track];
480 if (tp.size() != 0) {
482 tpref = tp.begin()->first;
483 if( simtorecoCollectionH->find(tpref) == simtorecoCollectionH->end() ) {
487 if( parentVertex.
isNonnull() ) radDist.push_back(parentVertex->position().R());
491 if( LamVtx->position() == parentVertex->position() ) {
492 if( parentVertex->nDaughterTracks() == 2 ) {
493 if( parentVertex->nSourceTracks() == 0 ) {
499 iTP != parentVertex->sourceTracks_end(); ++iTP) {
500 if(
abs((*iTP)->pdgId()) == 3122 ) {
504 std::pair<TrackingParticleRef, TrackingParticleRef> pair(firstDauTP, tpref);
506 trueLams.push_back(pair);
507 trueLamMasses.push_back(mass);
511 if(
abs((*iTP)->pdgId() ) == 310 ) {
529 LamVtx = parentVertex;
539 theDaughterTracks.clear();
542 theDaughterTracks.clear();
550 for(
unsigned int ndx = 0; ndx < radDist.size(); ndx++ ) {
575 if( (itp1->
pdgId() == 211 || itp1->
pdgId() == 2212)
579 bool isLambda =
false;
580 if( itp1->
pdgId() == 2212 ) isLambda =
true;
585 iTP1 != piCand1Vertex->sourceTracks_end(); iTP1++) {
586 if(
abs((*iTP1)->pdgId()) == 3122 ) {
594 if (isLambda) particle2pdgId = -211;
595 else particle2pdgId = -2212;
596 if( itp2->
pdgId() == particle2pdgId
604 iTP2 != piCand2Vertex->sourceTracks_end();
613 if(
abs((*iTP2)->pdgId()) == 3122 ) {
619 if(trueLams.size() > 0) {
621 for(std::vector< pair<TrackingParticleRef, TrackingParticleRef> >::const_iterator iEffCheck = trueLams.begin();
622 iEffCheck != trueLams.end();
624 if( itp1->
parentVertex() == iEffCheck->first->parentVertex()
625 && itp2->
parentVertex() == iEffCheck->second->parentVertex() ) {
643 std::vector< std::pair<RefToBase<reco::Track>,
double> > rt1;
644 std::vector< std::pair<RefToBase<reco::Track>,
double> > rt2;
646 if( simtorecoCollectionH->find(tpr1) != simtorecoCollectionH->end() ) {
647 rt1 = (std::vector<std::pair<RefToBase<reco::Track>,
double> >) (*simtorecoCollectionH)[tpr1];
648 if(rt1.size() != 0) {
656 if( (simtorecoCollectionH->find(tpr2) != simtorecoCollectionH->end()) ) {
657 rt2 = (std::vector<std::pair<RefToBase<reco::Track>,
double> >) (*simtorecoCollectionH)[tpr2];
658 if(rt2.size() != 0) {
688 if(
abs(LamGenEta) > 0.) {
723 if ( itp1->
pdgId() == 211
731 iTP1 != piCand1Vertex->sourceTracks_end(); ++iTP1) {
733 if ( (*iTP1)->pdgId()==310 ) {
746 iTP2 != piCand2Vertex->sourceTracks_end(); ++iTP2) {
750 if( (*iTP2)->pdgId() == 310 ) {
756 if( trueK0s.size() > 0 ) {
757 for( std::vector< pair<TrackingParticleRef, TrackingParticleRef> >::const_iterator iEffCheck = trueK0s.begin();
758 iEffCheck != trueK0s.end();
761 if (itp1->
parentVertex()==iEffCheck->first->parentVertex() &&
762 itp2->
parentVertex()==iEffCheck->second->parentVertex()) {
780 std::vector<std::pair<RefToBase<reco::Track>,
double> > rt1;
781 std::vector<std::pair<RefToBase<reco::Track>,
double> > rt2;
783 if( simtorecoCollectionH->find(tpr1) != simtorecoCollectionH->end() ) {
784 rt1 = (std::vector< std::pair<RefToBase<reco::Track>,
double> >) (*simtorecoCollectionH)[tpr1];
785 if(rt1.size() != 0) {
796 if( simtorecoCollectionH->find(tpr2) != simtorecoCollectionH->end() ) {
797 rt2 = (std::vector< std::pair<RefToBase<reco::Track>,
double> >) (*simtorecoCollectionH)[tpr2];
798 if(rt2.size() != 0) {
829 if(
abs(K0sGenEta) > 0.) {
MonitorElement * ksTkFakeVsPt
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::vector< VertexCompositeCandidate > VertexCompositeCandidateCollection
collection of Candidate objects
bool isNonnull() const
Checks for non-null.
MonitorElement * lamTkFakeVsR_num
MonitorElement * ksEffVsR
unsigned int K0sCandStatus
edm::EDGetTokenT< reco::SimToRecoCollection > recoSimToRecoCollectionToken_
V0Validator(const edm::ParameterSet &)
edm::EDGetTokenT< reco::VertexCompositeCandidateCollection > recoVertexCompositeCandidateCollection_k0s_Token_
std::vector< TrackingParticle > TrackingParticleCollection
Vector momentum() const
spatial momentum vector
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * ksFakeVsPt_denom
MonitorElement * lamTkEffVsR
int pdgId() const
PDG ID.
MonitorElement * lamFakeVsPt
MonitorElement * ksTkFakeVsEta
MonitorElement * ksFakeVsR_denom
MonitorElement * ksFakeVsEta_num
unsigned int LamPiCandStatus[2]
MonitorElement * lamEffVsEta_num
MonitorElement * lamFakeVsPt_denom
MonitorElement * ksEffVsR_num
MonitorElement * ksFakeVsPt_num
MonitorElement * lamFakeVsR_denom
MonitorElement * lamEffVsPt_denom
unsigned int K0sPiCandStatus[2]
MonitorElement * lamEffVsPt_num
MonitorElement * lamTkFakeVsR
MonitorElement * lamFakeVsR
MonitorElement * ksFakeVsEta
MonitorElement * lamZResolution
MonitorElement * lamFakeDauRadDist
MonitorElement * lamTkEffVsEta
MonitorElement * lamEffVsR
MonitorElement * ksFakeVsEta_denom
MonitorElement * fakeLamMass
MonitorElement * ksFakeDauRadDist
MonitorElement * lamTkFakeVsEta_num
edm::RefVector< edm::HepMCProduct, HepMC::GenVertex > GenVertexRefVector
MonitorElement * lamTkFakeVsPt
MonitorElement * ksEffVsPt_denom
MonitorElement * ksTkFakeVsEta_num
MonitorElement * ksTkEffVsR_num
MonitorElement * lamFakeVsEta_denom
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * lamXResolution
MonitorElement * ksEffVsEta_denom
MonitorElement * book1D(Args &&...args)
MonitorElement * lamTkEffVsPt
Abs< T >::type abs(const T &t)
MonitorElement * goodKsMass
T const * get() const
Returns C++ pointer to the item.
const TrackingVertexRef & parentVertex() const
MonitorElement * fakeKsMass
edm::EDGetTokenT< std::vector< reco::Vertex > > vec_recoVertex_Token_
MonitorElement * ksTkEffVsPt
MonitorElement * goodLamMass
MonitorElement * ksFakeVsPt
edm::Ref< TrackingVertexCollection > TrackingVertexRef
unsigned int LamGenStatus
MonitorElement * lamTkFakeVsEta
unsigned int K0sGenStatus
MonitorElement * ksMassAll
MonitorElement * lamTkEffVsR_num
MonitorElement * ksTkEffVsR
void setCurrentFolder(const std::string &fullpath)
MonitorElement * lamTkEffVsEta_num
MonitorElement * ksXResolution
MonitorElement * lamEffVsEta_denom
std::vector< TrackingVertex > TrackingVertexCollection
MonitorElement * lamFakeVsEta
MonitorElement * ksAbsoluteDistResolution
edm::AssociationMap< edm::OneToManyWithQualityGeneric< edm::View< reco::Track >, TrackingParticleCollection, double > > RecoToSimCollection
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleCollection_Eff_Token_
MonitorElement * ksCandStatus
MonitorElement * lamCandStatus
MonitorElement * lamEffVsEta
MonitorElement * lamTkFakeVsPt_num
MonitorElement * lamFakeVsEta_num
Point vertex() const
Parent vertex position.
MonitorElement * ksTkEffVsPt_num
MonitorElement * lamFakeVsPt_num
MonitorElement * lamMassAll
MonitorElement * lamFakeVsR_num
MonitorElement * lamEffVsR_num
MonitorElement * ksFakeVsR
MonitorElement * ksEffVsEta
MonitorElement * lamTkEffVsPt_num
edm::EDGetTokenT< reco::RecoToSimCollection > recoRecoToSimCollectionToken_
edm::EDGetTokenT< reco::VertexCompositeCandidateCollection > recoVertexCompositeCandidateCollection_lambda_Token_
edm::AssociationMap< edm::OneToManyWithQualityGeneric< TrackingParticleCollection, edm::View< reco::Track >, double > > SimToRecoCollection
MonitorElement * lamAbsoluteDistResolution
MonitorElement * ksZResolution
unsigned int LamCandStatus
Monte Carlo truth information used for tracking validation.
MonitorElement * ksEffVsPt_num
MonitorElement * ksTkEffVsEta_num
MonitorElement * lamEffVsPt
MonitorElement * ksEffVsR_denom
MonitorElement * ksTkFakeVsPt_num
MonitorElement * ksTkEffVsEta
MonitorElement * ksFakeVsR_num
MonitorElement * ksEffVsEta_num
MonitorElement * lamYResolution
MonitorElement * ksEffVsPt
edm::RefVector< edm::HepMCProduct, HepMC::GenParticle > GenParticleRefVector
MonitorElement * ksTkFakeVsR
MonitorElement * ksYResolution
MonitorElement * lamEffVsR_denom
MonitorElement * ksTkFakeVsR_num