And some more effc++
authorcblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Aug 2006 20:19:34 +0000 (20:19 +0000)
committercblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Aug 2006 20:19:34 +0000 (20:19 +0000)
12 files changed:
TRD/AliTRDRecParam.cxx
TRD/AliTRDRecParam.h
TRD/AliTRDReconstructor.cxx
TRD/AliTRDReconstructor.h
TRD/AliTRDhit.cxx
TRD/AliTRDhit.h
TRD/AliTRDpoints.cxx
TRD/AliTRDpoints.h
TRD/AliTRDsim.cxx
TRD/AliTRDsim.h
TRD/AliTRDtrackHits.cxx
TRD/AliTRDtrackHits.h

index d766253..053194a 100644 (file)
@@ -32,82 +32,101 @@ AliTRDRecParam* AliTRDRecParam::fgInstance = 0;
 Bool_t AliTRDRecParam::fgTerminated = kFALSE;
 
 //_ singleton implementation __________________________________________________
-AliTRDRecParam* AliTRDRecParam::Instance()
+AliTRDRecParam* AliTRDRecParam::Instance() 
 {
   //
   // Singleton implementation
   // Returns an instance of this class, it is created if neccessary
   // 
   
-  if (fgTerminated != kFALSE)
+  if (fgTerminated != kFALSE) {
     return 0;
+  }
 
-  if (fgInstance == 0)
+  if (fgInstance == 0) {
     fgInstance = new AliTRDRecParam();
-  
+  }  
+
   return fgInstance;
+
 }
 
+//_____________________________________________________________________________
 void AliTRDRecParam::Terminate()
 {
   //
   // Singleton implementation
-  // Deletes the instance of this class and sets the terminated flag, instances cannot be requested anymore
+  // Deletes the instance of this class and sets the terminated flag,
+  // instances cannot be requested anymore
   // This function can be called several times.
   //
   
   fgTerminated = kTRUE;
   
-  if (fgInstance != 0)
-  {
+  if (fgInstance != 0) {
     delete fgInstance;
     fgInstance = 0;
   }
+
 }
 
 //_____________________________________________________________________________
 AliTRDRecParam::AliTRDRecParam()
+  :TObject()
+  ,fClusMaxThresh(0)
+  ,fClusSigThresh(0)
+  ,fLUTOn(kFALSE)
+  ,fLUTbin(0)
+  ,fLUT(0)
+  ,fTCOn(kFALSE)
+  ,fTCnexp(0)
 {
   //
-  // constructor
+  // Constructor
   //
-  
-  fClusMaxThresh      = 0;
-  fClusSigThresh      = 0;
-  
-  fLUT                = 0;
-  fLUTOn              = kFALSE;  
-  fLUTbin = 0;
-  
-  fTCOn               = kFALSE;
-  fTCnexp             = 0;
-  
+    
   Init();
+
 }
 
 //_____________________________________________________________________________
 AliTRDRecParam::~AliTRDRecParam() 
 {
   //
-  // destructor
+  // Destructor
   //
   
   if (fLUT) {
     delete [] fLUT;
-    fLUT    = 0;
+    fLUT = 0;
   }
+
 }
 
 //_____________________________________________________________________________
-AliTRDRecParam::AliTRDRecParam(const AliTRDRecParam &p):TObject(p)
+AliTRDRecParam::AliTRDRecParam(const AliTRDRecParam &p)
+  :TObject(p)
+  ,fClusMaxThresh(p.fClusMaxThresh)
+  ,fClusSigThresh(p.fClusSigThresh)
+  ,fLUTOn(p.fLUTOn)
+  ,fLUTbin(p.fLUTbin)
+  ,fLUT(0)
+  ,fTCOn(p.fTCOn)
+  ,fTCnexp(p.fTCnexp)
 {
   //
-  // copy constructor
+  // Copy constructor
   //
 
-  ((AliTRDRecParam &) p).Copy(*this);
-}
+  if (((AliTRDRecParam &) p).fLUT) {
+    delete [] ((AliTRDRecParam &) p).fLUT;
+  }
+  ((AliTRDRecParam &) p).fLUT = new Float_t[fLUTbin];
+  for (Int_t iBin = 0; iBin < fLUTbin; iBin++) {
+    ((AliTRDRecParam &) p).fLUT[iBin] = fLUT[iBin];
+  }                                                                             
 
+}
 
 //_____________________________________________________________________________
 AliTRDRecParam &AliTRDRecParam::operator=(const AliTRDRecParam &p)
@@ -117,7 +136,9 @@ AliTRDRecParam &AliTRDRecParam::operator=(const AliTRDRecParam &p)
   //
 
   if (this != &p) ((AliTRDRecParam &) p).Copy(*this);
+
   return *this;
+
 }
 
 //_____________________________________________________________________________
@@ -128,22 +149,26 @@ void AliTRDRecParam::Copy(TObject &p) const
   //
   
   AliTRDRecParam* target = dynamic_cast<AliTRDRecParam*> (&p);
-  if (!target)
+  if (!target) {
     return;
+  }  
+
+  target->fLUTOn         = fLUTOn;
+  target->fLUTbin        = fLUTbin;
+      
+  target->fClusMaxThresh = fClusMaxThresh;
+  target->fClusSigThresh = fClusSigThresh;
   
-  target->fLUTOn              = fLUTOn;
-  target->fLUTbin             = fLUTbin;
-  if (target->fLUT)    delete [] target->fLUT;
-  target->fLUT  = new Float_t[fLUTbin];
+  target->fTCOn          = fTCOn;
+  target->fTCnexp        = fTCnexp;
+
+  if (target->fLUT) {
+    delete [] target->fLUT;
+  }
+  target->fLUT = new Float_t[fLUTbin];
   for (Int_t iBin = 0; iBin < fLUTbin; iBin++) {
-    target->fLUT[iBin]  = fLUT[iBin];
+    target->fLUT[iBin] = fLUT[iBin];
   }
-      
-  target->fClusMaxThresh      = fClusMaxThresh;
-  target->fClusSigThresh      = fClusSigThresh;
-  
-  target->fTCOn               = fTCOn;
-  target->fTCnexp             = fTCnexp;
 
 }
 
@@ -151,7 +176,7 @@ void AliTRDRecParam::Copy(TObject &p) const
 void AliTRDRecParam::Init() 
 {
   //
-  // constructor helper
+  // Constructor helper
   //
   
   // The default parameter for the clustering
@@ -165,10 +190,10 @@ void AliTRDRecParam::Init()
   FillLUT();
 
   // The tail cancelation
-  fTCOn           = kTRUE;
+  fTCOn          = kTRUE;
 
   // The number of exponentials
-  fTCnexp         = 1;
+  fTCnexp        = 1;
 
 }
 
@@ -179,7 +204,7 @@ void AliTRDRecParam::FillLUT()
   // Create the LUT
   //
 
-  const Int_t kNlut  = 128;
+  const Int_t kNlut = 128;
 
   fLUTbin = kNplan * kNlut;
 
@@ -295,11 +320,13 @@ void AliTRDRecParam::FillLUT()
     }
   }; 
 
-  if (fLUT) delete [] fLUT;
+  if (fLUT) {
+    delete [] fLUT;
+  }
   fLUT = new Float_t[fLUTbin];
 
   for (Int_t iplan = 0; iplan < kNplan; iplan++) {
-    for (Int_t ilut  = 0; ilut  < kNlut; ilut++) {
+    for (Int_t ilut  = 0; ilut  <  kNlut; ilut++  ) {
       fLUT[iplan*kNlut+ilut] = lut[iplan][ilut];
     }
   }
@@ -307,17 +334,18 @@ void AliTRDRecParam::FillLUT()
 }
 
 //_____________________________________________________________________________
