37 theDQMRootFileName(iConfig.getParameter<std::string>(
"DQMRootFileName")),
38 k0sCollectionTag(iConfig.getParameter<edm::InputTag>(
"kShortCollection")),
39 lamCollectionTag(iConfig.getParameter<edm::InputTag>(
"lambdaCollection")),
40 dirName(iConfig.getParameter<std::string>(
"dirName")) {
63 std::string subDirName =
dirName +
"/EffFakes";
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 "K^{0}_{S} Tracking Efficiency vs #rho", 40, 0., 40.);
90 "K^{0}_{S} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
92 "K^{0}_{S} Tracking Efficiency vs p_{T}", 70, 0., 20.);;
96 "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
98 "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
100 "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
104 "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
106 "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
108 "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
112 "#Lambda^{0} TrackingEfficiency vs #rho", 40, 0., 40.);
114 "#Lambda^{0} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
116 "#Lambda^{0} Tracking Efficiency vs p_{T}", 70, 0., 20.);
119 "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
121 "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
123 "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
127 "#Lambda^{0} TrackingEfficiency vs #rho", 40, 0., 40.);
129 "#Lambda^{0} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
131 "#Lambda^{0} Tracking Efficiency vs p_{T}", 70, 0., 20.);
135 "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
137 "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
139 "#Lambda^{0} Efficiency 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.);
166 "K^{0}_{S} Tracking Fake Rate vs #rho", 40, 0., 40.);
168 "K^{0}_{S} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
170 "K^{0}_{S} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
173 "K^{0}_{S} Fake Rate vs #rho", 40, 0., 40.);
175 "K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
177 "K^{0}_{S} 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.);
199 "#Lambda^{0} Tracking Fake Rate vs #rho", 40, 0., 40.);
201 "#Lambda^{0} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
203 "#Lambda^{0} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
206 "#Lambda^{0} Fake Rate vs #rho", 40, 0., 40.);
208 "#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
210 "#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
213 subDirName =
dirName +
"/Other";
217 "Number of K^{0}_{S} found per event", 60, 0., 60.);
219 "Number of #Lambda^{0} found per event", 60, 0., 60.);
222 "Resolution of V0 decay vertex X coordinate", 50, 0., 50.);
224 "Resolution of V0 decay vertex Y coordinate", 50, 0., 50.);
226 "Resolution of V0 decay vertex Z coordinate", 50, 0., 50.);
228 "Resolution of V0 decay vertex X coordinate", 50, 0., 50.);
230 "Resolution of V0 decay vertex Y coordinate", 50, 0., 50.);
232 "Resolution of V0 decay vertex Z coordinate", 50, 0., 50.);
234 "Resolution of absolute distance from primary vertex to V0 vertex",
237 "Resolution of absolute distance from primary vertex to V0 vertex",
241 "Fake type by cand status",
244 "Fake type by cand status",
247 double minKsMass = 0.49767 - 0.07;
248 double maxKsMass = 0.49767 + 0.07;
249 double minLamMass = 1.1156 - 0.05;
250 double maxLamMass = 1.1156 + 0.05;
251 int ksMassNbins = 100;
252 double ksMassXmin = minKsMass;
253 double ksMassXmax = maxKsMass;
254 int lamMassNbins = 100;
255 double lamMassXmin = minLamMass;
256 double lamMassXmax = maxLamMass;
260 ksMassNbins, minKsMass, maxKsMass);
262 "Mass of good reco K0S",
263 ksMassNbins, minKsMass, maxKsMass);
265 "Mass of fake Lambda",
266 lamMassNbins, minLamMass, maxLamMass);
268 "Mass of good Lambda",
269 lamMassNbins, minLamMass, maxLamMass);
272 "Invariant mass of all K0S",
273 ksMassNbins, ksMassXmin, ksMassXmax);
275 "Invariant mass of all #Lambda^{0}",
276 lamMassNbins, lamMassXmin, lamMassXmax);
279 "Production radius of daughter particle of Ks fake",
282 "Production radius of daughter particle of Lam fake",
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++ ) {
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++ ) {
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 * ksTkFakeVsPt
MonitorElement * lamTkFakeVsR_num
MonitorElement * ksEffVsR
unsigned int K0sCandStatus
V0Validator(const edm::ParameterSet &)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
std::vector< TrackingParticle > TrackingParticleCollection
MonitorElement * ksFakeVsPt_denom
void cd(void)
go to top directory (ie. root)
MonitorElement * lamTkEffVsR
int pdgId() const
PDG id, signal source, crossing number.
MonitorElement * lamFakeVsPt
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
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
const double piMassSquared
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
bool isNonnull() const
Checks for non-null.
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
const double protonMassSquared
edm::InputTag lamCollectionTag
MonitorElement * lamXResolution
MonitorElement * ksEffVsEta_denom
MonitorElement * lamTkEffVsPt
MonitorElement * goodKsMass
const TrackingVertexRef & parentVertex() const
MonitorElement * fakeKsMass
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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
MonitorElement * lamTkEffVsEta_num
MonitorElement * ksXResolution
MonitorElement * lamEffVsEta_denom
std::vector< TrackingVertex > TrackingVertexCollection
std::vector< SimVertex > SimVertexContainer
MonitorElement * lamFakeVsEta
MonitorElement * ksAbsoluteDistResolution
MonitorElement * ksCandStatus
Vector momentum() const
spatial momentum vector
MonitorElement * lamCandStatus
MonitorElement * lamEffVsEta
MonitorElement * lamTkFakeVsPt_num
MonitorElement * lamFakeVsEta_num
std::string theDQMRootFileName
MonitorElement * ksTkEffVsPt_num
MonitorElement * lamFakeVsPt_num
MonitorElement * lamMassAll
MonitorElement * lamFakeVsR_num
MonitorElement * lamEffVsR_num
MonitorElement * ksFakeVsR
MonitorElement * ksEffVsEta
MonitorElement * lamTkEffVsPt_num
MonitorElement * lamAbsoluteDistResolution
MonitorElement * ksZResolution
unsigned int LamCandStatus
MonitorElement * ksEffVsPt_num
MonitorElement * ksTkEffVsEta_num
MonitorElement * lamEffVsPt
MonitorElement * ksEffVsR_denom
MonitorElement * ksTkFakeVsPt_num
edm::InputTag k0sCollectionTag
MonitorElement * ksTkEffVsEta
MonitorElement * ksFakeVsR_num
MonitorElement * ksEffVsEta_num
virtual void endRun(const edm::Run &, const edm::EventSetup &)
T const * get() const
Returns C++ pointer to the item.
const Point & vertex() const
vertex position
MonitorElement * lamYResolution
MonitorElement * ksEffVsPt
std::vector< SimTrack > SimTrackContainer
edm::RefVector< edm::HepMCProduct, HepMC::GenParticle > GenParticleRefVector
void setCurrentFolder(const std::string &fullpath)
MonitorElement * ksTkFakeVsR
MonitorElement * ksYResolution
MonitorElement * lamEffVsR_denom
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
MonitorElement * ksTkFakeVsR_num