Using dinamic array for times of flight
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 1 Jul 2004 05:00:06 +0000 (05:00 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 1 Jul 2004 05:00:06 +0000 (05:00 +0000)
PHOS/AliPHOSPIDv1.cxx

index 7d3d5aba3e48f632b53bfe9409df8d6736bdb615..ed75b36637bca0f318c40e848409bef8b932b6b2 100644 (file)
@@ -568,10 +568,14 @@ void  AliPHOSPIDv1::MakePID()
   const Int_t kSPECIES = AliESDtrack::kSPECIESN ;
   Double_t pid[kSPECIES] = {0., 0., 0., 0., 0., 0.} ;  
   Int_t nparticles = AliPHOSGetter::Instance()->RecParticles()->GetEntriesFast() ;
-  const Int_t kMAXPARTICLES = 2000 ; 
-  if (nparticles >= kMAXPARTICLES) 
-    Error("MakePID", "Change size of MAXPARTICLES") ; 
-  Double_t stof[kSPECIES][kMAXPARTICLES] ;
+//   const Int_t kMAXPARTICLES = 2000 ; 
+//   if (nparticles >= kMAXPARTICLES) 
+//     Error("MakePID", "Change size of MAXPARTICLES") ; 
+//   Double_t stof[kSPECIES][kMAXPARTICLES] ;
+  Double_t * stof[kSPECIES];
+  for (Int_t i =0; i< kSPECIES; i++)
+    stof[i] = new Double_t[nparticles];
+
   // make the normalized distribution of pid for this event 
   // w(pid) in the Bayesian formulation
   for(index = 0 ; index < nparticles ; index ++) {
@@ -632,6 +636,8 @@ void  AliPHOSPIDv1::MakePID()
        recpar->SetPID(jndex, stof[jndex][index] * pid[jndex] / wn) ; 
       }
   }
+  for (Int_t i =0; i< kSPECIES; i++)
+    delete [] stof[i];
 }
 
 //____________________________________________________________________________