Coding Violations Corrected.
authorskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 Jan 2004 14:39:14 +0000 (14:39 +0000)
committerskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 Jan 2004 14:39:14 +0000 (14:39 +0000)
HBTAN/AliHBTReaderITSv1.cxx
HBTAN/AliHBTReaderITSv1.h

index a4043d93c3176e832c54fb8dabdc147a47bec4e2..fed34df6fae8ff7f75dcb93486b5f9e3e7c9da17 100644 (file)
@@ -9,21 +9,17 @@
 //////////////////////////////////////////////////////////////////////
 
 #include "AliHBTReaderITSv1.h"
-#include "AliHBTEvent.h"
 #include "AliHBTRun.h"
 #include "AliHBTParticle.h"
 #include "AliHBTParticleCut.h"
 
 #include <Riostream.h>
 
-#include <TROOT.h>
-#include <TFile.h>
 #include <TTree.h>
 #include <TBranch.h>
 #include <TObjArray.h>
 #include <TParticle.h>
 #include <TString.h>
-#include <TObjString.h>
 
 #include <AliRun.h>
 #include <AliStack.h>
 ClassImp(AliHBTReaderITSv1)
 /********************************************************************/
 
-AliHBTReaderITSv1::
-AliHBTReaderITSv1(const Char_t* tracksfilename,const Char_t* galicefilename):
-                 fITSTracksFileName(tracksfilename),fGAliceFileName(galicefilename)
- {
-     fParticles = new AliHBTRun();
-     fTracks    = new AliHBTRun();
-     fIsRead = kFALSE;
- }
+AliHBTReaderITSv1::AliHBTReaderITSv1(const Char_t* tracksfilename,const Char_t* galicefilename):
+ fITSTracksFileName(tracksfilename),
+ fGAliceFileName(galicefilename)
+{
+ //ctor
+}
 /********************************************************************/
 
-AliHBTReaderITSv1::
-AliHBTReaderITSv1(TObjArray* dirs, const Char_t* tracksfilename,const Char_t* galicefilename):
-                 AliHBTReader(dirs),
-                 fITSTracksFileName(tracksfilename),fGAliceFileName(galicefilename)
- {
-   fParticles = new AliHBTRun();
-   fTracks    = new AliHBTRun();
-   fIsRead    = kFALSE;
- }
+AliHBTReaderITSv1::AliHBTReaderITSv1(TObjArray* dirs, const Char_t* tracksfilename,const Char_t* galicefilename):
+ AliHBTReader(dirs),
+ fITSTracksFileName(tracksfilename),
+ fGAliceFileName(galicefilename)
+{
+//ctor
+}
 /********************************************************************/
 
 AliHBTReaderITSv1::~AliHBTReaderITSv1()
 {
-   delete fParticles;
-   delete fTracks;
+//dtor
 }
 /********************************************************************/
 
-AliHBTEvent* AliHBTReaderITSv1::GetParticleEvent(Int_t n)
- {
- //returns Nth event with simulated particles
-   if (!fIsRead) 
-    if(Read(fParticles,fTracks))
-     {
-       Error("GetParticleEvent","Error in reading");
-       return 0x0;
-     }
-
-   return fParticles->GetEvent(n);
- }
-/********************************************************************/
-
-AliHBTEvent* AliHBTReaderITSv1::GetTrackEvent(Int_t n)
- {
- //returns Nth event with reconstructed tracks
-   if (!fIsRead) 
-    if(Read(fParticles,fTracks))
-     {
-       Error("GetTrackEvent","Error in reading");
-       return 0x0;
-     }
-   return fTracks->GetEvent(n);
- }
-/********************************************************************/
-
-Int_t AliHBTReaderITSv1::GetNumberOfPartEvents()
- {
- //returns number of events of particles
-   if (!fIsRead)
-    if(Read(fParticles,fTracks))
-     {
-       Error("GetNumberOfPartEvents","Error in reading");
-       return 0;
-     }
-   return fParticles->GetNumberOfEvents();
- }
-
-/********************************************************************/
-Int_t AliHBTReaderITSv1::GetNumberOfTrackEvents()
- {
- //returns number of events of tracks
-  if (!fIsRead) 
-    if(Read(fParticles,fTracks))
-     {
-       Error("GetNumberOfTrackEvents","Error in reading");
-       return 0;
-     }
-  return fTracks->GetNumberOfEvents();
- }
-/********************************************************************/
 
 Int_t AliHBTReaderITSv1::Read(AliHBTRun* particles, AliHBTRun *tracks)
 {
- Int_t Nevents = 0;
+//Reads data
+ Int_t nevents = 0;
  AliITSIOTrack *iotrack=new AliITSIOTrack;
  Int_t currentdir = 0;
- Int_t Ndirs;
- Int_t totalNevents = 0;
+ Int_t ndirs;
+ Int_t totalnevents = 0;
  
  if (fDirs)
   {
-    Ndirs = fDirs->GetEntries();
+    ndirs = fDirs->GetEntries();
   }
  else
   {
-    Ndirs = 0;
+    ndirs = 0;
   }
  
  do //do while is good even if 
@@ -143,9 +83,9 @@ Int_t AliHBTReaderITSv1::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
+      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<<"Found "<<nevents<<" event(s) in directory "<<GetDirName(currentdir)<<endl;
       cout<<"Setting Magnetic Field. Factor is "<<gAlice->Field()->Factor()<<endl;
       AliKalmanTrack::SetConvConst(100/0.299792458/0.2/gAlice->Field()->Factor());
      }
