Converted to AOD schema
authorskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 28 Jun 2004 09:36:02 +0000 (09:36 +0000)
committerskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 28 Jun 2004 09:36:02 +0000 (09:36 +0000)
HBTAN/AliHBTPositionRandomizer.cxx
HBTAN/AliHBTPositionRandomizer.h

index 69fae8dd7c026ee8190c80f0241d55ffc32d0447..efb7f1990c27e509feacd8c1aebdc99da9fa8d0c 100644 (file)
@@ -10,9 +10,8 @@
 ////////////////////////////////////////////////////////////////////////////////
 
 #include <TRandom.h>
-#include "AliHBTRun.h"
-#include "AliHBTEvent.h"
-#include "AliHBTParticle.h"
+#include "AliAOD.h"
+#include "AliVAODParticle.h"
 
 
 ClassImp(AliHBTPositionRandomizer)
@@ -34,7 +33,7 @@ AliHBTPositionRandomizer::AliHBTPositionRandomizer():
 }
 /*********************************************************************/
 
-AliHBTPositionRandomizer::AliHBTPositionRandomizer(AliHBTReader* reader):
+AliHBTPositionRandomizer::AliHBTPositionRandomizer(AliReader* reader):
  fReader(reader),
  fRandomizer(new AliHBTRndmGaussBall(8.0)),
  fModel(0),
@@ -50,7 +49,7 @@ AliHBTPositionRandomizer::AliHBTPositionRandomizer(AliHBTReader* reader):
 /*********************************************************************/
 
 AliHBTPositionRandomizer::AliHBTPositionRandomizer(const AliHBTPositionRandomizer& in):
- AliHBTReader(in),
+ AliReader(in),
  fReader(),
  fRandomizer(0x0),
  fModel(0),
@@ -80,71 +79,46 @@ AliHBTPositionRandomizer& AliHBTPositionRandomizer::operator=(const AliHBTPositi
 }
 /*********************************************************************/
 
-AliHBTEvent* AliHBTPositionRandomizer::GetParticleEvent() 
+AliAOD* AliHBTPositionRandomizer::GetEventSim() 
 {
  // gets from fReader and randomizes current particle event
  if (fReader == 0x0) return 0x0;
- AliHBTEvent *e =  fReader->GetParticleEvent();
+ AliAOD *e =  fReader->GetEventSim();
  if (e->IsRandomized() == kFALSE) Randomize(e);
  return e;
 }
 /*********************************************************************/
 
-AliHBTEvent* AliHBTPositionRandomizer::GetTrackEvent() 
+AliAOD* AliHBTPositionRandomizer::GetEventRec() 
 {
  // gets from fReader and randomizes current track event
  if (fReader == 0x0) return 0x0;
- AliHBTEvent *e =  fReader->GetTrackEvent();
+ AliAOD *e =  fReader->GetEventRec();
  if (fRandomizeTracks) if (e->IsRandomized() == kFALSE) Randomize(e);
  return e;
 }
 /*********************************************************************/
 
-Int_t AliHBTPositionRandomizer::Read(AliHBTRun* particles, AliHBTRun *tracks)
-{
-  //Reads all available events and randomizes them
-  if (fReader == 0x0) return 1;
-  if (AliHBTParticle::GetDebug() > 5) Info("Randomize(AliHBTRun*)","");
-  Int_t err = fReader->Read(particles,tracks);
-  if (err) return err;
-  Randomize(particles);
-  if (fRandomizeTracks) Randomize(tracks);
-  return 0;
-}
-/*********************************************************************/
-
-AliHBTEvent* AliHBTPositionRandomizer::GetParticleEvent(Int_t n)
+AliAOD* AliHBTPositionRandomizer::GetEventSim(Int_t n)
 {
 //returns event n
  if (fReader == 0x0) return 0x0;
- AliHBTEvent *e =  fReader->GetParticleEvent(n);
+ AliAOD *e =  fReader->GetEventSim(n);
  if (e->IsRandomized() == kFALSE) Randomize(e);
  return e;
 }
 
 /*********************************************************************/
