00001
00002
00003
00004
00005
00006
00007
00008 #include "StMuL3Filter.h"
00009 #include "StMuDebug.h"
00010 #include "StMuException.hh"
00011 #include "StEvent/StTrack.h"
00012 #include "StEvent/StTrackGeometry.h"
00013 #include "StEvent/StTrackDetectorInfo.h"
00014 #include "StEvent/StContainers.h"
00015 #include "StEvent/StDedxPidTraits.h"
00016
00017
00018 #include "StarClassLibrary/BetheBloch.h"
00019
00020 ClassImp(StMuL3Filter)
00021
00022 bool StMuL3Filter::accept( const StEvent* e) { cout << "StMuL3Filter::accept( const StEvent* e) not overwritten, returning true" << endl; return true;}
00023 bool StMuL3Filter::accept( const StV0Vertex* v) { cout << "StMuL3Filter::accept(const StV0Vertex* v) not overwritten, returning true" << endl; return true;}
00024 bool StMuL3Filter::accept( const StXiVertex* x) { cout << "StMuL3Filter::accept(const StXiVertex* x) not overwritten, returning true" << endl; return true;}
00025 bool StMuL3Filter::accept( const StKinkVertex* k) { cout << "StMuL3Filter::accept(const StKinkVertex* k) not overwritten, returning true" << endl; return true;}
00026 bool StMuL3Filter::accept( const StV0MuDst* v) { cout << "StMuL3Filter::accept(const StV0MuDst* v) not overwritten, returning true" << endl; return true;}
00027 bool StMuL3Filter::accept( const StXiMuDst* x) { cout << "StMuL3Filter::accept(const StXiMuDst* x) not overwritten, returning true" << endl; return true;}
00028 bool StMuL3Filter::accept( const StKinkMuDst* k) { cout << "StMuL3Filter::accept(const StKinkMuDst* k) not overwritten, returning true" << endl; return true;}
00029
00030
00031 StMuL3Filter::StMuL3Filter() {
00032 DEBUGMESSAGE3("");
00033 cerr << "StMuL3Filter::StMuL3Filter(): called. Next BetheBloch instance is made." << endl;
00034 mBB = new BetheBloch();
00035 cerr << "StMuL3Filter::StMuL3Filter(): did you see the BetheBloch warning?" << endl;
00036 }
00037
00038 StMuL3Filter::~StMuL3Filter() {
00039 delete mBB; mBB = 0;
00040 }
00041
00042 bool StMuL3Filter::accept(const StTrack* track) {
00043
00044 float pCutHigh = 2.0;
00045 int nHitsCutHighP = 10;
00046
00047
00048 float pCutLow = 0.2;
00049 int nHitsCutLowP = 15;
00050 int chargeForLowP = -1;
00051 float dEdxMassCutHigh = 0.939;
00052 float dEdxFractionCutHigh = 0.6;
00053 float dEdxMassCutLow = 0.494;
00054 float dEdxFractionCutLow = 1.1;
00055
00056 int iret = 0;
00057
00058
00059 if (track->geometry()->momentum().magnitude() > pCutHigh
00060 && track->detectorInfo()->numberOfPoints() >= nHitsCutHighP)
00061 iret = 1;
00062
00063
00064 else {
00065 if (track->detectorInfo()->numberOfPoints() >= nHitsCutLowP
00066 && track->geometry()->momentum().magnitude() > pCutLow) {
00067
00068 int chargeOK = 0;
00069 int dedxOK = 0;
00070
00071
00072 if (chargeForLowP==0)
00073 chargeOK = 1;
00074 else if (track->geometry()->charge() == chargeForLowP)
00075 chargeOK = 1;
00076
00077
00078
00079 float p = track->geometry()->momentum().magnitude();
00080 float dedxHigh = dEdxFractionCutHigh * mBB->Sirrf(p/dEdxMassCutHigh);
00081 float dedxLow = dEdxFractionCutLow * mBB->Sirrf(p/dEdxMassCutLow);
00082
00083 float dedx = 0;
00084
00085 const StSPtrVecTrackPidTraits& traits = track->pidTraits();
00086 StDedxPidTraits* dedxPidTr;
00087 for (unsigned int itrait = 0; itrait < traits.size(); itrait++){
00088 dedxPidTr = 0;
00089 if (traits[itrait]->detector() == kTpcId) {
00090 StTrackPidTraits* thisTrait = traits[itrait];
00091 dedxPidTr = dynamic_cast<StDedxPidTraits*>(thisTrait);
00092 if (dedxPidTr && dedxPidTr->method() == kTruncatedMeanId) {
00093
00094 dedx = 2 * dedxPidTr->mean();
00095 }
00096 }
00097 }
00098 if (dedx > dedxHigh && dedx > dedxLow)
00099 dedxOK = 1;
00100
00101
00102 iret = chargeOK * dedxOK;
00103 }
00104
00105 }
00106
00107 return (bool)iret;
00108 }
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130