Skip to content

Commit

Permalink
Adding static function for the PID visulaization and coparisons
Browse files Browse the repository at this point in the history
Conflicts:
	STEER/STEERBase/AliTPCPIDResponse.h
  • Loading branch information
mivanov authored and hristov committed Jun 20, 2014
1 parent e2cc1ec commit 7e9504c
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
34 changes: 34 additions & 0 deletions STEER/STEERBase/AliTPCPIDResponse.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,14 @@
#include "AliVTrack.h"
#include "AliTPCPIDResponse.h"
#include "AliTPCdEdxInfo.h"
#include "TFile.h"
#include "TSpline.h"

ClassImp(AliTPCPIDResponse);


AliTPCPIDResponse *AliTPCPIDResponse::fgInstance =0;

const char* AliTPCPIDResponse::fgkGainScenarioName[fgkNumberOfGainScenarios+1]=
{
"", //default - no name
Expand Down Expand Up @@ -92,6 +97,7 @@ AliTPCPIDResponse::AliTPCPIDResponse():


ResetMultiplicityCorrectionFunctions();
fgInstance=this;
}
/*TODO remove?
//_________________________________________________________________________
Expand Down Expand Up @@ -146,6 +152,7 @@ AliTPCPIDResponse::~AliTPCPIDResponse()

delete fCorrFuncSigmaMultiplicity;
fCorrFuncSigmaMultiplicity = 0x0;
if (fgInstance==this) fgInstance=0;
}


Expand Down Expand Up @@ -1538,3 +1545,30 @@ Bool_t AliTPCPIDResponse::TrackApex(const AliVTrack* track, Float_t magField, Do
position[2]=0.;
return kTRUE;
}

Double_t AliTPCPIDResponse::EvaldEdxSpline(Double_t bg,Int_t entry){
//
// Evaluate the dEdx response for given entry
//
TSpline * spline = (TSpline*)fSplineArray.At(entry);
if (spline) return spline->Eval(bg);
return 0;
}


Bool_t AliTPCPIDResponse::RegisterSpline(const char * name, Int_t index){
//
// register spline to be used for drawing comparisons
//
TFile * fTPCBB = TFile::Open("$ALICE_ROOT/OADB/COMMON/PID/data/TPCPIDResponse.root");
TObjArray *arrayTPCPID= (TObjArray*) fTPCBB->Get("TPCPIDResponse");
if (fSplineArray.GetEntriesFast()<index) fSplineArray.Expand(index*2);
TSpline3 *spline=0;
if (arrayTPCPID){
spline = (TSpline3*)arrayTPCPID->FindObject(name);
if (spline) fSplineArray.AddAt(spline->Clone(),index);
}
delete arrayTPCPID;
delete fTPCBB;
return (spline!=0);
}
20 changes: 20 additions & 0 deletions STEER/STEERBase/AliTPCPIDResponse.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ class AliTPCPIDResponse: public TNamed {
Float_t GetRes0(ETPCgainScenario s) const { return fRes0[s]; }
Float_t GetResN2(ETPCgainScenario s) const { return fResN2[s]; }

Bool_t RegisterSpline(const char * name, Int_t index);
Double_t EvaldEdxSpline(Double_t bg,Int_t entry);
static Double_t SEvaldEdx(Double_t bg,Int_t entry){ return (fgInstance!=0)? fgInstance->EvaldEdxSpline(bg,entry):0;};

protected:
Double_t GetExpectedSignal(const AliVTrack* track,
AliPID::EParticleType species,
Expand All @@ -232,7 +236,18 @@ class AliTPCPIDResponse: public TNamed {
const TSpline3* responseFunction,
Bool_t correctEta,
Bool_t correctMultiplicity) const;

Double_t GetEtaCorrection(const AliVTrack *track, Double_t dEdxSplines) const;

Double_t GetMultiplicityCorrection(const AliVTrack *track, const Double_t dEdxExpected, const Int_t multiplicity) const;

Double_t GetMultiplicitySigmaCorrection(const Double_t dEdxExpected, const Int_t multiplicity) const;

Double_t GetSigmaPar1(const AliVTrack *track, AliPID::EParticleType species,
Double_t dEdx, const TSpline3* responseFunction) const;
//
// function for numberical debugging 0 registed splines can be used in the TFormula and tree visualizations
//
private:
Float_t fMIP; // dEdx for MIP
Float_t fRes0[fgkNumberOfGainScenarios]; // relative dEdx resolution rel sigma = fRes0*sqrt(1+fResN2/npoint)
Expand Down Expand Up @@ -270,9 +285,14 @@ class AliTPCPIDResponse: public TNamed {
TF1* fCorrFuncMultiplicityTanTheta; //! Function to correct the additional tanTheta dependence of the multiplicity dependence of the TPC dEdx
TF1* fCorrFuncSigmaMultiplicity; //! Function to correct for the multiplicity dependence of the TPC dEdx resolution

//
//
static AliTPCPIDResponse* fgInstance; //! Instance of this class (singleton implementation)
TObjArray fSplineArray; //array of registered splines
ClassDef(AliTPCPIDResponse,6) // TPC PID class
};


#endif


0 comments on commit 7e9504c

Please sign in to comment.