]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenExtFile.cxx
Changes needed by ANSI/ISO compilance
[u/mrichter/AliRoot.git] / EVGEN / AliGenExtFile.cxx
index e751e34f22452a2f3fe22c420c8e438bf2f8d96a..a2101984c562b32f62c06305dd4f2b26e038cb7a 100644 (file)
@@ -39,7 +39,7 @@
 #include <TTree.h>
 
 
- ClassImp(AliGenExtFile)
+ClassImp(AliGenExtFile)
 
 AliGenExtFile::AliGenExtFile()
   :AliGenMC()
@@ -60,9 +60,11 @@ AliGenExtFile::AliGenExtFile(Int_t npart)
     fReader = 0;
 }
 
-AliGenExtFile::AliGenExtFile(const AliGenExtFile & ExtFile)
+AliGenExtFile::AliGenExtFile(const AliGenExtFile & ExtFile):
+    AliGenMC(ExtFile)
 {
-// copy constructor
+// Copy constructor
+    ExtFile.Copy(*this);
 }
 //____________________________________________________________
 AliGenExtFile::~AliGenExtFile()
@@ -88,7 +90,7 @@ void AliGenExtFile::Generate()
   Float_t origin[3] = {0,0,0};
   Float_t p[3];
   Float_t random[6];
-  Int_t i, j, nt;
+  Int_t i = 0, j, nt;
   //
   for (j=0;j<3;j++) origin[j]=fOrigin[j];
   if(fVertexSmear == kPerTrack) {
@@ -112,7 +114,7 @@ void AliGenExtFile::Generate()
     //
     // The selction criterium for the external file generator is as follows:
     //
-    // 1) All tracs are subjects to the cuts defined by AliGenerator, i.e.
+    // 1) All tracks are subjects to the cuts defined by AliGenerator, i.e.
     //    fThetaMin, fThetaMax, fPhiMin, fPhiMax, fPMin, fPMax, fPtMin, fPtMax,
     //    fYMin, fYMax.
     //    If the particle does not satisfy these cuts, it is not put on the
@@ -120,12 +122,13 @@ void AliGenExtFile::Generate()
     // 2) If fCutOnChild and some specific child is selected (e.g. if
     //    fForceDecay==kSemiElectronic) the event is rejected if NOT EVEN ONE
     //    child falls into the child-cuts.
+    TParticle* iparticle = 0x0;
+    
     if(fCutOnChild) {
       // Count the selected children
       Int_t nSelected = 0;
-
-      for (i = 0; i < nTracks; i++) {
-       TParticle* iparticle = fReader->NextParticle();
+      while ( (iparticle=fReader->NextParticle()) ) {
+        ;
        Int_t kf = CheckPDGCode(iparticle->GetPdgCode());
        kf = TMath::Abs(kf);
        if (ChildSelected(kf) && KinematicSelection(iparticle, 1)) {
@@ -167,22 +170,23 @@ void AliGenExtFile::Generate()
       p[1] = iparticle->Py();
       p[2] = iparticle->Pz();
       Int_t idpart = iparticle->GetPdgCode();
-      if(fVertexSmear==kPerTrack) {
-         Rndm(random,6);
-         for (j = 0; j < 3; j++) {
-             origin[j]=fOrigin[j]
-                 +fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
-                 TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
-         }
+      if(fVertexSmear==kPerTrack) 
+       {
+         Rndm(random,6);
+         for (j = 0; j < 3; j++) {
+            origin[j]=fOrigin[j]+
+                      fOsigma[j]*TMath::Cos(2*random[2*j]*TMath::Pi())*
+                        TMath::Sqrt(-2*TMath::Log(random[2*j+1]));
+         }
       }
       Int_t decayed = iparticle->GetFirstDaughter();
       Int_t doTracking = fTrackIt && (decayed < 0) &&
                         (TMath::Abs(idpart) > 10) && selected;
       // printf("*** pdg, first daughter, trk = %d, %d, %d\n",
       //   idpart,decayed, doTracking);
-      //PH      SetTrack(doTracking,-1,idpart,p,origin,polar,0,kPPrimary,nt);
+      //PH      PushTrack(doTracking,-1,idpart,p,origin,polar,0,kPPrimary,nt);
       Int_t parent = iparticle->GetFirstMother();
-      SetTrack(doTracking,parent,idpart,p,origin,polar,0,kPPrimary,nt);
+      PushTrack(doTracking,parent,idpart,p,origin,polar,0,kPPrimary,nt);
       KeepTrack(nt);
     } // track loop
 
@@ -212,9 +216,18 @@ void AliGenExtFile::CdEventFile()
 AliGenExtFile& AliGenExtFile::operator=(const  AliGenExtFile& rhs)
 {
 // Assignment operator
+    rhs.Copy(*this);
     return *this;
 }
 
+void AliGenExtFile::Copy(TObject&) const
+{
+    //
+    // Copy 
+    //
+    Fatal("Copy","Not implemented!\n");
+}