From a3d851c25ee1abe3dab1f3717f2321eadb1eaab3 Mon Sep 17 00:00:00 2001 From: hristov Date: Wed, 7 Nov 2001 11:04:22 +0000 Subject: [PATCH] Minor corrections needed on Sun (arrays with undefined size created by new, inline decration removed when the body was hot in the header file) --- TRD/AliTRDmcTrack.cxx | 4 ++-- TRD/AliTRDpidLQ.cxx | 29 +++++++++++++++++++++++------ TRD/AliTRDpidLQ.h | 6 +++--- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/TRD/AliTRDmcTrack.cxx b/TRD/AliTRDmcTrack.cxx index 2b441d60033..536fee09d4e 100644 --- a/TRD/AliTRDmcTrack.cxx +++ b/TRD/AliTRDmcTrack.cxx @@ -72,7 +72,7 @@ AliTRDmcTrack::AliTRDmcTrack(Int_t label, Bool_t primary, Float_t mass //_____________________________________________________________________________ void AliTRDmcTrack::GetPxPyPz(Double_t& px, Double_t& py, Double_t& pz, - Int_t opt = 0) const + Int_t opt) const { // // Returns momentum components at the entrance (opt >= 0), or @@ -104,7 +104,7 @@ void AliTRDmcTrack::GetPxPyPz(Double_t& px, Double_t& py, Double_t& pz, //_____________________________________________________________________________ void AliTRDmcTrack::GetPlanePxPyPz(Double_t& px, Double_t& py, Double_t& pz, - Int_t plane, Int_t opt = 0) const + Int_t plane, Int_t opt) const { // // Returns momentum components at the entrance (opt >= 0), or diff --git a/TRD/AliTRDpidLQ.cxx b/TRD/AliTRDpidLQ.cxx index b500c4e62f0..2d6150087c8 100644 --- a/TRD/AliTRDpidLQ.cxx +++ b/TRD/AliTRDpidLQ.cxx @@ -15,6 +15,9 @@ /* $Log$ +Revision 1.1 2001/11/06 17:19:41 cblume +Add detailed geometry and simple simulator + */ /////////////////////////////////////////////////////////////////////////////// @@ -180,8 +183,8 @@ Bool_t AliTRDpidLQ::AssignLikelihood(AliTRDtrack *t) // 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; @@ -235,11 +238,17 @@ Bool_t AliTRDpidLQ::AssignLikelihood(AliTRDtrack *t) } } 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; @@ -248,6 +257,8 @@ Bool_t AliTRDpidLQ::AssignLikelihood(AliTRDtrack *t) // Assign the likelihoods t->SetLikelihoodElectron(lhEl); + delete [] charge; + delete [] nCluster; return kTRUE; } @@ -340,13 +351,17 @@ Bool_t AliTRDpidLQ::FillSpectra(const AliTRDtrack *t) if (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) { @@ -359,6 +374,8 @@ Bool_t AliTRDpidLQ::FillSpectra(const AliTRDtrack *t) } } + delete [] charge; + delete [] nCluster; return kTRUE; } diff --git a/TRD/AliTRDpidLQ.h b/TRD/AliTRDpidLQ.h index 20773bab6a8..1fdd521c243 100644 --- a/TRD/AliTRDpidLQ.h +++ b/TRD/AliTRDpidLQ.h @@ -25,9 +25,9 @@ class AliTRDpidLQ : public AliTRDpid { , const Float_t maxmom); virtual Bool_t FillSpectra(const AliTRDtrack *t); - inline Int_t GetIndex(const AliTRDtrack *t); - inline Int_t GetIndex(const Int_t imom, const Int_t ipid); - inline Int_t GetIndex(const Float_t mom, const Int_t ipid); + Int_t GetIndex(const AliTRDtrack *t); + Int_t GetIndex(const Int_t imom, const Int_t ipid); + Int_t GetIndex(const Float_t mom, const Int_t ipid); TObjArray* GetHist() const { return fHist; }; -- 2.43.0