-
-void AliHBTPositionRandomizer::Randomize(AliHBTRun* run) const
-{
-// randomizes postions of all particles in the run
-  if (run == 0x0) return;
-  if (AliHBTParticle::GetDebug() > 5) Info("Randomize(AliHBTRun*)","");
-  for (Int_t i = 0; i < run->GetNumberOfEvents(); i++)
-   {
-     Randomize(run->GetEvent(i));
-   }
-}
-/*********************************************************************/
-void AliHBTPositionRandomizer::Randomize(AliHBTEvent* event) const
+void AliHBTPositionRandomizer::Randomize(AliAOD* event) const
 {
 // randomizes postions of all particles in the event
   static const Double_t kfmtocm = 1.e-13;
-  if (AliHBTParticle::GetDebug() > 5) Info("Randomize(AliHBTEvent*)","");
+  if (AliVAODParticle::GetDebug() > 5) Info("Randomize(AliAOD*)","");
   if (event == 0x0) return;
 
   for (Int_t i = 0; i < event->GetNumberOfParticles(); i++)
    {
-     AliHBTParticle* p = event->GetParticle(i);
+     AliVAODParticle* p = event->GetParticle(i);
      Double_t x,y,z,t=0.0;
      fRandomizer->Randomize(x,y,z,p);
      
@@ -231,7 +205,7 @@ AliHBTRndmGaussBall::AliHBTRndmGaussBall(Float_t rx, Float_t ry, Float_t rz):
 }
 /*********************************************************************/
 
-void AliHBTRndmGaussBall::Randomize(Double_t& x,Double_t& y,Double_t&z, AliHBTParticle*/*particle*/) const
+void AliHBTRndmGaussBall::Randomize(Double_t& x,Double_t& y,Double_t&z, AliVAODParticle*/*particle*/) const
 {
 //randomizez gauss for each coordinate separately
   x = gRandom->Gaus(0.0,fRx);
@@ -246,7 +220,7 @@ void AliHBTRndmGaussBall::Randomize(Double_t& x,Double_t& y,Double_t&z, AliHBTPa
 //                                                                   //
 ///////////////////////////////////////////////////////////////////////
 
-void AliHBTRndmCyllSurf::Randomize(Double_t& x,Double_t& y,Double_t&z, AliHBTParticle* particle) const
+void AliHBTRndmCyllSurf::Randomize(Double_t& x,Double_t& y,Double_t&z, AliVAODParticle* particle) const
 {
 //Randomizes x,y,z
    Double_t r = fR + gRandom->Gaus(0.0, 1.0);
index b7dde59794c57b6e4f5900fe7fa0527e53ff7d4e..f0394001292b6e9389cdd0a0b86e341a43f07079 100644 (file)
 // 
 ////////////////////////////////////////////////////////////////////////////////
 
-#include "AliHBTReader.h"
-
+#include "AliReader.h"
 class AliHBTRndm;
-class AliHBTEvent;
-class AliHBTRun;
-class AliHBTParticle;
 class TH1I;
 
-class AliHBTPositionRandomizer: public AliHBTReader
+class AliHBTPositionRandomizer: public AliReader
 {
  public:
    enum EModelTypes{kGausBall,kCylinder,kCylinderSurf};
    AliHBTPositionRandomizer();
-   AliHBTPositionRandomizer(AliHBTReader* reader);
+   AliHBTPositionRandomizer(AliReader* reader);
    AliHBTPositionRandomizer(const AliHBTPositionRandomizer& in);
    
    virtual ~AliHBTPositionRandomizer();
@@ -33,23 +29,21 @@ class AliHBTPositionRandomizer: public AliHBTReader
    Int_t  Next(){return (fReader)?fReader->Next():1;}
    void   Rewind(){if(fReader) fReader->Rewind();}
    
-   Bool_t ReadsTracks() const {return (fReader)?fReader->ReadsTracks():kFALSE;}
-   Bool_t ReadsParticles() const {return (fReader)?fReader->ReadsParticles():kFALSE;}
-   
-   Int_t  Read(AliHBTRun* particles, AliHBTRun *tracks);
+   Bool_t ReadsRec() const {return (fReader)?fReader->ReadsRec():kFALSE;}
+   Bool_t ReadsSim() const {return (fReader)?fReader->ReadsSim():kFALSE;}
    
-   AliHBTEvent* GetParticleEvent() ;
-   AliHBTEvent* GetTrackEvent() ;
+   AliAOD* GetEventSim() ;
+   AliAOD* GetEventRec() ;
 
-   AliHBTEvent* GetParticleEvent(Int_t n);
-   AliHBTEvent* GetTrackEvent(Int_t n){return (fReader)?fReader->GetTrackEvent(n):0x0;}
-   Int_t GetNumberOfPartEvents(){return (fReader)?fReader->GetNumberOfPartEvents():0;}
-   Int_t GetNumberOfTrackEvents(){return (fReader)?fReader->GetNumberOfTrackEvents():0;}
+   AliAOD* GetEventSim(Int_t n);
+   AliAOD* GetEventRec(Int_t n){return (fReader)?fReader->GetEventRec(n):0x0;}
+   
+   Int_t GetNumberOfSimEvents(){return (fReader)?fReader->GetNumberOfSimEvents():0;}
+   Int_t GetNumberOfRecEvents(){return (fReader)?fReader->GetNumberOfRecEvents():0;}
    virtual TH1I* GetTrackCounter() const {return (fReader)?fReader->GetTrackCounter():0x0;}
    virtual void  WriteTrackCounter() const {if(fReader) fReader->WriteTrackCounter();}
 
-   void Randomize(AliHBTEvent* event) const;
-   void Randomize(AliHBTRun* run) const;
+   void Randomize(AliAOD* event) const;
    void SetEventVertex(Double_t x, Double_t y,Double_t z);
    
    void SetGaussianBall(Double_t r);
@@ -61,11 +55,11 @@ class AliHBTPositionRandomizer: public AliHBTReader
    
    
  protected:
-   void Randomize(Double_t& x,Double_t& y,Double_t&z, AliHBTParticle*p);
+   void Randomize(Double_t& x,Double_t& y,Double_t&z, AliVAODParticle*p);
    Int_t ReadNext(){return (fReader)?fReader->Next():1;}
    
  private:
-   AliHBTReader* fReader;      // Pointer to reader
+   AliReader* fReader;      // Pointer to reader
    AliHBTRndm*   fRandomizer;  // Pointer to class that performs randomization according to some model
    
    Int_t    fModel;            //Defines what model is used
@@ -87,7 +81,7 @@ class AliHBTRndm: public TObject
   public:
    AliHBTRndm(){}
    virtual ~AliHBTRndm(){}
-   virtual void Randomize(Double_t& x,Double_t& y,Double_t&z, AliHBTParticle*p) const = 0;
+   virtual void Randomize(Double_t& x,Double_t& y,Double_t&z, AliVAODParticle*p) const = 0;
    ClassDef(AliHBTRndm,1)
 };
 
@@ -98,7 +92,7 @@ class AliHBTRndmGaussBall: public AliHBTRndm
    AliHBTRndmGaussBall(Float_t r);
    AliHBTRndmGaussBall(Float_t rx, Float_t ry, Float_t rz);
    virtual ~AliHBTRndmGaussBall(){}
-   void Randomize(Double_t& x,Double_t& y,Double_t&z, AliHBTParticle*/*particle*/) const;
+   void Randomize(Double_t& x,Double_t& y,Double_t&z, AliVAODParticle*/*particle*/) const;
   private:
    Float_t fRx; //Dispertion in x 
    Float_t fRy; //Dispertion in y
@@ -113,7 +107,7 @@ class AliHBTRndmCyllSurf: public AliHBTRndm
    AliHBTRndmCyllSurf(Float_t r, Float_t l):fR(r),fL(l){}
    virtual ~AliHBTRndmCyllSurf(){}
    
-   void Randomize(Double_t& x,Double_t& y,Double_t&z, AliHBTParticle* particle) const;
+   void Randomize(Double_t& x,Double_t& y,Double_t&z, AliVAODParticle* particle) const;
   private:
    Float_t fR; //Redius of cylinder
    Float_t fL; //Length of cylinder