]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliKFParticleTest.C
Some fixes to make the KF macro working (was very old)
[u/mrichter/AliRoot.git] / STEER / AliKFParticleTest.C
index ac02216e0dff55d38d07226afb0ca764b6b9316c..b1f4e8be216545846ae68cfa0b1f3e7945213f30 100644 (file)
@@ -154,6 +154,7 @@ void RunV0(  AliESDEvent *event )
 
   for (Int_t iTr=0; iTr<nESDTracks; iTr++)
     {   
+      Printf("tracj %d", iTr);
       TESDTrackInfo &info = ESDTrackInfo[iTr];
       info.fOK = 0;
       info.fPrimUsedFlag = 0;
@@ -255,7 +256,7 @@ void RunV0(  AliESDEvent *event )
 
       //* Check chi^2 for a case
 
-      if( TMath::Sqrt( TMath::Abs(V0.GetChi2()/V0.GetNDF()) >3. )) continue;
+      if( TMath::Sqrt( TMath::Abs(V0.GetChi2()/V0.GetNDF())) >3. ) continue;
 
       //* Get V0 decay length with estimated error
 
@@ -292,7 +293,8 @@ void RunV0(  AliESDEvent *event )
 
 
 
-Int_t AliKFParticleTest(Int_t n1=0,Int_t n2=1000,char *dire="/d/alice10/sma/my_v4-05-Release/pp/"){
+//Int_t AliKFParticleTest(Int_t n1=0,Int_t n2=1000,char *dire="/d/alice10/sma/my_v4-05-Release/pp/"){
+Int_t AliKFParticleTest(Int_t n1=993,Int_t n2=999,char *dire="~/SOFT/AliRoot_git/AliRoot_20140223/test/genkine/TestKF/Events/"){
   //* Main macro
     
   //  LOOP  OVER  SERIES  OF  DIRECTORIES
@@ -306,6 +308,10 @@ Int_t AliKFParticleTest(Int_t n1=0,Int_t n2=1000,char *dire="/d/alice10/sma/my_v
     
     cout <<"  Opening "<<filename<<"\nand ESD "<<esdfile<<endl;
     
+    TFile* ftemp = TFile::Open(filename);
+    Printf("ftemp = %p", ftemp);
+    if (!ftemp) continue;
+
     if (gAlice) {
       delete AliRunLoader::Instance();
       delete gAlice;
@@ -328,8 +334,6 @@ Int_t AliKFParticleTest(Int_t n1=0,Int_t n2=1000,char *dire="/d/alice10/sma/my_v
       continue;
     }
     rl->LoadKinematics();
-    AliTracker::SetFieldMap(gAlice->Field(),1);
-    AliKFParticle::SetField( AliTracker::GetBz() );
 
     //---------------------------------------//
     //                                       //
@@ -344,7 +348,7 @@ Int_t AliKFParticleTest(Int_t n1=0,Int_t n2=1000,char *dire="/d/alice10/sma/my_v
     if (!ef || !ef->IsOpen()) {cerr<<"Error open AliESDs.root !\n"; continue ;}
 
     //create event object
-    AliESD *event = new AliESDEvent;
+    AliESDEvent *event = new AliESDEvent;
 
     //Set pointer to the esd tree in the file
     TTree* tree = (TTree*) ef->Get("esdTree");
@@ -353,7 +357,7 @@ Int_t AliKFParticleTest(Int_t n1=0,Int_t n2=1000,char *dire="/d/alice10/sma/my_v
     if (!tree) {cerr<<"no ESD tree found\n"; continue;};
     
     //Set pointer to the esd object in the tree
-    event->ReadFromTree(event);
+    event->ReadFromTree(tree);
     
     //Number of events
     Int_t nevents=tree->GetEntriesFast();
@@ -363,6 +367,7 @@ Int_t AliKFParticleTest(Int_t n1=0,Int_t n2=1000,char *dire="/d/alice10/sma/my_v
     for (Int_t iev=0; iev<nevents; iev++){
       tree->GetEvent(iev);
       rl->GetEvent(iev);
+      AliKFParticle::SetField(event->GetMagneticField());
       RunV0(event);
     }
     EndV0();