#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
ResetMultiplicityCorrectionFunctions();
+ fgInstance=this;
}
/*TODO remove?
//_________________________________________________________________________
delete fCorrFuncSigmaMultiplicity;
fCorrFuncSigmaMultiplicity = 0x0;
+ if (fgInstance==this) fgInstance=0;
}
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);
+}
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,
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)
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