AliAnalysisCuts(const char* name, const char* title);
AliAnalysisCuts(const AliAnalysisCuts& obj);
virtual ~AliAnalysisCuts() {;}
- virtual Bool_t IsSelected(TObject* /* obj */ ) {return kFALSE;}
- virtual Bool_t IsSelected(TList* /* list */ ) = 0;
+ virtual Bool_t IsSelected(TObject* track, TObject *event=0) = 0;
+ //virtual Bool_t IsSelected(TList* list) = 0;
virtual void Init() {;}
virtual void SetFilterMask(UInt_t mask) {fFilterMask = mask;}
virtual UInt_t GetFilterMask() const {return fFilterMask;}
return *this;
}
-UInt_t AliAnalysisFilter::IsSelected(TObject* obj)
+UInt_t AliAnalysisFilter::IsSelected(TObject* track, TObject* event)
{
//
// Loop over all set of cuts
Int_t iCutB = 1;
while((cuts = (AliAnalysisCuts*)next())) {
- Bool_t acc = cuts->IsSelected(obj);
+ Bool_t acc = cuts->IsSelected(track, event);
if ((filterMask = cuts->GetFilterMask()) > 0) {
acc = (acc && (filterMask == result));
}
return result;
}
+/*
UInt_t AliAnalysisFilter::IsSelected(TList* list)
{
//
return result;
}
-
+*/
void AliAnalysisFilter::Init()
{
//
AliAnalysisFilter(const AliAnalysisFilter& obj);
AliAnalysisFilter& operator=(const AliAnalysisFilter& other);
virtual ~AliAnalysisFilter() {;}
- virtual UInt_t IsSelected(TObject* obj);
- virtual UInt_t IsSelected(TList* obj);
+ virtual UInt_t IsSelected(TObject* track, TObject *event = 0);
+ //virtual UInt_t IsSelected(TList* obj);
virtual Bool_t IsSelected(char* name);
virtual void AddCuts(AliAnalysisCuts* cuts);
virtual void Init();
\r
usedTrack[idxBachFromCascade] = kTRUE;\r
UInt_t selectInfo = 0;\r
- if (fTrackFilter) selectInfo = fTrackFilter->IsSelected(esdCascadeBach);\r
+ if (fTrackFilter) selectInfo = fTrackFilter->IsSelected(esdCascadeBach,esd);\r
if(mcH)mcH->SelectParticle(esdCascadeBach->GetLabel());\r
aodTrack = new(tracks[jTracks++]) AliAODTrack(esdCascadeBach->GetID(),\r
esdCascadeBach->GetLabel(), \r
usedTrack[idxPosFromV0Dghter] = kTRUE;\r
\r
UInt_t selectInfo = 0;\r
- if (fTrackFilter) selectInfo = fTrackFilter->IsSelected(esdCascadePos);\r
+ if (fTrackFilter) selectInfo = fTrackFilter->IsSelected(esdCascadePos,esd);\r
if(mcH) mcH->SelectParticle(esdCascadePos->GetLabel());\r
aodTrack = new(tracks[jTracks++]) AliAODTrack( esdCascadePos->GetID(),\r
esdCascadePos->GetLabel(), \r
usedTrack[idxNegFromV0Dghter] = kTRUE;\r
\r
UInt_t selectInfo = 0;\r
- if (fTrackFilter) selectInfo = fTrackFilter->IsSelected(esdCascadeNeg);\r
+ if (fTrackFilter) selectInfo = fTrackFilter->IsSelected(esdCascadeNeg,esd);\r
if(mcH)mcH->SelectParticle(esdCascadeNeg->GetLabel());\r
aodTrack = new(tracks[jTracks++]) AliAODTrack( esdCascadeNeg->GetID(),\r
esdCascadeNeg->GetLabel(),\r
v0objects.AddAt(esdVtx, 3);\r
UInt_t selectV0 = 0;\r
if (fV0Filter) {\r
- selectV0 = fV0Filter->IsSelected(&v0objects);\r
+ selectV0 = fV0Filter->IsSelected(&v0objects,esd);\r
// this is a little awkward but otherwise the \r
// list wants to access the pointer (delete it) \r
// again when going out of scope\r
if (!usedTrack[posFromV0]) {\r
usedTrack[posFromV0] = kTRUE;\r
UInt_t selectInfo = 0;\r
- if (fTrackFilter) selectInfo = fTrackFilter->IsSelected(esdV0Pos);\r
+ if (fTrackFilter) selectInfo = fTrackFilter->IsSelected(esdV0Pos,esd);\r
if(mcH)mcH->SelectParticle(esdV0Pos->GetLabel());\r
aodTrack = new(tracks[jTracks++]) AliAODTrack(esdV0Pos->GetID(),\r
esdV0Pos->GetLabel(), \r
if (!usedTrack[negFromV0]) {\r
usedTrack[negFromV0] = kTRUE;\r
UInt_t selectInfo = 0;\r
- if (fTrackFilter) selectInfo = fTrackFilter->IsSelected(esdV0Neg);\r
+ if (fTrackFilter) selectInfo = fTrackFilter->IsSelected(esdV0Neg,esd);\r
if(mcH)mcH->SelectParticle(esdV0Neg->GetLabel());\r
aodTrack = new(tracks[jTracks++]) AliAODTrack(esdV0Neg->GetID(),\r
esdV0Neg->GetLabel(),\r
\r
UInt_t selectInfo = 0;\r
if (fTrackFilter) {\r
- selectInfo = fTrackFilter->IsSelected(esd->GetTrack(imother));\r
+ selectInfo = fTrackFilter->IsSelected(esd->GetTrack(imother),esd);\r
if (!selectInfo) continue;\r
}\r
\r
esdTrackD->GetCovarianceXYZPxPyPz(covTr);\r
esdTrackD->GetESDpid(pid);\r
selectInfo = 0;\r
- if (fTrackFilter) selectInfo = fTrackFilter->IsSelected(esdTrackD);\r
+ if (fTrackFilter) selectInfo = fTrackFilter->IsSelected(esdTrackD,esd);\r
if(mcH)mcH->SelectParticle(esdTrackD->GetLabel());\r
daughter = \r
new(tracks[jTracks++]) AliAODTrack(esdTrackD->GetID(),\r
//\r
// Track selection\r
if (fTrackFilter) {\r
- selectInfo = fTrackFilter->IsSelected(esdTrack);\r
+ selectInfo = fTrackFilter->IsSelected(esdTrack,esd);\r
if (!selectInfo && !vtx->UsesTrack(esdTrack->GetID())) continue;\r
}\r
\r
// Track selection
UInt_t selectInfo = 0;
if (fTrackFilter) {
- selectInfo = fTrackFilter->IsSelected(part);
+ selectInfo = fTrackFilter->IsSelected(part,0);
if (!selectInfo) continue;
}
//
// Track selection
if (fTrackFilter) {
- selectInfo = fTrackFilter->IsSelected(part);
+ selectInfo = fTrackFilter->IsSelected(part,0);
if (!selectInfo) continue;
}
#include <TString.h>
#include "AliESDtrack.h"
+#include "AliESDEvent.h"
#include "AliLog.h"
-#include "AliTPCpidESD.h"
-#include "AliTOFpidESD.h"
+#include "AliESDpid.h"
#include "AliESDpidCuts.h"
//_____________________________________________________________________
AliESDpidCuts::AliESDpidCuts(const Char_t *name, const Char_t *title):
AliAnalysisCuts(name, title)
- , fTPCpid(NULL)
- , fTOFpid(NULL)
+ , fESDpid(NULL)
, fTPCsigmaCutRequired(0)
, fTOFsigmaCutRequired(0)
, fCutTPCclusterRatio(0.)
// Default constructor
//
- fTPCpid = new AliTPCpidESD;
- fTOFpid = new AliTOFpidESD;
+ fESDpid = new AliESDpid;
memset(fCutTPCnSigma, 0, sizeof(Float_t) * 2);
memset(fCutTOFnSigma, 0, sizeof(Float_t) * 2);
//_____________________________________________________________________
AliESDpidCuts::AliESDpidCuts(const AliESDpidCuts &ref):
AliAnalysisCuts(ref)
- , fTPCpid(NULL)
- , fTOFpid(NULL)
+ , fESDpid(NULL)
, fTPCsigmaCutRequired(ref.fTPCsigmaCutRequired)
, fTOFsigmaCutRequired(ref.fTOFsigmaCutRequired)
, fCutTPCclusterRatio(ref.fCutTPCclusterRatio)
//
// Copy constructor
//
- fTPCpid = new AliTPCpidESD(*ref.fTPCpid);
- fTOFpid = new AliTOFpidESD(*ref.fTOFpid);
+ fESDpid = new AliESDpid(*ref.fESDpid);
memcpy(fCutTPCnSigma, ref.fCutTPCnSigma, sizeof(Float_t) * AliPID::kSPECIES * 2);
memcpy(fCutTOFnSigma, ref.fCutTOFnSigma, sizeof(Float_t) * AliPID::kSPECIES * 2);
//
// Destructor
//
- delete fTPCpid;
- delete fTOFpid;
+ delete fESDpid;
delete fHcutStatistics;
delete fHcutCorrelation;
}
//_____________________________________________________________________
-Bool_t AliESDpidCuts::IsSelected(TObject *o){
+Bool_t AliESDpidCuts::IsSelected(TObject *track, TObject *event){
//
// Select Track
//
- if(TString(o->IsA()->GetName()).CompareTo("AliESDtrack")){
+ if(TString(track->IsA()->GetName()).CompareTo("AliESDtrack")){
Char_t errormessage[256];
- sprintf(errormessage, "Provided object not an AliESDtrack: Type %s", o->IsA()->GetName());
+ sprintf(errormessage, "Provided object not an AliESDtrack: Type %s", track->IsA()->GetName());
AliError(errormessage);
return kFALSE;
}
- return AcceptTrack(const_cast<const AliESDtrack *>(dynamic_cast<AliESDtrack *>(o)));
+ return AcceptTrack(const_cast<const AliESDtrack *>(dynamic_cast<AliESDtrack *>(track)),dynamic_cast<AliESDEvent *>(event));
}
//_____________________________________________________________________
//
AliESDpidCuts &target = dynamic_cast<AliESDpidCuts &>(c);
- target.fTPCpid = new AliTPCpidESD;
- target.fTOFpid = new AliTOFpidESD;
+ target.fESDpid = new AliESDpid(*fESDpid);
target.fCutTPCclusterRatio = fCutTPCclusterRatio;
target.fMinMomentumTOF = fMinMomentumTOF;
}
//_____________________________________________________________________
-Bool_t AliESDpidCuts::AcceptTrack(const AliESDtrack *track){
+Bool_t AliESDpidCuts::AcceptTrack(const AliESDtrack *track, const AliESDEvent *event){
//
// Check whether the tracks survived the cuts
//
kCutNsigmaTOF
};
Long64_t cutRequired=0, cutFullfiled = 0;
+ if(fTOFsigmaCutRequired && event == 0)
+ AliError("No event pointer. Need event pointer for T0 for TOF cut");
Double_t clusterRatio = track->GetTPCNclsF() ? static_cast<Float_t>(track->GetTPCNcls())/static_cast<Float_t>(track->GetTPCNclsF()) : 1.;
if(fCutTPCclusterRatio > 0.){
SETBIT(cutRequired, kCutClusterRatioTPC);
// check TPC nSigma cut
Float_t nsigmaTPC[AliPID::kSPECIES], nsigma; // need all sigmas for QA plotting
for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){
- nsigmaTPC[ispec] = nsigma = fTPCpid->GetNumberOfSigmas(track, static_cast<AliPID::EParticleType>(ispec));
+ nsigmaTPC[ispec] = nsigma = fESDpid->NumberOfSigmasTPC(track,(AliPID::EParticleType)ispec);
if(!(fTPCsigmaCutRequired & 1 << ispec)) continue;
SETBIT(cutRequired, kCutNsigmaTPC); // We found at least one species where the n-Sigma Cut is required
if(nsigma >= fCutTPCnSigma[2*ispec] && nsigma <= fCutTPCnSigma[2*ispec+1]) SETBIT(cutFullfiled, kCutNsigmaTPC); // Fullfiled for at least one species
// check TOF nSigma cut
Float_t nsigmaTOF[AliPID::kSPECIES]; // see above
Bool_t hasTOFpid = track->GetStatus() & AliESDtrack::kTOFpid; // only apply TOF n-sigma cut when PID Status Bit is set
+ Double_t times[AliPID::kSPECIES];
+ track->GetIntegratedTimes(times);
for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++){
- if(hasTOFpid) nsigmaTOF[ispec] = nsigma = fTOFpid->GetNumberOfSigmas(track, static_cast<AliPID::EParticleType>(ispec));
+
+ if(hasTOFpid) nsigmaTOF[ispec] = nsigma = fESDpid->NumberOfSigmasTOF(track,(AliPID::EParticleType)ispec, event->GetT0());
if(!(fTOFsigmaCutRequired && 1 << ispec)) continue;
SETBIT(cutRequired, kCutNsigmaTOF);
if(track->GetOuterParam()->P() >= fMinMomentumTOF){
class TH2I;
class TList;
class AliESDtrack;
-class AliTPCpidESD;
-class AliTOFpidESD;
+class AliESDEvent;
+class AliESDpid;
class AliESDpidCuts : public AliAnalysisCuts{
enum{
void DefineHistograms(Color_t color = kRed);
void DrawHistograms();
void SaveHistograms(const Char_t *location = NULL);
- virtual Bool_t IsSelected(TObject *o);
- virtual Bool_t IsSelected(TList *) { return kTRUE; }
- virtual Bool_t AcceptTrack(const AliESDtrack *track);
+ virtual Bool_t IsSelected(TObject *track, TObject *event);
+ //virtual Bool_t IsSelected(TList *) { return kTRUE; }
+ virtual Bool_t AcceptTrack(const AliESDtrack *track, const AliESDEvent *event);
void SetTPCclusterRatioCut(Float_t clr) { fCutTPCclusterRatio = clr; }
inline void SetTPCnSigmaCut(AliPID::EParticleType itype, Float_t nSigma);
protected:
static const Int_t kNcuts; // Number of Cuts
- AliTPCpidESD *fTPCpid; //! TPC PID (n-sigma cut)
- AliTOFpidESD *fTOFpid; //! TOF PID (n-sigma-cut)
+ AliESDpid *fESDpid; //! PID helper (n-sigma-cut)
Char_t fTPCsigmaCutRequired; // Sigma cut Requirement for TPC and Particle Species
Char_t fTOFsigmaCutRequired; // Sigma cut Requirement for TOF and Particle Species
Float_t fCutTPCnSigma[AliPID::kSPECIES * 2]; // Species dependent cut on the distance to the TPC dE/dx line
TH1F *fHnSigmaTOF[AliPID::kSPECIES][2]; // TOF n-sigma cut
//------------------------------------------
- ClassDef(AliESDpidCuts, 1)
+ ClassDef(AliESDpidCuts, 2)
};
//_____________________________________________________________________
AliESDtrackCuts(const Char_t* name = "AliESDtrackCuts", const Char_t* title = "");
virtual ~AliESDtrackCuts();
- Bool_t IsSelected(TObject* obj)
- {return AcceptTrack((AliESDtrack*)obj);}
- Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
+ Bool_t IsSelected(TObject* track, TObject * /*event*/=0)
+ {return AcceptTrack((AliESDtrack*)track);}
+ //Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
Bool_t AcceptTrack(AliESDtrack* esdTrack);
TObjArray* GetAcceptedTracks(AliESDEvent* esd, Bool_t bTPC = kFALSE);
virtual ~AliPhysicsSelection();
// AliAnalysisCuts interface
- virtual Bool_t IsSelected(TObject* obj) { return IsCollisionCandidate((const AliESDEvent*) obj); }
- virtual Bool_t IsSelected(TList*) { return kFALSE; }
+ virtual Bool_t IsSelected(TObject* obj, TObject* /*event*/ = 0) { return IsCollisionCandidate((const AliESDEvent*) obj); }
+ //virtual Bool_t IsSelected(TList*) { return kFALSE; }
Bool_t IsCollisionCandidate(const AliESDEvent* aEsd);
Bool_t Initialize(UInt_t runNumber);
}
//______________________________________________________________
-Bool_t AliCFAcceptanceCuts::IsSelected(TObject *obj) {
+Bool_t AliCFAcceptanceCuts::IsSelected(TObject *obj, TObject *obj2) {
//
// check if selections on 'obj' are passed
// 'obj' must be an AliMCParticle
AliCFAcceptanceCuts(const AliCFAcceptanceCuts& c) ;
AliCFAcceptanceCuts& operator=(const AliCFAcceptanceCuts& c) ;
virtual ~AliCFAcceptanceCuts() { };
- virtual Bool_t IsSelected(TObject* obj) ;
- virtual Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
+ virtual Bool_t IsSelected(TObject* obj, TObject *obj2 = 0) ;
+ //virtual Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
virtual void SetMCEventInfo(const TObject* mcInfo) ;
void SetMinNHitITS (Int_t nhits) {fMinNHitITS=nhits;}
void SetMinNHitTPC (Int_t nhits) {fMinNHitTPC=nhits;}
}
//____________________________________________________________________
-Bool_t AliCFEventClassCuts::IsSelected(TObject* obj) {
+Bool_t AliCFEventClassCuts::IsSelected(TObject* obj, TObject * /* obj2 */) {
//
//Check if the requested cuts are passed
//
AliCFEventClassCuts(const AliCFEventClassCuts& c) ;
AliCFEventClassCuts& operator=(const AliCFEventClassCuts& c) ;
~AliCFEventClassCuts();
- Bool_t IsSelected(TObject* obj);
- Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
+ Bool_t IsSelected(TObject* obj, TObject *obj2 = 0);
+ //Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
//Association to The Trigger bits in the mask.
//They correspond to the PP running descriptor as in
return *this ;
}
//____________________________________________________________________
-Bool_t AliCFEventGenCuts::IsSelected(TObject* obj) {
+Bool_t AliCFEventGenCuts::IsSelected(TObject* obj, TObject * /* obj2 */) {
//
//Check if the requested cuts are passed
//
AliCFEventGenCuts(const AliCFEventGenCuts& c) ;
AliCFEventGenCuts& operator=(const AliCFEventGenCuts& c) ;
~AliCFEventGenCuts();
- Bool_t IsSelected(TObject* obj);
- Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
+ Bool_t IsSelected(TObject* obj, TObject *obj2 = 0);
+ //Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
//number of embedded cuts
enum{kNCuts=5};
}
//____________________________________________________________________
-Bool_t AliCFEventRecCuts::IsSelected(TObject* obj) {
+Bool_t AliCFEventRecCuts::IsSelected(TObject* obj, TObject * /* obj2 */) {
//
//Check if the requested cuts are passed
//
AliCFEventRecCuts(const AliCFEventRecCuts& c) ;
AliCFEventRecCuts& operator=(const AliCFEventRecCuts& c) ;
~AliCFEventRecCuts();
- Bool_t IsSelected(TObject* obj);
- Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
+ Bool_t IsSelected(TObject* obj, TObject *obj2 = 0);
+ //Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
void SetNTracksCut(Int_t xMin=-1, Int_t xMax=1000000) {fNTracksMin=xMin; fNTracksMax=xMax;} // cut values setter
}
//__________________________________________________________
-Bool_t AliCFPairAcceptanceCuts::IsSelected(TObject* obj) {
+Bool_t AliCFPairAcceptanceCuts::IsSelected(TObject* obj, TObject* /* obj2 */) {
//
// checks the number of track references associated to 'obj'
// 'obj' must be an AliMCParticle
AliCFPairAcceptanceCuts(const AliCFPairAcceptanceCuts& c) ;
AliCFPairAcceptanceCuts& operator=(const AliCFPairAcceptanceCuts& c) ;
virtual ~AliCFPairAcceptanceCuts() {delete fCutNeg; delete fCutPos; }
- Bool_t IsSelected(TObject* obj) ;
- Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
+ Bool_t IsSelected(TObject* obj, TObject *obj2) ;
+// Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
virtual void SetMCEventInfo(const TObject *mcInfo) ;
virtual AliCFAcceptanceCuts* GetNegCut() const {return fCutNeg;}
virtual AliCFAcceptanceCuts* GetPosCut() const {return fCutPos;}
}
//______________________________
-Bool_t AliCFParticleGenCuts::IsSelected(TObject* obj) {
+Bool_t AliCFParticleGenCuts::IsSelected(TObject* obj, TObject * /* obj2 */ ) {
//
// check if selections on 'obj' are passed
// 'obj' must be an AliMCParticle
AliCFParticleGenCuts (const AliCFParticleGenCuts& c) ;
AliCFParticleGenCuts& operator=(const AliCFParticleGenCuts& c) ;
virtual ~AliCFParticleGenCuts() { };
- virtual Bool_t IsSelected(TObject* obj) ;
- Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
+ virtual Bool_t IsSelected(TObject* obj, TObject *obj2 = 0) ;
+ //Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
virtual void SetMCEventInfo(const TObject* mcEvent) ;
void SetAODMC(Bool_t flag) {fIsAODMC=flag;}
return iPart;
}
//___________________________________________
-Bool_t AliCFTrackCutPid::IsSelected(TObject *track){
+Bool_t AliCFTrackCutPid::IsSelected(TObject *track, TObject * /* event */){
//
// method for the pid-cut selction
//
//main
- virtual Bool_t IsSelected(TObject *track);
- Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
+ virtual Bool_t IsSelected(TObject *track, TObject *event = 0);
+ //Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
//histos are added to a list
void AddQAHistograms(TList *qalist);
return;
}
//__________________________________________________________________________________
-Bool_t AliCFTrackIsPrimaryCuts::IsSelected(TObject* obj) {
+Bool_t AliCFTrackIsPrimaryCuts::IsSelected(TObject* obj, TObject *obj2) {
//
// loops over decisions of single cuts and returns if the track is accepted
//
~AliCFTrackIsPrimaryCuts();
void Copy(TObject &c) const;
- Bool_t IsSelected(TObject* obj);
- Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
+ Bool_t IsSelected(TObject* obj, TObject *obj2 = 0);
+ //Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
// cut value setter
void UseSPDvertex(Bool_t b=kFALSE);
return;
}
//__________________________________________________________________________________
-Bool_t AliCFTrackKineCuts::IsSelected(TObject* obj) {
+Bool_t AliCFTrackKineCuts::IsSelected(TObject* obj, TObject * /* obj2 */) {
//
// loops over decisions of single cuts and returns if the track is accepted
//
~AliCFTrackKineCuts();
void Copy(TObject &c) const;
- Bool_t IsSelected(TObject* obj);
- Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
+ Bool_t IsSelected(TObject* obj, TObject *obj2 = 0);
+ //Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
// cut value setter
void SetMomentumRange(Double_t momentumMin=0., Double_t momentumMax=1e99) {fMomentumMin=momentumMin; fMomentumMax=momentumMax;}
return;
}
//__________________________________________________________________________________
-Bool_t AliCFTrackQualityCuts::IsSelected(TObject* obj) {
+Bool_t AliCFTrackQualityCuts::IsSelected(TObject* obj, TObject *obj2) {
//
// loops over decisions of single cuts and returns if the track is accepted
//
~AliCFTrackQualityCuts();
void Copy(TObject &c) const;
- Bool_t IsSelected(TObject* obj);
- Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
+ Bool_t IsSelected(TObject* obj, TObject *obj2 = 0);
+ //Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
// cut value setter
void SetMinNClusterTPC(Int_t cluster=-1) {fMinNClusterTPC = cluster;}
*/
// #################################################################################
-Bool_t AliHLTJETJetCuts::IsSelected( TObject *obj ) {
+Bool_t AliHLTJETJetCuts::IsSelected( TObject *obj, TObject *obj2 ) {
// see header file for class documentation
Bool_t bResult = kTRUE;
@param obj AliHLTJETConeJetCandidate or AliAODJet
@return kTRUE if selected, kFALSE otherwise
*/
- Bool_t IsSelected( TObject* obj );
+ Bool_t IsSelected( TObject* obj, TObject *obj2= 0 );
/** Select jet
@param jet AliHLTJETConeJetCandidate jet
*/
// #################################################################################
-Bool_t AliHLTJETTrackCuts::IsSelected( TObject *obj ) {
+Bool_t AliHLTJETTrackCuts::IsSelected( TObject *obj, TObject *obj2 ) {
// see header file for class documentation
Bool_t bResult = kTRUE;
@param obj esd track or particle
@return kTRUE if selected, kFALSE otherwise
*/
- Bool_t IsSelected( TObject* obj );
+ Bool_t IsSelected( TObject* obj, TObject *obj2 = 0 );
/** Select track
@param particle particle
*/
// #################################################################################
-Bool_t AliHLTJETConeSeedCuts::IsSelected( TObject *obj ) {
+Bool_t AliHLTJETConeSeedCuts::IsSelected( TObject *obj, TObject *obj2 ) {
// see header file for class documentation
Bool_t bResult = kTRUE;
@param obj esd track or particle
@return kTRUE if selected, kFALSE otherwise
*/
- Bool_t IsSelected( TObject* obj );
+ Bool_t IsSelected( TObject* obj, TObject *obj2 = 0 );
/** Select track
@param particle particle
#include "AliHMPIDReconstructor.h" //class header
#include "AliHMPID.h" //Reconstruct()
#include "AliHMPIDCluster.h" //Dig2Clu()
-#include "AliHMPIDPid.h" //FillEsd()
-#include "AliHMPIDParam.h" //FillEsd()
+//#include "AliHMPIDPid.h" //FillEsd()
+//#include "AliHMPIDParam.h" //FillEsd()
#include <AliCDBEntry.h> //ctor
#include <AliCDBManager.h> //ctor
#include <AliESDEvent.h> //FillEsd()
// Fill ESD with all the infos from HMPID
// Probability vector from AliHMPIDPid
//...
+ /*
AliHMPIDPid pID;
Double_t prob[AliPID::kSPECIES];
pID.FindPid(pTrk,AliPID::kSPECIES,prob);
pTrk->SetHMPIDpid(prob);
}//ESD tracks loop
-
+ */
}//FillESD()
if(pTrk->GetHMPIDsignal()<0) continue;
+ /* Probabilies are set in AliReconstruction/AliPIDesd
AliHMPIDPid pID;
Double_t prob[5];
pID.FindPid(pTrk,5,prob);
pTrk->SetHMPIDpid(prob);
// Printf(" Prob e- %6.2f mu %6.2f pi %6.2f k %6.2f p %6.2f",prob[0]*100,prob[1]*100,prob[2]*100,prob[3]*100,prob[4]*100);
-
+ */
delete hmpTrk;hmpTrk=0x0;
}//iTrk
}
}
//
+ /*
if(!reconHTA.CkovHiddenTrk(pTrk,(TClonesArray *)pClus->At(ipCh),indMip,nmean)) { //search for track parameters and Cerenkov angle of this track
AliHMPIDPid pID;
Double_t prob[5];
pID.FindPid(pTrk,5,prob);
pTrk->SetHMPIDpid(prob);
}
+ */
// Printf(" Prob e- %6.2f mu %6.2f pi %6.2f k %6.2f p %6.2f",prob[0]*100,prob[1]*100,prob[2]*100,prob[3]*100,prob[4]*100);
}//iTrk
/**********************************************************************/
AliITSLoader::AliITSLoader():AliLoader(),
-fITSpid(0),
fGeom(0){
// Default constructor
}
/*********************************************************************/
AliITSLoader::AliITSLoader(const Char_t *name,const Char_t *topfoldername):
AliLoader(name,topfoldername),
-fITSpid(0),
fGeom(0){
//Constructor
AliDataLoader* rawClustersDataLoader = new AliDataLoader(
/**********************************************************************/
AliITSLoader::AliITSLoader(const Char_t *name,TFolder *topfolder):
AliLoader(name,topfolder),
-fITSpid(0),
fGeom(0){
//ctor
AliDataLoader* rawClustersDataLoader = new AliDataLoader(
// readout from file can be forced if force=kTRUE
AliITSgeom* GetITSgeom(Bool_t force=kFALSE);
void SetITSgeom(AliITSgeom* g);
- // PID
- AliITSpidESD* GetITSpid() const {return fITSpid;}
- void AdoptITSpid(AliITSpidESD* pid) {fITSpid=pid;}
protected:
AliITSLoader(const AliITSLoader &ob); // copy constructor
static const TString fgkDefaultVerticesContainerName; //default for primary vertices container name
static const TString fgkDefaultV0ContainerName; //default for V0 container name
static const TString fgkDefaultCascadeContainerName; //default fo cascade container name
- AliITSpidESD* fITSpid; //! pointer for ITS pid
AliITSgeom *fGeom; //! pointer to the ITS geometry class
- ClassDef(AliITSLoader,5) // Loader for additional ITS specific trees.
+ ClassDef(AliITSLoader,6) // Loader for additional ITS specific trees.
};
#endif
+++ /dev/null
-//////////////////////////////////////////////////////////////////////////
-// USER Class for PID in the ITS //
-//The PID is based on the likelihood of all the four ITS' layers, //
-//without using the truncated mean for the dE/dx. The response //
-//functions for each layer are convoluted Landau-Gaussian functions. //
-// Origin: Elena Bruna bruna@to.infn.it,, Massimo Masera masera@to.infn.it//
-//////////////////////////////////////////////////////////////////////////
-#include "AliESDtrack.h"
-#include "AliITSPidParams.h"
-#include "AliPID.h"
-#include "AliITSPident.h"
-
-ClassImp(AliITSPident)
- //_______________________________________________________________________
-AliITSPident::AliITSPident():
-fPBayesp(0),
-fPBayesk(0),
-fPBayespi(0),
-fPPriorip(0),
-fPPriorik(0),
-fPPrioripi(0),
-fPPriorie(0)
-{
- // default constructor
- for (Int_t i=0;i<8;i++){
- fCondFunProLay[i]=0;
- fCondFunKLay[i]=0;
- fCondFunPiLay[i]=0;
- }
-}
-//_______________________________________________________________________
-AliITSPident::~AliITSPident(){
- // destructor
-}
-//_______________________________________________________________________
-AliITSPident::AliITSPident(Double_t mom,AliITSPidParams *pars, Double_t *Qlay,Double_t priorip,Double_t priorik,Double_t prioripi,Double_t priorie):
-fPBayesp(0),
-fPBayesk(0),
-fPBayespi(0),
-fPPriorip(priorip),
-fPPriorik(priorik),
-fPPrioripi(prioripi),
-fPPriorie(priorie)
-{
- //
- CalculateResponses(mom,pars,Qlay);
-}
-//__________________________________________________________________________________________
-AliITSPident::AliITSPident(AliESDtrack *track,AliITSPidParams *pars,Double_t priorip,Double_t priorik,Double_t prioripi,Double_t priorie):
-fPBayesp(0),
-fPBayesk(0),
-fPBayespi(0),
-fPPriorip(priorip),
-fPPriorik(priorik),
-fPPrioripi(prioripi),
-fPPriorie(priorie)
-{
- //
- Double_t mom=track->GetP();
- Double_t Qlay[4]={0.,0.,0.,0.};
- track->GetITSdEdxSamples(Qlay);
- CalculateResponses(mom,pars,Qlay);
-}
-//_______________________________________________________________________
-void AliITSPident::CalculateResponses(Double_t mom,AliITSPidParams *pars, Double_t *Qlay){
- // calculates conditional probabilities
-
- for (Int_t i=0;i<8;i++){
- fCondFunProLay[i]=-1;
- fCondFunKLay[i]=-1;
- fCondFunPiLay[i]=-1;
- }
-
- for(Int_t iLay=0; iLay<4; iLay++){//loop on layers (3=SDD inner 6=SSD outer)
- Double_t dedx=Qlay[iLay];
- if(dedx>0){
- fCondFunProLay[iLay]=pars->GetLandauGausNorm(dedx,AliPID::kProton,mom,iLay+3);
- if(mom<0.4 && dedx<100)fCondFunProLay[iLay]=0.00001;
- if(mom<0.4 &&dedx<50)fCondFunProLay[iLay]=0.0000001;
- fCondFunKLay[iLay]=pars->GetLandauGausNorm(dedx,AliPID::kKaon,mom,iLay+3);
- if(mom<0.25 && dedx<100)fCondFunKLay[iLay]=0.00001;
- if(mom<0.4 &&dedx<30)fCondFunKLay[iLay]=0.0000001;
- fCondFunPiLay[iLay]=pars->GetLandauGausNorm(dedx,AliPID::kPion,mom,iLay+3);
- if(mom<0.6 &&dedx<20)fCondFunPiLay[iLay]=0.001;
- }
- }
- Double_t prior[4];
- Double_t condFun[8][3];
-
- prior[0]=fPPriorip;
- prior[1]=fPPriorik;
- prior[2]=fPPrioripi;
- prior[3]=fPPriorie;
- for(Int_t iLay=0;iLay<8;iLay++){
- condFun[iLay][0]= fCondFunProLay[iLay];
- condFun[iLay][1]= fCondFunKLay[iLay];
- condFun[iLay][2]= fCondFunPiLay[iLay];
- }
-
- fPBayesp=CookCombinedBayes(condFun,prior,0);
- fPBayesk=CookCombinedBayes(condFun,prior,1);
- fPBayespi=CookCombinedBayes(condFun,prior,2);
-}
-//_______________________________________________________________________
-Double_t AliITSPident::GetProdCondFunPro() const {
- //Product of conditional probability functions for protons
- Double_t rv=1.;
- for(Int_t i=0;i<8;i++){
- Double_t fun=GetCondFunPro(i);
- if(fun>=0)rv*=fun;
- }
- return rv;
-}//_______________________________________________________________________
-Double_t AliITSPident::GetProdCondFunK() const {
- //Product of conditional probability functions for kaons
- Double_t rv=1.;
- for(Int_t i=0;i<8;i++){
- Double_t fun=GetCondFunK(i);
- if(fun>=0)rv*=fun;
- }
- return rv;
-}
-//_______________________________________________________________________
-Double_t AliITSPident::GetProdCondFunPi() const {
- //Product of conditional probability functions for pions
- Double_t rv=1.;
- for(Int_t i=0;i<8;i++){
- Double_t fun=GetCondFunPi(i);
- if(fun>=0)rv*=fun;
- }
- return rv;
-}
-//_______________________________________________________________________
-Double_t AliITSPident::CookCombinedBayes(Double_t condfun[][3],Double_t *prior,Int_t part)const {
- //Bayesian combined PID in the ITS
- Int_t test=0;
- Double_t bayes;
- Double_t pprior[4]={0,0,0,0};
- for(Int_t j=0;j<4;j++)pprior[j]=prior[j];
- pprior[2]+=pprior[3];//prior for electrons summed to priors for pions
- for(Int_t i=0;i<8;i++){//layer
- if (condfun[i][0]>0 || condfun[i][1]>0 ||condfun[i][2]>0) test++;
- }
-
- if(test>0){
- Double_t sum=CookSum(condfun,pprior);
- if ((pprior[0]!=0 || pprior[1]!=0 ||pprior[2]!=0)&&sum!=0.){
-
- bayes=pprior[part]*CookProd(condfun,part)*1/sum;
-
- }
- else bayes=-100;
- }
- else bayes=-100;
- return bayes;
-}
-//_______________________________________________________________________
-Double_t AliITSPident::CookProd(Double_t condfun[][3],Int_t part)const{
- //
- Double_t p=1;
- for(Int_t lay=0;lay<8;lay++){
- if(condfun[lay][part]>0.) p=p*condfun[lay][part];
- }
- return p;
-}
-//_______________________________________________________________________
-Double_t AliITSPident::CookSum(Double_t condfun[][3],Double_t *prior)const{
- //
- Double_t sum=0.;
- Double_t pprior[4]={0,0,0,0};
- for(Int_t j=0;j<4;j++) pprior[j]=prior[j];
- pprior[2]+=pprior[3];//prior for electrons summed to priors for pions
- for(Int_t i=0;i<3;i++){//sum over the particles--electrons excluded
- sum+=pprior[i]*CookProd(condfun,i);
- }
- return sum;
-
-}
+++ /dev/null
-#ifndef ALIITSPIDENT_H
-#define ALIITSPIDENT_H
-
-/////////////////////////////////////////////////////////////////////////
-//Class for PID in the ITS //
-//The PID is based on the likelihood of all the four ITS' layers, //
-//without using the truncated mean for the dE/dx. The response //
-//functions for each layer are convoluted Landau-Gaussian functions. //
-// Origin: Elena Bruna bruna@to.infn.it, Massimo Masera masera@to.infn.it//
-////////////////////////////////////////////////////////////////////////
-
-#include <TObject.h>
-class AliESDtrack;
-class TF1;
-class AliITSPidParams;
-
-class AliITSPident : public TObject{
-
- public:
- AliITSPident();
- AliITSPident(Double_t mom,AliITSPidParams *pars,Double_t *Qlay,Double_t priorip=0.066,Double_t priorik=0.103,Double_t prioripi=0.83,Double_t priorie=0.001);
-
- AliITSPident(AliESDtrack *track,AliITSPidParams *pars,Double_t priorip=0.066,Double_t priorik=0.103,Double_t prioripi=0.83,Double_t priorie=0.001);
-
- virtual ~AliITSPident();
- Double_t GetCondFunPro(Int_t lay) const {
- return fCondFunProLay[lay];
- }
- Double_t GetProdCondFunPro() const;
- Double_t GetCondFunK(Int_t lay) const {
- return fCondFunKLay[lay];
- }
- Double_t GetProdCondFunK() const;
- Double_t GetCondFunPi(Int_t lay) const {
- return fCondFunPiLay[lay];
- }
- Double_t GetProdCondFunPi() const;
-
- Double_t GetPBayesp()const {return fPBayesp;}
- Double_t GetPBayesk()const {return fPBayesk;}
- Double_t GetPBayespi()const {return fPBayespi;}
- Double_t GetPPriorip() const {return fPPriorip;}
- Double_t GetPPriorik() const {return fPPriorik;}
- Double_t GetPPrioripi() const {return fPPrioripi;}
- Double_t GetPPriorie() const {return fPPriorie;}
-
- private:
-
- void CalculateResponses(Double_t mom,AliITSPidParams *pars, Double_t *Qlay);
- Double_t CookCombinedBayes(Double_t condfun[][3],Double_t *prior,Int_t part)const;
- Double_t CookProd(Double_t condfun[][3],Int_t part) const;
- Double_t CookSum(Double_t condfun[][3],Double_t *prior) const;
-
- AliITSPident(const AliITSPident &ob); // copy constructor
- AliITSPident& operator=(const AliITSPident & ob); // ass. op.
-
- Double_t fCondFunProLay[8]; // one for each silicon layer
- Double_t fCondFunKLay[8]; // cond. prob. function kaons per layer
- Double_t fCondFunPiLay[8]; // cond. prob. function pions per layer
- Double_t fPBayesp; // Bayes prob.
- Double_t fPBayesk; // Bayes prob. for kaons
- Double_t fPBayespi; // Bayes prob. for pions
- Double_t fPPriorip; // Priori prob.
- Double_t fPPriorik; // Priori prob. for kaons
- Double_t fPPrioripi; // Priori prob. for pions
- Double_t fPPriorie; // Priori prob. for electrons
-
- ClassDef(AliITSPident,4);
-};
-#endif
#include "AliITSVertexerZ.h"
#include "AliITSVertexerCosmics.h"
#include "AliESDEvent.h"
-#include "AliITSpidESD.h"
-#include "AliITSpidESD1.h"
-#include "AliITSpidESD2.h"
#include "AliITSInitGeometry.h"
#include "AliITSTrackleterSPDEff.h"
//___________________________________________________________________________
AliITSReconstructor::AliITSReconstructor() : AliReconstructor(),
-fItsPID(0),
fDetTypeRec(0)
{
// Default constructor
//___________________________________________________________________________
AliITSReconstructor::~AliITSReconstructor(){
// destructor
- delete fItsPID;
if(fDetTypeRec) delete fDetTypeRec;
}
Int_t pidOpt = GetRecoParam()->GetPID();
AliITSReconstructor* nc = const_cast<AliITSReconstructor*>(this);
+ /*
if(pidOpt==1){
Info("FillESD","ITS LandauFitPID option has been selected\n");
nc->fItsPID = new AliITSpidESD2();
Double_t parITS[] = {79.,0.13, 5.}; //IB: this is "pp tuning"
nc->fItsPID = new AliITSpidESD1(parITS);
}
-
+ */
return tracker;
}
AliESDEvent* esd) const
{
// make PID, find V0s and cascade
+/* Now done in AliESDpid
if(fItsPID!=0) fItsPID->MakePID(esd);
else AliError("!! cannot do the PID !!");
+*/
}
class AliITSgeom;
class AliTracker;
class AliITStrackerMI;
-class AliITSpidESD;
class AliITSDetTypeRec;
class AliITSReconstructor: public AliReconstructor {
AliITSReconstructor& operator=(const AliITSReconstructor &); //Not implemented
//data
- AliITSpidESD *fItsPID; // Pid for ITS
AliITSDetTypeRec *fDetTypeRec; // reconstructor
ClassDef(AliITSReconstructor, 6) // class for the ITS reconstruction
#include <TDatabasePDG.h>
#include "AliITSdEdxAnalyzer.h"
#include "AliExternalTrackParam.h"
-#include "AliITSpidESD.h"
+//#include "AliITSpidESD.h"
+#include "AliITSPIDResponse.h"
#include "AliPID.h"
ClassImp(AliITSdEdxAnalyzer)
//______________________________________________________________________
Double_t AliITSdEdxAnalyzer::BetheBloch(const Float_t p, const Float_t m) const {
//
+ static AliITSPIDResponse pidResponse;
Double_t dedxbb=0.;
if(fBBmodel==0){
Double_t betagamma=p/m;
Double_t conv=fDensity*1E6*fThickness/116.24*fMIP;
dedxbb=conv*AliExternalTrackParam::BetheBlochSolid(betagamma);
}else if(fBBmodel==1){
- dedxbb=fMIP*AliITSpidESD::Bethe(p,m);
+ dedxbb=pidResponse.Bethe(p,m);
}
return dedxbb;
}
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-/* $Id$ */
-
-//-----------------------------------------------------------------
-// Implementation of the ITS PID class
-// Very naive one... Should be made better by the detector experts...
-// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
-//-----------------------------------------------------------------
-
-#include <TMath.h>
-
-#include "AliITSpidESD.h"
-#include "AliESDtrack.h"
-#include "AliExternalTrackParam.h"
-
-ClassImp(AliITSpidESD)
-
-
-//______________________________________________________________________
-AliITSpidESD::AliITSpidESD():TObject(){
- //Default constructor
-
-}
-
-Double_t AliITSpidESD::Bethe(Double_t p,Double_t mass) {
- // returns AliExternalTrackParam::BetheBloch normalized to 1 at the minimum
- Double_t density=2.33; // g/cm3
- Double_t thickness=0.03; // cm
- Double_t meanMIPSi=116.24; // keV in 300 microns of Si
- Double_t conv=density*1E6*thickness/meanMIPSi;
- Float_t betagamma=p/mass;
- return conv*AliExternalTrackParam::BetheBlochSolid(betagamma);
-
-}
+++ /dev/null
-#ifndef ALIITSpIDESD_H
-#define ALIITSpIDESD_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id$ */
-
-//-------------------------------------------------------
-// ITS PID class
-// Base class:
-// See the implementations AliITSpidESD1 and AliITSpidESD2
-//-------------------------------------------------------
-//#include <Rtypes.h>
-#include <TObject.h>
-
-class AliESDEvent;
-
-class AliITSpidESD : public TObject {
-
-public:
- AliITSpidESD();
- virtual ~AliITSpidESD() {}
- virtual Int_t MakePID(AliESDEvent *event) = 0;
- static Double_t Bethe(Double_t p,Double_t mass);
-
-private:
- ClassDef(AliITSpidESD,1) // ITS PID class
-};
-
-#endif
-
-
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 2005-2007, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-/* $Id$ */
-
-//-----------------------------------------------------------------
-// ITS PID method # 1
-// Implementation of the ITS PID class
-// Very naive one... Should be made better by the detector experts...
-// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
-//-----------------------------------------------------------------
-#include "AliITSpidESD.h"
-#include "AliITSpidESD1.h"
-#include "AliESDEvent.h"
-#include "AliESDtrack.h"
-
-ClassImp(AliITSpidESD1)
-
-AliITSpidESD1::AliITSpidESD1(): AliITSpidESD(),
-fMIP(0),
-fRes(0),
-fRange(0)
-{
- //Default constructor
-}
-//_________________________________________________________________________
-AliITSpidESD1::AliITSpidESD1(Double_t *param): AliITSpidESD(),
-fMIP(param[0]),
-fRes(param[1]),
-fRange(param[2])
-{
- //
- // The main constructor
- //
-}
-
-
-//_________________________________________________________________________
-Int_t AliITSpidESD1::MakePID(AliESDEvent *event)
-{
- //
- // This function calculates the "detector response" PID probabilities
- //
- Int_t ntrk=event->GetNumberOfTracks();
- for (Int_t i=0; i<ntrk; i++) {
- AliESDtrack *t=event->GetTrack(i);
- if ((t->GetStatus()&AliESDtrack::kITSin )==0)
- if ((t->GetStatus()&AliESDtrack::kITSout)==0) continue;
- Double_t mom=t->GetP();
- Double_t dedx=t->GetITSsignal()/fMIP;
- Double_t p[10];
- Bool_t mismatch=kTRUE, heavy=kTRUE;
- for (Int_t j=0; j<AliPID::kSPECIES; j++) {
- Double_t mass=AliPID::ParticleMass(j);//GeV/c^2
- Double_t bethe=AliITSpidESD::Bethe(mom,mass);
- Double_t sigma=fRes*bethe;
- if (TMath::Abs(dedx-bethe) > fRange*sigma) {
- p[j]=TMath::Exp(-0.5*fRange*fRange)/sigma;
- } else {
- p[j]=TMath::Exp(-0.5*(dedx-bethe)*(dedx-bethe)/(sigma*sigma))/sigma;
- mismatch=kFALSE;
- }
-
- // Check for particles heavier than (AliPID::kSPECIES - 1)
- if (dedx < (bethe + fRange*sigma)) heavy=kFALSE;
-
- }
-
- if (mismatch)
- for (Int_t j=0; j<AliPID::kSPECIES; j++) p[j]=1/AliPID::kSPECIES;
-
- t->SetITSpid(p);
-
- if (heavy) t->ResetStatus(AliESDtrack::kITSpid);
-
- }
- return 0;
-}
+++ /dev/null
-#ifndef ALIITSPIDESD1_H
-#define ALIITSPIDESD1_H
-/* Copyright(c) 2005-2007, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id$ */
-
-//-------------------------------------------------------
-// PID method # 1
-// ITS PID class
-// A very naive design... Should be made better by the detector experts...
-// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
-//-------------------------------------------------------
-#include "AliITSpidESD.h"
-
-class AliITSpidESD1 : public AliITSpidESD {
-public:
- AliITSpidESD1();
- AliITSpidESD1(Double_t *param);
- virtual ~AliITSpidESD1() {}
- virtual Int_t MakePID(AliESDEvent *event);
-
-private:
- Double_t fMIP; // dE/dx for MIP (relative units)
- Double_t fRes; // relative dEdx resolution
- Double_t fRange; // one particle type PID range (in sigmas)
- ClassDef(AliITSpidESD1,3) // ITS PID class
-};
-
-#endif
-
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 2005-2007, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-/* $Id$ */
-
-//-----------------------------------------------------------------------//
-// ITS PID class --- method # 2 //
-// //
-// //
-//The PID is based on the likelihood of all the four ITS' layers, //
-//without using the truncated mean for the dE/dx. The response //
-//functions for each layer are convoluted Landau-Gaussian functions. //
-// Origin: Elena Bruna bruna@to.infn.it, Massimo Masera masera@to.infn.it//
-//-----------------------------------------------------------------------//
-
-#include "AliITSpidESD2.h"
-#include "AliESDEvent.h"
-#include "AliESDtrack.h"
-#include "AliITSLoader.h"
-#include "AliITSPidParams.h"
-#include "AliITSPident.h"
-#include "AliLog.h"
-
-ClassImp(AliITSpidESD2)
-//_________________________________________________________________________
-AliITSpidESD2::AliITSpidESD2():
- AliITSpidESD(),
- fPidPars(0)
-{
- // The main constructor
- fPidPars=new AliITSPidParams("default");
-}
-
-
-//_________________________________________________________________________
-AliITSpidESD2::~AliITSpidESD2(){
- //destructor
-
- if(fPidPars)delete fPidPars;
-}
-
-
-//______________________________________________________________________
-AliITSpidESD2::AliITSpidESD2(const AliITSpidESD2 &ob) :AliITSpidESD(ob),
-fPidPars(ob.fPidPars)
-{
- // Copy constructor
-}
-
-
-//______________________________________________________________________
-AliITSpidESD2& AliITSpidESD2::operator=(const AliITSpidESD2& ob ){
- // Assignment operator
- this->~AliITSpidESD2();
- new(this) AliITSpidESD2(ob);
- return *this;
-}
-
-
-//______________________________________________________________________
-void AliITSpidESD2::GetITSpidSingleTrack(AliESDtrack* esdtr, Double_t condprobfun[]){
- // Method to calculate PID probabilities for a single track
-
-
- Double_t prip=0.33;
- Double_t prik=0.33;
- Double_t pripi=0.33;
- Double_t prie=0.;
- AliITSPident mypid(esdtr,fPidPars,prip,prik,pripi,prie);
- condprobfun[0]=mypid.GetProdCondFunPi();//el --PID in the ITS does not distinguish among Pi,el,mu
- condprobfun[1]=mypid.GetProdCondFunPi();//mu
- condprobfun[2]=mypid.GetProdCondFunPi();//pi
- condprobfun[3]=mypid.GetProdCondFunK();//kaon
- condprobfun[4]=mypid.GetProdCondFunPro();//pro
- return;
-}
-
-
-
-//_________________________________________________________________________
-Int_t AliITSpidESD2::MakePID(AliESDEvent *event){
- // This function calculates the "detector response" PID probabilities
-
- Int_t ntrk=event->GetNumberOfTracks();
- const Int_t kns=AliPID::kSPECIES;
- Double_t condprobfun[kns];
-
- for (Int_t i=0; i<ntrk; i++) {
- AliESDtrack *esdtr=event->GetTrack(i);
- if ((esdtr->GetStatus()&AliESDtrack::kITSin )==0){
- if ((esdtr->GetStatus()&AliESDtrack::kITSout)==0) continue;
- }
- GetITSpidSingleTrack(esdtr,condprobfun);
- esdtr->SetITSpid(condprobfun);
- }
- return 0;
-}
+++ /dev/null
-#ifndef ALIITSpIDESD2_H
-#define ALIITSpIDESD2_H
-/* Copyright(c) 2005-2007, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id$ */
-
-//-----------------------------------------------------------------------//
-// ITS PID class --- method # 2 //
-// //
-// //
-//The PID is based on the likelihood of all the four ITS' layers, //
-//without using the truncated mean for the dE/dx. The response //
-//functions for each layer are convoluted Landau-Gaussian functions. //
-// Origin: Elena Bruna bruna@to.infn.it, Massimo Masera masera@to.infn.it//
-//-----------------------------------------------------------------------//
-#include "AliITSpidESD.h"
-#include "AliESDtrack.h"
-
-class AliITSPidParams;
-
-class AliITSpidESD2 : public AliITSpidESD {
-public:
- AliITSpidESD2();
- virtual ~AliITSpidESD2();
- AliITSpidESD2(const AliITSpidESD2 &ob); // copy constructor
- AliITSpidESD2& operator=(const AliITSpidESD2 & source); // ass. op.
-
- void GetITSpidSingleTrack(AliESDtrack *esdtr, Double_t condprobfun[]);
- virtual Int_t MakePID(AliESDEvent *event);
-
-private:
- AliITSPidParams* fPidPars; //!pointer to AliITSSteerPid
-
- ClassDef(AliITSpidESD2,4) // ITS PID class
-};
-
-#endif
-
#pragma link C++ class AliITSCorrectSDDPoints+;
// Classes for PID
-#pragma link C++ class AliITSPid+;
-#pragma link C++ class AliITSPidParams+;
-#pragma link C++ class AliITSPident+;
-#pragma link C++ class AliITSpidESD+;
-#pragma link C++ class AliITSpidESD1+;
-#pragma link C++ class AliITSpidESD2+;
#pragma link C++ class AliITSdEdxAnalyzer+;
//beam test classes
#pragma link C++ class AliITSBeamTestDig+;
AliITSVertexer3DTapan.cxx \
AliITSMeanVertexer.cxx \
AliITSZPoint.cxx \
- AliITSPid.cxx \
AliITSreconstruction.cxx \
AliITSclusterTable.cxx \
AliITStrackSA.cxx \
AliITStrackerSA.cxx \
- AliITSpidESD.cxx \
- AliITSpidESD1.cxx \
- AliITSpidESD2.cxx \
AliITSdEdxAnalyzer.cxx \
- AliITSPident.cxx \
- AliITSPidParams.cxx \
AliITSReconstructor.cxx \
AliITSRecoParam.cxx \
AliITSBeamTestDig.cxx \
//
// Track selection
if (fTrackFilter) {
- selectInfo = fTrackFilter->IsSelected(esdTrack);
+ selectInfo = fTrackFilter->IsSelected(esdTrack, fESD);
if (!selectInfo) continue;
}
}
-Bool_t AliAnalysisCentralCutESD::IsSelected(TObject *obj){
+Bool_t AliAnalysisCentralCutESD::IsSelected(TObject *obj, TObject * /* obj2 */ ){
// Checks if a particle passes the cuts
AliESDtrack *track = dynamic_cast<AliESDtrack *>(obj);
AliAnalysisCentralCutESD(const char *name="AliAnalysisCentralCutESD", const char *title="ESD_cuts");
virtual ~AliAnalysisCentralCutESD();
- Bool_t IsSelected(TObject* obj);
- Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
+ Bool_t IsSelected(TObject* obj, TObject *obj2 = 0);
+ //Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
void SetPartType(PDG_t type) {fReqPID = kTRUE; fPartType = type;}
void SetPIDtype(TString type) {fPIDtype = type;}
-Bool_t AliAnalysisCentralCutEvtESD::IsSelected(TObject *obj){
+Bool_t AliAnalysisCentralCutEvtESD::IsSelected(TObject *obj, TObject * /* obj2 */){
// check whether the event passes the cuts
AliESDEvent *esdEvent = dynamic_cast<AliESDEvent *>(obj);
if(!esdEvent){
AliAnalysisCentralCutEvtESD(const char *name="AliAnalysisCentralCutEvtESD", const char *title="ESD_Event_cuts");
virtual ~AliAnalysisCentralCutEvtESD();
- Bool_t IsSelected(TObject* obj);
- Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
+ Bool_t IsSelected(TObject* obj, TObject* obj2);
+ // Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
void SetMultiplicityRange(Int_t r1 = 0, Int_t r2 = 1000000) {fReqMult = kTRUE; fMultMin = r1; fMultMax = r2;}
void SetDirectivityRange(Double_t r1 = 0.0, Double_t r2 = 1e10) {fReqDir = kTRUE; fDirMin = r1; fDirMax = r2;}
}
//___________________________________________________________________________
-Bool_t AliAnalysisCentralCutEvtMC::IsSelected(TObject *obj){
+Bool_t AliAnalysisCentralCutEvtMC::IsSelected(TObject *obj, TObject * /* obj2 */){
// Checks whether the event passes the cuts
if (!obj){
AliAnalysisCentralCutEvtMC(const char *name="AliAnalysisCentralCutEvtMC", const char *title="MC_cuts");
virtual ~AliAnalysisCentralCutEvtMC();
- Bool_t IsSelected(TObject* obj);
- Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
+ Bool_t IsSelected(TObject* obj, TObject *obj2 = 0);
+ //Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
void SetMultiplicityRange(Int_t r1=0, Int_t r2=1000000){fReqMult = kTRUE; fMultMin=r1; fMultMax=r2;}
void SetDirectivityRange(Float_t r1=-1e10, Float_t r2=1e10) {fReqDir = kTRUE; fDirMin=r1; fDirMax=r2;}
}
//___________________________________________________________________________
-Bool_t AliAnalysisCentralCutMC::IsSelected(TObject* const obj){
+Bool_t AliAnalysisCentralCutMC::IsSelected(TObject* const obj, TObject * /* obj2 */){
// Check if the particle passes the cuts
AliMCParticle *part = dynamic_cast<AliMCParticle *>(obj);
AliAnalysisCentralCutMC(const char *name="AliAnalysisCentralCutMC", const char *title="MC_cuts");
virtual ~AliAnalysisCentralCutMC();
-Bool_t IsSelected(TObject* const obj);
-Bool_t IsSelected(TList* const /*list*/) {return kTRUE;}
+Bool_t IsSelected(TObject* obj, TObject *obj2 = 0);
+//Bool_t IsSelected(TList* const /*list*/) {return kTRUE;}
void SetOnlyPrimaries(Bool_t val = kFALSE) {fOnlyPrim = val;}
#include "AliESDEvent.h"
#include "AliESDInputHandler.h"
#include "AliESDtrack.h"
-#include "AliTPCpidESD.h"
+#include "AliESDpid.h"
#include "AliMCEventHandler.h"
#include "AliMCEvent.h"
//________________________________________________________________________
AliAnalysisTaskChargedHadronSpectra::AliAnalysisTaskChargedHadronSpectra()
- : AliAnalysisTaskSE("TaskChargedHadron"), fESD(0), fListHist(0), fESDtrackCuts(0),fPidObject(0),
+ : AliAnalysisTaskSE("TaskChargedHadron"), fESD(0), fListHist(0), fESDtrackCuts(0),fESDpid(0),
fMCtrue(0),
fAlephParameters(),
fHistPtMCKaon(0),
//________________________________________________________________________
AliAnalysisTaskChargedHadronSpectra::AliAnalysisTaskChargedHadronSpectra(const char *name)
- : AliAnalysisTaskSE(name), fESD(0), fListHist(0), fESDtrackCuts(0),fPidObject(0),
+ : AliAnalysisTaskSE(name), fESD(0), fListHist(0), fESDtrackCuts(0),fESDpid(0),
fMCtrue(0),
fAlephParameters(),
fHistPtMCKaon(0),
fAlephParameters[3] = 2.30445734159456084e+00;//1.8631;
fAlephParameters[4] = 2.25624744086878559e+00;//1.9479;
- fPidObject = new AliTPCpidESD();
- fPidObject->SetBetheBlochParameters(fAlephParameters[0]/50.,fAlephParameters[1],fAlephParameters[2],fAlephParameters[3],fAlephParameters[4]);
+ fESDpid = new AliESDpid();
+ fESDpid->GetTPCResponse().SetBetheBlochParameters(fAlephParameters[0]/50.,fAlephParameters[1],fAlephParameters[2],fAlephParameters[3],fAlephParameters[4]);
// Constructor
Printf("*** CONSTRUCTOR CALLED ****");
}
//
/* 2sigma PID with 2sigma eff correction! */
+ Double_t tpcMom = track->GetP();
+ const AliExternalTrackParam *in = track->GetTPCInnerParam();
+ if (in)
+ tpcMom = in->GetP();
// PION
- if (TMath::Abs(fPidObject->GetNumberOfSigmas(track,AliPID::kPion)) < 2) {
+ if (TMath::Abs(fESDpid->NumberOfSigmasTPC(track,AliPID::kPion)) < 2) {
fHistPtEtaPion->Fill(trackCounter, eta, sign*pT, k2sigmaCorr);
//
if (trackCounter < 300 && fMCtrue) {
}
}
// KAON
- if (TMath::Abs(fPidObject->GetNumberOfSigmas(track,AliPID::kKaon)) < 2) {
+ if (TMath::Abs(fESDpid->NumberOfSigmasTPC(track,AliPID::kKaon)) < 2) {
fHistPtEtaKaon->Fill(trackCounter, eta, sign*pT, k2sigmaCorr);
//
if (trackCounter < 300 && fMCtrue) {
}
}
// KAON NO KINK
- if (TMath::Abs(fPidObject->GetNumberOfSigmas(track,AliPID::kKaon)) < 2 && track->GetKinkIndex(0)==0) fHistPtEtaKaonNoKink->Fill(trackCounter, eta, sign*pT, k2sigmaCorr);
+ if (TMath::Abs(fESDpid->NumberOfSigmasTPC(track,AliPID::kKaon)) < 2 && track->GetKinkIndex(0)==0) fHistPtEtaKaonNoKink->Fill(trackCounter, eta, sign*pT, k2sigmaCorr);
// PROTON
- if (TMath::Abs(fPidObject->GetNumberOfSigmas(track,AliPID::kProton)) < 2) {
+ if (TMath::Abs(fESDpid->NumberOfSigmasTPC(track,AliPID::kProton)) < 2) {
fHistPtEtaProton->Fill(trackCounter, eta, sign*pT, k2sigmaCorr);
//
track->GetImpactParameters(dca,cov);
}
}
// ELECTRON
- if (TMath::Abs(fPidObject->GetNumberOfSigmas(track,AliPID::kElectron))) fHistPtEtaElectron->Fill(trackCounter, eta, sign*pT, k2sigmaCorr);
+ if (TMath::Abs(fESDpid->NumberOfSigmasTPC(track,AliPID::kElectron))) fHistPtEtaElectron->Fill(trackCounter, eta, sign*pT, k2sigmaCorr);
delete track;
class AliESDtrack;
class AliESDtrackCuts;
class AliHeader;
-class AliTPCpidESD;
+class AliESDpid;
#include "AliAnalysisTaskSE.h"
AliESDEvent *fESD; //! ESD object
TList *fListHist; //! list for histograms
//
- AliESDtrackCuts * fESDtrackCuts; // basic cut variables
- AliTPCpidESD * fPidObject; // basic TPC object for n-sigma cuts
+ AliESDtrackCuts * fESDtrackCuts; // basic cut variables
+ AliESDpid * fESDpid; // basic TPC object for n-sigma cuts
Bool_t fMCtrue; // flag if real data or MC is processed
Double_t fAlephParameters[5]; // Aleph Parameters for Bethe-Bloch
//
AliAnalysisTaskChargedHadronSpectra(const AliAnalysisTaskChargedHadronSpectra&);
AliAnalysisTaskChargedHadronSpectra& operator=(const AliAnalysisTaskChargedHadronSpectra&);
- ClassDef(AliAnalysisTaskChargedHadronSpectra, 1);
+ ClassDef(AliAnalysisTaskChargedHadronSpectra, 2);
};
#endif
#include "AliESDEvent.h"
#include "AliAODEvent.h"
//#include "AliCascadeVertexer.h"
-#include "AliTPCpidESD.h"
+#include "AliESDpid.h"
#include "AliCFContainer.h"
#include "AliMultiplicity.h"
//________________________________________________________________________
AliAnalysisTaskCheckCascade::AliAnalysisTaskCheckCascade()
- : AliAnalysisTaskSE(), fAnalysisType("ESD"), fCollidingSystems(0), fRealData(0), fTpcPidManager(0),
-
+ : AliAnalysisTaskSE(), fAnalysisType("ESD"), fCollidingSystems(0), fESDpid(0),
+ fRealData(0),
// - Cascade part initialisation
fListHistCascade(0),
fHistTrackMultiplicity(0), fHistCascadeMultiplicity(0),
//________________________________________________________________________
AliAnalysisTaskCheckCascade::AliAnalysisTaskCheckCascade(const char *name)
- : AliAnalysisTaskSE(name), fAnalysisType("ESD"), fCollidingSystems(0), fRealData(0), fTpcPidManager(0),
-
+ : AliAnalysisTaskSE(name), fAnalysisType("ESD"), fCollidingSystems(0), fESDpid(0),
+ fRealData(0),
// - Cascade part initialisation
fListHistCascade(0),
fHistTrackMultiplicity(0), fHistCascadeMultiplicity(0),
}
-if(! fTpcPidManager){
+if(! fESDpid){
Double_t lAlephParameters[5] = {0.};
// Reasonable parameters extracted for p-p simulation (LHC09a4) - A.Kalweit
lAlephParameters[3] = 2.30445734159456084e+00;//1.8631;
lAlephParameters[4] = 2.25624744086878559e+00;//1.9479;
- fTpcPidManager = new AliTPCpidESD();
- fTpcPidManager->SetBetheBlochParameters(lAlephParameters[0]/50.,
+ fESDpid = new AliESDpid();
+ fESDpid->GetTPCResponse().SetBetheBlochParameters(lAlephParameters[0]/50.,
lAlephParameters[1],
lAlephParameters[2],
lAlephParameters[3],
// B - TPC PID : 3-sigma bands on Bethe-Bloch curve
// Bachelor
- if (TMath::Abs(fTpcPidManager->GetNumberOfSigmas(bachTrackXi,AliPID::kKaon)) < 3) lIsBachelorKaonForTPC = kTRUE;
- if (TMath::Abs(fTpcPidManager->GetNumberOfSigmas(bachTrackXi,AliPID::kPion)) < 3) lIsBachelorPionForTPC = kTRUE;
+ if (TMath::Abs(fESDpid->NumberOfSigmasTPC(bachTrackXi,AliPID::kKaon)) < 3) lIsBachelorKaonForTPC = kTRUE;
+ if (TMath::Abs(fESDpid->NumberOfSigmasTPC(bachTrackXi,AliPID::kPion)) < 3) lIsBachelorPionForTPC = kTRUE;
// Negative V0 daughter
- if (TMath::Abs(fTpcPidManager->GetNumberOfSigmas(nTrackXi,AliPID::kPion )) < 3) lIsNegPionForTPC = kTRUE;
- if (TMath::Abs(fTpcPidManager->GetNumberOfSigmas(nTrackXi,AliPID::kProton )) < 3) lIsNegProtonForTPC = kTRUE;
+ if (TMath::Abs(fESDpid->NumberOfSigmasTPC(nTrackXi,AliPID::kPion )) < 3) lIsNegPionForTPC = kTRUE;
+ if (TMath::Abs(fESDpid->NumberOfSigmasTPC(nTrackXi,AliPID::kProton )) < 3) lIsNegProtonForTPC = kTRUE;
// Positive V0 daughter
- if (TMath::Abs(fTpcPidManager->GetNumberOfSigmas(pTrackXi,AliPID::kPion )) < 3) lIsPosPionForTPC = kTRUE;
- if (TMath::Abs(fTpcPidManager->GetNumberOfSigmas(pTrackXi,AliPID::kProton )) < 3) lIsPosProtonForTPC = kTRUE;
+ if (TMath::Abs(fESDpid->NumberOfSigmasTPC(pTrackXi,AliPID::kPion )) < 3) lIsPosPionForTPC = kTRUE;
+ if (TMath::Abs(fESDpid->NumberOfSigmasTPC(pTrackXi,AliPID::kProton )) < 3) lIsPosProtonForTPC = kTRUE;
class TVector3;
class THnSparse;
-class AliTPCpidESD;
+class AliESDpid;
class AliCFContainer;
private:
TString fAnalysisType; // "ESD" or "AOD" analysis type
Short_t fCollidingSystems; // 0 = pp collisions or 1 = AA collisions
+ AliESDpid* fESDpid; //! Tool data member to manage the TPC Bethe-Bloch info
Short_t fRealData; // 0 = MC data or 1 = real data (needed for trigger issues)
- AliTPCpidESD* fTpcPidManager; //! Tool data member to manage the TPC Bethe-Bloch info
-
- TList *fListHistCascade; //! List of Cascade histograms
+ TList *fListHistCascade; //! List of Cascade histograms
// - General histos (filled for any event)
TH1F *fHistTrackMultiplicity; //! Track multiplicity distribution
#include <AliESDEvent.h>
#include <AliPID.h>
#include <AliVertexerTracks.h>
-#include <AliTPCpidESD.h>
+#include <AliESDpid.h>
class AliLog;
class AliESDVertex;
fAlephParameters[4] = 1.9479;
}
- AliTPCpidESD *fPidObject = new AliTPCpidESD();
- fPidObject->SetBetheBlochParameters(fAlephParameters[0]/50.,fAlephParameters[1],fAlephParameters[2],fAlephParameters[3],fAlephParameters[4]);
+ AliESDpid *fESDpid = new AliESDpid();
+ fESDpid->GetTPCResponse().SetBetheBlochParameters(fAlephParameters[0]/50.,fAlephParameters[1],fAlephParameters[2],fAlephParameters[3],fAlephParameters[4]);
- Double_t nsigma = TMath::Abs(fPidObject->GetNumberOfSigmas(track,AliPID::kProton));
+ Double_t nsigma = TMath::Abs(fESDpid->NumberOfSigmasTPC(track,AliPID::kProton));
if(nsigma <= fNSigma)
return kTRUE;
}//kSigma1 PID method
}
//______________________________________________________
-Bool_t AliHFEextraCuts::IsSelected(TObject *o){
+Bool_t AliHFEextraCuts::IsSelected(TObject *o, TObject * /* o2 */){
//
// Steering function for the track selection
//
AliHFEextraCuts &operator=(const AliHFEextraCuts &c);
virtual ~AliHFEextraCuts();
- virtual Bool_t IsSelected(TObject *o);
- virtual Bool_t IsSelected(TList *) { return kTRUE; };
+ virtual Bool_t IsSelected(TObject *o, TObject *o2 = 0);
+ //virtual Bool_t IsSelected(TList *) { return kTRUE; };
inline void SetClusterRatioTPC(Double_t ratio);
inline void SetRequireITSpixel(ITSPixel_t pixel);
#include "AliLog.h"
#include "AliMCParticle.h"
#include "AliPID.h"
-#include "AliTOFpidESD.h"
+#include "AliESDpid.h"
#include "AliHFEpidTOF.h"
#include "AliHFEpidBase.h"
AliHFEpidBase(name)
, fPID(0x0)
, fQAList(0x0)
- , fPIDtofESD(0x0)
+ , fESDpid(0x0)
, fNsigmaTOF(3)
{
//
// Constructor
//
- fPIDtofESD = new AliTOFpidESD();
+ fESDpid = new AliESDpid();
}
//___________________________________________________________________
AliHFEpidBase("")
, fPID(0x0)
, fQAList(0x0)
- , fPIDtofESD(0x0)
+ , fESDpid(0x0)
, fNsigmaTOF(3)
{
//
// Destructor
//
if(fPID) delete fPID;
- if(fPIDtofESD) delete fPIDtofESD;
+ if(fESDpid) delete fESDpid;
if(fQAList){
fQAList->Delete();
delete fQAList;
target.fPID = fPID;
target.fQAList = fQAList;
- target.fPIDtofESD = new AliTOFpidESD(*fPIDtofESD);
+ target.fESDpid = new AliESDpid(*fESDpid);
AliHFEpidBase::Copy(ref);
}
//
Long_t status = 0;
status = track->GetStatus();
+
+ Float_t timeZeroTOF = 0; // Need to get TimeZero first!
if(!(status & AliESDtrack::kTOFout)) return 0;
// sanity check, should not be necessary
if(TMath::Abs(tTOFpidSum - 1) > 0.01) return 0;
- Double_t nSigmas = fPIDtofESD->GetNumberOfSigmas(track, (AliPID::EParticleType)tMAXindex);
+ Double_t nSigmas = fESDpid->NumberOfSigmasTOF(track, (AliPID::EParticleType)tMAXindex,timeZeroTOF);
if(TMath::Abs(nSigmas) > fNsigmaTOF) return 0;
//IMPORTANT: Tracks which are judged to be outliers get negative likelihoods -> unusable for combination with further detectors!
+ Float_t timeZeroTOF = 0; // Need to get timeZero first !
if(!track) return -1.;
Bool_t outlier = kTRUE;
// Check whether distance from the respective particle line is smaller than r sigma
for(Int_t hypo = 0; hypo < AliPID::kSPECIES; hypo++){
- if(TMath::Abs(fPIDtofESD->GetNumberOfSigmas(track, (AliPID::EParticleType)hypo)) > rsig)
+ if(TMath::Abs(fESDpid->NumberOfSigmasTOF(track, (AliPID::EParticleType)hypo, timeZeroTOF)) > rsig)
outlier = kTRUE;
else {
outlier = kFALSE;
class AliAODMCParticle;
class AliESDtrack;
class AliMCParticle;
-class AliTOFpidESD;
+class AliESDpid;
class AliHFEpidTOF : public AliHFEpidBase{
public:
AliPID *fPID; //! PID Object
TList *fQAList; //! QA histograms
- AliTOFpidESD *fPIDtofESD; //! TOF pid object
+ AliESDpid *fESDpid; //! ESD pid object
Short_t fNsigmaTOF; // TOF sigma band
#include "AliLog.h"
#include "AliMCParticle.h"
#include "AliPID.h"
-#include "AliTPCpidESD.h"
+#include "AliESDpid.h"
//#include "AliVParticle.h"
#include "AliHFEpidTPC.h"
, fNsigmaTPC(3)
, fRejectionEnabled(0)
, fPID(NULL)
- , fPIDtpcESD(NULL)
+ , fESDpid(NULL)
, fQAList(NULL)
{
//
memset(fPAsigCut, 0, sizeof(Float_t) * 2);
memset(fNAsigmaTPC, 0, sizeof(Float_t) * 2);
fPID = new AliPID;
- fPIDtpcESD = new AliTPCpidESD;
+ fESDpid = new AliESDpid;
}
//___________________________________________________________________
, fNsigmaTPC(2)
, fRejectionEnabled(0)
, fPID(NULL)
- , fPIDtpcESD(NULL)
+ , fESDpid(NULL)
, fQAList(NULL)
{
//
target.fNsigmaTPC = fNsigmaTPC;
target.fRejectionEnabled = fRejectionEnabled;
target.fPID = new AliPID(*fPID);
- target.fPIDtpcESD = new AliTPCpidESD(*fPIDtpcESD);
+ target.fESDpid = new AliESDpid(*fESDpid);
target.fQAList = dynamic_cast<TList *>(fQAList->Clone());
memcpy(target.fLineCrossingSigma, fLineCrossingSigma, sizeof(Double_t) * AliPID::kSPECIES);
memcpy(target.fPAsigCut, fPAsigCut, sizeof(Float_t) * 2);
// Destructor
//
if(fPID) delete fPID;
- if(fPIDtpcESD) delete fPIDtpcESD;
+ if(fESDpid) delete fESDpid;
if(fQAList){
fQAList->Delete();
delete fQAList;
// Doing TPC PID as explained in IsSelected for ESD tracks
//
if(IsQAon()) FillTPChistograms(esdTrack, mctrack);
- Float_t nsigma = fPIDtpcESD->GetNumberOfSigmas(esdTrack, AliPID::kElectron);
+ Float_t nsigma = fESDpid->NumberOfSigmasTPC(esdTrack, AliPID::kElectron);
// exclude crossing points:
// Determine the bethe values for each particle species
Bool_t isLineCrossing = kFALSE;
for(Int_t ispecies = 0; ispecies < AliPID::kSPECIES; ispecies++){
if(ispecies == AliPID::kElectron) continue;
if(!(fLineCrossingsEnabled & 1 << ispecies)) continue;
- if(TMath::Abs(fPIDtpcESD->GetNumberOfSigmas(esdTrack, (AliPID::EParticleType)ispecies)) < fLineCrossingSigma[ispecies] && TMath::Abs(nsigma) < fNsigmaTPC){
+ if(TMath::Abs(fESDpid->NumberOfSigmasTPC(esdTrack, (AliPID::EParticleType)ispecies)) < fLineCrossingSigma[ispecies] && TMath::Abs(nsigma) < fNsigmaTPC){
// Point in a line crossing region, no PID possible, but !PID still possible ;-)
- isLineCrossing = kTRUE;
+ isLineCrossing = kTRUE;
fLineCrossingType = ispecies;
break;
}
if(!TESTBIT(fRejectionEnabled, ispec)) continue;
// Particle rejection enabled
if(p < fRejection[4*ispec] || p > fRejection[4*ispec+2]) continue;
- Double_t sigma = fPIDtpcESD->GetNumberOfSigmas(track, static_cast<AliPID::EParticleType>(ispec));
+ Double_t sigma = fESDpid->NumberOfSigmasTPC(track, static_cast<AliPID::EParticleType>(ispec));
if(sigma >= fRejection[4*ispec+1] && sigma <= fRejection[4*ispec+3]) return pdc[ispec] * track->Charge();
}
return 0;
Bool_t outlier = kTRUE;
// Check whether distance from the respective particle line is smaller than r sigma
for(Int_t hypo = 0; hypo < AliPID::kSPECIES; hypo++){
- if(TMath::Abs(fPIDtpcESD->GetNumberOfSigmas(track, (AliPID::EParticleType)hypo)) > rsig)
+ if(TMath::Abs(fESDpid->NumberOfSigmasTPC(track, (AliPID::EParticleType)hypo)) > rsig)
outlier = kTRUE;
else {
outlier = kFALSE;
class AliAODMCParticle;
class AliESDtrack;
class AliMCParticle;
-class AliTPCpidESD;
+class AliESDpid;
class AliVParticle;
class AliHFEpidTPC : public AliHFEpidBase{
Float_t fRejection[4*AliPID::kSPECIES]; // All informations for Particle Rejection, order pmin, sigmin, pmax, sigmax
UChar_t fRejectionEnabled; // Bitmap for enabled particle rejection
AliPID *fPID; //! PID Object
- AliTPCpidESD *fPIDtpcESD; //! TPC PID object
+ AliESDpid *fESDpid; //! TPC PID object
TList *fQAList; //! QA histograms
- ClassDef(AliHFEpidTPC, 1) // TPC Electron ID class
+ ClassDef(AliHFEpidTPC, 2) // TPC Electron ID class
};
inline void AliHFEpidTPC::SetAsymmetricTPCsigmaCut(Float_t pmin, Float_t pmax, Float_t sigmaMin, Float_t sigmaMax) {
\r
\r
#include "AliPID.h"\r
-#include "AliTPCpidESD.h"\r
+#include "AliTPCPIDResponse.h"\r
#include "AliAnalysisManager.h"\r
#include "AliAODHandler.h"\r
#include "AliESDtrack.h"\r
//________________________________________________________________________\r
Bool_t AliAnalysisTaskSEDStar::SelectTPCPID(AliAODTrack *trk, Int_t pid, Double_t nsig){//pid(0-4): {e,mu,pi,K,p}\r
Bool_t flag=kTRUE;\r
- const Double_t mip=50.0, Res=0.07;\r
if ((trk->GetStatus()&AliESDtrack::kTPCpid )==0) return flag;\r
AliAODPid *detpid = trk->GetDetPid();\r
- Double_t dedx = detpid->GetTPCsignal()/mip;\r
- Double_t mass = AliPID::ParticleMass(pid);\r
- AliTPCpidESD tpcpid;\r
- Double_t mean = tpcpid.Bethe(trk->P()/mass);\r
- Double_t nsigma = (dedx-mean)/(Res*mean);\r
+ static AliTPCPIDResponse TPCpid;\r
+ Double_t nsigma = TPCpid.GetNumberOfSigmas(trk->P(),detpid->GetTPCsignal(),trk->GetTPCClusterMap().CountBits(),(AliPID::EParticleType)pid);\r
if (TMath::Abs(nsigma)>nsig) flag=kFALSE;\r
return flag;\r
}\r
#include "AliStack.h"
#include "AliMCEventHandler.h"
-#include "AliTPCpidESD.h"
+#include "AliESDpid.h"
#include "AliGammaConversionBGHandler.h"
class iostream;
fESDHandler(NULL),
fESDEvent(NULL),
fCFManager(NULL),
- fTPCpid(NULL),
+ fESDpid(NULL),
fHistograms(NULL),
fCurrentV0IndexNumber(0),
fCurrentV0(NULL),
fBGEventHandler(NULL),
fBGEventInitialized(kFALSE)
{
- fTPCpid = new AliTPCpidESD;
+ fESDpid = new AliESDpid;
}
fESDHandler(original.fESDHandler),
fESDEvent(original.fESDEvent),
fCFManager(original.fCFManager),
- fTPCpid(original.fTPCpid),
+ fESDpid(original.fESDpid),
fHistograms(original.fHistograms),
fCurrentV0IndexNumber(original.fCurrentV0IndexNumber),
fCurrentV0(original.fCurrentV0),
}
AliV0Reader::~AliV0Reader()
{
- if(fTPCpid){
- delete fTPCpid;
+ if(fESDpid){
+ delete fESDpid;
}
}
//print warning here
}
// Better parameters for MonteCarlo from A. Kalweit 2010/01/8
- fTPCpid->SetBetheBlochParameters( 2.15898e+00/50.,
+ fESDpid->GetTPCResponse().SetBetheBlochParameters( 2.15898e+00/50.,
1.75295e+01,
3.40030e-09,
1.96178e+00,
}
else{
// Better parameters for data from A. Kalweit 2010/01/8
- fTPCpid->SetBetheBlochParameters(0.0283086,
+ fESDpid->GetTPCResponse().SetBetheBlochParameters(0.0283086,
2.63394e+01,
5.04114e-11,
2.12543e+00,
if(fDodEdxSigmaCut == kTRUE){
- if( fTPCpid->GetNumberOfSigmas(fCurrentPositiveESDTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine ||
- fTPCpid->GetNumberOfSigmas(fCurrentPositiveESDTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine ||
- fTPCpid->GetNumberOfSigmas(fCurrentNegativeESDTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine ||
- fTPCpid->GetNumberOfSigmas(fCurrentNegativeESDTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine ){
+ if( fESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine ||
+ fESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine ||
+ fESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine ||
+ fESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine ){
iResult=kFALSE;
if(fHistograms != NULL && fUpdateV0AlreadyCalled == kFALSE){
fHistograms->FillHistogram("ESD_CutdEdxSigmaElectronLine_InvMass",GetMotherCandidateMass());
}
}
if( fCurrentPositiveESDTrack->P()>fPIDMinPnSigmaAbovePionLine){
- if(fTPCpid->GetNumberOfSigmas(fCurrentPositiveESDTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
- fTPCpid->GetNumberOfSigmas(fCurrentPositiveESDTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&&
- fTPCpid->GetNumberOfSigmas(fCurrentPositiveESDTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){
+ if(fESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
+ fESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&&
+ fESDpid->NumberOfSigmasTPC(fCurrentPositiveESDTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){
iResult=kFALSE;
if(fHistograms != NULL && fUpdateV0AlreadyCalled == kFALSE){
fHistograms->FillHistogram("ESD_CutdEdxSigmaPionLine_InvMass",GetMotherCandidateMass());
}
if( fCurrentNegativeESDTrack->P()>fPIDMinPnSigmaAbovePionLine){
- if(fTPCpid->GetNumberOfSigmas(fCurrentNegativeESDTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
- fTPCpid->GetNumberOfSigmas(fCurrentNegativeESDTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&&
- fTPCpid->GetNumberOfSigmas(fCurrentNegativeESDTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){
+ if(fESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
+ fESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&&
+ fESDpid->NumberOfSigmasTPC(fCurrentNegativeESDTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){
iResult=kFALSE;
if(fHistograms != NULL && fUpdateV0AlreadyCalled == kFALSE){
fHistograms->FillHistogram("ESD_CutdEdxSigmaPionLine_InvMass",GetMotherCandidateMass());
class TChain;
class AliCFManager; // for CF
class AliCFContainer; // for CF
-class AliTPCpidESD; // for dEdx cut based on nSigma to particle lines
+class AliESDpid; // for dEdx cut based on nSigma to particle lines
class AliV0Reader : public TObject {
// AliCFContainer *container;
// for dEdx cut based on nSigma to a particle line
- AliTPCpidESD * fTPCpid;
+ AliESDpid * fESDpid;
AliGammaConversionHistograms *fHistograms; //! pointer to histogram handling class
// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
//-----------------------------------------------------------------
+#include "AliLog.h"
+#include "AliPID.h"
#include "AliESDpid.h"
#include "AliESDEvent.h"
#include "AliESDtrack.h"
ClassImp(AliESDpid)
+Int_t AliESDpid::MakePID(AliESDEvent *event, Bool_t TPConly, Float_t TimeZeroTOF) const {
+ //
+ // Calculate probabilities for all detectors, except if TPConly==kTRUE
+ // and combine PID
+ //
+ // Option TPConly==kTRUE is used during reconstruction,
+ // because ITS tracking uses TPC pid
+ // HMPID and TRD pid are done in detector reconstructors
+ //
+
+ /*
+ Float_t TimeZeroTOF = 0;
+ if (subtractT0)
+ TimeZeroTOF = event->GetT0();
+ */
+ Int_t nTrk=event->GetNumberOfTracks();
+ for (Int_t iTrk=0; iTrk<nTrk; iTrk++) {
+ AliESDtrack *track=event->GetTrack(iTrk);
+ MakeTPCPID(track);
+ if (!TPConly) {
+ MakeITSPID(track);
+ MakeTOFPID(track, TimeZeroTOF);
+ //MakeHMPIDPID(track);
+ //MakeTRDPID(track);
+ }
+ CombinePID(track);
+ }
+ return 0;
+}
//_________________________________________________________________________
-Int_t AliESDpid::MakePID(AliESDEvent *event)
+void AliESDpid::MakeTPCPID(AliESDtrack *track) const
{
//
- // Combine the information of various detectors
- // to determine the Particle Identification
+ // TPC pid using bethe-bloch and gaussian response
//
- Int_t ntrk=event->GetNumberOfTracks();
- for (Int_t i=0; i<ntrk; i++) {
- Int_t ns=AliPID::kSPECIES;
- Double_t p[10]={1.,1.,1.,1.,1.,1.,1.,1.,1.,1.};
+ if ((track->GetStatus()&AliESDtrack::kTPCin )==0)
+ if ((track->GetStatus()&AliESDtrack::kTPCout)==0) return;
- AliESDtrack *t=event->GetTrack(i);
+ Double_t mom = track->GetP();
+ const AliExternalTrackParam *in=track->GetInnerParam();
+ if (in) mom = in->GetP();
- if (t->IsOn(AliESDtrack::kITSpid)) {
- Double_t d[10];
- t->GetITSpid(d);
- for (Int_t j=0; j<ns; j++) p[j]*=d[j];
- }
+ Double_t p[AliPID::kSPECIES];
+ Double_t dedx=track->GetTPCsignal();
+ Bool_t mismatch=kTRUE, heavy=kTRUE;
- if (t->IsOn(AliESDtrack::kTPCpid)) {
- Double_t d[10];
- t->GetTPCpid(d);
- for (Int_t j=0; j<ns; j++) p[j]*=d[j];
- }
+ for (Int_t j=0; j<AliPID::kSPECIES; j++) {
+ AliPID::EParticleType type=AliPID::EParticleType(j);
+ Double_t bethe=fTPCResponse.GetExpectedSignal(mom,type);
+ Double_t sigma=fTPCResponse.GetExpectedSigma(mom,track->GetTPCsignalN(),type);
+ if (TMath::Abs(dedx-bethe) > fRange*sigma) {
+ p[j]=TMath::Exp(-0.5*fRange*fRange)/sigma;
+ } else {
+ p[j]=TMath::Exp(-0.5*(dedx-bethe)*(dedx-bethe)/(sigma*sigma))/sigma;
+ mismatch=kFALSE;
+ }
- if (t->IsOn(AliESDtrack::kTRDpid)) {
- Double_t d[10];
- t->GetTRDpid(d);
- for (Int_t j=0; j<ns; j++) p[j]*=d[j];
- }
+ // Check for particles heavier than (AliPID::kSPECIES - 1)
+ if (dedx < (bethe + fRange*sigma)) heavy=kFALSE;
- if (t->IsOn(AliESDtrack::kTOFpid)) {
- Double_t d[10];
- t->GetTOFpid(d);
- for (Int_t j=0; j<ns; j++) p[j]*=d[j];
}
- if (t->IsOn(AliESDtrack::kHMPIDpid)) {
- Double_t d[10];
- t->GetHMPIDpid(d);
- for (Int_t j=0; j<ns; j++) p[j]*=d[j];
+ if (mismatch)
+ for (Int_t j=0; j<AliPID::kSPECIES; j++) p[j]=1/AliPID::kSPECIES;
+
+ track->SetTPCpid(p);
+
+ if (heavy) track->ResetStatus(AliESDtrack::kTPCpid);
+
+}
+//_________________________________________________________________________
+void AliESDpid::MakeITSPID(AliESDtrack *track) const
+{
+ //
+ // ITS PID
+ // Two options, depending on fITSPIDmethod:
+ // 1) Truncated mean method
+ // 2) Likelihood, using charges measured in all 4 layers and
+ // Landau+gaus response functions
+ //
+
+ if ((track->GetStatus()&AliESDtrack::kITSin)==0 &&
+ (track->GetStatus()&AliESDtrack::kITSout)==0) return;
+
+ Double_t mom=track->GetP();
+ if (fITSPIDmethod == kITSTruncMean) {
+ Double_t dedx=track->GetITSsignal();
+ Double_t p[10];
+ Bool_t mismatch=kTRUE, heavy=kTRUE;
+ for (Int_t j=0; j<AliPID::kSPECIES; j++) {
+ Double_t mass=AliPID::ParticleMass(j);//GeV/c^2
+ Double_t bethe=fITSResponse.Bethe(mom,mass);
+ Double_t sigma=fITSResponse.GetResolution(bethe);
+ if (TMath::Abs(dedx-bethe) > fRange*sigma) {
+ p[j]=TMath::Exp(-0.5*fRange*fRange)/sigma;
+ } else {
+ p[j]=TMath::Exp(-0.5*(dedx-bethe)*(dedx-bethe)/(sigma*sigma))/sigma;
+ mismatch=kFALSE;
+ }
+
+ // Check for particles heavier than (AliPID::kSPECIES - 1)
+ if (dedx < (bethe + fRange*sigma)) heavy=kFALSE;
+
}
- t->SetESDpid(p);
+ if (mismatch)
+ for (Int_t j=0; j<AliPID::kSPECIES; j++) p[j]=1./AliPID::kSPECIES;
+
+ track->SetITSpid(p);
+
+ if (heavy) track->ResetStatus(AliESDtrack::kITSpid);
+ }
+ else { // Likelihood method
+ Double_t condprobfun[AliPID::kSPECIES];
+ Double_t qclu[4];
+ track->GetITSdEdxSamples(qclu);
+ fITSResponse.GetITSProbabilities(mom,qclu,condprobfun);
+ track->SetITSpid(condprobfun);
}
- return 0;
+}
+//_________________________________________________________________________
+void AliESDpid::MakeTOFPID(AliESDtrack *track, Float_t TimeZeroTOF) const
+{
+ //
+ // TOF PID using gaussian response
+ //
+ if ((track->GetStatus()&AliESDtrack::kTOFout)==0) return;
+ if ((track->GetStatus()&AliESDtrack::kTIME)==0) return;
+
+ Double_t time[AliPID::kSPECIESN];
+ track->GetIntegratedTimes(time);
+
+ Double_t sigma[AliPID::kSPECIES];
+ for (Int_t iPart = 0; iPart < AliPID::kSPECIES; iPart++) {
+ sigma[iPart] = fTOFResponse.GetExpectedSigma(track->GetP(),time[iPart],AliPID::ParticleMass(iPart));
+ }
+
+ AliDebugGeneral("AliESDpid::MakeTOFPID",2,
+ Form("Expected TOF signals [ps]: %f %f %f %f %f",
+ time[AliPID::kElectron],
+ time[AliPID::kMuon],
+ time[AliPID::kPion],
+ time[AliPID::kKaon],
+ time[AliPID::kProton]));
+
+ AliDebugGeneral("AliESDpid::MakeTOFPID",2,
+ Form("Expected TOF std deviations [ps]: %f %f %f %f %f",
+ sigma[AliPID::kElectron],
+ sigma[AliPID::kMuon],
+ sigma[AliPID::kPion],
+ sigma[AliPID::kKaon],
+ sigma[AliPID::kProton]
+ ));
+
+ Double_t tof = track->GetTOFsignal() - TimeZeroTOF;
+
+ Double_t p[AliPID::kSPECIES];
+ Bool_t mismatch = kTRUE, heavy = kTRUE;
+ for (Int_t j=0; j<AliPID::kSPECIES; j++) {
+ Double_t sig = sigma[j];
+ if (TMath::Abs(tof-time[j]) > fRange*sig) {
+ p[j] = TMath::Exp(-0.5*fRange*fRange)/sig;
+ } else
+ p[j] = TMath::Exp(-0.5*(tof-time[j])*(tof-time[j])/(sig*sig))/sig;
+
+ // Check the mismatching
+ Double_t mass = AliPID::ParticleMass(j);
+ Double_t pm = fTOFResponse.GetMismatchProbability(track->GetP(),mass);
+ if (p[j]>pm) mismatch = kFALSE;
+
+ // Check for particles heavier than (AliPID::kSPECIES - 1)
+ if (tof < (time[j] + fRange*sig)) heavy=kFALSE;
+
+ }
+
+ if (mismatch)
+ for (Int_t j=0; j<AliPID::kSPECIES; j++) p[j]=1/AliPID::kSPECIES;
+
+ track->SetTOFpid(p);
+
+ if (heavy) track->ResetStatus(AliESDtrack::kTOFpid);
+}
+//_________________________________________________________________________
+void AliESDpid::CombinePID(AliESDtrack *track) const
+{
+ //
+ // Combine the information of various detectors
+ // to determine the Particle Identification
+ //
+ Int_t ns=AliPID::kSPECIES;
+ Double_t p[10]={1.,1.,1.,1.,1.,1.,1.,1.,1.,1.};
+
+ if (track->IsOn(AliESDtrack::kITSpid)) {
+ Double_t d[10];
+ track->GetITSpid(d);
+ for (Int_t j=0; j<ns; j++) p[j]*=d[j];
+ }
+
+ if (track->IsOn(AliESDtrack::kTPCpid)) {
+ Double_t d[10];
+ track->GetTPCpid(d);
+ for (Int_t j=0; j<ns; j++) p[j]*=d[j];
+ }
+
+ if (track->IsOn(AliESDtrack::kTRDpid)) {
+ Double_t d[10];
+ track->GetTRDpid(d);
+ for (Int_t j=0; j<ns; j++) p[j]*=d[j];
+ }
+
+ if (track->IsOn(AliESDtrack::kTOFpid)) {
+ Double_t d[10];
+ track->GetTOFpid(d);
+ for (Int_t j=0; j<ns; j++) p[j]*=d[j];
+ }
+
+ if (track->IsOn(AliESDtrack::kHMPIDpid)) {
+ Double_t d[10];
+ track->GetHMPIDpid(d);
+ for (Int_t j=0; j<ns; j++) p[j]*=d[j];
+ }
+
+ track->SetESDpid(p);
}
// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
//-------------------------------------------------------
#include <Rtypes.h>
+#include "AliESDtrack.h" // Needed for inline functions
+#include "AliTPCPIDResponse.h"
+#include "AliITSPIDResponse.h"
+#include "AliTOFPIDResponse.h"
+//#include "HMPID/AliHMPID.h"
+//#include "TRD/AliTRDpidESD.h"
class AliESDEvent;
class AliESDpid {
public:
- AliESDpid(){}
+ AliESDpid(): fRange(5.), fITSPIDmethod(kITSTruncMean), fTPCResponse(), fITSResponse(), fTOFResponse() {;}
virtual ~AliESDpid() {}
- static Int_t MakePID(AliESDEvent *event);
+ Int_t MakePID(AliESDEvent *event, Bool_t TPCOnly = kFALSE, Float_t TimeZeroTOF=0) const;
+ void MakeTPCPID(AliESDtrack *track) const;
+ void MakeITSPID(AliESDtrack *track) const;
+ void MakeTOFPID(AliESDtrack *track, Float_t TimeZeroTOF) const;
+ // void MakeHMPIDPID(AliESDtrack *track);
+ // void MakeTRDPID(AliESDtrack *track);
+ void CombinePID(AliESDtrack *track) const;
+ Float_t NumberOfSigmasTPC(const AliESDtrack *track, AliPID::EParticleType type) const;
+ Float_t NumberOfSigmasTOF(const AliESDtrack *track, AliPID::EParticleType type, const Float_t TimeZeroTOF) const;
+ Float_t NumberOfSigmasITS(const AliESDtrack *track, AliPID::EParticleType type) const;
+
+ AliITSPIDResponse &GetITSResponse() {return fITSResponse;}
+ AliTPCPIDResponse &GetTPCResponse() {return fTPCResponse;}
+ AliTOFPIDResponse &GetTOFResponse() {return fTOFResponse;}
+
+ enum ITSPIDmethod { kITSTruncMean, kITSLikelihood };
+
private:
- ClassDef(AliESDpid,2) // TPC PID class
+ Float_t fRange; // nSigma max in likelihood
+ ITSPIDmethod fITSPIDmethod; // 0 = trunc mean; 1 = likelihood
+ AliTPCPIDResponse fTPCResponse;
+ AliITSPIDResponse fITSResponse;
+ AliTOFPIDResponse fTOFResponse;
+ // AliHMPIDPIDResponse fHMPIDResponse;
+ // AliTRDPIDResponse fTRDResponse;
+
+ ClassDef(AliESDpid,3) // PID calculation class
};
+inline Float_t AliESDpid::NumberOfSigmasTPC(const AliESDtrack *track, AliPID::EParticleType type) const {
+ Double_t mom = track->GetP();
+ const AliExternalTrackParam *in = track->GetTPCInnerParam();
+ if (in)
+ mom = in->GetP();
+ return fTPCResponse.GetNumberOfSigmas(mom,track->GetTPCsignal(),track->GetTPCsignalN(),type);
+}
+
+inline Float_t AliESDpid::NumberOfSigmasTOF(const AliESDtrack *track, AliPID::EParticleType type, const Float_t TimeZeroTOF) const {
+ Double_t times[AliPID::kSPECIES];
+ track->GetIntegratedTimes(times);
+ return (track->GetTOFsignal() - TimeZeroTOF - times[type])/fTOFResponse.GetExpectedSigma(track->GetP(),times[type],AliPID::ParticleMass(type));
+}
+
+inline Float_t AliESDpid::NumberOfSigmasITS(const AliESDtrack *track, AliPID::EParticleType type) const {
+ return fITSResponse.GetNumberOfSigmas(track->GetP(),track->GetITSsignal(),type);
+}
#endif
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+//////////////////////////////////////////////////////////////////////////
+// //
+// AliHMPIDPid //
+// //
+// HMPID class to perfom particle identification //
+// //
+//////////////////////////////////////////////////////////////////////////
+
+#include "AliHMPIDPid.h" //class header
+#include "AliHMPIDParam.h" //class header
+#include "AliHMPIDRecon.h" //class header
+#include <AliESDtrack.h> //FindPid()
+#include <TRandom.h> //Resolution()
+
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+AliHMPIDPid::AliHMPIDPid():TTask("HMPIDrec","HMPIDPid")
+{
+//..
+//init of data members
+//..
+}
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+Double_t AliHMPIDPIDResponse::CosTheta(Float_t mom, Int_t species) {
+ Double_t mass = AliPID::ParticleMass(species);
+ TMath::Sqrt(mass*mass+pmod*pmod)/(AliHMPIDParam::Instance()->MeanIdxRad()*pmod); // evaluate the theor. Theta Cherenkov
+}
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+Double_t AliHMPIDPIDResponse::Resolution(Double_t thetaCerTh, AliESDtrack *pTrk)
+{
+ AliHMPIDParam *pParam = AliHMPIDParam::Instance();
+
+ AliHMPIDRecon rec;
+ Float_t xRa,yRa,thRa,phRa;
+ pTrk->GetHMPIDtrk(xRa,yRa,thRa,phRa);
+ rec.SetTrack(xRa,yRa,thRa,phRa);
+ Double_t thetaMax = TMath::ACos(1./pParam->MeanIdxRad());
+ Int_t nPhots = (Int_t)(21.*TMath::Sin(thetaCerTh)*TMath::Sin(thetaCerTh)/(TMath::Sin(thetaMax)*TMath::Sin(thetaMax))+0.01);
+
+ Double_t sigmatot = 0;
+ Int_t nTrks = 20;
+ for(Int_t iTrk=0;iTrk<nTrks;iTrk++) {
+ Double_t invSigma = 0;
+ Int_t nPhotsAcc = 0;
+ for(Int_t j=0;j<nPhots;j++){
+ Double_t phi = gRandom->Rndm()*TMath::TwoPi();
+ TVector2 pos; pos=rec.TracePhot(thetaCerTh,phi);
+ if(!pParam->IsInside(pos.X(),pos.Y())) continue;
+ if(pParam->IsInDead(pos.X(),pos.Y())) continue;
+ Double_t sigma2 = pParam->Sigma2(thRa,phRa,thetaCerTh,phi);//photon candidate sigma^2
+ if(sigma2!=0) {
+ invSigma += 1./sigma2;
+ nPhotsAcc++;
+ }
+ }
+ if(invSigma!=0) sigmatot += 1./TMath::Sqrt(invSigma);
+ }
+ return sigmatot/nTrks;
+}
--- /dev/null
+#ifndef AliHMPIDPIDResponse_h
+#define AliHMPIDPIDResponse_h
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+//////////////////////////////////////////////////////////////////////////
+// //
+// AliHMPIDPIDResponse //
+// //
+// HMPID class to perfom pattern recognition based on Hough transfrom //
+// //
+//////////////////////////////////////////////////////////////////////////
+
+
+#include <TTask.h> //base class
+
+class AliESDtrack;
+
+class AliHMPIDPIDResponse : public TTask
+{
+public :
+ AliHMPIDPIDResponse(); //ctor
+ virtual ~AliHMPIDPIDResponse() {;} //dtor
+ Double_t CosTheta(Float_t *mod, Int_t species);
+ Double_t Resolution(Double_t thetaCerTh, AliESDtrack *pTrk); //Find the sigma for a given ThetaCerTh
+
+//
+protected:
+
+private:
+ AliHMPIDPIDResponse(const AliHMPIDPIDResponse& r); //dummy copy constructor
+ AliHMPIDPIDResponse &operator=(const AliHMPIDPIDResponse& r); //dummy assignment operator
+//
+ ClassDef(AliHMPIDPIDResponse,0)
+};
+
+#endif // #ifdef AliHMPIDPIDResponse_cxx
+
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 2005-2007, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/* $Id$ */
+
+//-----------------------------------------------------------------
+// ITS PID method # 1
+// Implementation of the ITS PID class
+// Very naive one... Should be made better by the detector experts...
+// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+//-----------------------------------------------------------------
+#include "TMath.h"
+#include "AliITSPIDResponse.h"
+#include "AliITSPidParams.h"
+#include "AliExternalTrackParam.h"
+
+Float_t AliITSPIDResponse::fgMIP = 82;
+ClassImp(AliITSPIDResponse)
+
+AliITSPIDResponse::AliITSPIDResponse():
+ fRes(0.13),
+ fKp1(15.77),
+ fKp2(4.95),
+ fKp3(0.312),
+ fKp4(2.14),
+ fKp5(0.82)
+{
+}
+
+//_________________________________________________________________________
+AliITSPIDResponse::AliITSPIDResponse(Double_t *param):
+ fRes(param[1]),
+ fKp1(15.77),
+ fKp2(4.95),
+ fKp3(0.312),
+ fKp4(2.14),
+ fKp5(0.82)
+{
+ //
+ // The main constructor
+ //
+ fgMIP = param[0];
+}
+
+
+Double_t AliITSPIDResponse::Bethe(Double_t p,Double_t mass) const {
+ //
+ // returns AliExternalTrackParam::BetheBloch normalized to
+ // fgMIP at the minimum
+ //
+ Double_t bb=
+ AliExternalTrackParam::BetheBlochAleph(p/mass,fKp1,fKp2,fKp3,fKp4,fKp5);
+ return bb*fgMIP;
+}
+
+Double_t AliITSPIDResponse::GetResolution(Double_t bethe) const {
+ //
+ // Calculate expected resolution for truncated mean
+ //
+ return fRes*bethe;
+}
+
+void AliITSPIDResponse::GetITSProbabilities(Float_t mom, Double_t qclu[4], Double_t condprobfun[AliPID::kSPECIES]) const {
+ //
+ // Method to calculate PID probabilities for a single track
+ // using the likelihood method
+ //
+ const Int_t nLay = 4;
+ const Int_t nPart = 3;
+
+ static AliITSPidParams pars; // Pid parametrisation parameters
+
+ Double_t itsProb[nPart] = {1,1,1}; // p, K, pi
+
+ for (Int_t iLay = 0; iLay < nLay; iLay++) {
+ if (qclu[iLay] <= 0)
+ continue;
+
+ Float_t dedx = qclu[iLay];
+ Float_t layProb = pars.GetLandauGausNorm(dedx,AliPID::kProton,mom,iLay+3);
+ itsProb[0] *= layProb;
+
+ layProb = pars.GetLandauGausNorm(dedx,AliPID::kKaon,mom,iLay+3);
+ if (mom < 0.16) layProb=0.00001;
+ itsProb[1] *= layProb;
+
+ layProb = pars.GetLandauGausNorm(dedx,AliPID::kPion,mom,iLay+3);
+ itsProb[2] *= layProb;
+ }
+
+ // Normalise probabilities
+ Double_t sumProb = 0;
+ for (Int_t iPart = 0; iPart < nPart; iPart++) {
+ sumProb += itsProb[iPart];
+ }
+
+ for (Int_t iPart = 0; iPart < nPart; iPart++) {
+ itsProb[iPart]/=sumProb;
+ }
+
+ condprobfun[AliPID::kElectron] = itsProb[2]/3.;
+ condprobfun[AliPID::kMuon] = itsProb[2]/3.;
+ condprobfun[AliPID::kPion] = itsProb[2]/3.;
+ condprobfun[AliPID::kKaon] = itsProb[1];
+ condprobfun[AliPID::kProton] = itsProb[0];
+ return;
+}
--- /dev/null
+#ifndef ALIITSPIDRESPONSE_H
+#define ALIITSPIDRESPONSE_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+//-------------------------------------------------------
+// ITS PID response class
+//
+//
+//-------------------------------------------------------
+//#include <Rtypes.h>
+#include <TObject.h>
+
+#include "AliPID.h"
+
+class AliITSPIDResponse : public TObject {
+
+public:
+ AliITSPIDResponse();
+ AliITSPIDResponse(Double_t *param);
+ ~AliITSPIDResponse() {}
+ Double_t Bethe(Double_t p,Double_t mass) const;
+ Double_t GetResolution(Double_t bethe) const;
+ void GetITSProbabilities(Float_t mom, Double_t qclu[4], Double_t condprobfun[AliPID::kSPECIES]) const;
+ Float_t GetNumberOfSigmas(Float_t mom, Float_t signal, AliPID::EParticleType type) const {
+ Float_t bethe = Bethe(mom,AliPID::ParticleMass(type));
+ return (signal - bethe)/GetResolution(bethe);
+}
+
+private:
+
+ // Data members for truncated mean method
+ static Float_t fgMIP; // dE/dx for MIP (relative units)
+ Float_t fRes; // relative dEdx resolution
+ Double_t fKp1; // ALEPH BB param 1
+ Double_t fKp2; // ALEPH BB param 2
+ Double_t fKp3; // ALEPH BB param 3
+ Double_t fKp4; // ALEPH BB param 4
+ Double_t fKp5; // ALEPH BB param 5
+
+ ClassDef(AliITSPIDResponse,1) // ITS PID class
+};
+
+#endif
+
+
// run the reconstruction over a single event
// The event loop is steered in Run method
+
static Long_t oldMres=0;
static Long_t oldMvir=0;
static Float_t oldCPU=0;
AliCodeTimerAuto("",0);
+ AliESDpid PID;
+
if (iEvent >= fRunLoader->GetNumberOfEvents()) {
fRunLoader->SetEventNumber(iEvent);
fRunLoader->GetHeader()->Reset(fRawReader->GetRunNumber(),
if (reconstructor && fRecoParam.GetDetRecoParamArray(iDet)) {
const AliDetectorRecoParam *par = fRecoParam.GetDetRecoParam(iDet);
reconstructor->SetRecoParam(par);
- reconstructor->SetEventInfo(&fEventInfo);
+ reconstructor->GetPidSettings(&PID);
+ reconstructor->SetEventInfo(&fEventInfo);
if (fRunQA) {
AliQAManager::QAManager()->SetRecoParam(iDet, par) ;
AliQAManager::QAManager()->SetEventSpecie(AliRecoParam::Convert(par->GetEventSpecie())) ;
// barrel tracking
if (!fRunTracking.IsNull()) {
- if (!RunTracking(fesd)) {
+ if (!RunTracking(fesd,PID)) {
if (fStopOnError) {CleanUp(); return kFALSE;}
}
}
}
// combined PID
- AliESDpid::MakePID(fesd);
+ PID.MakePID(fesd);
if (fFillTriggerESD) {
if (!FillTriggerESD(fesd)) {
//_____________________________________________________________________________
-Bool_t AliReconstruction::RunTracking(AliESDEvent*& esd)
+Bool_t AliReconstruction::RunTracking(AliESDEvent*& esd,AliESDpid &PID)
{
// run the barrel tracking
static Int_t eventNr=0;
// preliminary PID in TPC needed by the ITS tracker
if (iDet == 1) {
GetReconstructor(1)->FillESD((TTree*)NULL, (TTree*)NULL, esd);
- AliESDpid::MakePID(esd);
+ PID.MakePID(esd,kTRUE);
}
AliSysInfo::AddStamp(Form("Tracking0%s_%d",fgkDetectorName[iDet],eventNr), iDet,3,eventNr);
}
}
// updated PID in TPC needed by the ITS tracker -MI
if (iDet == 1) {
- GetReconstructor(1)->FillESD((TTree*)NULL, (TTree*)NULL, esd);
- AliESDpid::MakePID(esd);
+ //GetReconstructor(1)->FillESD((TTree*)NULL, (TTree*)NULL, esd);
+ //AliESDpid::MakePID(esd);
+ PID.MakePID(esd,kTRUE);
}
AliSysInfo::AddStamp(Form("Tracking1%s_%d",fgkDetectorName[iDet],eventNr), iDet,3, eventNr);
}
class AliESDVertex;
class AliESDEvent;
class AliESDfriend;
+class AliESDpid;
class AliVertexerTracks;
class TFile;
class TTree;
Bool_t RunHLTTracking(AliESDEvent*& esd);
Bool_t RunMuonTracking(AliESDEvent*& esd);
Bool_t RunSPDTrackleting(AliESDEvent*& esd);
- Bool_t RunTracking(AliESDEvent*& esd);
+ Bool_t RunTracking(AliESDEvent*& esd, AliESDpid &PID);
Bool_t CleanESD(AliESDEvent *esd);
Bool_t FillESD(AliESDEvent*& esd, const TString& detectors);
Bool_t FillTriggerESD(AliESDEvent*& esd);
return NULL;
}
}
+
+//_____________________________________________________________________________
+void AliReconstructor::GetPidSettings(AliESDpid *esdPID) {
+ //
+ // Function to set Pid settings in esdPID
+ // based on detector-specific AliRecoParams
+ // to be implemented by detectors separately (e.g TOF)
+ //
+ return;
+}
class AliDetectorRecoParam;
class AliRunInfo;
class AliEventInfo;
+class AliESDpid;
#include "AliReconstruction.h"
void SetRecoParam(const AliDetectorRecoParam *par);
static const AliDetectorRecoParam* GetRecoParam(Int_t iDet);
+ virtual void GetPidSettings(AliESDpid *esdPID);
private:
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+//-----------------------------------------------------------------//
+// //
+// Implementation of the TOF PID class //
+// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch //
+// //
+//-----------------------------------------------------------------//
+
+#include "TMath.h"
+#include "AliLog.h"
+
+#include "AliTOFPIDResponse.h"
+
+ClassImp(AliTOFPIDResponse)
+
+//_________________________________________________________________________
+AliTOFPIDResponse::AliTOFPIDResponse():
+ fSigma(0),
+ fPmax(0), // zero at 0.5 GeV/c for pp
+ fTime0(0)
+{
+}
+//_________________________________________________________________________
+AliTOFPIDResponse::AliTOFPIDResponse(Double_t *param):
+ fSigma(param[0]),
+ fPmax(0), // zero at 0.5 GeV/c for pp
+ fTime0(0)
+{
+ //
+ // The main constructor
+ //
+ //
+
+ //fPmax=TMath::Exp(-0.5*3*3)/fSigma; // ~3 sigma at 0.5 GeV/c for PbPb
+}
+//_________________________________________________________________________
+Double_t
+AliTOFPIDResponse::GetMismatchProbability(Double_t p, Double_t mass) const {
+ //
+ // Returns the probability of mismatching
+ // assuming 1/(p*beta)^2 scaling
+ //
+ const Double_t km=0.5; // "reference" momentum (GeV/c)
+
+ Double_t ref2=km*km*km*km/(km*km + mass*mass);// "reference" (p*beta)^2
+ Double_t p2beta2=p*p*p*p/(p*p + mass*mass);
+
+ return fPmax*ref2/p2beta2;
+}
+//_________________________________________________________________________
+Double_t AliTOFPIDResponse::GetExpectedSigma(Float_t mom, Float_t time, Float_t mass) const {
+ //
+ // Return the expected sigma of the PID signal for the specified
+ // particle type.
+ // If the operation is not possible, return a negative value.
+ //
+
+ Double_t dpp = 0.01; //mean relative pt resolution;
+ if (mom>0.5) dpp = 0.01*mom;
+
+
+ Double_t sigma = dpp*time/(1.+ mom*mom/(mass*mass));
+
+ return TMath::Sqrt(sigma*sigma + fSigma*fSigma);
+}
+
--- /dev/null
+#ifndef ALITOFPIDRESPONSE_H
+#define ALITOFPIDRESPONSE_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+//-------------------------------------------------------
+// TOF PID class
+// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+//-------------------------------------------------------
+
+#include "TObject.h"
+#include "AliPID.h"
+
+class AliTOFPIDResponse : public TObject {
+public:
+ AliTOFPIDResponse();
+ AliTOFPIDResponse(Double_t *param);
+ ~AliTOFPIDResponse(){}
+
+ void SetTimeResolution(Float_t res) { fSigma = res; }
+ void SetTimeZero(Double_t t0) { fTime0=t0; }
+ Double_t GetTimeZero() const { return fTime0; }
+
+ void SetMaxMismatchProbability(Double_t p) {fPmax=p;}
+ Double_t GetMaxMismatchProbability() const {return fPmax;}
+
+ Double_t GetExpectedSigma(Float_t mom, Float_t tof, Float_t mass) const;
+
+
+ Double_t GetMismatchProbability(Double_t p,Double_t mass) const;
+
+ private:
+ Double_t fSigma; // intrinsic TOF resolution
+ Double_t fPmax; // "maximal" probability of mismathing (at ~0.5 GeV/c)
+ Double_t fTime0; // time zero
+
+ ClassDef(AliTOFPIDResponse,1) // TOF PID class
+};
+
+#endif
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-//-----------------------------------------------------------------//
-// //
-// Implementation of the TOF PID class //
-// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch //
-// //
-//-----------------------------------------------------------------//
-
-#include "TMath.h"
-#include "AliLog.h"
-
-#include "AliESDtrack.h"
-#include "AliESDEvent.h"
-
-#include "AliTOFpidESD.h"
-
-ClassImp(AliTOFpidESD)
-
-//_________________________________________________________________________
-AliTOFpidESD::AliTOFpidESD():
- fSigma(0),
- fRange(0),
- fPmax(0), // zero at 0.5 GeV/c for pp
- fTime0(0)
-{
-}
-//_________________________________________________________________________
-AliTOFpidESD::AliTOFpidESD(Double_t *param):
- fSigma(param[0]),
- fRange(param[1]),
- fPmax(0), // zero at 0.5 GeV/c for pp
- fTime0(0)
-{
- //
- // The main constructor
- //
- //
-
- //fPmax=TMath::Exp(-0.5*3*3)/fSigma; // ~3 sigma at 0.5 GeV/c for PbPb
-}
-
-//_________________________________________________________________________
-Double_t
-AliTOFpidESD::GetMismatchProbability(Double_t p, Double_t mass) const {
- //
- // Returns the probability of mismatching
- // assuming 1/(p*beta)^2 scaling
- //
- const Double_t km=0.5; // "reference" momentum (GeV/c)
-
- Double_t ref2=km*km*km*km/(km*km + mass*mass);// "reference" (p*beta)^2
- Double_t p2beta2=p*p*p*p/(p*p + mass*mass);
-
- return fPmax*ref2/p2beta2;
-}
-
-//_________________________________________________________________________
-Int_t AliTOFpidESD::MakePID(AliESDEvent *event, Double_t timeZero)
-{
- //
- // This function calculates the "detector response" PID probabilities
- // Just for a bare hint...
-
- AliDebug(1,Form("TOF PID Parameters: Sigma (ps)= %f, Range= %f",fSigma,fRange));
- AliDebug(1,"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \n");
-
- fTime0=timeZero;
- return MakePID(event);
-}
-
-//_________________________________________________________________________
-Int_t AliTOFpidESD::MakePID(AliESDEvent *event)
-{
- //
- // This function calculates the "detector response" PID probabilities
- // Just for a bare hint...
-
- Int_t ntrk=event->GetNumberOfTracks();
- AliESDtrack **tracks=new AliESDtrack*[ntrk];
-
- Int_t i;
- for (i=0; i<ntrk; i++) {
- AliESDtrack *t=event->GetTrack(i);
- tracks[i]=t;
- }
-
- for (i=0; i<ntrk; i++) {
- AliESDtrack *t=tracks[i];
- if ((t->GetStatus()&AliESDtrack::kTOFout)==0) continue;
- if ((t->GetStatus()&AliESDtrack::kTIME)==0) continue;
-
- Double_t time[AliPID::kSPECIES];
- if (!ExpectedSignals(t,time,AliPID::kSPECIES)) continue;
- Double_t sigma[AliPID::kSPECIES];
- if (!ExpectedSigmas(t,sigma,AliPID::kSPECIES)) continue;
-
- AliDebug(2,Form("Expected TOF signals [ps]: %f %f %f %f %f",
- GetExpectedSignal(t,AliPID::kElectron),
- GetExpectedSignal(t,AliPID::kMuon),
- GetExpectedSignal(t,AliPID::kPion),
- GetExpectedSignal(t,AliPID::kKaon),
- GetExpectedSignal(t,AliPID::kProton)
- ));
-
- AliDebug(2,Form("Expected TOF std deviations [ps]: %f %f %f %f %f",
- GetExpectedSigma(t,AliPID::kElectron),
- GetExpectedSigma(t,AliPID::kMuon),
- GetExpectedSigma(t,AliPID::kPion),
- GetExpectedSigma(t,AliPID::kKaon),
- GetExpectedSigma(t,AliPID::kProton)
- ));
-
- AliDebug(2,Form("Expected TOF std deviations [number of expected sigmas]: %f %f %f %f %f",
- GetNumberOfSigmas(t,AliPID::kElectron),
- GetNumberOfSigmas(t,AliPID::kMuon),
- GetNumberOfSigmas(t,AliPID::kPion),
- GetNumberOfSigmas(t,AliPID::kKaon),
- GetNumberOfSigmas(t,AliPID::kProton)
- ));
-
- Double_t tof = t->GetTOFsignal() - fTime0;
-
- Double_t p[AliPID::kSPECIES];
- Bool_t mismatch = kTRUE, heavy = kTRUE;
- for (Int_t j=0; j<AliPID::kSPECIES; j++) {
- Double_t sig = sigma[j];
- if (TMath::Abs(tof-time[j]) > fRange*sig) {
- p[j] = TMath::Exp(-0.5*fRange*fRange)/sig;
- } else
- p[j] = TMath::Exp(-0.5*(tof-time[j])*(tof-time[j])/(sig*sig))/sig;
-
- // Check the mismatching
- Double_t mass = AliPID::ParticleMass(j);
- Double_t pm = GetMismatchProbability(t->GetP(),mass);
- if (p[j]>pm) mismatch = kFALSE;
-
- // Check for particles heavier than (AliPID::kSPECIES - 1)
- if (tof < (time[j] + fRange*sig)) heavy=kFALSE;
-
- }
-
- if (mismatch)
- for (Int_t j=0; j<AliPID::kSPECIES; j++) p[j]=1/AliPID::kSPECIES;
-
- t->SetTOFpid(p);
-
- if (heavy) t->ResetStatus(AliESDtrack::kTOFpid);
-
- }
-
- delete[] tracks;
-
- return 0;
-}
-
-//_________________________________________________________________________
-Bool_t AliTOFpidESD::ExpectedSignals(const AliESDtrack *t,
- Double_t s[],Int_t n) const
-{
- //
- // Return the expected PID signals for the involved particle species
- //
-
- if (n > AliPID::kSPECIESN) return kFALSE;
- if ( !t->IsOn(AliESDtrack::kTIME) ) return kFALSE;
-
- Double_t time[AliPID::kSPECIESN];
- t->GetIntegratedTimes(time);
- for (Int_t i=0; i<n; i++) s[i]=time[i];
- return kTRUE;
-}
-
-//_________________________________________________________________________
-Bool_t AliTOFpidESD::ExpectedSigmas(const AliESDtrack *t,
- Double_t s[],Int_t n) const
-{
- //
- // Return the expected sigma of PID signals for the involved
- // particle species.
- // This approximate (but reasonable) formula takes into account the
- // relative momentum resolution.
- //
-
- Double_t time[AliPID::kSPECIESN];
- if ( !ExpectedSignals(t,time,n) ) return kFALSE;
-
- Double_t mom = t->GetP();
- Double_t dpp = 0.01; //mean relative pt resolution;
- if (mom>0.5) dpp = 0.01*mom;
- for (Int_t i=0; i<n; i++) {
- Double_t mass = AliPID::ParticleMass(i);
- Double_t sigma = dpp*time[i]/(1.+ mom*mom/(mass*mass));
- s[i] = TMath::Sqrt(sigma*sigma + fSigma*fSigma);
- }
- return kTRUE;
-}
-
-//_________________________________________________________________________
-Bool_t AliTOFpidESD::NumberOfSigmas(const AliESDtrack *t,
- Double_t s[],Int_t n) const
-{
- //
- // Returns the deviation of the actual PID signal from the expected
- // signal, in units of expected sigmas.
- //
-
- Double_t time[AliPID::kSPECIESN];
- if ( !ExpectedSignals(t,time,n) ) return kFALSE;
-
- if ( !ExpectedSigmas(t,s,n) ) return kFALSE;
-
- Double_t tof = t->GetTOFsignal() - fTime0;
- for (Int_t i=0; i<n; i++) s[i] = (time[i]-tof)/s[i];
-
- return kTRUE;
-}
-
-//_________________________________________________________________________
- Double_t AliTOFpidESD::GetExpectedSignal(const AliESDtrack *t,
- AliPID::EParticleType n) const
-{
- //
- // Return the expected PID signal for the specified particle type.
- // If the operation is not possible, return a negative value.
- //
-
- if (Int_t(n) >= AliPID::kSPECIESN) return -1.;
- if ( !t->IsOn(AliESDtrack::kTIME) ) return -1.;
-
- Double_t time[AliPID::kSPECIESN];
- t->GetIntegratedTimes(time);
-
- return time[n];
-}
-
-//_________________________________________________________________________
- Double_t AliTOFpidESD::GetExpectedSigma(const AliESDtrack *t,
- AliPID::EParticleType n) const
-{
- //
- // Return the expected sigma of the PID signal for the specified
- // particle type.
- // If the operation is not possible, return a negative value.
- //
-
- Double_t time[AliPID::kSPECIESN];
- if ( !ExpectedSignals(t,time,AliPID::kSPECIESN) ) return -1.;
-
- Double_t mom = t->GetP();
- Double_t dpp = 0.01; //mean relative pt resolution;
- if (mom>0.5) dpp = 0.01*mom;
-
- Double_t mass = AliPID::ParticleMass(n);
- Double_t sigma = dpp*time[n]/(1.+ mom*mom/(mass*mass));
-
- return TMath::Sqrt(sigma*sigma + fSigma*fSigma);
-}
-
-//_________________________________________________________________________
- Double_t AliTOFpidESD::GetNumberOfSigmas(const AliESDtrack *t,
- AliPID::EParticleType n) const
-{
- //
- // Returns the deviation of the actual PID signal from the expected
- // signal for the specified particle type, in units of expected
- // sigmas.
- // If the operation is not possible, return a negative value.
- //
-
- Double_t time=GetExpectedSignal(t,n);;
- if (time < 0.) return -1.;
-
- Double_t sigma=GetExpectedSigma(t,n);
- if (sigma < 0.) return -1;
-
- Double_t tof=t->GetTOFsignal() - fTime0;
- return (time-tof)/sigma;
-}
+++ /dev/null
-#ifndef ALITOFPIDESD_H
-#define ALITOFPIDESD_H
-
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-//-------------------------------------------------------
-// TOF PID class
-// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
-//-------------------------------------------------------
-
-#include "TObject.h"
-#include "AliPID.h"
-
-class AliESDEvent;
-class AliESDtrack;
-
-class AliTOFpidESD : public TObject {
-public:
- AliTOFpidESD();
- AliTOFpidESD(Double_t *param);
- ~AliTOFpidESD(){}
-
- void SetTimeZero(Double_t t0) { fTime0=t0; }
- Double_t GetTimeZero() const { return fTime0; }
-
- void SetMaxMismatchProbability(Double_t p) {fPmax=p;}
- Double_t GetMaxMismatchProbability() const {return fPmax;}
-
- Int_t MakePID(AliESDEvent *event);
- Int_t MakePID(AliESDEvent *event, Double_t timeZero);
-
- Bool_t ExpectedSignals(const AliESDtrack *t,
- Double_t s[],
- Int_t n=AliPID::kSPECIES) const;
- Bool_t ExpectedSigmas(const AliESDtrack *t,
- Double_t s[],
- Int_t n=AliPID::kSPECIES) const;
- Bool_t NumberOfSigmas(const AliESDtrack *t,
- Double_t s[],
- Int_t n=AliPID::kSPECIES) const;
-
- Double_t GetExpectedSignal(const AliESDtrack *t,
- AliPID::EParticleType n=AliPID::kKaon) const;
- Double_t GetExpectedSigma(const AliESDtrack *t,
- AliPID::EParticleType n=AliPID::kKaon) const;
- Double_t GetNumberOfSigmas(const AliESDtrack *t,
- AliPID::EParticleType n=AliPID::kKaon) const;
-
-private:
- Double_t GetMismatchProbability(Double_t p,Double_t mass) const;
-
- Double_t fSigma; // intrinsic TOF resolution
- Double_t fRange; // one particle type PID range (in sigmas)
- Double_t fPmax; // "maximal" probability of mismathing (at ~0.5 GeV/c)
- Double_t fTime0; // time zero
-
- ClassDef(AliTOFpidESD,3) // TOF PID class
-};
-
-#endif
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+//-----------------------------------------------------------------
+// Implementation of the TPC PID class
+// Very naive one... Should be made better by the detector experts...
+// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
+// With many additions and modifications suggested by
+// Alexander Kalweit, GSI, alexander.philipp.kalweit@cern.ch
+// Dariusz Miskowiec, GSI, D.Miskowiec@gsi.de
+//-----------------------------------------------------------------
+
+#include "AliTPCPIDResponse.h"
+#include "AliExternalTrackParam.h"
+
+ClassImp(AliTPCPIDResponse)
+
+//_________________________________________________________________________
+AliTPCPIDResponse::AliTPCPIDResponse():
+ fMIP(50.),
+ fRes0(0.07),
+ fResN2(0.),
+ fKp1(0.76176e-1),
+ fKp2(10.632),
+ fKp3(0.13279e-4),
+ fKp4(1.8631),
+ fKp5(1.9479)
+{
+ //
+ // The default constructor
+ //
+}
+
+//_________________________________________________________________________
+AliTPCPIDResponse::AliTPCPIDResponse(Double_t *param):
+ fMIP(param[0]),
+ fRes0(param[1]),
+ fResN2(param[2]),
+ fKp1(0.76176e-1),
+ fKp2(10.632),
+ fKp3(0.13279e-4),
+ fKp4(1.8631),
+ fKp5(1.9479)
+{
+ //
+ // The main constructor
+ //
+}
+
+Double_t AliTPCPIDResponse::Bethe(Double_t betaGamma) const {
+ //
+ // This is the Bethe-Bloch function normalised to 1 at the minimum
+ // WARNING
+ // Simulated and reconstructed Bethe-Bloch differs
+ // Simulated curve is the dNprim/dx
+ // Reconstructed is proportianal dNtot/dx
+ // Temporary fix for production - Simple linear correction function
+ // Future 2 Bethe Bloch formulas needed
+ // 1. for simulation
+ // 2. for reconstructed PID
+ //
+ const Float_t kmeanCorrection =0.1;
+ Double_t bb=
+ AliExternalTrackParam::BetheBlochAleph(betaGamma,fKp1,fKp2,fKp3,fKp4,fKp5);
+ return bb*fMIP;
+}
+
+//_________________________________________________________________________
+void AliTPCPIDResponse::SetBetheBlochParameters(Double_t kp1,
+ Double_t kp2,
+ Double_t kp3,
+ Double_t kp4,
+ Double_t kp5) {
+ //
+ // Set the parameters of the ALEPH Bethe-Bloch formula
+ //
+ fKp1=kp1;
+ fKp2=kp2;
+ fKp3=kp3;
+ fKp4=kp4;
+ fKp5=kp5;
+}
+//_________________________________________________________________________
+void AliTPCPIDResponse::SetSigma(Float_t res0, Float_t resN2) {
+ //
+ // Set the relative resolution sigma_rel = res0 * sqrt(1+resN2/npoint)
+ //
+ fRes0 = res0;
+ fResN2 = resN2;
+}
+
+//_________________________________________________________________________
+Double_t AliTPCPIDResponse::GetExpectedSignal(const Float_t mom,
+ AliPID::EParticleType n) const {
+ //
+ // Calculates the expected PID signal as the function of
+ // the information stored in the track, for the specified particle type
+ //
+ // At the moment, these signals are just the results of calling the
+ // Bethe-Bloch formula.
+ // This can be improved. By taking into account the number of
+ // assigned clusters and/or the track dip angle, for example.
+ //
+
+ Double_t mass=AliPID::ParticleMass(n);
+ return Bethe(mom/mass);
+}
+
+//_________________________________________________________________________
+Double_t AliTPCPIDResponse::GetExpectedSigma(const Float_t mom,
+ const Int_t nPoints,
+ AliPID::EParticleType n) const {
+ //
+ // Calculates the expected sigma of the PID signal as the function of
+ // the information stored in the track, for the specified particle type
+ //
+ //
+
+ if (nPoints != 0)
+ return GetExpectedSignal(mom,n)*fRes0*sqrt(1. + fResN2/nPoints);
+ else
+ return GetExpectedSignal(mom,n)*fRes0;
+}
-#ifndef ALITPCpIDESD_H
-#define ALITPCpIDESD_H
+#ifndef ALITPCPIDRESPONSE_H
+#define ALITPCPIDRESPONSE_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
#include "AliPID.h"
-class AliESDEvent;
-class AliESDtrack;
-
-class AliTPCpidESD {
+class AliTPCPIDResponse {
public:
- AliTPCpidESD();
- AliTPCpidESD(Double_t *param);
- virtual ~AliTPCpidESD() {}
+ AliTPCPIDResponse();
+ AliTPCPIDResponse(Double_t *param);
+ virtual ~AliTPCPIDResponse() {}
+ void SetSigma(Float_t res0, Float_t resN2);
void SetBetheBlochParameters(Double_t kp1,
Double_t kp2,
Double_t kp3,
Double_t kp4,
Double_t kp5
);
- Int_t MakePID(AliESDEvent *event);
+ void SetMip(Float_t mip) { fMIP = mip; } // Set overall normalisation; mean dE/dx for MIP
Double_t Bethe(Double_t bg) const;
- Bool_t ExpectedSignals(const AliESDtrack *t,
- Double_t s[],
- Int_t n=AliPID::kSPECIES) const;
- Bool_t ExpectedSigmas(const AliESDtrack *t,
- Double_t s[],
- Int_t n=AliPID::kSPECIES) const;
- Bool_t NumberOfSigmas(const AliESDtrack *t,
- Double_t s[],
- Int_t n=AliPID::kSPECIES) const;
- Double_t GetExpectedSignal(const AliESDtrack *t,
- AliPID::EParticleType n=AliPID::kKaon) const;
- Double_t GetExpectedSigma(const AliESDtrack *t,
+ Double_t GetExpectedSignal(const Float_t mom,
AliPID::EParticleType n=AliPID::kKaon) const;
- Double_t GetNumberOfSigmas(const AliESDtrack *t,
+ Double_t GetExpectedSigma(const Float_t mom, const Int_t nPoints,
AliPID::EParticleType n=AliPID::kKaon) const;
+ Float_t GetNumberOfSigmas(const Float_t mom, const Float_t dEdx,
+ const Int_t nPoints,
+ AliPID::EParticleType n=AliPID::kKaon) const {
+
+ Double_t bethe=GetExpectedSignal(mom,n);
+ Double_t sigma=GetExpectedSigma(mom,nPoints,n);
+ return (dEdx-bethe)/sigma;
+ }
+ Double_t GetMIP() const { return fMIP;}
private:
- Double_t fMIP; // dEdx for MIP
- Double_t fRes; // relative dEdx resolution
- Double_t fRange; // one particle type PID range (in sigmas)
+ Float_t fMIP; // dEdx for MIP
+ Float_t fRes0; // relative dEdx resolution rel sigma = fRes0*sqrt(1+fResN2/npoint)
+ Float_t fResN2; // relative Npoint dependence rel sigma = fRes0*sqrt(1+fResN2/npoint)
Double_t fKp1; // Parameters
Double_t fKp2; // of
Double_t fKp4; // Bethe-Bloch
Double_t fKp5; // formula
- ClassDef(AliTPCpidESD,2) // TPC PID class
+ ClassDef(AliTPCPIDResponse,2) // TPC PID class
};
#endif
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-//-----------------------------------------------------------------
-// Implementation of the TPC PID class
-// Very naive one... Should be made better by the detector experts...
-// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
-// With many additions and modifications suggested by
-// Alexander Kalweit, GSI, alexander.philipp.kalweit@cern.ch
-// Dariusz Miskowiec, GSI, D.Miskowiec@gsi.de
-//-----------------------------------------------------------------
-
-#include "AliTPCpidESD.h"
-#include "AliESDEvent.h"
-#include "AliESDtrack.h"
-
-ClassImp(AliTPCpidESD)
-
-//_________________________________________________________________________
-AliTPCpidESD::AliTPCpidESD():
- fMIP(50.),
- fRes(0.07),
- fRange(5.),
- fKp1(0.76176e-1),
- fKp2(10.632),
- fKp3(0.13279e-4),
- fKp4(1.8631),
- fKp5(1.9479)
-{
- //
- // The default constructor
- //
-}
-
-//_________________________________________________________________________
-AliTPCpidESD::AliTPCpidESD(Double_t *param):
- fMIP(param[0]),
- fRes(param[1]),
- fRange(param[2]),
- fKp1(0.76176e-1),
- fKp2(10.632),
- fKp3(0.13279e-4),
- fKp4(1.8631),
- fKp5(1.9479)
-{
- //
- // The main constructor
- //
-}
-
-Double_t AliTPCpidESD::Bethe(Double_t betaGamma) const {
- //
- // This is the Bethe-Bloch function normalised to 1 at the minimum
- // WARNING
- // Simulated and reconstructed Bethe-Bloch differs
- // Simulated curve is the dNprim/dx
- // Reconstructed is proportianal dNtot/dx
- // Temporary fix for production - Simple linear correction function
- // Future 2 Bethe Bloch formulas needed
- // 1. for simulation
- // 2. for reconstructed PID
- //
- const Float_t kmeanCorrection =0.1;
- Double_t bb=
- AliExternalTrackParam::BetheBlochAleph(betaGamma,fKp1,fKp2,fKp3,fKp4,fKp5);
- Double_t meanCorrection =(1+(bb-1)*kmeanCorrection);
- bb *= meanCorrection;
- return bb;
-}
-
-//_________________________________________________________________________
-void AliTPCpidESD::SetBetheBlochParameters(Double_t kp1,
- Double_t kp2,
- Double_t kp3,
- Double_t kp4,
- Double_t kp5) {
- //
- // Set the parameters of the ALEPH Bethe-Bloch formula
- //
- fKp1=kp1;
- fKp2=kp2;
- fKp3=kp3;
- fKp4=kp4;
- fKp5=kp5;
-}
-
-//_________________________________________________________________________
-Bool_t AliTPCpidESD::ExpectedSigmas(const AliESDtrack *t,
- Double_t s[],
- Int_t n) const {
- //
- // Calculate the expected dE/dx resolution as the function of
- // the information stored in the track.
- //
- // At the moment, this resolution is just proportional to the expected
- // signal. This can be improved. By taking into account the number of
- // assigned clusters, for example.
- //
- Bool_t ok=kFALSE;
- Double_t signals[AliPID::kSPECIESN];
- if (ExpectedSignals(t,signals,n)) {
- for (Int_t i=0; i<n; i++) s[i] = fRes*signals[i];
- ok=kTRUE;
- }
- return ok;
-}
-
-//_________________________________________________________________________
-Bool_t AliTPCpidESD::NumberOfSigmas(const AliESDtrack *t,
- Double_t s[],
- Int_t n) const {
- //
- // Calculate the deviation of the actual PID signal from the expected
- // signal, in units of expected sigmas.
- //
- Bool_t ok=kFALSE;
-
- Double_t dedx=t->GetTPCsignal()/fMIP;
- Double_t sigmas[AliPID::kSPECIESN];
- if (ExpectedSigmas(t,sigmas,n)) {
- Double_t signals[AliPID::kSPECIESN];
- if (ExpectedSignals(t,signals,n)) {
- for (Int_t i=0; i<n; i++) s[i] = (signals[i] - dedx)/sigmas[i];
- ok=kTRUE;
- }
- }
- return ok;
-}
-
-//_________________________________________________________________________
-Bool_t AliTPCpidESD::ExpectedSignals(const AliESDtrack *t,
- Double_t s[],
- Int_t n) const {
- //
- // Calculates the expected PID signals as the function of
- // the information stored in the track.
- //
- // At the moment, these signals are just the results of calling the
- // Bethe-Bloch formula.
- // This can be improved. By taking into account the number of
- // assigned clusters and/or the track dip angle, for example.
- //
-
- Double_t mom=t->GetP();
- const AliExternalTrackParam *in=t->GetInnerParam();
- if (in) mom=in->GetP();
-
- for (Int_t i=0; i<n; i++) {
- Double_t mass=AliPID::ParticleMass(i);
- s[i]=Bethe(mom/mass);
- }
-
- return kTRUE;
-}
-
-//_________________________________________________________________________
-Double_t AliTPCpidESD::GetExpectedSignal(const AliESDtrack *t,
- AliPID::EParticleType n) const {
- //
- // Calculates the expected PID signal as the function of
- // the information stored in the track, for the specified particle type
- //
- // At the moment, these signals are just the results of calling the
- // Bethe-Bloch formula.
- // This can be improved. By taking into account the number of
- // assigned clusters and/or the track dip angle, for example.
- //
-
- Double_t mom=t->GetP();
- const AliExternalTrackParam *in=t->GetInnerParam();
- if (in) mom=in->GetP();
-
- Double_t mass=AliPID::ParticleMass(n);
- return Bethe(mom/mass);
-}
-
-//_________________________________________________________________________
-Double_t AliTPCpidESD::GetExpectedSigma(const AliESDtrack *t,
- AliPID::EParticleType n) const {
- //
- // Calculates the expected sigma of the PID signal as the function of
- // the information stored in the track, for the specified particle type
- //
- //
- // At the moment, this sigma is just proportional to the expected
- // signal. This can be improved. By taking into account the number of
- // assigned clusters, for example.
- //
-
- return fRes*GetExpectedSignal(t,n);
-}
-
-//_________________________________________________________________________
-Double_t AliTPCpidESD::GetNumberOfSigmas(const AliESDtrack *t,
- AliPID::EParticleType n) const {
- //
- // Calculate the deviation of the actual PID signal from the expected
- // signal, in units of expected sigmas, for the specified particle type
- //
-
- Double_t dedx=t->GetTPCsignal()/fMIP;
- return (dedx - GetExpectedSignal(t,n))/GetExpectedSigma(t,n);
-}
-
-//_________________________________________________________________________
-Int_t AliTPCpidESD::MakePID(AliESDEvent *event)
-{
- //
- // This function calculates the "detector response" PID probabilities
- //
- Int_t ntrk=event->GetNumberOfTracks();
- for (Int_t i=0; i<ntrk; i++) {
- AliESDtrack *t=event->GetTrack(i);
- if ((t->GetStatus()&AliESDtrack::kTPCin )==0)
- if ((t->GetStatus()&AliESDtrack::kTPCout)==0) continue;
- Double_t p[10];
- Double_t dedx=t->GetTPCsignal()/fMIP;
- Bool_t mismatch=kTRUE, heavy=kTRUE;
- for (Int_t j=0; j<AliPID::kSPECIES; j++) {
- AliPID::EParticleType type=AliPID::EParticleType(j);
- Double_t bethe=GetExpectedSignal(t,type);
- Double_t sigma=GetExpectedSigma(t,type);
- if (TMath::Abs(dedx-bethe) > fRange*sigma) {
- p[j]=TMath::Exp(-0.5*fRange*fRange)/sigma;
- } else {
- p[j]=TMath::Exp(-0.5*(dedx-bethe)*(dedx-bethe)/(sigma*sigma))/sigma;
- mismatch=kFALSE;
- }
-
- // Check for particles heavier than (AliPID::kSPECIES - 1)
- if (dedx < (bethe + fRange*sigma)) heavy=kFALSE;
-
- }
-
- if (mismatch)
- for (Int_t j=0; j<AliPID::kSPECIES; j++) p[j]=1/AliPID::kSPECIES;
-
- t->SetTPCpid(p);
-
- if (heavy) t->ResetStatus(AliESDtrack::kTPCpid);
-
- }
- return 0;
-}
//-------------------------------------------------------------------------
#include <TNamed.h>
+class AliESDEvent;
class AliVCuts : public TNamed {
virtual ~AliVCuts() { };
AliVCuts(const AliVCuts& evt);
AliVCuts& operator=(const AliVCuts& evt);
- virtual Bool_t IsSelected(TObject* /* obj */) = 0;
+ virtual Bool_t IsSelected(TObject* /* obj */, TObject * /*evt*/ = 0) = 0;
ClassDef(AliVCuts,1);
};
#pragma link C++ class AliESDVZEROfriend+;
-#pragma link C++ class AliTPCpidESD+;
-#pragma link C++ class AliTOFpidESD+;
-
#pragma link C++ class AliTriggerScalersESD+;
#pragma link C++ class AliTriggerScalersRecordESD+;
#pragma link C++ class AliExternalTrackParam+;
#pragma link C++ class AliQA+;
+#pragma link C++ class AliITSPidParams+;
+#pragma link C++ class AliITSPIDResponse+;
+#pragma link C++ class AliTPCPIDResponse+;
+#pragma link C++ class AliTOFPIDResponse+;
+
#endif
AliESDACORDE.cxx \
AliTriggerIR.cxx \
AliESDVZEROfriend.cxx \
- AliTPCpidESD.cxx \
- AliTOFpidESD.cxx \
AliTriggerScalersESD.cxx \
AliTriggerScalersRecordESD.cxx
AliCodeTimer.cxx \
AliPDG.cxx \
AliTimeStamp.cxx AliTriggerScalers.cxx AliTriggerScalersRecord.cxx \
- AliExternalTrackParam.cxx AliQA.cxx
+ AliExternalTrackParam.cxx AliQA.cxx \
+ AliITSPidParams.cxx \
+ AliITSPIDResponse.cxx AliTPCPIDResponse.cxx AliTOFPIDResponse.cxx
HDRS:= $(SRCS:.cxx=.h)
#include "AliTOFcalibHisto.h"
#include "AliPID.h"
#include "AliESDpid.h"
-#include "AliTOFpidESD.h"
ClassImp(AliTOFT0maker)
}
//____________________________________________________________________________
void AliTOFT0maker::RemakeTOFpid(AliESDEvent *esd,Float_t timezero){
- Double_t param[3];
-
- param[0]=TMath::Sqrt(fT0sigma*fT0sigma + fTimeResolution*fTimeResolution);
- param[1]=5;
- param[2]=0.9;
-
- AliTOFpidESD* pidTOF=new AliTOFpidESD(param);
- pidTOF->MakePID(esd,timezero);
-
- AliESDpid* pidESD = new AliESDpid();
- pidESD->MakePID(esd);
+ AliESDpid pidESD;
+ pidESD.GetTOFResponse().SetTimeResolution(TMath::Sqrt(fT0sigma*fT0sigma + fTimeResolution*fTimeResolution));
+ pidESD.MakePID(esd,kFALSE,timezero);
}
//____________________________________________________________________________
#include "AliGeomManager.h"
#include "AliESDtrack.h"
#include "AliESDEvent.h"
+#include "AliESDpid.h"
#include "AliLog.h"
#include "AliTrackPointArray.h"
#include "AliCDBManager.h"
-#include "AliTOFpidESD.h"
+//#include "AliTOFpidESD.h"
#include "AliTOFRecoParam.h"
#include "AliTOFReconstructor.h"
#include "AliTOFcluster.h"
AliTOFtracker::AliTOFtracker():
fRecoParam(0x0),
fGeom(0x0),
- fPid(0x0),
fN(0),
fNseeds(0),
fNseedsTOF(0),
delete fRecoParam;
}
delete fGeom;
- delete fPid;
delete fHDigClusMap;
delete fHDigNClus;
delete fHDigClusTime;
}
//_____________________________________________________________________________
+void AliTOFtracker::GetPidSettings(AliESDpid *esdPID) {
+ //
+ // Sets TOF resolution from RecoParams
+ //
+ if (fRecoParam)
+ esdPID->GetTOFResponse().SetTimeResolution(fRecoParam->GetTimeResolution());
+ else
+ AliWarning("fRecoParam not yet set; cannot set PID settings");
+}
+//_____________________________________________________________________________
Int_t AliTOFtracker::PropagateBack(AliESDEvent* event) {
//
// Gets seeds from ESD event and Match with TOF Clusters
//if(fRecoParam->GetApplyPbPbCuts())fRecoParam=fRecoParam->GetPbPbparam();
//fRecoParam->PrintParameters();
- Double_t parPID[2];
- parPID[0]=fRecoParam->GetTimeResolution();
- parPID[1]=fRecoParam->GetTimeNSigma();
- fPid=new AliTOFpidESD(parPID);
-
//Initialise some counters
fNseeds=0;
}
}
- //Handle Time Zero information
-
- Double_t timeZero=0.;
- Double_t timeZeroMax=99999.;
- Bool_t usetimeZero = fRecoParam->UseTimeZero();
- Bool_t timeZeroFromT0 = fRecoParam->GetTimeZerofromT0();
- Bool_t timeZeroFromTOF = fRecoParam->GetTimeZerofromTOF();
-
- AliDebug(2,Form("Use Time Zero?: %d",usetimeZero));
- AliDebug(2,Form("Time Zero from T0? : %d",timeZeroFromT0));
- AliDebug(2,Form("Time Zero From TOF? : %d",timeZeroFromTOF));
-
- if(usetimeZero){
- if(timeZeroFromT0){
- timeZero=GetTimeZerofromT0(event);
- }
- if(timeZeroFromTOF && (timeZero>timeZeroMax || !timeZeroFromT0)){
- timeZero=GetTimeZerofromTOF(event);
- }
- }
- AliDebug(2,Form("time Zero used in PID: %f",timeZero));
//Make TOF PID
- fPid->MakePID(event,timeZero);
+ // Now done in AliESDpid
+ // fPid->MakePID(event,timeZero);
fSeeds->Clear();
fTracks->Clear();
return tofcorr;
}
//_________________________________________________________________________
-Float_t AliTOFtracker::GetTimeZerofromT0(AliESDEvent *event) const {
-
- //Returns TimeZero as measured by T0 detector
-
- return event->GetT0();
-}
-//_________________________________________________________________________
-Float_t AliTOFtracker::GetTimeZerofromTOF(AliESDEvent * /*event*/) const {
-
- //dummy, for the moment. T0 algorithm using tracks on TOF
- {
- //place T0 algo here...
- }
- return 0.;
-}
-//_________________________________________________________________________
void AliTOFtracker::FillClusterArray(TObjArray* arr) const
{
// -- : Chiara.Zampolli@bo.infn.it //
// -- : Silvia.Arcelli@bo.infn.it //
// //
-//----------------------------------------------------------------------//
#include "AliTracker.h"
class TH2F;
class AliESDEvent;
+class AliESDpid;
class AliTOFcluster;
class AliTOFRecoParam;
class AliTOFGeometry;
-class AliTOFpidESD;
class AliTOFtracker : public AliTracker {
AliTOFtracker();
virtual ~AliTOFtracker();
+ virtual void GetPidSettings(AliESDpid *esdPID);
virtual Int_t Clusters2Tracks(AliESDEvent* /*event*/) {return -1;};
virtual Int_t PropagateBack(AliESDEvent* event);
virtual Int_t RefitInward(AliESDEvent* /*event*/) {return -1;};
Int_t FindClusterIndex(Double_t z) const; // Returns cluster index
void MatchTracks(Bool_t mLastStep); // Matching Algorithm
void CollectESD(); // Select starting Set for Matching
- Float_t GetTimeZerofromTOF(AliESDEvent* /*event*/) const; // T0 from TOF
- Float_t GetTimeZerofromT0(AliESDEvent* event) const; // T0 from T0
Float_t CorrectTimeWalk(Float_t dist,Float_t tof); // Time Walk correction
const AliTOFRecoParam* fRecoParam; // Pointer to TOF Recon. Pars
AliTOFGeometry* fGeom; // Pointer to TOF geometry
- AliTOFpidESD* fPid; // Pointer to TOF PID
AliTOFcluster *fClusters[kMaxCluster]; // pointers to the TOF clusters
Int_t fN; // Number of Clusters
Float_t fExpTimeKa; // exp time, Kaons
Float_t fExpTimePr; // exp time, Protons
- ClassDef(AliTOFtracker, 3) // TOF tracker
+ ClassDef(AliTOFtracker, 4) // TOF tracker
};
#endif
#include "AliESDEvent.h"
#include "AliESDtrack.h"
+#include "AliESDpid.h"
#include "AliTOFRecoParam.h"
#include "AliTOFReconstructor.h"
#include "AliTOFGeometry.h"
#include "AliTOFtrackerMI.h"
#include "AliTOFtrack.h"
-#include "AliTOFpidESD.h"
class TGeoManager;
AliTOFtrackerMI::AliTOFtrackerMI():
fRecoParam(0x0),
fGeom(0x0),
- fPid(0x0),
fN(0),
fNseeds(0),
fNseedsTOF(0),
}
delete fRecoParam;
delete fGeom;
- delete fPid;
if (fTracks){
fTracks->Delete();
delete fTracks;
fSeeds=0x0;
}
}
+//_____________________________________________________________________________
+void AliTOFtrackerMI::GetPidSettings(AliESDpid *esdPID) {
+ //
+ // Sets TOF resolution from RecoParams
+ //
+ if (fRecoParam)
+ esdPID->GetTOFResponse().SetTimeResolution(fRecoParam->GetTimeResolution());
+ else
+ AliWarning("fRecoParam not yet set; cannot set PID settings");
+}
//_____________________________________________________________________________
Int_t AliTOFtrackerMI::PropagateBack(AliESDEvent* event) {
//if(fRecoParam->GetApplyPbPbCuts())fRecoParam=fRecoParam->GetPbPbparam();
//fRecoParam->PrintParameters();
- Double_t parPID[2];
- parPID[0]=fRecoParam->GetTimeResolution();
- parPID[1]=fRecoParam->GetTimeNSigma();
- fPid=new AliTOFpidESD(parPID);
-
//Initialise some counters
fNseeds=0;
//Make TOF PID
- fPid->MakePID(event);
fSeeds->Clear();
fTracks->Clear();
class TClonesArray;
class AliESDEvent;
+class AliESDpid;
class AliTOFcluster;
class AliTOFRecoParam;
class AliTOFGeometry;
class AliTOFtrack;
-class AliTOFpidESD;
class AliTOFtrackerMI : public AliTracker {
// virtual ~AliTOFtrackerMI() {delete fTOFpid;}
virtual ~AliTOFtrackerMI();
+ virtual void GetPidSettings(AliESDpid *esdPID);
virtual Int_t Clusters2Tracks(AliESDEvent* /*event*/) {return -1;};
virtual Int_t PropagateBack(AliESDEvent* event);
virtual Int_t RefitInward(AliESDEvent* /*event*/) {return -1;};
const AliTOFRecoParam* fRecoParam; // Pointer to TOF Recon. Pars
AliTOFGeometry* fGeom; // Pointer to TOF geometry
- AliTOFpidESD* fPid; // Pointer to TOF PID
AliTOFcluster *fClusters[kMaxCluster]; // pointers to the TOF clusters
Int_t fN; // Number of Clusters
TClonesArray* fTracks; //! pointer to the TClonesArray with TOF tracks
TClonesArray* fSeeds; //! pointer to the TClonesArray with ESD tracks
TTreeSRedirector *fDebugStreamer; //!debug streamer
- ClassDef(AliTOFtrackerMI, 1) // TOF trackerMI
+ ClassDef(AliTOFtrackerMI, 2) // TOF trackerMI
};
#endif
#include "AliESDtrack.h"
#include "AliESDEvent.h"
+#include "AliESDpid.h"
#include "AliLog.h"
#include "AliTrackPointArray.h"
#include "AliGeomManager.h"
#include "AliTOFGeometry.h"
#include "AliTOFtrackerV1.h"
#include "AliTOFtrack.h"
-#include "AliTOFpidESD.h"
extern TROOT *gROOT;
//_____________________________________________________________________________
AliTOFtrackerV1::AliTOFtrackerV1():
fRecoParam(0x0),
- fPid(0x0),
fN(0),
fNseeds(0),
fNseedsTOF(0),
if(!(AliCDBManager::Instance()->GetCacheFlag())){
delete fRecoParam;
}
- delete fPid;
delete fHDigClusMap;
delete fHDigNClus;
delete fHDigClusTime;
}
}
//_____________________________________________________________________________
+void AliTOFtrackerV1::GetPidSettings(AliESDpid *esdPID) {
+ //
+ // Sets TOF resolution from RecoParams
+ //
+ if (fRecoParam)
+ esdPID->GetTOFResponse().SetTimeResolution(fRecoParam->GetTimeResolution());
+ else
+ AliWarning("fRecoParam not yet set; cannot set PID settings");
+}
+//_____________________________________________________________________________
Int_t AliTOFtrackerV1::PropagateBack(AliESDEvent* event) {
//
// Gets seeds from ESD event and Match with TOF Clusters
//if(fRecoParam->GetApplyPbPbCuts())fRecoParam=fRecoParam->GetPbPbparam();
//fRecoParam->PrintParameters();
- Double_t parPID[2];
- parPID[0]=fRecoParam->GetTimeResolution();
- parPID[1]=fRecoParam->GetTimeNSigma();
- fPid=new AliTOFpidESD(parPID);
+ //Handle Time Zero information
+
+ Double_t timeZero=0.;
+ Double_t timeZeroMax=99999.;
//Initialise some counters
}
}
- //Handle Time Zero information
-
- Double_t timeZero=0.;
- Double_t timeZeroMax=99999.;
- Bool_t usetimeZero = fRecoParam->UseTimeZero();
- Bool_t timeZeroFromT0 = fRecoParam->GetTimeZerofromT0();
- Bool_t timeZeroFromTOF = fRecoParam->GetTimeZerofromTOF();
-
- AliDebug(2,Form("Use Time Zero?: %d",usetimeZero));
- AliDebug(2,Form("Time Zero from T0? : %d",timeZeroFromT0));
- AliDebug(2,Form("Time Zero From TOF? : %d",timeZeroFromTOF));
-
- if(usetimeZero){
- if(timeZeroFromT0){
- timeZero=GetTimeZerofromT0(event);
- }
- if(timeZeroFromTOF && (timeZero>timeZeroMax || !timeZeroFromT0)){
- timeZero=GetTimeZerofromTOF(event);
- }
- }
- AliDebug(2,Form("time Zero used in PID: %f",timeZero));
- //Make TOF PID
- fPid->MakePID(event,timeZero);
-
fSeeds->Clear();
fTracks->Clear();
return 0;
class AliTOFcluster;
class AliTOFRecoParam;
-class AliTOFpidESD;
+class AliESDpid;
class AliTOFtrackerV1 : public AliTracker {
AliTOFtrackerV1();
virtual ~AliTOFtrackerV1();
+ virtual void GetPidSettings(AliESDpid *esdPID);
virtual Int_t Clusters2Tracks(AliESDEvent* /*event*/) {return -1;};
virtual Int_t PropagateBack(AliESDEvent* event);
virtual Int_t RefitInward(AliESDEvent* /*event*/) {return -1;};
Float_t CorrectTimeWalk(Float_t dist,Float_t tof); // Time Walk correction
const AliTOFRecoParam* fRecoParam; // Pointer to TOF Recon. Pars
- AliTOFpidESD* fPid; // Pointer to TOF PID
AliTOFcluster *fClusters[kMaxCluster]; // pointers to the TOF clusters
Int_t fN; // Number of Clusters
TH2F * fHRecSigYVsPWin;//Reco QA, search window size in Y (cm)
TH2F * fHRecSigZVsPWin;//Reco QA, search window size in X (cm)
- ClassDef(AliTOFtrackerV1, 1) // TOF tracker
+ ClassDef(AliTOFtrackerV1, 2) // TOF tracker
};
#endif
#include "AliRawReader.h"
#include "AliTPCclustererMI.h"
#include "AliTPCtrackerMI.h"
-#include "AliTPCpidESD.h"
+//#include "AliTPCpidESD.h"
#include "AliTPCParam.h"
#include "AliTPCParamSR.h"
#include "AliTPCcalibDB.h"
AliESDEvent* esd) const
{
// make PID
-
+/* Now done in AliESDpid
Double_t parTPC[] = {50., 0.07, 5.}; // MIP nnormalized to channel 50 -MI
AliTPCpidESD tpcPID(parTPC);
tpcPID.MakePID(esd);
+*/
}