null alignment file
[u/mrichter/AliRoot.git] / ALIFAST / AliFTrackMaker.cxx
index 17bd12f467c6d41b55f0aaa3f4c3301ae7bf773c..0a06374f21beeabf35773b19d646bbad6f4f113a 100644 (file)
 # pragma optimize( "", off )
 #endif
 
-#include <TParticle.h>
 #include <TFile.h>
-#include <TSystem.h>
-#include <TRandom.h>
-#include <TROOT.h>
-#include <TMath.h>
 #include <TH1.h>
-#include <TH2.h>
-#include <TH3.h>
+#include <TMath.h>
+#include <TParticle.h>
+#include <TRandom.h>
 
-#include "AliFast.h"
-//#include "AliFMCMaker.h"
-#include "AliFTrackMaker.h"
-#include "AliFTrack.h"
 #include "AliFDet.h"
+#include "AliFTrack.h"
+#include "AliFTrackMaker.h"
+#include "AliFast.h"
+#include "AliMC.h"
 
-const Double_t kPi       = TMath::Pi();
-const Double_t k2Pi      = 2*kPi;
-const Double_t kPiHalf   = kPi/2.;
+static const Double_t kPi       = TMath::Pi();
+static const Double_t k2Pi      = 2*kPi;
+static const Double_t kPiHalf   = kPi/2.;
 extern  AliFast * gAliFast;
 ClassImp(AliFTrackMaker)
 
 //_____________________________________________________________________________
 AliFTrackMaker::AliFTrackMaker()
 {
-   fNTracks = 0;
+  //
+  // Default constructor
+  //
+  fNTracks = 0;
+  fResID1Test = 0;
+  fResID2Test = 0;
+  fResID3Test = 0;
+  fResID4Test = 0;
+  fResID5Test = 0;
 }
 
 //_____________________________________________________________________________
 AliFTrackMaker::AliFTrackMaker(const char *name, const char *title)
                  :AliFMaker(name,title)
 {
-//    Default Setters for tracks
-
+  //
+  // Standard Setters for tracks
+  //
    fFruits     = new TClonesArray("AliFTrack",100, kFALSE);
    fBranchName = "Tracks";
    fNTracks    = 0;
@@ -86,10 +91,22 @@ AliFTrackMaker::AliFTrackMaker(const char *name, const char *title)
    Save();
 }
 
+//_______________________________________________________________________
+AliFTrackMaker::AliFTrackMaker(const AliFTrackMaker& aftmk):
+  AliFMaker(aftmk)
+{
+  //
+  // Copy constructor for AliRun
+  //
+  aftmk.Copy(*this);
+}
+
 //_____________________________________________________________________________
 AliFTrackMaker::~AliFTrackMaker()
 {
-   //dummy
+  //
+  // Dummy constructor
+  //
 }
 
 //_____________________________________________________________________________
@@ -174,11 +191,11 @@ void AliFTrackMaker::Init()
 
 }
 
-//_____________________________________________________________________________
-// Calculate track and its resolution
-//_____________________________________________________________________________
 void AliFTrackMaker::Make()
 {
+  //
+  // Calculate track and its resolution
+  //
   Double_t v11, v22, v33, v12, v13, v23;
   Int_t iFlag;
 
@@ -192,14 +209,13 @@ void AliFTrackMaker::Make()
      // Run production job  
      // Get pointers to Particles arrays and TClonesArray
 
-     TClonesArray *particles = gAliFast->Particles();  
      Int_t idPart, idTrack;
      Double_t  charge, pT, eta, phi;
      TParticle *part;
-     Int_t  nparticles = particles->GetEntriesFast();
+     Int_t  nparticles = gAlice->GetMCApp()->GetNtrack();
      printf("%10s%10d\n","nparticles",nparticles);
      for(Int_t ind=0;ind<nparticles;ind++) {       
-       part = (TParticle*)particles->UncheckedAt(ind);
+       part = gAlice->GetMCApp()->Particle(ind);
        idPart  = part->GetPdgCode();
        charge  = part->GetPDG()->Charge();
        pT      = part->Pt();  
@@ -298,6 +314,12 @@ void AliFTrackMaker::Make()
   }
 }
 
+//_______________________________________________________________________
+void AliFTrackMaker::Copy(TObject &) const
+{
+  Fatal("Copy","Not implemented!\n");
+}
+
 //_____________________________________________________________________________
 void AliFTrackMaker::Finish()
 {
@@ -715,11 +737,12 @@ void AliFTrackMaker::TPCResolution(Double_t pTransv, Double_t radiPad, Double_t
   
 }
 
-//_____________________________________________________________________________
-// returns the mass given particle ID 
 //-----------------------------------------------------------------------------
-Double_t AliFTrackMaker::ParticleMass(Int_t idTrack)
+Double_t AliFTrackMaker::ParticleMass(Int_t idTrack) const
 {
+  //
+  // returns the mass given particle ID 
+  //
   Double_t mass = 0.0;
 
        if(idTrack == 2){ mass = fPionMass;}
@@ -731,12 +754,12 @@ Double_t AliFTrackMaker::ParticleMass(Int_t idTrack)
 
 }
 
-//_____________________________________________________________________________
-// returns the rapidity given particle pT, pz 
-//-----------------------------------------------------------------------------
+//____________________________________________________________________________
 Double_t AliFTrackMaker::Rapidity(Double_t pt, Double_t pz)
 {
-//   Compute rapidity
+  //
+  // returns the rapidity given particle pT, pz 
+  //   Compute rapidity
 
    Double_t etalog = TMath::Log((TMath::Sqrt(pt*pt + pz*pz) + TMath::Abs(pz))/pt);
    if (pz < 0 ) return -TMath::Abs(etalog);
@@ -925,11 +948,12 @@ Int_t AliFTrackMaker::Compress(Int_t kf)
     return ret;
 }
 
-//_____________________________________________________________________________
-// TEST JOB: Calculate tracks resolution
 //_____________________________________________________________________________
 void AliFTrackMaker::MakeTest(Int_t n)
 {
+  //
+  // TEST JOB: Calculate tracks resolution
+  //
   Double_t v11, v22, v33, v12, v13, v23;
   Int_t iFlag;
   Int_t idTrack;
@@ -939,7 +963,7 @@ void AliFTrackMaker::MakeTest(Int_t n)
   Double_t isum,fm;
   Double_t pTotal,partMassSQ,beta,lambda;
   Double_t dPop,dLop,dDip,dPhi,rho12,rho13,rho23;
-  Double_t dPPStrag,dPPTot;
+  Double_t dPPStrag,dPPTot=0;
   //  Double_t resol1[1001][11],resol2[10001][11],resol3[1001][11],
   //           resol4[1001][11],resol5[10001][11]
   Double_t store1[1001],store2[10001],store3[1001],