29 : theDQMRootFileName(iConfig.getParameter<std::
string>(
"DQMRootFileName"))
34 , std::
string(
"MergedTrackTruth" )
39 , std::
string(
"MergedTrackTruth" )
43 , edmView_recoTrack_Token_( consumes< edm::
View<
reco::Track> >( edm::
InputTag( std::
string(
"generalTracks" ) ) ) )
46 , vec_recoVertex_Token_( consumes< std::vector<
reco::
Vertex> >( edm::
InputTag( std::
string(
"offlinePrimaryVertices" ) ) ) )
66 "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
68 "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
70 "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
73 "K^{0}_{S} Tracking Efficiency vs #rho", 40, 0., 40.);
75 "K^{0}_{S} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
77 "K^{0}_{S} Tracking Efficiency vs p_{T}", 70, 0., 20.);
80 "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
82 "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
84 "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
87 "K^{0}_{S} Tracking Efficiency vs #rho", 40, 0., 40.);
89 "K^{0}_{S} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
91 "K^{0}_{S} Tracking Efficiency vs p_{T}", 70, 0., 20.);;
94 "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
96 "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
98 "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
101 "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
103 "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
105 "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
108 "#Lambda^{0} TrackingEfficiency vs #rho", 40, 0., 40.);
110 "#Lambda^{0} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
112 "#Lambda^{0} Tracking Efficiency vs p_{T}", 70, 0., 20.);
115 "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
117 "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
119 "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
122 "#Lambda^{0} TrackingEfficiency vs #rho", 40, 0., 40.);
124 "#Lambda^{0} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
126 "#Lambda^{0} Tracking Efficiency vs p_{T}", 70, 0., 20.);
129 "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
131 "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
133 "#Lambda^{0} Efficiency 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.);
155 "K^{0}_{S} Tracking Fake Rate vs #rho", 40, 0., 40.);
157 "K^{0}_{S} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
159 "K^{0}_{S} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
162 "K^{0}_{S} Fake Rate vs #rho", 40, 0., 40.);
164 "K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
166 "K^{0}_{S} 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.);
188 "#Lambda^{0} Tracking Fake Rate vs #rho", 40, 0., 40.);
190 "#Lambda^{0} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
192 "#Lambda^{0} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
195 "#Lambda^{0} Fake Rate vs #rho", 40, 0., 40.);
197 "#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
199 "#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
202 subDirName =
dirName +
"/Other";
206 "Number of K^{0}_{S} found per event", 60, 0., 60.);
208 "Number of #Lambda^{0} found per event", 60, 0., 60.);
211 "Resolution of V0 decay vertex X coordinate", 50, 0., 50.);
213 "Resolution of V0 decay vertex Y coordinate", 50, 0., 50.);
215 "Resolution of V0 decay vertex Z coordinate", 50, 0., 50.);
217 "Resolution of V0 decay vertex X coordinate", 50, 0., 50.);
219 "Resolution of V0 decay vertex Y coordinate", 50, 0., 50.);
221 "Resolution of V0 decay vertex Z coordinate", 50, 0., 50.);
223 "Resolution of absolute distance from primary vertex to V0 vertex",
226 "Resolution of absolute distance from primary vertex to V0 vertex",
230 "Fake type by cand status",
233 "Fake type by cand status",
236 double minKsMass = 0.49767 - 0.07;
237 double maxKsMass = 0.49767 + 0.07;
238 double minLamMass = 1.1156 - 0.05;
239 double maxLamMass = 1.1156 + 0.05;
240 int ksMassNbins = 100;
241 double ksMassXmin = minKsMass;
242 double ksMassXmax = maxKsMass;
243 int lamMassNbins = 100;
244 double lamMassXmin = minLamMass;
245 double lamMassXmax = maxLamMass;
249 ksMassNbins, minKsMass, maxKsMass);
251 "Mass of good reco K0S",
252 ksMassNbins, minKsMass, maxKsMass);
254 "Mass of fake Lambda",
255 lamMassNbins, minLamMass, maxLamMass);
257 "Mass of good Lambda",
258 lamMassNbins, minLamMass, maxLamMass);
261 "Invariant mass of all K0S",
262 ksMassNbins, ksMassXmin, ksMassXmax);
264 "Invariant mass of all #Lambda^{0}",
265 lamMassNbins, lamMassXmin, lamMassXmax);
268 "Production radius of daughter particle of Ks fake",
271 "Production radius of daughter particle of Lam fake",
326 std::vector<reco::Vertex>::const_iterator iVtxPH = primaryVtxCollectionH->begin();
327 for(std::vector<reco::Vertex>::const_iterator iVtx = primaryVtxCollectionH->begin();
328 iVtx < primaryVtxCollectionH->end();
330 if(primaryVtxCollectionH->size() > 1) {
331 if(iVtx->tracksSize() > iVtxPH->tracksSize()) {
346 std::vector< pair<TrackingParticleRef, TrackingParticleRef> > trueK0s;
347 std::vector< pair<TrackingParticleRef, TrackingParticleRef> > trueLams;
348 std::vector<double> trueKsMasses;
349 std::vector<double> trueLamMasses;
356 double numK0sFound = 0.;
358 std::vector<double> radDist;
359 if ( k0sCollection->size() > 0 ) {
360 vector<reco::TrackRef> theDaughterTracks;
361 for( reco::VertexCompositeCandidateCollection::const_iterator iK0s = k0sCollection->begin();
362 iK0s != k0sCollection->end();
373 theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iK0s->daughter(0)) )).track() );
374 theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iK0s->daughter(1)) )).track() );
376 for (
int itrack = 0; itrack < 2; itrack++) {
380 std::vector< std::pair<TrackingParticleRef, double> > tp;
390 if(recotosimCollectionH->find(track) != recotosimCollectionH->end()) {
391 tp = (*recotosimCollectionH)[track];
392 if (tp.size() != 0) {
394 tpref = tp.begin()->first;
396 if( simtorecoCollectionH->find(tpref) == simtorecoCollectionH->end() ) {
400 if(parentVertex.
isNonnull()) radDist.push_back(parentVertex->position().R());
404 if( k0sVtx->position() == parentVertex->position() ) {
405 if( parentVertex->nDaughterTracks() == 2 ) {
406 if( parentVertex->nSourceTracks() == 0 ) {
412 iTP != parentVertex->sourceTracks_end(); iTP++) {
413 if( (*iTP)->pdgId() == 310 ) {
417 std::pair<TrackingParticleRef, TrackingParticleRef> pair(firstDauTP, tpref);
419 trueK0s.push_back(pair);
420 trueKsMasses.push_back(mass);
424 if( (*iTP)->pdgId() == 3122 ) {
442 k0sVtx = parentVertex;
452 theDaughterTracks.clear();
455 theDaughterTracks.clear();
463 for(
unsigned int ndx = 0; ndx < radDist.size(); ndx++ ) {
477 nKs->
Fill( (
float) numK0sFound );
480 double numLamFound = 0.;
484 if ( lambdaCollection->size() > 0 ) {
485 vector<reco::TrackRef> theDaughterTracks;
486 for( reco::VertexCompositeCandidateCollection::const_iterator iLam = lambdaCollection->begin();
487 iLam != lambdaCollection->end();
499 theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iLam->daughter(0)) )).track() );
500 theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iLam->daughter(1)) )).track() );
502 for (
int itrack = 0; itrack < 2; itrack++) {
506 std::vector< std::pair<TrackingParticleRef, double> > tp;
515 if(recotosimCollectionH->find(track) != recotosimCollectionH->end()) {
516 tp = (*recotosimCollectionH)[track];
517 if (tp.size() != 0) {
519 tpref = tp.begin()->first;
520 if( simtorecoCollectionH->find(tpref) == simtorecoCollectionH->end() ) {
524 if( parentVertex.
isNonnull() ) radDist.push_back(parentVertex->position().R());
528 if( LamVtx->position() == parentVertex->position() ) {
529 if( parentVertex->nDaughterTracks() == 2 ) {
530 if( parentVertex->nSourceTracks() == 0 ) {
536 iTP != parentVertex->sourceTracks_end(); ++iTP) {
537 if(
abs((*iTP)->pdgId()) == 3122 ) {
541 std::pair<TrackingParticleRef, TrackingParticleRef> pair(firstDauTP, tpref);
543 trueLams.push_back(pair);
544 trueLamMasses.push_back(mass);
548 if(
abs((*iTP)->pdgId() ) == 310 ) {
566 LamVtx = parentVertex;
576 theDaughterTracks.clear();
579 theDaughterTracks.clear();
587 for(
unsigned int ndx = 0; ndx < radDist.size(); ndx++ ) {
612 if( (itp1->
pdgId() == 211 || itp1->
pdgId() == 2212)
616 bool isLambda =
false;
617 if( itp1->
pdgId() == 2212 ) isLambda =
true;
622 iTP1 != piCand1Vertex->sourceTracks_end(); iTP1++) {
623 if(
abs((*iTP1)->pdgId()) == 3122 ) {
631 if (isLambda) particle2pdgId = -211;
632 else particle2pdgId = -2212;
633 if( itp2->
pdgId() == particle2pdgId
641 iTP2 != piCand2Vertex->sourceTracks_end();
650 if(
abs((*iTP2)->pdgId()) == 3122 ) {
656 if(trueLams.size() > 0) {
658 for(std::vector< pair<TrackingParticleRef, TrackingParticleRef> >::const_iterator iEffCheck = trueLams.begin();
659 iEffCheck != trueLams.end();
661 if( itp1->
parentVertex() == iEffCheck->first->parentVertex()
662 && itp2->
parentVertex() == iEffCheck->second->parentVertex() ) {
680 std::vector< std::pair<RefToBase<reco::Track>,
double> > rt1;
681 std::vector< std::pair<RefToBase<reco::Track>,
double> > rt2;
683 if( simtorecoCollectionH->find(tpr1) != simtorecoCollectionH->end() ) {
684 rt1 = (std::vector<std::pair<RefToBase<reco::Track>,
double> >) (*simtorecoCollectionH)[tpr1];
685 if(rt1.size() != 0) {
693 if( (simtorecoCollectionH->find(tpr2) != simtorecoCollectionH->end()) ) {
694 rt2 = (std::vector<std::pair<RefToBase<reco::Track>,
double> >) (*simtorecoCollectionH)[tpr2];
695 if(rt2.size() != 0) {
725 if(
abs(LamGenEta) > 0.) {
760 if ( itp1->
pdgId() == 211
768 iTP1 != piCand1Vertex->sourceTracks_end(); ++iTP1) {
770 if ( (*iTP1)->pdgId()==310 ) {
783 iTP2 != piCand2Vertex->sourceTracks_end(); ++iTP2) {
787 if( (*iTP2)->pdgId() == 310 ) {
793 if( trueK0s.size() > 0 ) {
794 for( std::vector< pair<TrackingParticleRef, TrackingParticleRef> >::const_iterator iEffCheck = trueK0s.begin();
795 iEffCheck != trueK0s.end();
798 if (itp1->
parentVertex()==iEffCheck->first->parentVertex() &&
799 itp2->
parentVertex()==iEffCheck->second->parentVertex()) {
817 std::vector<std::pair<RefToBase<reco::Track>,
double> > rt1;
818 std::vector<std::pair<RefToBase<reco::Track>,
double> > rt2;
820 if( simtorecoCollectionH->find(tpr1) != simtorecoCollectionH->end() ) {
821 rt1 = (std::vector< std::pair<RefToBase<reco::Track>,
double> >) (*simtorecoCollectionH)[tpr1];
822 if(rt1.size() != 0) {
833 if( simtorecoCollectionH->find(tpr2) != simtorecoCollectionH->end() ) {
834 rt2 = (std::vector< std::pair<RefToBase<reco::Track>,
double> >) (*simtorecoCollectionH)[tpr2];
835 if(rt2.size() != 0) {
866 if(
abs(K0sGenEta) > 0.) {
MonitorElement * ksTkFakeVsPt
edm::EDGetTokenT< edm::SimVertexContainer > edmSimVertexContainerToken_
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
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
std::vector< Vertex > VertexCollection
collection of Vertex objects
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
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * ksFakeVsEta
MonitorElement * lamZResolution
MonitorElement * lamFakeDauRadDist
MonitorElement * lamTkEffVsEta
MonitorElement * lamEffVsR
MonitorElement * ksFakeVsEta_denom
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleCollectionToken_
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
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.
edm::EDGetTokenT< reco::TrackToTrackingParticleAssociator > recoTrackToTrackingParticleAssociator_Token_
MonitorElement * fakeKsMass
edm::EDGetTokenT< std::vector< reco::Vertex > > vec_recoVertex_Token_
MonitorElement * ksTkEffVsPt
MonitorElement * goodLamMass
MonitorElement * ksFakeVsPt
edm::Ref< TrackingVertexCollection > TrackingVertexRef
unsigned int LamGenStatus
edm::EDGetTokenT< edm::SimTrackContainer > edmSimTrackContainerToken_
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
std::vector< SimVertex > SimVertexContainer
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
edm::EDGetTokenT< edm::View< reco::Track > > edmView_recoTrack_Token_
const TrackingVertexRef & parentVertex() const
MonitorElement * lamEffVsR_num
MonitorElement * ksFakeVsR
MonitorElement * ksEffVsEta
MonitorElement * lamTkEffVsPt_num
Vector momentum() const
spatial momentum vector
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
std::vector< SimTrack > SimTrackContainer
edm::RefVector< edm::HepMCProduct, HepMC::GenParticle > GenParticleRefVector
MonitorElement * ksTkFakeVsR
MonitorElement * ksYResolution
MonitorElement * lamEffVsR_denom
MonitorElement * ksTkFakeVsR_num