470 iEvent.
getByLabel(
"trackingParticleRecoTrackAsssociation", recotosimCollectionH);
474 iEvent.
getByLabel(
"trackingParticleRecoTrackAsssociation", simtorecoCollectionH);
478 iEvent.
getByLabel(
"mergedtruth",
"MergedTrackTruth", TPCollectionEff);
492 iEvent.
getByLabel(
"generalTracks", trackCollectionH);
495 iEvent.
getByLabel(
"g4SimHits", simTrackCollection);
499 iEvent.
getByLabel(
"g4SimHits", simVertexCollection);
505 iEvent.
getByLabel(
"mergedtruth",
"MergedTrackTruth", TPCollectionH);
514 iEvent.
getByLabel(
"offlinePrimaryVertices", primaryVtxCollectionH);
518 std::vector<reco::Vertex>::const_iterator iVtxPH = primaryVtxCollectionH->begin();
519 for(std::vector<reco::Vertex>::const_iterator iVtx = primaryVtxCollectionH->begin();
520 iVtx < primaryVtxCollectionH->end();
522 if(primaryVtxCollectionH->size() > 1) {
523 if(iVtx->tracksSize() > iVtxPH->tracksSize()) {
549 std::vector< pair<TrackingParticleRef, TrackingParticleRef> > trueK0s;
550 std::vector< pair<TrackingParticleRef, TrackingParticleRef> > trueLams;
551 std::vector<double> trueKsMasses;
552 std::vector<double> trueLamMasses;
585 double numK0sFound = 0.;
587 std::vector<double> radDist;
590 if ( k0sCollection->size() > 0 ) {
593 vector<reco::TrackRef> theDaughterTracks;
594 for( reco::VertexCompositeCandidateCollection::const_iterator iK0s = k0sCollection->begin();
595 iK0s != k0sCollection->end();
609 theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iK0s->daughter(0)) )).track() );
610 theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iK0s->daughter(1)) )).track() );
613 for (
int itrack = 0; itrack < 2; itrack++) {
617 std::vector< std::pair<TrackingParticleRef, double> > tp;
629 if(recotosimCollectionH->find(track) != recotosimCollectionH->end()) {
631 tp = (*recotosimCollectionH)[track];
632 if (tp.size() != 0) {
634 tpref = tp.begin()->first;
637 if( simtorecoCollectionH->find(tpref) == simtorecoCollectionH->end() ) {
642 if(parentVertex.
isNonnull()) radDist.push_back(parentVertex->position().R());
646 if( k0sVtx->position() == parentVertex->position() ) {
647 if( parentVertex->nDaughterTracks() == 2 ) {
648 if( parentVertex->nSourceTracks() == 0 ) {
654 iTP != parentVertex->sourceTracks_end(); iTP++) {
655 if( (*iTP)->pdgId() == 310 ) {
660 std::pair<TrackingParticleRef, TrackingParticleRef> pair(firstDauTP, tpref);
662 trueK0s.push_back(pair);
663 trueKsMasses.push_back(mass);
667 if( (*iTP)->pdgId() == 3122 ) {
685 k0sVtx = parentVertex;
696 theDaughterTracks.clear();
700 theDaughterTracks.clear();
709 for(
unsigned int ndx = 0; ndx < radDist.size(); ndx++ ) {
713 if( K0sCandStatus == 5 ) {
726 nKs->
Fill( (
float) numK0sFound );
731 double numLamFound = 0.;
735 if ( lambdaCollection->size() > 0 ) {
738 vector<reco::TrackRef> theDaughterTracks;
739 for( reco::VertexCompositeCandidateCollection::const_iterator iLam = lambdaCollection->begin();
740 iLam != lambdaCollection->end();
752 theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iLam->daughter(0)) )).track() );
753 theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iLam->daughter(1)) )).track() );
755 for (
int itrack = 0; itrack < 2; itrack++) {
759 std::vector< std::pair<TrackingParticleRef, double> > tp;
770 if(recotosimCollectionH->find(track) != recotosimCollectionH->end()) {
772 tp = (*recotosimCollectionH)[track];
773 if (tp.size() != 0) {
775 tpref = tp.begin()->first;
778 if( simtorecoCollectionH->find(tpref) == simtorecoCollectionH->end() ) {
782 if( parentVertex.
isNonnull() ) radDist.push_back(parentVertex->position().R());
786 if( LamVtx->position() == parentVertex->position() ) {
787 if( parentVertex->nDaughterTracks() == 2 ) {
788 if( parentVertex->nSourceTracks() == 0 ) {
794 iTP != parentVertex->sourceTracks_end(); ++iTP) {
795 if(
abs((*iTP)->pdgId()) == 3122 ) {
799 std::pair<TrackingParticleRef, TrackingParticleRef> pair(firstDauTP, tpref);
801 trueLams.push_back(pair);
802 trueLamMasses.push_back(mass);
806 if(
abs((*iTP)->pdgId() ) == 310 ) {
827 LamVtx = parentVertex;
837 theDaughterTracks.clear();
840 theDaughterTracks.clear();
856 for(
unsigned int ndx = 0; ndx < radDist.size(); ndx++ ) {
861 if( K0sCandStatus == 5 ) {
887 if( (itp1->
pdgId() == 211 || itp1->
pdgId() == 2212)
891 bool isLambda =
false;
892 if( itp1->
pdgId() == 2212 ) isLambda =
true;
897 iTP1 != piCand1Vertex->sourceTracks_end(); iTP1++) {
898 if(
abs((*iTP1)->pdgId()) == 3122 ) {
907 if (isLambda) particle2pdgId = -211;
908 else particle2pdgId = -2212;
909 if( itp2->
pdgId() == particle2pdgId
917 iTP2 != piCand2Vertex->sourceTracks_end();
926 if(
abs((*iTP2)->pdgId()) == 3122 ) {
933 if(trueLams.size() > 0) {
935 for(std::vector< pair<TrackingParticleRef, TrackingParticleRef> >::const_iterator iEffCheck = trueLams.begin();
936 iEffCheck != trueLams.end();
939 if( itp1->
parentVertex() == iEffCheck->first->parentVertex()
940 && itp2->
parentVertex() == iEffCheck->second->parentVertex() ) {
960 std::vector< std::pair<RefToBase<reco::Track>,
double> > rt1;
961 std::vector< std::pair<RefToBase<reco::Track>,
double> > rt2;
964 if( simtorecoCollectionH->find(tpr1) != simtorecoCollectionH->end() ) {
966 rt1 = (std::vector<std::pair<RefToBase<reco::Track>,
double> >) (*simtorecoCollectionH)[tpr1];
967 if(rt1.size() != 0) {
976 if( (simtorecoCollectionH->find(tpr2) != simtorecoCollectionH->end()) ) {
978 rt2 = (std::vector<std::pair<RefToBase<reco::Track>,
double> >) (*simtorecoCollectionH)[tpr2];
979 if(rt2.size() != 0) {
1010 if(
abs(LamGenEta) > 0.) {
1046 if ( itp1->
pdgId() == 211
1054 iTP1 != piCand1Vertex->sourceTracks_end(); ++iTP1) {
1056 if ( (*iTP1)->pdgId()==310 ) {
1069 iTP2 != piCand2Vertex->sourceTracks_end(); ++iTP2) {
1073 if( (*iTP2)->pdgId() == 310 ) {
1079 if( trueK0s.size() > 0 ) {
1080 for( std::vector< pair<TrackingParticleRef, TrackingParticleRef> >::const_iterator iEffCheck = trueK0s.begin();
1081 iEffCheck != trueK0s.end();
1084 if (itp1->
parentVertex()==iEffCheck->first->parentVertex() &&
1085 itp2->
parentVertex()==iEffCheck->second->parentVertex()) {
1105 std::vector<std::pair<RefToBase<reco::Track>,
double> > rt1;
1106 std::vector<std::pair<RefToBase<reco::Track>,
double> > rt2;
1109 if( simtorecoCollectionH->find(tpr1) != simtorecoCollectionH->end() ) {
1110 rt1 = (std::vector< std::pair<RefToBase<reco::Track>,
double> >) (*simtorecoCollectionH)[tpr1];
1112 if(rt1.size() != 0) {
1124 if( simtorecoCollectionH->find(tpr2) != simtorecoCollectionH->end() ) {
1125 rt2 = (std::vector< std::pair<RefToBase<reco::Track>,
double> >) (*simtorecoCollectionH)[tpr2];
1127 if(rt2.size() != 0) {
1159 if(
abs(K0sGenEta) > 0.) {
MonitorElement * lamTkFakeVsR_num
unsigned int K0sCandStatus
MonitorElement * ksFakeVsPt_denom
int pdgId() const
PDG id, signal source, crossing number.
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 * lamFakeDauRadDist
MonitorElement * ksFakeVsEta_denom
bool isNonnull() const
Checks for non-null.
MonitorElement * fakeLamMass
MonitorElement * ksFakeDauRadDist
MonitorElement * lamTkFakeVsEta_num
MonitorElement * ksEffVsPt_denom
MonitorElement * ksTkFakeVsEta_num
MonitorElement * ksTkEffVsR_num
MonitorElement * lamFakeVsEta_denom
edm::InputTag lamCollectionTag
MonitorElement * ksEffVsEta_denom
MonitorElement * goodKsMass
const TrackingVertexRef & parentVertex() const
MonitorElement * fakeKsMass
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
MonitorElement * goodLamMass
unsigned int LamGenStatus
unsigned int K0sGenStatus
MonitorElement * ksMassAll
MonitorElement * lamTkEffVsR_num
MonitorElement * lamTkEffVsEta_num
MonitorElement * lamEffVsEta_denom
std::vector< SimVertex > SimVertexContainer
MonitorElement * ksCandStatus
Vector momentum() const
spatial momentum vector
MonitorElement * lamCandStatus
MonitorElement * lamTkFakeVsPt_num
MonitorElement * lamFakeVsEta_num
MonitorElement * ksTkEffVsPt_num
MonitorElement * lamFakeVsPt_num
MonitorElement * lamMassAll
MonitorElement * lamFakeVsR_num
MonitorElement * lamEffVsR_num
MonitorElement * lamTkEffVsPt_num
unsigned int LamCandStatus
MonitorElement * ksEffVsPt_num
MonitorElement * ksTkEffVsEta_num
MonitorElement * ksEffVsR_denom
MonitorElement * ksTkFakeVsPt_num
edm::InputTag k0sCollectionTag
std::vector< TrackingParticle > TrackingParticleCollection
MonitorElement * ksFakeVsR_num
MonitorElement * ksEffVsEta_num
const Point & vertex() const
vertex position
std::vector< SimTrack > SimTrackContainer
MonitorElement * lamEffVsR_denom
MonitorElement * ksTkFakeVsR_num