-Double_t AliTRDRecParam::LUTposition(Int_t iplane, Double_t ampL, Double_t ampC, Double_t ampR) const
+Double_t AliTRDRecParam::LUTposition(Int_t iplane, Double_t ampL
+                                  , Double_t ampC, Double_t ampR) const
 {
   //
   // Calculates the cluster position using the lookup table.
   // Method provided by Bogdan Vulpescu.
   //
 
-  const Int_t kNlut  = 128;
+  const Int_t kNlut = 128;
 
   Double_t pos;
-  Double_t x = 0.0;
+  Double_t x    = 0.0;
   Double_t xmin;
   Double_t xmax;
   Double_t xwid;
@@ -325,8 +353,10 @@ Double_t AliTRDRecParam::LUTposition(Int_t iplane, Double_t ampL, Double_t ampC,
   Int_t    side = 0;
   Int_t    ix;
 
-  Double_t xMin[kNplan] = { 0.006492, 0.006377, 0.006258, 0.006144, 0.006030, 0.005980 };
-  Double_t xMax[kNplan] = { 0.960351, 0.965870, 0.970445, 0.974352, 0.977667, 0.996101 };
+  Double_t xMin[kNplan] = { 0.006492, 0.006377, 0.006258
+                          , 0.006144, 0.006030, 0.005980 };
+  Double_t xMax[kNplan] = { 0.960351, 0.965870, 0.970445
+                          , 0.974352, 0.977667, 0.996101 };
 
   if      (ampL > ampR) {
     x    = (ampL - ampR) / ampC;
@@ -362,5 +392,5 @@ Double_t AliTRDRecParam::LUTposition(Int_t iplane, Double_t ampL, Double_t ampC,
   }
 
   return pos;
-}
 
+}
index 24831ce..f9ac272 100644 (file)
 
 #include "TObject.h"
 
-class AliTRDRecParam : public TObject
-{
-  public:
-    static AliTRDRecParam* Instance();
-    static void Terminate();
-  
-    enum { kNplan = 6, kNcham = 5, kNsect = 18, kNdet = 540 };
-    
-    AliTRDRecParam(const AliTRDRecParam &p);   
-    AliTRDRecParam &operator=(const AliTRDRecParam &p); 
-    virtual void Copy(TObject &p) const;
+class AliTRDRecParam : public TObject {
+
+ public:
+
+  static  AliTRDRecParam *Instance();
+  static  void Terminate();
   
-    virtual void     SetLUT(Int_t lutOn = 1)                        { fLUTOn          = lutOn;    };
-    virtual void     SetClusMaxThresh(Float_t thresh)                 { fClusMaxThresh  = thresh;   };
-    virtual void     SetClusSigThresh(Float_t thresh)                 { fClusSigThresh  = thresh;   };
+  enum { kNplan =   6
+       , kNcham =   5
+       , kNsect =  18
+       , kNdet  = 540 };
     
-            void SetTailCancelation(Int_t tcOn = 1)                 { fTCOn           = tcOn;     };
-            void SetNexponential(Int_t nexp)                        { fTCnexp         = nexp;     };
+  AliTRDRecParam(const AliTRDRecParam &p);   
+  AliTRDRecParam &operator=(const AliTRDRecParam &p);
+  virtual void     Copy(TObject &p) const;
   
-    Bool_t   LUTOn()                                          const { return fLUTOn;         };
-    virtual Float_t    GetClusMaxThresh()                       const { return fClusMaxThresh; };
-    virtual Float_t    GetClusSigThresh()                       const { return fClusSigThresh; };
+  virtual void     SetLUT(Int_t lutOn = 1)                        { fLUTOn         = lutOn;  };
+  virtual void     SetClusMaxThresh(Float_t thresh)               { fClusMaxThresh = thresh; };
+  virtual void     SetClusSigThresh(Float_t thresh)               { fClusSigThresh = thresh; };
+          void     SetTailCancelation(Int_t tcOn = 1)             { fTCOn          = tcOn;   };
+          void     SetNexponential(Int_t nexp)                    { fTCnexp        = nexp;   };
+          Bool_t   LUTOn() const                                  { return fLUTOn;           };
+  virtual Float_t  GetClusMaxThresh() const                       { return fClusMaxThresh;   };
+  virtual Float_t  GetClusSigThresh() const                       { return fClusSigThresh;   };
+          Bool_t   TCOn() const                                   { return fTCOn;            };
+          Int_t    GetTCnexp() const                              { return fTCnexp;          };
     
-    virtual Double_t  LUTposition(Int_t iplane, Double_t ampL, Double_t ampC, Double_t ampR) const;
+  virtual Double_t LUTposition(Int_t iplane, Double_t ampL, Double_t ampC, Double_t ampR) const;
   
-            Bool_t   TCOn()                                   const { return fTCOn;          };
-            Int_t    GetTCnexp()                              const { return fTCnexp;            };
-  
-  protected:
-    static AliTRDRecParam* fgInstance;     // Instance of this class (singleton implementation)
-    static Bool_t fgTerminated;               // Defines if this class has already been terminated and therefore does not return instances in GetInstance anymore
+ protected:
+
+  static  AliTRDRecParam *fgInstance; //  Instance of this class (singleton implementation)
+  static  Bool_t   fgTerminated;      //  Defines if this class has already been terminated and
+                                      //  therefore does not return instances in GetInstance anymore
     
-    void Init();
+          void     Init();
+  virtual void     FillLUT();
   
-    // Clusterization parameter
-    Float_t              fClusMaxThresh;                      //  Threshold value for cluster maximum
-    Float_t              fClusSigThresh;                      //  Threshold value for cluster signal
+          // Clusterization parameter
+          Float_t  fClusMaxThresh;    //  Threshold value for cluster maximum
+          Float_t  fClusSigThresh;    //  Threshold value for cluster signal
     
-    Int_t                fLUTOn;                              //  Switch for the lookup table method
-    Int_t                fLUTbin;                             //  Number of bins of the LUT
-    Float_t             *fLUT;                                //! The lookup table
+          Int_t    fLUTOn;            //  Switch for the lookup table method
+          Int_t    fLUTbin;           //  Number of bins of the LUT
+          Float_t *fLUT;              //! The lookup table
   
-    Int_t                fTCOn;                               //  Switch for the tail cancelation
-    Int_t                fTCnexp;                             //  Number of exponentials, digital filter
-    virtual void         FillLUT();
+          Int_t    fTCOn;             //  Switch for the tail cancelation
+          Int_t    fTCnexp;           //  Number of exponentials, digital filter
   
-  private:
-    // this is a singleton, constructor is private!  
-    AliTRDRecParam();
-    ~AliTRDRecParam();
+ private:
+
+  // This is a singleton, constructor is private!  
+  AliTRDRecParam();
+  ~AliTRDRecParam();
   
-    ClassDef(AliTRDRecParam, 1)
+  ClassDef(AliTRDRecParam,1)          //  The reconstruction parameter
+
 };
 
 #endif
index 1ebf360..dbe04b0 100644 (file)
 
 #include <TFile.h>
 
-#include "AliTRDReconstructor.h"
 #include "AliRunLoader.h"
+#include "AliRawReader.h"
+#include "AliLog.h"
+#include "AliRun.h"
+#include "AliESDTrdTrack.h"
+#include "AliESD.h"
+
+#include "AliTRDReconstructor.h"
 #include "AliTRDclusterizerV1.h"
 #include "AliTRDtracker.h"
 #include "AliTRDpidESD.h"
-#include "AliRawReader.h"
-#include "AliLog.h"
 #include "AliTRDtrigger.h"
 #include "AliTRDtrigParam.h"
 #include "AliTRDgtuTrack.h"
-#include "AliRun.h"
-#include "AliESDTrdTrack.h"
-#include "AliESD.h"
 
 ClassImp(AliTRDReconstructor)
 
-Bool_t  AliTRDReconstructor::fgkSeedingOn = kFALSE;
-Int_t   AliTRDReconstructor::fgStreamLevel     = 0;      // stream (debug) level
+Bool_t AliTRDReconstructor::fgkSeedingOn  = kFALSE;
+Int_t  AliTRDReconstructor::fgStreamLevel = 0;      // Stream (debug) level
 
 //_____________________________________________________________________________
-void AliTRDReconstructor::Reconstruct(AliRunLoader* runLoader) const
+void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader) const
 {
-// reconstruct clusters
+  //
+  // Reconstruct clusters
+  //
 
-  AliLoader *loader=runLoader->GetLoader("TRDLoader");
+  AliLoader *loader = runLoader->GetLoader("TRDLoader");
   loader->LoadRecPoints("recreate");
 
   runLoader->CdGAFile();
   Int_t nEvents = runLoader->GetNumberOfEvents();
 
   for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
-    AliTRDclusterizerV1 clusterer("clusterer", "TRD clusterizer");
-    clusterer.Open(runLoader->GetFileName(), iEvent);
+    AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
+    clusterer.Open(runLoader->GetFileName(),iEvent);
     clusterer.ReadDigits();
     clusterer.MakeClusters();
     clusterer.WriteClusters(-1);
@@ -63,30 +66,33 @@ void AliTRDReconstructor::Reconstruct(AliRunLoader* runLoader) const
 
   loader->UnloadRecPoints();
 
+  //
   // Trigger (tracklets, LTU)
-
+  //
   loader->LoadTracks("RECREATE");
-
-  Info("Reconstruct","Trigger tracklets will be produced");
+  AliInfo("Trigger tracklets will be produced");
 
   AliTRDtrigger trdTrigger("Trigger","Trigger class"); 
 
-  AliTRDtrigParam *trigp = new AliTRDtrigParam("TRDtrigParam","TRD Trigger parameters");
+  AliTRDtrigParam *trigp = new AliTRDtrigParam("TRDtrigParam"
+                                              ,"TRD Trigger parameters");
 
-  if (runLoader->GetAliRun() == 0x0) runLoader->LoadgAlice();
+  if (runLoader->GetAliRun() == 0x0) {
+    runLoader->LoadgAlice();
+  }
   gAlice = runLoader->GetAliRun();
-  Double_t x[3] = { 0.0, 0.0, 0.0 };
+  Double_t x[3]  = { 0.0, 0.0, 0.0 };
   Double_t b[3];
-  gAlice->Field(x,b);  // b[] is in kilo Gauss
-  Float_t field = b[2] * 0.1; // Tesla
-  Info("Reconstruct","Trigger set for magnetic field = %f Tesla \n",field);
+  gAlice->Field(x,b);          // b[] is in kilo Gauss
+  Float_t  field = b[2] * 0.1; // Tesla
+  AliInfo(Form("Trigger set for magnetic field = %f Tesla \n",field));
 
   trigp->SetField(field);
   trigp->Init();
   trdTrigger.SetParameter(trigp);
 
   for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
-    trdTrigger.Open(runLoader->GetFileName(), iEvent);
+    trdTrigger.Open(runLoader->GetFileName(),iEvent);
     trdTrigger.ReadDigits();
     trdTrigger.MakeTracklets();
     trdTrigger.WriteTracklets(-1);
@@ -97,14 +103,16 @@ void AliTRDReconstructor::Reconstruct(AliRunLoader* runLoader) const
 }
 
 //_____________________________________________________________________________
-void AliTRDReconstructor::Reconstruct(AliRunLoader* runLoader,
-                                      AliRawReader* rawReader) const
+void AliTRDReconstructor::Reconstruct(AliRunLoader *runLoader
+                                    , AliRawReader *rawReader) const
 {
-// reconstruct clusters
+  //
+  // Reconstruct clusters
+  //
 
   AliInfo("Reconstruct TRD clusters from RAW data");
 
-  AliLoader *loader=runLoader->GetLoader("TRDLoader");
+  AliLoader *loader = runLoader->GetLoader("TRDLoader");
   loader->LoadRecPoints("recreate");
 
   runLoader->CdGAFile();
@@ -112,8 +120,8 @@ void AliTRDReconstructor::Reconstruct(AliRunLoader* runLoader,
 
   for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
     if (!rawReader->NextEvent()) break;
-    AliTRDclusterizerV1 clusterer("clusterer", "TRD clusterizer");
-    clusterer.Open(runLoader->GetFileName(), iEvent);
+    AliTRDclusterizerV1 clusterer("clusterer","TRD clusterizer");
+    clusterer.Open(runLoader->GetFileName(),iEvent);
     clusterer.ReadDigits(rawReader);
     clusterer.MakeClusters();
     clusterer.WriteClusters(-1);
@@ -121,26 +129,30 @@ void AliTRDReconstructor::Reconstruct(AliRunLoader* runLoader,
 
   loader->UnloadRecPoints();
 
+  //
   // Trigger (tracklets, LTU)
-
+  //
   loader->LoadTracks();
   if (loader->TreeT()) {
-    Info("Reconstruct","Tracklets already exist");
+    AliError("Tracklets already exist");
     return;
   }
-  Info("Reconstruct","Trigger tracklets will be produced");
+  AliInfo("Trigger tracklets will be produced");
 
   AliTRDtrigger trdTrigger("Trigger","Trigger class"); 
 
-  AliTRDtrigParam *trigp = new AliTRDtrigParam("TRDtrigParam","TRD Trigger parameters");
+  AliTRDtrigParam *trigp = new AliTRDtrigParam("TRDtrigParam"
+                                              ,"TRD Trigger parameters");
 
-  if (runLoader->GetAliRun() == 0x0) runLoader->LoadgAlice();
+  if (runLoader->GetAliRun() == 0x0) {
+    runLoader->LoadgAlice();
+  }
   gAlice = runLoader->GetAliRun();
-  Double_t x[3] = { 0.0, 0.0, 0.0 };
+  Double_t x[3]  = { 0.0, 0.0, 0.0 };
   Double_t b[3];
-  gAlice->Field(x,b);  // b[] is in kilo Gauss
-  Float_t field = b[2] * 0.1; // Tesla
-  Info("Reconstruct","Trigger set for magnetic field = %f Tesla \n",field);
+  gAlice->Field(x,b);          // b[] is in kilo Gauss
+  Float_t  field = b[2] * 0.1; // Tesla
+  AliInfo(Form("Trigger set for magnetic field = %f Tesla \n",field));
 
   trigp->SetField(field);
   trigp->Init();
@@ -150,7 +162,7 @@ void AliTRDReconstructor::Reconstruct(AliRunLoader* runLoader,
 
   for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) {
     if (!rawReader->NextEvent()) break;
-    trdTrigger.Open(runLoader->GetFileName(), iEvent);
+    trdTrigger.Open(runLoader->GetFileName(),iEvent);
     trdTrigger.ReadDigits(rawReader);
     trdTrigger.MakeTracklets();
     trdTrigger.WriteTracklets(-1);
@@ -161,41 +173,46 @@ void AliTRDReconstructor::Reconstruct(AliRunLoader* runLoader,
 }
 
 //_____________________________________________________________________________
-AliTracker* AliTRDReconstructor::CreateTracker(AliRunLoader* runLoader) const
+AliTracker *AliTRDReconstructor::CreateTracker(AliRunLoader *runLoader) const
 {
-// create a TRD tracker
+  //
+  // Create a TRD tracker
+  //
 
   runLoader->CdGAFile();
+
   return new AliTRDtracker(gFile);
+
 }
 
 //_____________________________________________________________________________
-void AliTRDReconstructor::FillESD(AliRunLoader* runLoader, 
-                                 AliESD* esd) const
+void AliTRDReconstructor::FillESD(AliRunLoader *runLoader
+                                , AliESD *esd) const
 {
-// make PID
+  //
+  // Make PID
+  //
 
-  //Double_t parTRD[] = {
-  //  280., // Min. Ionizing Particle signal.  Check it !!!
-  //  0.23, // relative resolution             Check it !!!
-  //  10.   // PID range (in sigmas)
-  //};
   AliTRDpidESD trdPID;
   trdPID.MakePID(esd);
 
+  //
   // Trigger (tracks, GTU)
-
+  //
   AliTRDtrigger trdTrigger("Trigger","Trigger class"); 
 
-  AliTRDtrigParam *trigp = new AliTRDtrigParam("TRDtrigParam","TRD Trigger parameters");
+  AliTRDtrigParam *trigp = new AliTRDtrigParam("TRDtrigParam"
+                                              ,"TRD Trigger parameters");
 
-  if (runLoader->GetAliRun() == 0x0) runLoader->LoadgAlice();
+  if (runLoader->GetAliRun() == 0x0) {
+    runLoader->LoadgAlice();
+  }
   gAlice = runLoader->GetAliRun();
-  Double_t x[3] = { 0.0, 0.0, 0.0 };
+  Double_t x[3]  = { 0.0, 0.0, 0.0 };
   Double_t b[3];
-  gAlice->Field(x,b);  // b[] is in kilo Gauss
-  Float_t field = b[2] * 0.1; // Tesla
-  Info("FillESD","Trigger set for magnetic field = %f Tesla \n",field);
+  gAlice->Field(x,b);          // b[] is in kilo Gauss
+  Float_t  field = b[2] * 0.1; // Tesla
+  AliInfo(Form("Trigger set for magnetic field = %f Tesla \n",field));
 
   trigp->SetField(field);
   trigp->Init();
@@ -235,6 +252,3 @@ void AliTRDReconstructor::FillESD(AliRunLoader* runLoader,
   }
 
 }
-
-
-
index ac4b23f..8475489 100644 (file)
@@ -3,41 +3,50 @@
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
+/* $Id$ */
+
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
-// class for TRD reconstruction                                              //
+// Class for TRD reconstruction                                              //
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
-/* $Id$ */
-
 #include "AliReconstructor.h"
 
 class AliRawReader;
 
 class AliTRDReconstructor: public AliReconstructor {
-public:
-  AliTRDReconstructor(): AliReconstructor() {};
-  virtual ~AliTRDReconstructor() {};
-
-  virtual void         Reconstruct(AliRunLoader* runLoader, AliRawReader* rawReader) const;
-  virtual void         Reconstruct(AliRawReader*, TTree*) const { };
-  virtual void         Reconstruct(TTree*, TTree*) const { };
-  virtual void         Reconstruct(AliRunLoader* runLoader) const;
-  virtual AliTracker*  CreateTracker(AliRunLoader* runLoader) const;
-  virtual void         FillESD(AliRunLoader*, AliRawReader*, AliESD*) const { };
-  virtual void         FillESD(AliRawReader*, TTree*, AliESD*) const { };
-  virtual void         FillESD(TTree*, TTree*, AliESD*) const { };
-  virtual void         FillESD(AliRunLoader* runLoader, AliESD* esd) const;
-  static  Bool_t       SeedingOn(){ return fgkSeedingOn;}
-  static  void         SetSeedingOn(Bool_t seeding) { fgkSeedingOn = seeding;}  
-  static Int_t StreamLevel()               { return fgStreamLevel;}
-  static void  SetStreamLevel(Int_t level) { fgStreamLevel = level;}
-private:
-  static Bool_t fgkSeedingOn;               // set flag for seeding during reconstruction
-  static Int_t    fgStreamLevel;     // flag for streaming      - for TPC reconstruction
-
-  ClassDef(AliTRDReconstructor, 0)   // class for the TRD reconstruction
+
+ public:
+
+  AliTRDReconstructor(): AliReconstructor()                             { };
+  virtual ~AliTRDReconstructor()                                        { };
+
+  virtual void     Reconstruct(AliRunLoader *runLoader, AliRawReader *rawReader) const;
+  virtual void     Reconstruct(AliRawReader*, TTree*) const             { };
+  virtual void     Reconstruct(TTree*, TTree*) const                    { };
+  virtual void     Reconstruct(AliRunLoader *runLoader) const;
+
+  virtual AliTracker *CreateTracker(AliRunLoader *runLoader) const;
+
+  virtual void     FillESD(AliRunLoader*, AliRawReader*, AliESD*) const { };
+  virtual void     FillESD(AliRawReader*, TTree*, AliESD*) const        { };
+  virtual void     FillESD(TTree*, TTree*, AliESD*) const { };
+  virtual void     FillESD(AliRunLoader *runLoader, AliESD *esd) const;
+
+  static  void     SetSeedingOn(Bool_t seeding)               { fgkSeedingOn  = seeding; }  
+  static  void     SetStreamLevel(Int_t level)                { fgStreamLevel = level;   }
+
+  static  Bool_t   SeedingOn()                                { return fgkSeedingOn;     }
+  static  Int_t    StreamLevel()                              { return fgStreamLevel;    }
+
+ private:
+
+  static  Bool_t   fgkSeedingOn;  //  Set flag for seeding during reconstruction
+  static  Int_t    fgStreamLevel; //  Flag for streaming
+
+  ClassDef(AliTRDReconstructor,0) //  Class for the TRD reconstruction
+
 };
 
 #endif
index 5089bd3..bf6a730 100644 (file)
 ClassImp(AliTRDhit)
 
 //_____________________________________________________________________________
-AliTRDhit::AliTRDhit():AliHit()
+AliTRDhit::AliTRDhit()
+  :AliHit()
+  ,fDetector(0)
+  ,fQ(0)
 {
   //
   // AliTRDhit default constructor
@@ -37,22 +40,18 @@ AliTRDhit::AliTRDhit():AliHit()
 //_____________________________________________________________________________
 AliTRDhit::AliTRDhit(Int_t shunt, Int_t track, Int_t det
                    , Float_t *hits, Int_t q)
-          :AliHit(shunt, track)
+  :AliHit(shunt,track)
+  ,fDetector((UShort_t) det)
+  ,fQ((Short_t) q)
 {
   //
   // Create a TRD hit
   //
 
-  // Store detector number
-  fDetector = (UShort_t) det;
-
   // Store position 
-  fX        = hits[0];
-  fY        = hits[1];
-  fZ        = hits[2];
-
-  // Store the charge
-  fQ        = (Short_t) q;
+  fX = hits[0];
+  fY = hits[1];
+  fZ = hits[2];
 
 }
 
index 3fa5027..ca1e2d6 100644 (file)
@@ -3,15 +3,16 @@
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
-/* $Id: AliTRDhit.h,v */
+/* $Id$ */
 
-////////////////////////////////////////////////
-//  Hit class for the TRD                     //
-////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+//                                                                        //
+//  Hit class for the TRD                                                 //
+//                                                                        //
+////////////////////////////////////////////////////////////////////////////
 
 #include "AliHit.h"
 
-//_____________________________________________________________________________
 class AliTRDhit : public AliHit {
 
  public:
@@ -20,36 +21,36 @@ class AliTRDhit : public AliHit {
   AliTRDhit(Int_t shunt, Int_t track, Int_t det, Float_t *hits, Int_t q);
   virtual ~AliTRDhit();
 
-          Int_t  GetDetector() const         { return fDetector; };
-          Int_t  GetCharge() const           { return fQ;        };
+          Int_t    GetDetector() const         { return fDetector; }
+          Int_t    GetCharge() const           { return fQ;        }
 
-          void   SetX(Float_t x)             { fX        =   x; }
-          void   SetY(Float_t y)             { fY        =   y; }
-          void   SetZ(Float_t z)             { fZ        =   z; }
-          void   SetDetector(Int_t det)      { fDetector = det; }
-          void   SetQ(Int_t q)               { fQ        =   q; }
+          void     SetX(Float_t x)             { fX        =   x;  }
+          void     SetY(Float_t y)             { fY        =   y;  }
+          void     SetZ(Float_t z)             { fZ        =   z;  }
+          void     SetDetector(Int_t det)      { fDetector = det;  }
+          void     SetQ(Int_t q)               { fQ        =   q;  }
 
-          Bool_t FromDrift() const           { return TestBit(kDrift);         };
-          Bool_t FromAmplification() const   { return TestBit(kAmplification); };
-          Bool_t FromTRphoton() const        { return (fQ < 0);                };
-
-          void   SetDrift()                  { SetBit(kDrift);         };
-          void   SetAmplification()          { SetBit(kAmplification); };
-          void   SetTRphoton()               { SetBit(kTRphoton);      };
+          Bool_t   FromDrift() const           { return TestBit(kDrift);         }
+          Bool_t   FromAmplification() const   { return TestBit(kAmplification); }
+          Bool_t   FromTRphoton() const        { return (fQ < 0);                }
+         
+          void     SetDrift()                  { SetBit(kDrift);                 }
+          void     SetAmplification()          { SetBit(kAmplification);         }
+          void     SetTRphoton()               { SetBit(kTRphoton);              }
 
  protected:
 
-  enum {
-    kDrift         = 0x00000001,    // Hit is from the drift region
-    kAmplification = 0x00000002,    // Hit is from the amplification region
-    kTRphoton      = 0x00000004,    // Hit is from a TR photon
-    kTest          = 0x00000008     // Hit is a special test hit
-  };
+          enum {
+              kDrift         = 0x00000001   //  Hit is from the drift region
+            , kAmplification = 0x00000002   //  Hit is from the amplification region
+            , kTRphoton      = 0x00000004   //  Hit is from a TR photon
+            , kTest          = 0x00000008   //  Hit is a special test hit
+          };
 
-  UShort_t     fDetector;           // TRD detector number
-  Short_t      fQ;                  // Charge created by a hit. TR signals are negative.
+          UShort_t fDetector;               //  TRD detector number
+          Short_t  fQ;                      //  Charge created by a hit. TR signals are negative.
 
-  ClassDef(AliTRDhit,3)             // Hit for the Transition Radiation Detector
+  ClassDef(AliTRDhit,3)                     //  Hit for the Transition Radiation Detector
 
 };
 
index e25ca2f..ec0f3c7 100644 (file)
 ClassImp(AliTRDpoints)
 
 //_____________________________________________________________________________
-AliTRDpoints::AliTRDpoints():AliPoints()
+AliTRDpoints::AliTRDpoints()
+  :AliPoints()
+  ,fNTRpoints(0)
+  ,fTRpolyMarker(0)
 {
   //
   // Default constructor
   //
 
-  fNTRpoints    = 0;
-  fTRpolyMarker = 0;
-
 }
 
 //_____________________________________________________________________________
-AliTRDpoints::AliTRDpoints(Int_t nhitsE, Int_t nhitsT):AliPoints(nhitsE)
+AliTRDpoints::AliTRDpoints(Int_t nhitsE, Int_t nhitsT)
+  :AliPoints(nhitsE)
+  ,fNTRpoints(nhitsT)
+  ,fTRpolyMarker(0)
 {
   //
   // Standard constructor
   //
 
-  fNTRpoints    = nhitsT;
-  fTRpolyMarker = 0;
-
 }
         
 //_____________________________________________________________________________
-AliTRDpoints::AliTRDpoints(const AliTRDpoints &p):AliPoints(p)
+AliTRDpoints::AliTRDpoints(const AliTRDpoints &p)
+  :AliPoints(p)
+  ,fNTRpoints(p.fNTRpoints)
+  ,fTRpolyMarker(0)
 {
   //
   // Copy contructor
   //
-  ((AliTRDpoints &) p).Copy(*this);
+
+  for (Int_t i = 0; i < 3*fNTRpoints; i++) {
+    ((AliTRDpoints &) p).fTRpoints[i] = fTRpoints[i];
+  }
 
 }
 
@@ -74,7 +79,10 @@ AliTRDpoints::~AliTRDpoints()
   // Default destructor
   //
 
-  if (fTRpolyMarker) delete fTRpolyMarker;
+  if (fTRpolyMarker) {
+    delete fTRpolyMarker;
+    fTRpolyMarker = 0;
+  }
 
 }
 
@@ -113,7 +121,6 @@ void AliTRDpoints::Draw(Option_t *option)
 
   AliPoints::Draw(option);
 
-  //if (fTRpolyMarker) delete fTRpolyMarker;
   if (fNTRpoints) {
     fTRpolyMarker = new TPolyMarker3D(fNTRpoints,fTRpoints,29);
     fTRpolyMarker->SetMarkerColor(2); 
@@ -130,15 +137,14 @@ void AliTRDpoints::SetTRpoints(Int_t n, Float_t *coor)
   // Sets the number and the coordinates of the photon hits
   //
 
-  if (kNTRpoints >= 3 * n) {
+  if (kNTRpoints >= 3*n) {
     fNTRpoints = n;
     for (Int_t i = 0; i < 3*n; i++) {
       fTRpoints[i] = coor[i];
     } 
   }
   else {
-    printf("AliTRDpoints::SetTRpoints -- ");
-    printf("Boundary error: %d/%d\n",3*n,kNTRpoints);
+    AliError(Form("Boundary error: %d/%d\n",3*n,kNTRpoints));
   }
 
 }
index 0f9b9ff..67ec7bc 100644 (file)
@@ -5,12 +5,12 @@
 
 /* $Id$ */
 
-///////////////////////////////////////////////////////////////////////////////
-//                                                                           //
-//  This class contains the TRD points for the ALICE event display.          //
-//  Used to seperately display dEdx and TR photon hits.                      //
-//                                                                           //
-///////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+//                                                                        //
+//  This class contains the TRD points for the ALICE event display.       //
+//  Used to seperately display dEdx and TR photon hits.                   //
+//                                                                        //
+////////////////////////////////////////////////////////////////////////////
 
 #include "AliPoints.h"
 
@@ -24,20 +24,20 @@ class AliTRDpoints : public AliPoints {
   virtual ~AliTRDpoints();
   AliTRDpoints &operator=(const AliTRDpoints &p);
 
-  virtual void           Copy(TObject &p) const;   
-  virtual void           Draw(Option_t *option);
+  virtual void     Copy(TObject &p) const;   
+  virtual void     Draw(Option_t *option);
 
-  virtual void           SetTRpoints(Int_t n, Float_t *coor);
+  virtual void     SetTRpoints(Int_t n, Float_t *coor);
 
  protected:
 
   enum { kNTRpoints = 75 };
 
-  Float_t          fTRpoints[kNTRpoints];       //  The hits from TR photons
-  Int_t            fNTRpoints;                  //  The number of TR photon hits
+          Float_t  fTRpoints[kNTRpoints];       //  The hits from TR photons
+          Int_t    fNTRpoints;                  //  The number of TR photon hits
   TPolyMarker3D   *fTRpolyMarker;               //! Polymarker to draw the photon hits
   
-  ClassDef(AliTRDpoints,1)                      // Class to draw TRD hits 
+  ClassDef(AliTRDpoints,1)                      //  Class to draw TRD hits 
 
 };
 #endif
index dfed138..2bd4955 100644 (file)
 #include <TParticle.h>
 
 #include "AliModule.h"
+#include "AliLog.h"
 
 #include "AliTRDsim.h"
 
 ClassImp(AliTRDsim)
 
 //_____________________________________________________________________________
-AliTRDsim::AliTRDsim():TObject()
+AliTRDsim::AliTRDsim()
+  :TObject()
+  ,fNFoilsDim(0)
+  ,fNFoils(0)
+  ,fNFoilsUp(0)
+  ,fFoilThick(0)
+  ,fGapThick(0)
+  ,fFoilDens(0)
+  ,fGapDens(0)
+  ,fFoilOmega(0)
+  ,fGapOmega()
+  ,fFoilZ(0)
+  ,fGapZ(0)
+  ,fFoilA(0)
+  ,fGapA(0)
+  ,fTemp(0)
+  ,fSpNBins(0)
+  ,fSpRange(0)
+  ,fSpBinWidth(0)
+  ,fSpLower(0)
+  ,fSpUpper(0)
+  ,fSigma(0)
+  ,fSpectrum(0)
 {
   //
   // AliTRDsim default constructor
   // 
 
-  fSpectrum = 0;
-  fSigma    = 0;
-  fNFoils   = 0;
-  fNFoilsUp = 0;
-
   Init();
 
 }
 
 //_____________________________________________________________________________
 AliTRDsim::AliTRDsim(AliModule *mod, Int_t foil, Int_t gap)
+  :TObject()
+  ,fNFoilsDim(0)
+  ,fNFoils(0)
+  ,fNFoilsUp(0)
+  ,fFoilThick(0)
+  ,fGapThick(0)
+  ,fFoilDens(0)
+  ,fGapDens(0)
+  ,fFoilOmega(0)
+  ,fGapOmega()
+  ,fFoilZ(0)
+  ,fGapZ(0)
+  ,fFoilA(0)
+  ,fGapA(0)
+  ,fTemp(0)
+  ,fSpNBins(0)
+  ,fSpRange(0)
+  ,fSpBinWidth(0)
+  ,fSpLower(0)
+  ,fSpUpper(0)
+  ,fSigma(0)
+  ,fSpectrum(0)
 {
   //
   // AliTRDsim constructor. Takes the material properties of the radiator
@@ -68,15 +108,18 @@ AliTRDsim::AliTRDsim(AliModule *mod, Int_t foil, Int_t gap)
   // thickness of the gaps is 500 mu.
   //
 
-  Float_t aFoil, zFoil, rhoFoil;
-  Float_t aGap,  zGap,  rhoGap;
-  Float_t rad, abs;
-  Char_t  name[21];
+  Float_t aFoil;
+  Float_t zFoil;
+  Float_t rhoFoil;
+
+  Float_t aGap;
+  Float_t zGap;
+  Float_t rhoGap;
 
-  fSpectrum = 0;
-  fSigma    = 0;
-  fNFoils   = 0;
-  fNFoilsUp = 0;
+  Float_t rad;
+  Float_t abs;
+
+  Char_t  name[21];
 
   Init();
 
@@ -96,13 +139,59 @@ AliTRDsim::AliTRDsim(AliModule *mod, Int_t foil, Int_t gap)
 }
 
 //_____________________________________________________________________________
-AliTRDsim::AliTRDsim(const AliTRDsim &s):TObject(s)
+AliTRDsim::AliTRDsim(const AliTRDsim &s)
+  :TObject(s)
+  ,fNFoilsDim(s.fNFoilsDim)
+  ,fNFoils(0)
+  ,fNFoilsUp(0)
+  ,fFoilThick(s.fFoilThick)
+  ,fGapThick(s.fGapThick)
+  ,fFoilDens(s.fFoilDens)
+  ,fGapDens(s.fGapDens)
+  ,fFoilOmega(s.fFoilOmega)
+  ,fGapOmega(s.fGapOmega)
+  ,fFoilZ(s.fFoilZ)
+  ,fGapZ(s.fGapZ)
+  ,fFoilA(s.fFoilA)
+  ,fGapA(s.fGapA)
+  ,fTemp(s.fTemp)
+  ,fSpNBins(s.fSpNBins)
+  ,fSpRange(s.fSpRange)
+  ,fSpBinWidth(s.fSpBinWidth)
+  ,fSpLower(s.fSpLower)
+  ,fSpUpper(s.fSpUpper)
+  ,fSigma(0)
+  ,fSpectrum(0)
 {
   //
   // AliTRDsim copy constructor
   //
 
-  ((AliTRDsim &) s).Copy(*this);
+  if (((AliTRDsim &) s).fNFoils) {
+    delete [] ((AliTRDsim &) s).fNFoils;
+  }
+  ((AliTRDsim &) s).fNFoils   = new Int_t[fNFoilsDim];
+  for (Int_t iFoil = 0; iFoil < fNFoilsDim; iFoil++) {
+    ((AliTRDsim &) s).fNFoils[iFoil]   = fNFoils[iFoil];
+  }  
+
+  if (((AliTRDsim &) s).fNFoilsUp) {
+    delete [] ((AliTRDsim &) s).fNFoilsUp;
+  }
+  ((AliTRDsim &) s).fNFoilsUp = new Double_t[fNFoilsDim];
+  for (Int_t iFoil = 0; iFoil < fNFoilsDim; iFoil++) {
+    ((AliTRDsim &) s).fNFoilsUp[iFoil] = fNFoilsUp[iFoil];
+  }  
+
+  if (((AliTRDsim &) s).fSigma) {
+    delete [] ((AliTRDsim &) s).fSigma;
+  }
+  ((AliTRDsim &) s).fSigma    = new Double_t[fSpNBins];
+  for (Int_t iBin = 0; iBin < fSpNBins; iBin++) {
+    ((AliTRDsim &) s).fSigma[iBin]     = fSigma[iBin];
+  }  
+
+  fSpectrum->Copy(*((AliTRDsim &) s).fSpectrum);
 
 }
 
@@ -113,10 +202,20 @@ AliTRDsim::~AliTRDsim()
   // AliTRDsim destructor
   //
 
-  //  if (fSpectrum) delete fSpectrum;
-  if (fSigma)    delete [] fSigma;
-  if (fNFoils)   delete [] fNFoils;
-  if (fNFoilsUp) delete [] fNFoilsUp;
+  if (fSigma) {
+    delete [] fSigma;
+    fSigma    = 0;
+  }
+
+  if (fNFoils) {
+    delete [] fNFoils;
+    fNFoils   = 0;
+  }
+
+  if (fNFoilsUp) {
+    delete [] fNFoilsUp;
+    fNFoilsUp = 0;
+  }
 
 }
 
@@ -128,6 +227,7 @@ AliTRDsim &AliTRDsim::operator=(const AliTRDsim &s)
   //
 
   if (this != &s) ((AliTRDsim &) s).Copy(*this);
+
   return *this;
 
 }
@@ -156,22 +256,28 @@ void AliTRDsim::Copy(TObject &s) const
   ((AliTRDsim &) s).fSpLower    = fSpLower;
   ((AliTRDsim &) s).fSpUpper    = fSpUpper;
 
-  if (((AliTRDsim &) s).fNFoils) delete [] ((AliTRDsim &) s).fNFoils;
+  if (((AliTRDsim &) s).fNFoils) {
+    delete [] ((AliTRDsim &) s).fNFoils;
+  }
   ((AliTRDsim &) s).fNFoils   = new Int_t[fNFoilsDim];
   for (Int_t iFoil = 0; iFoil < fNFoilsDim; iFoil++) {
-    ((AliTRDsim &) s).fNFoils[iFoil] = fNFoils[iFoil];
+    ((AliTRDsim &) s).fNFoils[iFoil]   = fNFoils[iFoil];
   }  
 
-  if (((AliTRDsim &) s).fNFoilsUp) delete [] ((AliTRDsim &) s).fNFoilsUp;
+  if (((AliTRDsim &) s).fNFoilsUp) {
+    delete [] ((AliTRDsim &) s).fNFoilsUp;
+  }
   ((AliTRDsim &) s).fNFoilsUp = new Double_t[fNFoilsDim];
   for (Int_t iFoil = 0; iFoil < fNFoilsDim; iFoil++) {
     ((AliTRDsim &) s).fNFoilsUp[iFoil] = fNFoilsUp[iFoil];
   }  
 
-  if (((AliTRDsim &) s).fSigma)  delete [] ((AliTRDsim &) s).fSigma;
-  ((AliTRDsim &) s).fSigma = new Double_t[fSpNBins];
+  if (((AliTRDsim &) s).fSigma) {
+    delete [] ((AliTRDsim &) s).fSigma;
+  }
+  ((AliTRDsim &) s).fSigma    = new Double_t[fSpNBins];
   for (Int_t iBin = 0; iBin < fSpNBins; iBin++) {
-    ((AliTRDsim &) s).fSigma[iBin] = fSigma[iBin];
+    ((AliTRDsim &) s).fSigma[iBin]     = fSigma[iBin];
   }  
 
   fSpectrum->Copy(*((AliTRDsim &) s).fSpectrum);
@@ -189,17 +295,21 @@ void AliTRDsim::Init()
 
   fNFoilsDim   = 7;
 
-  if (fNFoils)   delete [] fNFoils;
+  if (fNFoils) {
+    delete [] fNFoils;
+  }
   fNFoils      = new Int_t[fNFoilsDim];
   fNFoils[0]   = 170;
-  fNFoils[1]   = 225; //250;
-  fNFoils[2]   = 275; //310;
-  fNFoils[3]   = 305; //380;
-  fNFoils[4]   = 325; //430;
-  fNFoils[5]   = 340; //490;
-  fNFoils[6]   = 350; //550;
-
-  if (fNFoilsUp) delete [] fNFoilsUp;
+  fNFoils[1]   = 225;
+  fNFoils[2]   = 275;
+  fNFoils[3]   = 305;
+  fNFoils[4]   = 325;
+  fNFoils[5]   = 340;
+  fNFoils[6]   = 350;
+
+  if (fNFoilsUp) {
+    delete [] fNFoilsUp;
+  }
   fNFoilsUp    = new Double_t[fNFoilsDim];
   fNFoilsUp[0] = 1.25;
   fNFoilsUp[1] = 1.75;
@@ -290,7 +400,7 @@ Int_t AliTRDsim::TrPhotons(Float_t p, Float_t mass
   const Double_t kAlpha  = 0.0072973;
   const Int_t    kSumMax = 30;
        
-  Double_t tau = fGapThick / fFoilThick;
+  Double_t tau   = fGapThick / fFoilThick;
 
   // Calculate gamma
   Double_t gamma = TMath::Sqrt(p*p + mass*mass) / mass;
@@ -300,45 +410,59 @@ Int_t AliTRDsim::TrPhotons(Float_t p, Float_t mass
 
   fSpectrum->Reset();
 
+  //
   // The TR spectrum
-       Double_t csi1,csi2,rho1,rho2;
-       Double_t fSigma,Sum,Nequ,theta_n,aux;
-  Double_t energyeV, energykeV;
-       for (Int_t iBin = 1; iBin <= fSpNBins; iBin++) {
-    energykeV = fSpectrum->GetBinCenter(iBin);
-    energyeV = energykeV * 1.e3;
+  //
 
-    fSigma       = Sigma(energykeV);
+  Double_t csi1;
+  Double_t csi2;
+  Double_t rho1;
+  Double_t rho2;
+  Double_t sSigma;
+  Double_t sum;
+  Double_t nEqu;
+  Double_t thetaN;
+  Double_t aux;
+  Double_t energyeV;
+  Double_t energykeV;
 
-    csi1 = fFoilOmega / energyeV;
-    csi2 = fGapOmega  / energyeV;
+  for (Int_t iBin = 1; iBin <= fSpNBins; iBin++) {
 
-    rho1 = 2.5 * energyeV * fFoilThick * 1.E4 
-                                 * (1. / (gamma*gamma) + csi1*csi1);
-    rho2 = 2.5 * energyeV * fFoilThick * 1.E4 
-                                 * (1.0 / (gamma*gamma) + csi2 *csi2);
+    energykeV = fSpectrum->GetBinCenter(iBin);
+    energyeV  = energykeV * 1.e3;
+    sSigma    = Sigma(energykeV);
+
+    csi1      = fFoilOmega / energyeV;
+    csi2      = fGapOmega  / energyeV;
+
+    rho1      = 2.5 * energyeV * fFoilThick * 1.0e4 
+              * (1. / (gamma*gamma) + csi1*csi1);
+    rho2      = 2.5 * energyeV * fFoilThick * 1.0e4 
+              * (1.0 / (gamma*gamma) + csi2 *csi2);
 
     // Calculate the sum
-    Sum = 0;
+    sum = 0;
     for (Int_t n = 1; n <= kSumMax; n++) {
-      theta_n = (TMath::Pi() * 2.0 * n - (rho1 + tau * rho2)) / (1.+ tau);
-      if (theta_n < 0.) theta_n = 0.0;
-      aux   = 1. / (rho1 + theta_n) - 1. / (rho2 + theta_n);
-      Sum  += theta_n * (aux*aux) * (1.0 - TMath::Cos(rho1 + theta_n));
+      thetaN = (TMath::Pi() * 2.0 * n - (rho1 + tau * rho2)) / (1.0 + tau);
+      if (thetaN < 0.0) {
+        thetaN = 0.0;
+      }
+      aux    = 1.0 / (rho1 + thetaN) - 1.0 / (rho2 + thetaN);
+      sum  += thetaN * (aux*aux) * (1.0 - TMath::Cos(rho1 + thetaN));
     }
 
     // Equivalent number of foils
-    Nequ      = (1. - TMath::Exp(-foils * fSigma)) / (1.- TMath::Exp(-fSigma));
-
+    nEqu = (1.0 - TMath::Exp(-foils * sSigma)) / (1.0 - TMath::Exp(-sSigma));
 
     // dN / domega
-    fSpectrum->SetBinContent(iBin,4. * kAlpha * Nequ * Sum /  (energykeV * (1. + tau)));
+    fSpectrum->SetBinContent(iBin,4.0 * kAlpha * nEqu * sum / (energykeV * (1.0 + tau)));
+
   }
 
   // <nTR> (binsize corr.)
   Float_t ntr = fSpBinWidth*fSpectrum->Integral();
   // Number of TR photons from Poisson distribution with mean <ntr>
-  nPhoton = gRandom->Poisson(ntr);
+  nPhoton     = gRandom->Poisson(ntr);
   // Energy of the TR photons
   for (Int_t iPhoton = 0; iPhoton < nPhoton; iPhoton++) {
     ePhoton[iPhoton] = fSpectrum->GetRandom();
@@ -355,12 +479,14 @@ void AliTRDsim::SetSigma()
   // Sets the absorbtion crosssection for the energies of the TR spectrum
   //
 
-  if (fSigma) delete [] fSigma;
+  if (fSigma) {
+    delete [] fSigma;
+  }
   fSigma = new Double_t[fSpNBins];
+
   for (Int_t iBin = 0; iBin < fSpNBins; iBin++) {
     Double_t energykeV = iBin * fSpBinWidth + 1.0;
     fSigma[iBin]       = Sigma(energykeV);
-    //printf("SetSigma(): iBin = %d fSigma %g\n",iBin,fSigma[iBin]);
   }
 
 }
@@ -379,7 +505,7 @@ Double_t AliTRDsim::Sigma(Double_t energykeV)
            GetMuAi(energyMeV) * fGapDens  * fGapThick  * GetTemp());
   }
   else {
-    return 1e6;
+    return 1.0e6;
   }
 
 }
@@ -778,20 +904,30 @@ Int_t AliTRDsim::Locate(Double_t *xv, Int_t n, Double_t xval
   // Locates a point (xval) in a 1-dim grid (xv(n))
   //
 
-  if (xval >= xv[n-1]) return  1;
-  if (xval <  xv[0])   return -1;
+  if (xval >= xv[n-1]) {
+    return  1;
+  }
+  if (xval <  xv[0]) {
+    return -1;
+  }
 
   Int_t km;
   Int_t kh = n - 1;
 
   kl = 0;
   while (kh - kl > 1) {
-    if (xval < xv[km = (kl+kh)/2]) kh = km; 
-    else                           kl = km;
+    if (xval < xv[km = (kl+kh)/2]) {
+      kh = km; 
+    }
+    else {
+      kl = km;
+    }
   }
-  if (xval < xv[kl] || xval > xv[kl+1] || kl >= n-1) {
-    printf("Locate failed xv[%d] %f xval %f xv[%d] %f!!!\n"
-          ,kl,xv[kl],xval,kl+1,xv[kl+1]);
+  if ((xval <  xv[kl])   || 
+      (xval >  xv[kl+1]) || 
+      (kl   >= n-1)) {
+    AliError(Form("Locate failed xv[%d] %f xval %f xv[%d] %f!!!\n"
+                 ,kl,xv[kl],xval,kl+1,xv[kl+1]));
     exit(1);
   }
 
index 33f28fc..ac511e5 100644 (file)
@@ -5,11 +5,11 @@
 
 /* $Id$ */
 
-///////////////////////////////////////////////////////////////////////////////
-//                                                                           //
-//  TRD simulation - multimodule (regular rad.)                              //
-//                                                                           //
-///////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+//                                                                        //
+//  TRD simulation - multimodule (regular rad.)                           //
+//                                                                        //
+////////////////////////////////////////////////////////////////////////////
 
 #include <TObject.h>
 
@@ -27,94 +27,94 @@ class AliTRDsim : public TObject {
   virtual ~AliTRDsim();
   AliTRDsim &operator=(const AliTRDsim &s);
 
-  virtual void          Copy(TObject &s) const;
-  virtual void          Init();
-  virtual Int_t         CreatePhotons(Int_t pdg, Float_t p
-                                    , Int_t &nPhoton, Float_t *ePhoton);
-  virtual Int_t         TrPhotons(Float_t p, Float_t mass, Int_t &nPhoton, Float_t *ePhoton);
-  virtual Double_t      Sigma(Double_t energykeV);
-  virtual Double_t      Interpolate(Double_t energyMeV
-                                  , Double_t *en, Double_t *mu, Int_t n);
-  virtual Int_t         Locate(Double_t *xv, Int_t n, Double_t xval
-                             , Int_t &kl, Double_t &dx);
-  virtual Double_t      Omega(Float_t rho, Float_t z, Float_t a) 
-                             { return (28.8 * TMath::Sqrt(rho * z / a)); };
-  virtual Int_t         SelectNFoils(Float_t p);
-
-          void          SetFoilThick(Float_t t) { fFoilThick = t;
-                           SetSigma();                                  };
-          void          SetGapThick(Float_t t)  { fGapThick  = t;
-                           SetSigma();                                  };
-          void          SetFoilDens(Float_t d)  { fFoilDens  = d; 
-                           fFoilOmega = Omega(fFoilDens,fFoilZ,fFoilA);
-                           SetSigma();                                  };
-          void          SetFoilZ(Float_t z)     { fFoilZ     = z; 
-                           fFoilOmega = Omega(fFoilDens,fFoilZ,fFoilA); };
-          void          SetFoilA(Float_t a)     { fFoilA     = a; 
-                           fFoilOmega = Omega(fFoilDens,fFoilZ,fFoilA); };
-          void          SetGapDens(Float_t d)   { fGapDens   = d;
-                           fGapOmega  = Omega(fGapDens ,fGapZ ,fGapA );
-                           SetSigma();                                  };
-          void          SetGapZ(Float_t z)      { fGapZ      = z;
-                           fGapOmega  = Omega(fGapDens ,fGapZ ,fGapA ); };
-          void          SetGapA(Float_t a)      { fGapA      = a;
-                           fGapOmega  = Omega(fGapDens ,fGapZ ,fGapA ); };
-          void          SetTemp(Float_t t)      { fTemp      = t; 
-                           SetSigma();                                  };
-          void          SetSigma();
-
-  virtual Double_t      GetMuPo(Double_t energyMeV);
-  virtual Double_t      GetMuCO(Double_t energyMeV);
-  virtual Double_t      GetMuXe(Double_t energyMeV);
-  virtual Double_t      GetMuBu(Double_t energyMeV);
-  virtual Double_t      GetMuMy(Double_t energyMeV);
-  virtual Double_t      GetMuN2(Double_t energyMeV);
-  virtual Double_t      GetMuO2(Double_t energyMeV);
-  virtual Double_t      GetMuHe(Double_t energyMeV);
-  virtual Double_t      GetMuAi(Double_t energyMeV);
-
-          Float_t       GetFoilThick() const    { return fFoilThick;     };
-          Float_t       GetGapThick() const     { return fGapThick;      };
-          Float_t       GetFoilDens() const     { return fFoilDens;      };
-          Float_t       GetGapDens() const      { return fGapDens;       };
-          Double_t      GetFoilOmega() const    { return fFoilOmega;     };
-          Double_t      GetGapOmega() const     { return fGapOmega;      };
-          Float_t       GetTemp() const         { return fTemp / 273.16; };
-          TH1D         *GetSpectrum() const     { return fSpectrum;      };
+  virtual void     Copy(TObject &s) const;
+  virtual void     Init();
+  virtual Int_t    CreatePhotons(Int_t pdg, Float_t p
+                               , Int_t &nPhoton, Float_t *ePhoton);
+  virtual Int_t    TrPhotons(Float_t p, Float_t mass
+                           , Int_t &nPhoton, Float_t *ePhoton);
+  virtual Double_t Sigma(Double_t energykeV);
+  virtual Double_t Interpolate(Double_t energyMeV
+                             , Double_t *en, Double_t *mu, Int_t n);
+  virtual Int_t    Locate(Double_t *xv, Int_t n, Double_t xval
+                        , Int_t &kl, Double_t &dx);
+  virtual Double_t Omega(Float_t rho, Float_t z, Float_t a)  { return (28.8 * TMath::Sqrt(rho * z / a)); };
+  virtual Int_t    SelectNFoils(Float_t p);
+
+          void     SetFoilThick(Float_t t)                   { fFoilThick = t;
+                                                               SetSigma();                                  };
+          void     SetGapThick(Float_t t)                    { fGapThick  = t;
+                                                               SetSigma();                                  };
+          void     SetFoilDens(Float_t d)                    { fFoilDens  = d; 
+                                                               fFoilOmega = Omega(fFoilDens,fFoilZ,fFoilA);
+                                                               SetSigma();                                  };
+          void     SetFoilZ(Float_t z)                       { fFoilZ     = z; 
+                                                               fFoilOmega = Omega(fFoilDens,fFoilZ,fFoilA); };
+          void     SetFoilA(Float_t a)                       { fFoilA     = a; 
+                                                               fFoilOmega = Omega(fFoilDens,fFoilZ,fFoilA); };
+          void     SetGapDens(Float_t d)                     { fGapDens   = d;
+                                                               fGapOmega  = Omega(fGapDens ,fGapZ ,fGapA );
+                                                               SetSigma();                                  };
+          void     SetGapZ(Float_t z)                        { fGapZ      = z;
+                                                               fGapOmega  = Omega(fGapDens ,fGapZ ,fGapA ); };
+          void     SetGapA(Float_t a)                        { fGapA      = a;
+                                                               fGapOmega  = Omega(fGapDens ,fGapZ ,fGapA ); };
+          void     SetTemp(Float_t t)                        { fTemp      = t; 
+                                                               SetSigma();                                  };
+          void     SetSigma();
+
+  virtual Double_t GetMuPo(Double_t energyMeV);
+  virtual Double_t GetMuCO(Double_t energyMeV);
+  virtual Double_t GetMuXe(Double_t energyMeV);
+  virtual Double_t GetMuBu(Double_t energyMeV);
+  virtual Double_t GetMuMy(Double_t energyMeV);
+  virtual Double_t GetMuN2(Double_t energyMeV);
+  virtual Double_t GetMuO2(Double_t energyMeV);
+  virtual Double_t GetMuHe(Double_t energyMeV);
+  virtual Double_t GetMuAi(Double_t energyMeV);
+
+          Float_t  GetFoilThick() const                      { return fFoilThick;     };
+          Float_t  GetGapThick() const                       { return fGapThick;      };
+          Float_t  GetFoilDens() const                       { return fFoilDens;      };
+          Float_t  GetGapDens() const                        { return fGapDens;       };
+          Double_t GetFoilOmega() const                      { return fFoilOmega;     };
+          Double_t GetGapOmega() const                       { return fGapOmega;      };
+          Float_t  GetTemp() const                           { return fTemp / 273.16; };
+          TH1D    *GetSpectrum() const                       { return fSpectrum;      };
 
  protected:
 
-  Int_t     fNFoilsDim;            // Dimension of the NFoils array
-  Int_t    *fNFoils;               //[fNFoilsDim] Number of foils in the radiator stack
-  Double_t *fNFoilsUp;             //[fNFoilsDim] Upper momenta for a given number of foils
-  Float_t   fFoilThick;            // Thickness of the foils (cm)
-  Float_t   fGapThick;             // Thickness of the gaps between the foils (cm)
+          Int_t     fNFoilsDim;            //  Dimension of the NFoils array
+          Int_t    *fNFoils;               //[fNFoilsDim] Number of foils in the radiator stack
+          Double_t *fNFoilsUp;             //[fNFoilsDim] Upper momenta for a given number of foils
+          Float_t   fFoilThick;            //  Thickness of the foils (cm)
+          Float_t   fGapThick;             //  Thickness of the gaps between the foils (cm)
 
-  Float_t   fFoilDens;             // Density of the radiator foils (g/cm^3) 
-  Float_t   fGapDens;              // Density of the gas in the radiator gaps (g/cm^3)
+          Float_t   fFoilDens;             //  Density of the radiator foils (g/cm^3) 
+          Float_t   fGapDens;              //  Density of the gas in the radiator gaps (g/cm^3)
 
-  Double_t  fFoilOmega;            // Plasma frequency of the radiator foils
-  Double_t  fGapOmega;             // Plasma frequency of the gas in the radiator gaps
+          Double_t  fFoilOmega;            //  Plasma frequency of the radiator foils
+          Double_t  fGapOmega;             //  Plasma frequency of the gas in the radiator gaps
 
-  Float_t   fFoilZ;                // Z of the foil material
-  Float_t   fGapZ;                 // Z of the gas in the gaps
+          Float_t   fFoilZ;                //  Z of the foil material
+          Float_t   fGapZ;                 //  Z of the gas in the gaps
 
-  Float_t   fFoilA;                // A of the foil material
-  Float_t   fGapA;                 // A of the gas in the gaps
+          Float_t   fFoilA;                //  A of the foil material
+          Float_t   fGapA;                 //  A of the gas in the gaps
 
-  Float_t   fTemp;                 // Temperature of the radiator gas (Kelvin)
+          Float_t   fTemp;                 //  Temperature of the radiator gas (Kelvin)
 
-  Int_t     fSpNBins;              // Number of bins of the TR spectrum
-  Float_t   fSpRange;              // Range of the TR spectrum
-  Float_t   fSpBinWidth;           // Bin width of the TR spectrum
-  Float_t   fSpLower;              // Lower border of the TR spectrum
-  Float_t   fSpUpper;              // Upper border of the TR spectrum
+          Int_t     fSpNBins;              //  Number of bins of the TR spectrum
+          Float_t   fSpRange;              //  Range of the TR spectrum
+          Float_t   fSpBinWidth;           //  Bin width of the TR spectrum
+          Float_t   fSpLower;              //  Lower border of the TR spectrum
+          Float_t   fSpUpper;              //  Upper border of the TR spectrum
 
-  Double_t *fSigma;                //[fSpNBins] Array of sigma values
+          Double_t *fSigma;                //[fSpNBins] Array of sigma values
 
-  TH1D     *fSpectrum;             //!TR photon energy spectrum
+          TH1D     *fSpectrum;             //! TR photon energy spectrum
 
-  ClassDef(AliTRDsim,2)            // Simulates TR photons
+  ClassDef(AliTRDsim,2)                    //  Simulates TR photons
 
 };
 #endif
index a585a19..9a5c041 100644 (file)
 //                                            //
 ////////////////////////////////////////////////
 
-#include "AliTRDtrackHits.h"
-#include "TClonesArray.h"    
-#include "AliTRDhit.h"    
-
 #include <Riostream.h>
 
+#include <TClonesArray.h>
+
+#include "AliTRDtrackHits.h"
+#include "AliTRDhit.h"    
 
 ClassImp(AliTRDtrackHits)
  
-void  AliTRDtrackHits::AddHitTRD(Int_t volumeID, Int_t trackID, Double_t x, 
-                   Double_t y, Double_t z,Int_t q, Bool_t inDrift)
+//_____________________________________________________________________________
+void  AliTRDtrackHits::AddHitTRD(Int_t volumeID, Int_t trackID, Double_t x
+                              , Double_t y, Double_t z, Int_t q, Bool_t inDrift)
 {
   //
   // Add one TRD hit
   //
 
-  if (inDrift) q=2*q+1;
-  else q=2*q;
-  AddHitKartez(volumeID, trackID,x,y,z,q,0);
+  if (inDrift) {
+    q = 2 * q + 1;
+  }
+  else {
+    q = 2 * q;
+  }
+
+  AddHitKartez(volumeID,trackID,x,y,z,q,0);
+
 }
 
+//_____________________________________________________________________________
 Bool_t AliTRDtrackHits::First()
 {
   //
-  //set Current hit for the first hit
+  // Set Current hit for the first hit
   //
 
-  if (fArray->GetSize()<=0) {
+  if (fArray->GetSize() <= 0) {
     fCurrentHit->fStatus = kFALSE;
     return kFALSE;
   }
 
-  AliTrackHitsParamV2 *param = (AliTrackHitsParamV2 *)fArray->At(0);
-  if (!fHit) 
+  AliTrackHitsParamV2 *param = (AliTrackHitsParamV2 *) fArray->At(0);
+  if (!fHit) {
     fHit = new AliTRDhit;
-  if (!(param) ) {
+  }
+  if (!(param)) {
     fCurrentHit->fStatus = kFALSE;
     return kFALSE;
   }
-  //
+
   fCurrentHit->fParamIndex = 0;
   fCurrentHit->fStackIndex = 0;
-  //
-  //
-  ((AliTRDhit*)fHit)->SetDetector(param->fVolumeID);
-  ((AliTRDhit*)fHit)->SetTrack(param->fTrackID);
-  ((AliTRDhit*)fHit)->SetX(param->fR*TMath::Cos(param->fFi));
-  ((AliTRDhit*)fHit)->SetY(param->fR*TMath::Sin(param->fFi));
-  ((AliTRDhit*)fHit)->SetZ(param->fZ); 
-  ((AliTRDhit*)fHit)->SetQ(param->fCharge[0]/2);  
-  if (param->fCharge[0]%2==0) ((AliTRDhit*)fHit)->SetAmplification(); 
-  else ((AliTRDhit*)fHit)->SetDrift();
+
+  ((AliTRDhit *) fHit)->SetDetector(param->fVolumeID);
+  ((AliTRDhit *) fHit)->SetTrack(param->fTrackID);
+  ((AliTRDhit *) fHit)->SetX(param->fR * TMath::Cos(param->fFi));
+  ((AliTRDhit *) fHit)->SetY(param->fR * TMath::Sin(param->fFi));
+  ((AliTRDhit *) fHit)->SetZ(param->fZ); 
+  ((AliTRDhit *) fHit)->SetQ(param->fCharge[0] / 2);  
+  if ((param->fCharge[0] % 2) == 0) {
+    ((AliTRDhit *) fHit)->SetAmplification(); 
+  }
+  else {
+    ((AliTRDhit *) fHit)->SetDrift();
+  }
   fCurrentHit->fR = param->fR;
   
   return fCurrentHit->fStatus = kTRUE;
-}
 
+}
+//set current hit to next
+//_____________________________________________________________________________
 Bool_t AliTRDtrackHits::Next()
 {
   //
-  //  
-  if (!(fCurrentHit->fStatus)) 
-    return kFALSE;
+  // Set current hit to next
+  //
 
+  if (!(fCurrentHit->fStatus)) { 
+    return kFALSE;
+  }
   fCurrentHit->fStackIndex++;
 
-  AliTrackHitsParamV2 *param =  (AliTrackHitsParamV2 *)fArray->At(fCurrentHit->fParamIndex);
-  if (fCurrentHit->fStackIndex>= param->fNHits){
+  AliTrackHitsParamV2 *param = (AliTrackHitsParamV2 *) 
+                                 fArray->At(fCurrentHit->fParamIndex);
+
+  if (fCurrentHit->fStackIndex >= param->fNHits) {
     fCurrentHit->fParamIndex++;
-    if (fCurrentHit->fParamIndex>= fArray->GetEntriesFast()){
-      fCurrentHit->fStatus=kFALSE;
+    if (fCurrentHit->fParamIndex >= fArray->GetEntriesFast()) {
+      fCurrentHit->fStatus = kFALSE;
       return kFALSE;
     }
-    param =  (AliTrackHitsParamV2 *)fArray->At(fCurrentHit->fParamIndex);
-    fCurrentHit->fStackIndex=0; 
-    fCurrentHit->fR = param->fR;
+    param = (AliTrackHitsParamV2 *) fArray->At(fCurrentHit->fParamIndex);
+    fCurrentHit->fStackIndex = 0; 
+    fCurrentHit->fR          = param->fR;
   }
 
-
-
   Double_t ratio;
-  
-  //    Double_t dfi2 = param->fAn+2*param->fAd*(fCurrentHit->fR-param->fR);
   Double_t dfi2 = param->fAn;
-  dfi2*=dfi2*fCurrentHit->fR*fCurrentHit->fR;
-  //    Double_t ddz2 = param->fTheta+2*param->fThetaD*(fCurrentHit->fR-param->fR);
-  Double_t ddz2 =  param->fTheta;
-  ddz2*=ddz2;
-  ratio = TMath::Sqrt(1.+ dfi2+ ddz2);  
-
+  dfi2 *= dfi2 * fCurrentHit->fR * fCurrentHit->fR;
+  Double_t ddz2 = param->fTheta;
+  ddz2 *= ddz2;
+  ratio = TMath::Sqrt(1.0 + dfi2 + ddz2);  
 
-  fCurrentHit->fR += fStep*param->fHitDistance[fCurrentHit->fStackIndex]/ratio;
+  fCurrentHit->fR += fStep * param->fHitDistance[fCurrentHit->fStackIndex] / ratio;
 
   Double_t dR = fCurrentHit->fR - param->fR;
-  Double_t fi = param->fFi + (param->fAn*dR+param->fAd*dR*dR);
-  Double_t z  = param->fZ + (param->fTheta*dR+param->fThetaD*dR*dR);
-
-  ((AliTRDhit*)fHit)->SetQ(param->fCharge[fCurrentHit->fStackIndex]/2);   
-  if ( param->fCharge[fCurrentHit->fStackIndex]%2==0) ((AliTRDhit*)fHit)->SetAmplification();
-  else ((AliTRDhit*)fHit)->SetDrift();
-  ((AliTRDhit*)fHit)->SetX(fCurrentHit->fR*TMath::Cos(fi));
-  ((AliTRDhit*)fHit)->SetY(fCurrentHit->fR*TMath::Sin(fi));
-  ((AliTRDhit*)fHit)->SetZ(z);   
-  ((AliTRDhit*)fHit)->SetDetector(param->fVolumeID);
-  ((AliTRDhit*)fHit)->SetTrack(param->fTrackID);
+  Double_t fi = param->fFi + (param->fAn    * dR + param->fAd     * dR*dR);
+  Double_t z  = param->fZ  + (param->fTheta * dR + param->fThetaD * dR*dR);
+
+  ((AliTRDhit *) fHit)->SetQ(param->fCharge[fCurrentHit->fStackIndex] / 2);   
+  if ((param->fCharge[fCurrentHit->fStackIndex] % 2) ==0) {
+    ((AliTRDhit *) fHit)->SetAmplification();
+  }
+  else {
+    ((AliTRDhit *) fHit)->SetDrift();
+  }
+  ((AliTRDhit *) fHit)->SetX(fCurrentHit->fR * TMath::Cos(fi));
+  ((AliTRDhit *) fHit)->SetY(fCurrentHit->fR * TMath::Sin(fi));
+  ((AliTRDhit *) fHit)->SetZ(z);   
+  ((AliTRDhit *) fHit)->SetDetector(param->fVolumeID);
+  ((AliTRDhit *) fHit)->SetTrack(param->fTrackID);
 
   return kTRUE;
+
 }
   
index 12fefb1..150b12b 100644 (file)
@@ -3,24 +3,34 @@
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
-////////////////////////////////////////////////
-//                                            //
-//  Manager class for TRD   hits              //
-//                                            //
-////////////////////////////////////////////////
+/* $Id$ */
+
+////////////////////////////////////////////////////////////////////////////
+//                                                                        //
+//  Manager class for TRD hits                                            //
+//                                                                        //
+////////////////////////////////////////////////////////////////////////////
 
 #include "../TPC/AliTPCTrackHitsV2.h"
+
 class AliTRDhit;
 
 class AliTRDtrackHits : public AliTPCTrackHitsV2 {
-public:
-  void AddHitTRD(Int_t volumeID, Int_t trackID, Double_t x, 
-                   Double_t y, Double_t z,Int_t q, Bool_t inDrift);
-  Bool_t First(); //set current hit to first hit 
-  Bool_t Next();  //set current hit to next
-public:
-  ClassDef(AliTRDtrackHits,1) 
-};
 
+ public:
+
+  AliTRDtrackHits()          { };
+  virtual ~AliTRDtrackHits() { };
+
+          void     AddHitTRD(Int_t volumeID, Int_t trackID, Double_t x
+                          , Double_t y, Double_t z,Int_t q, Bool_t inDrift);
+          Bool_t   First();
+          Bool_t   Next();
+
+ public:
+
+  ClassDef(AliTRDtrackHits,1) // Manager class for TRD hits
+
+};
 
-#endif //ALITRDTRACKHITS_H
+#endif