#include <TFile.h>
#include <TROOT.h>
-#include <TObject.h>
#include <TMultiLayerPerceptron.h>
-#include "AliLog.h"
#include "AliPID.h"
-#include "AliESD.h"
-#include "AliESDtrack.h"
-#include "AliTRDtrack.h"
+#include "AliLog.h"
+#include "AliTRDgeometry.h"
#include "AliTRDCalPIDNN.h"
-#include "AliTRDcalibDB.h"
ClassImp(AliTRDCalPIDNN)
// Read Networks
for (Int_t imom = 0; imom < kNMom; imom++) {
- for (Int_t iplane = 0; iplane < kNPlane; iplane++) {
+ for (Int_t iplane = 0; iplane < AliTRDgeometry::kNlayer; iplane++) {
TMultiLayerPerceptron *nn = (TMultiLayerPerceptron *)
nnFile->Get(Form("NN_Mom%d_Plane%d",imom,iplane));
fModel->AddAt(nn,GetModelID(imom,0,iplane));
if (ip<0 || ip>= kNMom) return 0x0;
AliInfo(Form("Retrive MultiLayerPerceptron for %5.2f GeV/c for plane %d"
- ,fTrackMomentum[ip]
+ ,fgTrackMomentum[ip]
,iplane));
return fModel->At(GetModelID(ip, 0, iplane));
}
//_________________________________________________________________________
-Double_t AliTRDCalPIDNN::GetProbability(Int_t spec, Float_t mom, Float_t *dedx
+Double_t AliTRDCalPIDNN::GetProbability(Int_t spec, Float_t mom
+ , const Float_t * const dedx
, Float_t, Int_t iplane) const
{
//
// find the interval in momentum and track segment length which applies for this data
Int_t imom = 1;
- while (imom<AliTRDCalPID::kNMom-1 && mom>fTrackMomentum[imom]) imom++;
+ while (imom<AliTRDCalPID::kNMom-1 && mom>fgTrackMomentum[imom]) imom++;
Double_t lNN1, lNN2;
- Double_t mom1 = fTrackMomentum[imom-1], mom2 = fTrackMomentum[imom];
+ Double_t mom1 = fgTrackMomentum[imom-1], mom2 = fgTrackMomentum[imom];
TMultiLayerPerceptron *nn = 0x0;
if(!(nn = (TMultiLayerPerceptron *) fModel->At(GetModelID(imom-1, spec, iplane/*, ilength*/)))){
return 0.;
}
- Double_t ddedx[AliTRDtrack::kNMLPslice];
+ Double_t ddedx[AliTRDCalPID::kNSlicesNN];
- for (int inode=0; inode<AliTRDtrack::kNMLPslice; inode++) {
- ddedx[inode] = (((Double_t) dedx[inode]/kMLPscale)*3) // Bug fix! Needs new reference data or different calculation of dedx!!!!
- / (AliTRDcalibDB::Instance()->GetNumberOfTimeBins()/AliTRDtrack::kNMLPslice);
+ for (int inode=0; inode<AliTRDCalPID::kNSlicesNN; inode++) {
+ ddedx[inode] = (Double_t) dedx[inode]/kMLPscale;
}
lNN1 = nn->Evaluate(spec, ddedx);
lNN2 = nn->Evaluate(spec, ddedx);
// return interpolation over momentum binning
- if (mom < fTrackMomentum[0]) {
+ if (mom < fgTrackMomentum[0]) {
return lNN1;
}
- else if (mom > fTrackMomentum[AliTRDCalPID::kNMom-1]) {
+ else if (mom > fgTrackMomentum[AliTRDCalPID::kNMom-1]) {
return lNN2;
}
else {
// Initialization
//
- fModel = new TObjArray(AliTRDCalPID::kNPlane * AliTRDCalPID::kNMom);
+ fModel = new TObjArray(AliTRDgeometry::kNlayer * AliTRDCalPID::kNMom);
fModel->SetOwner();
}
//_________________________________________________________________________
-Int_t AliTRDCalPIDNN::GetModelID(Int_t mom, Int_t, Int_t plane) const
+Int_t AliTRDCalPIDNN::GetModelID(Int_t mom, Int_t /*ii*/, Int_t plane)
{
// returns the ID of the NN distribution (66 MLPs, ID from 56 to 121)