* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-*/
+/* $Id$ */
///////////////////////////////////////////////////////////////////////////////
// //
#include <TParticle.h>
#include "AliRun.h"
-#include "AliTRD.h"
#include "AliTRDpidLQ.h"
#include "AliTRDcluster.h"
#include "AliTRDtrack.h"
}
//_____________________________________________________________________________
-AliTRDpidLQ::AliTRDpidLQ(const AliTRDpidLQ &p)
+AliTRDpidLQ::AliTRDpidLQ(const AliTRDpidLQ &p):AliTRDpid(p)
{
//
// AliTRDpidLQ copy constructor
}
//_____________________________________________________________________________
-void AliTRDpidLQ::Copy(TObject &p)
+void AliTRDpidLQ::Copy(TObject &p) const
{
//
// Copy function
//
const Int_t kNpla = AliTRDgeometry::Nplan();
- Float_t charge[kNpla];
- Int_t nCluster[kNpla];
+ Float_t * charge = new Float_t[kNpla];
+ Int_t * nCluster = new Int_t[kNpla];
Float_t lhPi = 0;
Float_t lhEl = 0;
TH1F *hTmpPi;
t->SetLikelihoodElectron(-1.);
- if (isnan(t->GetP())) return kFALSE;
+ if (TMath::IsNaN(t->GetP())) return kFALSE;
Float_t mom = t->GetP();
// Calculate the total charge in each plane
}
}
else {
+ delete [] charge;
+ delete [] nCluster;
return kTRUE;
}
pSum = pEl + pPi;
- if (pSum <= 0) return kFALSE;
+ if (pSum <= 0) {
+ delete [] charge;
+ delete [] nCluster;
+ return kFALSE;
+ }
lhEl = pEl / pSum;
lhPi = pPi / pSum;
// Assign the likelihoods
t->SetLikelihoodElectron(lhEl);
+ delete [] charge;
+ delete [] nCluster;
return kTRUE;
}
//_____________________________________________________________________________
-Bool_t AliTRDpidLQ::CreateHistograms(const Int_t nmom
- , const Float_t minmom
- , const Float_t maxmom)
+Bool_t AliTRDpidLQ::CreateHistograms(Int_t nmom, Float_t minmom, Float_t maxmom)
{
//
// Creates the histograms
// Bool_t status = kTRUE;
-// if (isnan(t->GetP())) return kFALSE;
+// if (TMath::IsNaN(t->GetP())) return kFALSE;
// Float_t mom = t->GetP();
// Int_t ipid = MCpid(t);
const Int_t kNpla = AliTRDgeometry::Nplan();
- if (isnan(t->GetP())) return kFALSE;
+ if (TMath::IsNaN(t->GetP())) return kFALSE;
- Float_t charge[kNpla];
- Int_t nCluster[kNpla];
+ Float_t * charge = new Float_t[kNpla];
+ Int_t * nCluster = new Int_t[kNpla];
Float_t mom = t->GetP();
Int_t ipid = MCpid(t);
TH1F *hTmp = NULL;
- if (!SumCharge(t,charge,nCluster)) return kFALSE;
+ if (!SumCharge(t,charge,nCluster)) {
+ delete [] charge;
+ delete [] nCluster;
+ return kFALSE;
+ }
Int_t index = GetIndex(mom,ipid);
if (index > -1) {
}
}
+ delete [] charge;
+ delete [] nCluster;
return kTRUE;
}
// Returns the histogram index
//
- if (isnan(t->GetP())) return -1;
+ if (TMath::IsNaN(t->GetP())) return -1;
Float_t mom = t->GetP();
Int_t ipid = MCpid(t);
}
//_____________________________________________________________________________
-Int_t AliTRDpidLQ::GetIndex(const Float_t mom, const Int_t ipid)
+Int_t AliTRDpidLQ::GetIndex(Float_t mom, Int_t ipid)
{
//
// Returns the histogram index
}
//_____________________________________________________________________________
-Int_t AliTRDpidLQ::GetIndex(const Int_t imom, const Int_t ipid)
+Int_t AliTRDpidLQ::GetIndex(Int_t imom, Int_t ipid)
{
//
// Returns the histogram index