@@ -167,7 +107,7 @@ Int_t AliHBTReaderITSv1::Read(AliHBTRun* particles, AliHBTRun *tracks)
    Int_t naccepted = 0;
    char tname[30];
    
-   for (Int_t currentEvent = 0; currentEvent < Nevents; currentEvent++)
+   for (Int_t currentEvent = 0; currentEvent < nevents; currentEvent++)
     { 
       cout<<"Reading Event "<<currentEvent;
       
@@ -224,12 +164,12 @@ Int_t AliHBTReaderITSv1::Read(AliHBTRun* particles, AliHBTRun *tracks)
         if(Pass(track)) { delete  track;continue;}//check if meets all criteria of any of our cuts
                                                   //if it does not delete it and take next good track
 
-        particles->AddParticle(totalNevents,part);//put track and particle on the run
-        tracks->AddParticle(totalNevents,track);
+        particles->AddParticle(totalnevents,part);//put track and particle on the run
+        tracks->AddParticle(totalnevents,track);
         naccepted++;
        }//end loop over tracks in the event
 
-       totalNevents++;
+       totalnevents++;
        cout<<"  Accepted "<<naccepted<<" tracks"<<endl;
      }//end of loop over events in current directory
     
@@ -241,7 +181,7 @@ Int_t AliHBTReaderITSv1::Read(AliHBTRun* particles, AliHBTRun *tracks)
     delete file;
     file = 0;
     currentdir++;
-   }while(currentdir < Ndirs);//end of loop over directories specified in fDirs Obj Array
+   }while(currentdir < ndirs);//end of loop over directories specified in fDirs Obj Array
 
 
   delete iotrack;
@@ -281,6 +221,7 @@ TFile* AliHBTReaderITSv1::OpenTrackFile(Int_t ndir)
 /********************************************************************/
 TFile* AliHBTReaderITSv1::OpenGAliceFile(Int_t ndir)
 {
+//Opens galice.root file
   const TString& dirname = GetDirName(ndir); 
    if (dirname == "")
     {
index d4289b5cadb990ecae4a11ca2bda0f118f60ddee..90366bf28ee2326c94e6f5c08a0cb47cfbf25e0e 100644 (file)
@@ -31,22 +31,13 @@ class AliHBTReaderITSv1: public AliHBTReader
     
     Int_t Read(AliHBTRun* particles, AliHBTRun *tracks);//reads tracks and particles and puts them in runs
     
-    AliHBTEvent* GetParticleEvent(Int_t);//returns pointer to event with particles
-    AliHBTEvent* GetTrackEvent(Int_t);//returns pointer to event with particles
-    Int_t GetNumberOfPartEvents();//returns number of particle events
-    Int_t GetNumberOfTrackEvents();//returns number of track events
     
   protected:
     TString fITSTracksFileName; //name of the file with tracks
     TString fGAliceFileName;//name of the file containing Run Loader
     
-    AliHBTRun* fParticles; //!simulated particles
-    AliHBTRun* fTracks; //!reconstructed tracks (particles)
-    
-    Bool_t fIsRead;//flag indicating if the data are already read
-   
-    TFile* OpenTrackFile(Int_t);//opens files to be read for given directoru nomber in fDirs Array
-    TFile* OpenGAliceFile(Int_t);
+    TFile* OpenTrackFile(Int_t n);//opens files to be read for given directoru nomber in fDirs Array
+    TFile* OpenGAliceFile(Int_t n);
     
   private:
     ClassDef(AliHBTReaderITSv1,1)