X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=STEER%2FAliAODTrack.cxx;h=f2a95e73da604ed2b182507bae069dff0dc7cb44;hb=d6e39fcb89b57ca56ae9cbda8d4c5e16fbb71a00;hp=fa384d86315fdfbe4c890af2c65ed9e3f629e063;hpb=c8fe2783489236d4d3aff0b807d1f507720af244;p=u%2Fmrichter%2FAliRoot.git diff --git a/STEER/AliAODTrack.cxx b/STEER/AliAODTrack.cxx index fa384d86315..f2a95e73da6 100644 --- a/STEER/AliAODTrack.cxx +++ b/STEER/AliAODTrack.cxx @@ -40,6 +40,7 @@ AliAODTrack::AliAODTrack() : fFilterMap(0), fTPCClusterMap(), fTPCSharedMap(), + fTPCnclsF(0), fID(-999), fCharge(-99), fType(kUndef), @@ -83,6 +84,7 @@ AliAODTrack::AliAODTrack(Short_t id, fFilterMap(selectInfo), fTPCClusterMap(), fTPCSharedMap(), + fTPCnclsF(0), fID(id), fCharge(charge), fType(ttype), @@ -130,6 +132,7 @@ AliAODTrack::AliAODTrack(Short_t id, fFilterMap(selectInfo), fTPCClusterMap(), fTPCSharedMap(), + fTPCnclsF(0), fID(id), fCharge(charge), fType(ttype), @@ -171,6 +174,7 @@ AliAODTrack::AliAODTrack(const AliAODTrack& trk) : fFilterMap(trk.fFilterMap), fTPCClusterMap(trk.fTPCClusterMap), fTPCSharedMap(trk.fTPCSharedMap), + fTPCnclsF(trk.fTPCnclsF), fID(trk.fID), fCharge(trk.fCharge), fType(trk.fType), @@ -346,27 +350,22 @@ AliAODTrack::AODTrkPID_t AliAODTrack::GetMostProbablePID() const // Returns the most probable PID array element. Int_t nPID = 10; - if (fPID) { - AODTrkPID_t loc = kUnknown; - Double_t max = 0.; - Bool_t allTheSame = kTRUE; - - for (Int_t iPID = 0; iPID < nPID; iPID++) { - if (fPID[iPID] >= max) { - if (fPID[iPID] > max) { - allTheSame = kFALSE; - max = fPID[iPID]; - loc = (AODTrkPID_t)iPID; - } else { - allTheSame = kTRUE; - } + AODTrkPID_t loc = kUnknown; + Double_t max = 0.; + Bool_t allTheSame = kTRUE; + + for (Int_t iPID = 0; iPID < nPID; iPID++) { + if (fPID[iPID] >= max) { + if (fPID[iPID] > max) { + allTheSame = kFALSE; + max = fPID[iPID]; + loc = (AODTrkPID_t)iPID; + } else { + allTheSame = kTRUE; } } - - return allTheSame ? kUnknown : loc; - } else { - return kUnknown; } + return allTheSame ? kUnknown : loc; } //______________________________________________________________________________ @@ -566,3 +565,58 @@ Bool_t AliAODTrack::GetPxPyPz(Double_t p[3]) const p[0]=Px(); p[1]=Py(); p[2]=Pz(); return kTRUE; } + +//______________________________________________________________________________ +Float_t AliAODTrack::GetTPCClusterInfo(Int_t nNeighbours/*=3*/, Int_t type/*=0*/, Int_t row0, Int_t row1) const +{ + // + // TPC cluster information + // type 0: get fraction of found/findable clusters with neighbourhood definition + // 1: findable clusters with neighbourhood definition + // 2: found clusters + // + // definition of findable clusters: + // a cluster is defined as findable if there is another cluster + // within +- nNeighbours pad rows. The idea is to overcome threshold + // effects with a very simple algorithm. + // + + if (type==2) return fTPCClusterMap.CountBits(); + + Int_t found=0; + Int_t findable=0; + Int_t last=-nNeighbours; + + for (Int_t i=row0; i0) + fraction=(Float_t)found/(Float_t)findable; + else + fraction=0; + return fraction; + } + return 0; // undefined type - default value +}