Reverting to 1.10. Removing tracker - is not needed since labels are stored in tracks.
authorskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 20 May 2003 09:22:22 +0000 (09:22 +0000)
committerskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 20 May 2003 09:22:22 +0000 (09:22 +0000)
HBTAN/AliHBTReaderTPC.cxx

index eea77ae..e30656c 100644 (file)
@@ -1,7 +1,5 @@
 #include "AliHBTReaderTPC.h"
-
-#include <Riostream.h>
-//#include <Riostream.h>
 #include <TTree.h>
 #include <TFile.h>
 #include <TParticle.h>
 
 
 ClassImp(AliHBTReaderTPC)
+//______________________________________________
+//
+// class AliHBTReaderTPC
+//
 //reader for TPC tracking
-//needs galice.root, AliTPCtracks.root, AliTPCclusters.root, good_tracks_tpc 
+//needs galice.root, AliTPCtracks.root, AliTPCclusters.root
 //
 //more info: http://alisoft.cern.ch/people/skowron/analyzer/index.html
 //Piotr.Skowronski@cern.ch
+//
 
-AliHBTReaderTPC::
- AliHBTReaderTPC(const Char_t* trackfilename,const Char_t* clusterfilename,
-                 const Char_t* galicefilename):
-                 fTrackFileName(trackfilename),fClusterFileName(clusterfilename),
-                 fGAliceFileName(galicefilename)
+AliHBTReaderTPC:: AliHBTReaderTPC(const Char_t* trackfilename,
+                                  const Char_t* clusterfilename,
+                                  const Char_t* galicefilename):
+ fTrackFileName(trackfilename),
+ fClusterFileName(clusterfilename),
+ fGAliceFileName(galicefilename)
 {
   //constructor, 
   //Defaults:
@@ -43,13 +47,13 @@ AliHBTReaderTPC::
   fIsRead = kFALSE;
 }
 /********************************************************************/
