]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Minor corrections needed on Sun (arrays with undefined size created by new, inline...
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Nov 2001 11:04:22 +0000 (11:04 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Nov 2001 11:04:22 +0000 (11:04 +0000)
TRD/AliTRDmcTrack.cxx
TRD/AliTRDpidLQ.cxx
TRD/AliTRDpidLQ.h

index 2b441d600338318bd76769e48082b237a4edcd61..536fee09d4e2d23705f9d07e293a69f02b25fc22 100644 (file)
@@ -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
index b500c4e62f00d3098c7dd6d3c6c6a0f50795a88f..2d6150087c89e7c683333261425aafc650a509c3 100644 (file)
@@ -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;
 
 }
index 20773bab6a81b52c512f988d87ab6b654fcc8505..1fdd521c243457df70f638011e47de0e801750a6 100644 (file)
@@ -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;        };