29 : theDQMRootFileName(iConfig.getParameter<std::
string>(
"DQMRootFileName"))
31 , recoRecoToSimCollectionToken_( consumes<
reco::
RecoToSimCollection>( edm::InputTag( std::
string(
"trackingParticleRecoTrackAsssociation" ) ) ) )
32 , recoSimToRecoCollectionToken_( consumes<
reco::
SimToRecoCollection>( edm::InputTag( std::
string(
"trackingParticleRecoTrackAsssociation" ) ) ) )
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" ) ) ) )
64 "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
66 "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
68 "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
71 "K^{0}_{S} Tracking Efficiency vs #rho", 40, 0., 40.);
73 "K^{0}_{S} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
75 "K^{0}_{S} Tracking Efficiency vs p_{T}", 70, 0., 20.);
78 "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
80 "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
82 "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
85 "K^{0}_{S} Tracking Efficiency vs #rho", 40, 0., 40.);
87 "K^{0}_{S} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
89 "K^{0}_{S} Tracking Efficiency vs p_{T}", 70, 0., 20.);;
92 "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
94 "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
96 "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
99 "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
101 "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
103 "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
106 "#Lambda^{0} TrackingEfficiency vs #rho", 40, 0., 40.);
108 "#Lambda^{0} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
110 "#Lambda^{0} Tracking Efficiency vs p_{T}", 70, 0., 20.);
113 "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
115 "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
117 "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
120 "#Lambda^{0} TrackingEfficiency vs #rho", 40, 0., 40.);
122 "#Lambda^{0} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
124 "#Lambda^{0} Tracking Efficiency vs p_{T}", 70, 0., 20.);
127 "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
129 "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
131 "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
134 "K^{0}_{S} Fake Rate vs #rho", 40, 0., 40.);
136 "K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
138 "K^{0}_{S} Fake Rate vs p_{T}", 70, 0., 20.);
140 "K^{0}_{S} Tracking Fake Rate vs #rho", 40, 0., 40.);
142 "K^{0}_{S} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
144 "K^{0}_{S} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
147 "K^{0}_{S} Fake Rate vs #rho", 40, 0., 40.);
149 "K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
151 "K^{0}_{S} Fake Rate vs p_{T}", 70, 0., 20.);
153 "K^{0}_{S} Tracking Fake Rate vs #rho", 40, 0., 40.);
155 "K^{0}_{S} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
157 "K^{0}_{S} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
160 "K^{0}_{S} Fake Rate vs #rho", 40, 0., 40.);
162 "K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
164 "K^{0}_{S} Fake Rate vs p_{T}", 70, 0., 20.);
167 "#Lambda^{0} Fake Rate vs #rho", 40, 0., 40.);
169 "#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
171 "#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
173 "#Lambda^{0} Tracking Fake Rate vs #rho", 40, 0., 40.);
175 "#Lambda^{0} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
177 "#Lambda^{0} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
180 "#Lambda^{0} Fake Rate vs #rho", 40, 0., 40.);
182 "#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
184 "#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
186 "#Lambda^{0} Tracking Fake Rate vs #rho", 40, 0., 40.);
188 "#Lambda^{0} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
190 "#Lambda^{0} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
193 "#Lambda^{0} Fake Rate vs #rho", 40, 0., 40.);
195 "#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
197 "#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
200 subDirName =
dirName +
"/Other";
204 "Number of K^{0}_{S} found per event", 60, 0., 60.);
206 "Number of #Lambda^{0} found per event", 60, 0., 60.);
209 "Resolution of V0 decay vertex X coordinate", 50, 0., 50.);
211 "Resolution of V0 decay vertex Y coordinate", 50, 0., 50.);
213 "Resolution of V0 decay vertex Z coordinate", 50, 0., 50.);
215 "Resolution of V0 decay vertex X coordinate", 50, 0., 50.);
217 "Resolution of V0 decay vertex Y coordinate", 50, 0., 50.);
219 "Resolution of V0 decay vertex Z coordinate", 50, 0., 50.);
221 "Resolution of absolute distance from primary vertex to V0 vertex",
224 "Resolution of absolute distance from primary vertex to V0 vertex",
228 "Fake type by cand status",
231 "Fake type by cand status",
234 double minKsMass = 0.49767 - 0.07;
235 double maxKsMass = 0.49767 + 0.07;
236 double minLamMass = 1.1156 - 0.05;
237 double maxLamMass = 1.1156 + 0.05;
238 int ksMassNbins = 100;
239 double ksMassXmin = minKsMass;
240 double ksMassXmax = maxKsMass;
241 int lamMassNbins = 100;
242 double lamMassXmin = minLamMass;
243 double lamMassXmax = maxLamMass;
247 ksMassNbins, minKsMass, maxKsMass);
249 "Mass of good reco K0S",
250 ksMassNbins, minKsMass, maxKsMass);
252 "Mass of fake Lambda",
253 lamMassNbins, minLamMass, maxLamMass);
255 "Mass of good Lambda",
256 lamMassNbins, minLamMass, maxLamMass);
259 "Invariant mass of all K0S",
260 ksMassNbins, ksMassXmin, ksMassXmax);
262 "Invariant mass of all #Lambda^{0}",
263 lamMassNbins, lamMassXmin, lamMassXmax);
266 "Production radius of daughter particle of Ks fake",
269 "Production radius of daughter particle of Lam fake",
324 std::vector<reco::Vertex>::const_iterator iVtxPH = primaryVtxCollectionH->begin();
325 for(std::vector<reco::Vertex>::const_iterator iVtx = primaryVtxCollectionH->begin();
326 iVtx < primaryVtxCollectionH->end();
328 if(primaryVtxCollectionH->size() > 1) {
329 if(iVtx->tracksSize() > iVtxPH->tracksSize()) {
344 std::vector< pair<TrackingParticleRef, TrackingParticleRef> > trueK0s;
345 std::vector< pair<TrackingParticleRef, TrackingParticleRef> > trueLams;
346 std::vector<double> trueKsMasses;
347 std::vector<double> trueLamMasses;
354 double numK0sFound = 0.;
356 std::vector<double> radDist;
357 if ( k0sCollection->size() > 0 ) {
358 vector<reco::TrackRef> theDaughterTracks;
359 for( reco::VertexCompositeCandidateCollection::const_iterator iK0s = k0sCollection->begin();
360 iK0s != k0sCollection->end();
371 theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iK0s->daughter(0)) )).track() );
372 theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iK0s->daughter(1)) )).track() );
374 for (
int itrack = 0; itrack < 2; itrack++) {
378 std::vector< std::pair<TrackingParticleRef, double> > tp;
388 if(recotosimCollectionH->find(track) != recotosimCollectionH->end()) {
389 tp = (*recotosimCollectionH)[track];
390 if (tp.size() != 0) {
392 tpref = tp.begin()->first;
394 if( simtorecoCollectionH->find(tpref) == simtorecoCollectionH->end() ) {
398 if(parentVertex.
isNonnull()) radDist.push_back(parentVertex->position().R());
402 if( k0sVtx->position() == parentVertex->position() ) {
403 if( parentVertex->nDaughterTracks() == 2 ) {
404 if( parentVertex->nSourceTracks() == 0 ) {
410 iTP != parentVertex->sourceTracks_end(); iTP++) {
411 if( (*iTP)->pdgId() == 310 ) {
415 std::pair<TrackingParticleRef, TrackingParticleRef> pair(firstDauTP, tpref);
417 trueK0s.push_back(pair);
418 trueKsMasses.push_back(mass);
422 if( (*iTP)->pdgId() == 3122 ) {
440 k0sVtx = parentVertex;
450 theDaughterTracks.clear();
453 theDaughterTracks.clear();
461 for(
unsigned int ndx = 0; ndx < radDist.size(); ndx++ ) {
475 nKs->
Fill( (
float) numK0sFound );
478 double numLamFound = 0.;
482 if ( lambdaCollection->size() > 0 ) {
483 vector<reco::TrackRef> theDaughterTracks;
484 for( reco::VertexCompositeCandidateCollection::const_iterator iLam = lambdaCollection->begin();
485 iLam != lambdaCollection->end();
497 theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iLam->daughter(0)) )).track() );
498 theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iLam->daughter(1)) )).track() );
500 for (
int itrack = 0; itrack < 2; itrack++) {
504 std::vector< std::pair<TrackingParticleRef, double> > tp;
513 if(recotosimCollectionH->find(track) != recotosimCollectionH->end()) {
514 tp = (*recotosimCollectionH)[track];
515 if (tp.size() != 0) {
517 tpref = tp.begin()->first;
518 if( simtorecoCollectionH->find(tpref) == simtorecoCollectionH->end() ) {
522 if( parentVertex.
isNonnull() ) radDist.push_back(parentVertex->position().R());
526 if( LamVtx->position() == parentVertex->position() ) {
527 if( parentVertex->nDaughterTracks() == 2 ) {
528 if( parentVertex->nSourceTracks() == 0 ) {
534 iTP != parentVertex->sourceTracks_end(); ++iTP) {
535 if(
abs((*iTP)->pdgId()) == 3122 ) {
539 std::pair<TrackingParticleRef, TrackingParticleRef> pair(firstDauTP, tpref);
541 trueLams.push_back(pair);
542 trueLamMasses.push_back(mass);
546 if(
abs((*iTP)->pdgId() ) == 310 ) {
564 LamVtx = parentVertex;
574 theDaughterTracks.clear();
577 theDaughterTracks.clear();
585 for(
unsigned int ndx = 0; ndx < radDist.size(); ndx++ ) {
610 if( (itp1->
pdgId() == 211 || itp1->
pdgId() == 2212)
614 bool isLambda =
false;
615 if( itp1->
pdgId() == 2212 ) isLambda =
true;
620 iTP1 != piCand1Vertex->sourceTracks_end(); iTP1++) {
621 if(
abs((*iTP1)->pdgId()) == 3122 ) {
629 if (isLambda) particle2pdgId = -211;
630 else particle2pdgId = -2212;
631 if( itp2->
pdgId() == particle2pdgId
639 iTP2 != piCand2Vertex->sourceTracks_end();
648 if(
abs((*iTP2)->pdgId()) == 3122 ) {
654 if(trueLams.size() > 0) {
656 for(std::vector< pair<TrackingParticleRef, TrackingParticleRef> >::const_iterator iEffCheck = trueLams.begin();
657 iEffCheck != trueLams.end();
659 if( itp1->
parentVertex() == iEffCheck->first->parentVertex()
660 && itp2->
parentVertex() == iEffCheck->second->parentVertex() ) {
678 std::vector< std::pair<RefToBase<reco::Track>,
double> > rt1;
679 std::vector< std::pair<RefToBase<reco::Track>,
double> > rt2;
681 if( simtorecoCollectionH->find(tpr1) != simtorecoCollectionH->end() ) {
682 rt1 = (std::vector<std::pair<RefToBase<reco::Track>,
double> >) (*simtorecoCollectionH)[tpr1];
683 if(rt1.size() != 0) {
691 if( (simtorecoCollectionH->find(tpr2) != simtorecoCollectionH->end()) ) {
692 rt2 = (std::vector<std::pair<RefToBase<reco::Track>,
double> >) (*simtorecoCollectionH)[tpr2];
693 if(rt2.size() != 0) {
723 if(
abs(LamGenEta) > 0.) {
758 if ( itp1->
pdgId() == 211
766 iTP1 != piCand1Vertex->sourceTracks_end(); ++iTP1) {
768 if ( (*iTP1)->pdgId()==310 ) {
781 iTP2 != piCand2Vertex->sourceTracks_end(); ++iTP2) {
785 if( (*iTP2)->pdgId() == 310 ) {
791 if( trueK0s.size() > 0 ) {
792 for( std::vector< pair<TrackingParticleRef, TrackingParticleRef> >::const_iterator iEffCheck = trueK0s.begin();
793 iEffCheck != trueK0s.end();
796 if (itp1->
parentVertex()==iEffCheck->first->parentVertex() &&
797 itp2->
parentVertex()==iEffCheck->second->parentVertex()) {
815 std::vector<std::pair<RefToBase<reco::Track>,
double> > rt1;
816 std::vector<std::pair<RefToBase<reco::Track>,
double> > rt2;
818 if( simtorecoCollectionH->find(tpr1) != simtorecoCollectionH->end() ) {
819 rt1 = (std::vector< std::pair<RefToBase<reco::Track>,
double> >) (*simtorecoCollectionH)[tpr1];
820 if(rt1.size() != 0) {
831 if( simtorecoCollectionH->find(tpr2) != simtorecoCollectionH->end() ) {
832 rt2 = (std::vector< std::pair<RefToBase<reco::Track>,
double> >) (*simtorecoCollectionH)[tpr2];
833 if(rt2.size() != 0) {
864 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.
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
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