-AliHBTReaderTPC::
-AliHBTReaderTPC(TObjArray* dirs,
+AliHBTReaderTPC::AliHBTReaderTPC(TObjArray* dirs,
                   const Char_t* trackfilename, const Char_t* clusterfilename,
                   const Char_t* galicefilename):
-                  AliHBTReader(dirs), fTrackFileName(trackfilename),
-                  fClusterFileName(clusterfilename),fGAliceFileName(galicefilename)
-
+ AliHBTReader(dirs), 
+ fTrackFileName(trackfilename),
+ fClusterFileName(clusterfilename),
+ fGAliceFileName(galicefilename)
 {
   //constructor, 
   //Defaults:
@@ -61,7 +65,6 @@ AliHBTReaderTPC(TObjArray* dirs,
   fParticles = new AliHBTRun();
   fTracks    = new AliHBTRun();
   fIsRead = kFALSE;
-  
 }
 /********************************************************************/
 
@@ -85,6 +88,7 @@ AliHBTEvent* AliHBTReaderTPC::GetParticleEvent(Int_t n)
    return fParticles->GetEvent(n);
  }
 /********************************************************************/
+
 AliHBTEvent* AliHBTReaderTPC::GetTrackEvent(Int_t n)
  {
  //returns Nth event with reconstructed tracks
@@ -130,7 +134,7 @@ Int_t AliHBTReaderTPC::Read(AliHBTRun* particles, AliHBTRun *tracks)
  //reads data and puts put to the particles and tracks objects
  //reurns 0 if everything is OK
  //
-  cout<<"AliHBTReaderTPC::Read()"<<endl;
+  Info("Read","");
   Int_t i; //iterator and some temprary values
   Int_t Nevents = 0;
   Int_t totalNevents = 0;
@@ -179,9 +183,9 @@ Int_t AliHBTReaderTPC::Read(AliHBTRun* particles, AliHBTRun *tracks)
     if (gAlice->TreeE())//check if tree E exists
      {
       Nevents = (Int_t)gAlice->TreeE()->GetEntries();//if yes get number of events in gAlice
-      cout<<"________________________________________________________\n";
-      cout<<"Found "<<Nevents<<" event(s) in directory "<<GetDirName(currentdir)<<endl;
-      cout<<"Setting Magnetic Field: B="<<gAlice->Field()->SolenoidField()<<"T"<<endl;
+      Info("Read","________________________________________________________");
+      Info("Read","Found %d event(s) in directory %s",Nevents,GetDirName(currentdir).Data());
+      Info("Read","Setting Magnetic Field: B=%fT",gAlice->Field()->SolenoidField());
       AliKalmanTrack::SetConvConst(1000/0.299792458/gAlice->Field()->SolenoidField());
      }
     else
@@ -207,7 +211,7 @@ Int_t AliHBTReaderTPC::Read(AliHBTRun* particles, AliHBTRun *tracks)
   
     for(Int_t currentEvent =0; currentEvent<Nevents;currentEvent++)//loop over all events
      {
-       cout<<"Reading Event "<<currentEvent<<endl;
+       Info("Read","Reading Event %d",currentEvent);
        /**************************************/
         /**************************************/
          /**************************************/ 
@@ -233,39 +237,24 @@ Int_t AliHBTReaderTPC::Read(AliHBTRun* particles, AliHBTRun *tracks)
             continue;
           }
          Int_t NTPCtracks=(Int_t)tracktree->GetEntries();//get number of TPC tracks 
-         cout<<"Found "<<NTPCtracks<<" TPC tracks.\n";
+         Info("Read","Found %d TPC tracks.",NTPCtracks);
          //Copy tracks to array
          
          AliTPCtrack *iotrack=0;
          
          aClustersFile->cd();//set cluster file active 
-         //AliTPCtracker *tracker = new AliTPCtracker(TPCParam,currentEvent);//create the tacker for this event
-         AliTPCtracker *tracker = new AliTPCtracker(TPCParam); //I.B.
-         tracker->SetEventNumber(currentEvent);                //I.B.
-         if (!tracker) //check if it has created succeffuly
-          {//if not return with error
-            Error("Read","Can't get a tracker !\n"); 
-            continue;
-          }
-         //tracker->LoadInnerSectors(); //I.B.
-         //tracker->LoadOuterSectors(); //I.B.
-         tracker->LoadClusters();       //I.B.
    
          for (i=0; i<NTPCtracks; i++) //loop over all tpc tracks
           {
             iotrack=new AliTPCtrack;   //create new tracks
             trackbranch->SetAddress(&iotrack); //tell the branch ehere to put track data from tree(file)
             tracktree->GetEvent(i); //stream track i to the iotrack
-            tracker->CookLabel(iotrack,0.1); //calculate (cook) the label of the tpc track
-                                             //which is the label of corresponding simulated particle 
             tarray->AddLast(iotrack); //put the track in the array
           }
          
          aTracksFile->Delete(treename);//delete tree from memmory (and leave untached on disk)- we do not need it any more
          aTracksFile->Delete("tracks");//delete branch from memmory
-         delete tracker; //delete tracker
          
-         tracker = 0x0;
          trackbranch = 0x0;
          tracktree = 0x0;
    
@@ -283,9 +272,10 @@ Int_t AliHBTReaderTPC::Read(AliHBTRun* particles, AliHBTRun *tracks)
           { 
             iotrack = (AliTPCtrack*)tarray->At(i);
             label = iotrack->GetLabel();
-
+            
             if (label < 0) continue;
             
+            
             TParticle *p = (TParticle*)gAlice->Particle(label);
             
             if(p == 0x0) continue; //if returned pointer is NULL
@@ -293,7 +283,6 @@ Int_t AliHBTReaderTPC::Read(AliHBTRun* particles, AliHBTRun *tracks)
            
             if(Pass(p->GetPdgCode())) continue; //check if we are intersted with particles of this type 
                                         //if not take next partilce
-            
             AliHBTParticle* part = new AliHBTParticle(*p);
             if(Pass(part)) { delete part; continue;}//check if meets all criteria of any of our cuts
                                                     //if it does not delete it and take next good track
@@ -324,7 +313,6 @@ Int_t AliHBTReaderTPC::Read(AliHBTRun* particles, AliHBTRun *tracks)
              }
             particles->AddParticle(totalNevents,part);//put track and particle on the run
             tracks->AddParticle(totalNevents,track);
-
           }
          tarray->Clear(); //clear the array
          
@@ -333,7 +321,6 @@ Int_t AliHBTReaderTPC::Read(AliHBTRun* particles, AliHBTRun *tracks)
       /**************************************/  
      totalNevents++;
     }
-  
     //save environment (resouces) --
     //clean your place after the work
     CloseFiles(aTracksFile,aClustersFile,aGAliceFile);