//
// Default constructor
//
- Int_t size = (AliPID::kSPECIES)*(kNPBins);
- //memset(fMapRefHists, 0, sizeof(Int_t) * size);
for(Int_t ispec = 0; ispec < AliPID::kSPECIES; ispec++)
for(Int_t ipbin = 0; ipbin < kNPBins; ipbin++)
fMapRefHists[ispec][ipbin] = -1;
species = AliPID::kPion;
}
pbin = histname.Atoi() - 1;
+ AliDebug(1, Form("Species %d, Histname %s, Pbin %d, Position in container %d", species, histname.Data(), pbin, arrayPos));
fMapRefHists[species][pbin] = arrayPos;
fReferences->AddAt(new TH1F(*dynamic_cast<TH1F *>(tmp)), arrayPos);
arrayPos++;
for(Int_t is(AliPID::kSPECIES); is--;) prob[is]=.2;
Double_t prLayer[AliPID::kSPECIES];
- memset(prLayer, 0, AliPID::kSPECIES*sizeof(Double_t));
Double_t DE[10], s(0.);
for(Int_t il(kNlayer); il--;){
+ memset(prLayer, 0, AliPID::kSPECIES*sizeof(Double_t));
if(!CookdEdx(&dedx[il*n], &DE[0])) continue;
s=0.;
for(Int_t is(AliPID::kSPECIES); is--;){
- prLayer[is] = GetProbabilitySingleLayer(is, p[il], DE[0]);
+ if((DE[0] > 0.) && (p[il] > 0.)) prLayer[is] = GetProbabilitySingleLayer(is, p[il], DE[0]);
AliDebug(3, Form("Probability for Species %d in Layer %d: %f", is, il, prLayer[is]));
s+=prLayer[is];
}
// Interpolation between momentum bins
//
AliDebug(1, Form("Make Probability for Species %d with Momentum %f", species, plocal));
- Int_t pbin = GetLowerMomentumBin(plocal);
+ Int_t pbin = GetLowerMomentumBin(plocal);
+ AliDebug(1, Form("Bin %d", pbin));
Double_t pLayer = 0.;
// Do Interpolation exept for underflow and overflow
if(pbin >= 0 && pbin < kNPBins-1){
TH1 *refHistUpper = NULL, *refHistLower = NULL;
- if(fMapRefHists[species][pbin] > 0)
+ if(fMapRefHists[species][pbin] >= 0)
refHistLower = dynamic_cast<TH1 *>(fReferences->UncheckedAt(fMapRefHists[species][pbin]));
- if(fMapRefHists[species][pbin+1] > 0)
+ if(fMapRefHists[species][pbin+1] >= 0)
refHistUpper = dynamic_cast<TH1 *>(fReferences->UncheckedAt(fMapRefHists[species][pbin+1]));
+ AliDebug(1, Form("Reference Histos (Upper/Lower): [%p|%p]", refHistUpper, refHistLower));
if (refHistLower && refHistUpper ) {
Double_t pLower = refHistLower->GetBinContent(refHistLower->GetXaxis()->FindBin(dEdx));
void SetPIDmethod(Int_t m) {fPIDmethod=m;}
void SetGainNormalisationFactor(Double_t gainFactor) { fGainNormalisationFactor = gainFactor; }
-
private:
Bool_t CookdEdx(Double_t *in, Double_t *out) const;
Int_t GetLowerMomentumBin(Double_t p) const;
- Double_t GetProbabilitySingleLayer(Int_t species, Double_t dEdx, Double_t p) const;
+ Double_t GetProbabilitySingleLayer(Int_t species, Double_t plocal, Double_t dEdx) const;
Bool_t Load(const Char_t *filename = NULL);
static const Double_t fgkPBins[kNPBins];
TObjArray *fReferences; // Container for reference distributions
- Int_t fMapRefHists[AliPID::kSPECIES+1][kNPBins+1];
+ Int_t fMapRefHists[AliPID::kSPECIES][kNPBins];
// Map for the position of a given historgam in the container
Double_t fGainNormalisationFactor; // Gain normalisation factor
UChar_t fPIDmethod; // PID method selector
- ClassDef(AliTRDPIDResponse, 1) // Tool for TRD PID
+ ClassDef(AliTRDPIDResponse, 2) // Tool for TRD PID
};
#endif