]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliGenHalo.cxx
Threshold for digits in RecPoint introduced
[u/mrichter/AliRoot.git] / EVGEN / AliGenHalo.cxx
index 1898bc2ad7065208dcc65245968831b9195a7b91..cb0c814aeaafd1bd2308545fdc311fe55243e288 100644 (file)
@@ -1,22 +1,63 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/*
+$Log$
+Revision 1.10  2000/12/21 16:24:06  morsch
+Coding convention clean-up
+
+Revision 1.9  2000/11/30 07:12:50  alibrary
+Introducing new Rndm and QA classes
+
+Revision 1.8  2000/10/02 15:20:40  morsch
+Direct reference to default input file removed.
+
+Revision 1.7  2000/06/30 12:19:07  morsch
+Type of fFileName changed to TString, fp has been !-ed.
+
+Revision 1.6  2000/06/09 20:36:01  morsch
+All coding rule violations except RS3 corrected
+
+Revision 1.5  1999/11/03 17:43:20  fca
+New version from G.Martinez & A.Morsch
+
+Revision 1.4  1999/09/29 09:24:14  fca
+Introduction of the Copyright and cvs Log
+
+*/
+
+// Read background particles from a boundary source
+// Very specialized generator to simulate background from beam halo.
+// The input file is a text file specially prepared 
+// for this purpose.
+// Author: andreas.morsch@cern.ch
+
 #include "AliGenHalo.h"
-#include "AliGenMUONlib.h"
-#include "AliMC.h"
 #include "AliRun.h"
 #include "AliPDG.h"
 
-#include <TDirectory.h>
 #include <TDatabasePDG.h>
-#include <TFile.h>
-#include <TTree.h>
 #include <stdlib.h>
+
  ClassImp(AliGenHalo)
      AliGenHalo::AliGenHalo()
         :AliGenerator(-1)
 {
+// Constructor
     fName="Halo";
     fTitle="Halo from LHC Tunnel";
-    // Set the default file 
-    fFileName="~/marsip/marsip5.mu";
 //
 //  Read all particles
     fNpart=-1;
 AliGenHalo::AliGenHalo(Int_t npart)
     :AliGenerator(npart)
 {
+// Constructor
     fName="Halo";
     fTitle="Halo from LHC Tunnel";
-    // Set the default file 
-    fFileName="~/marsip/marsip5.mu";
 //
 //  Read all particles
     fNpart=-1;
     fp=0;
 }
 
+AliGenHalo::AliGenHalo(const AliGenHalo & Halo)
+{
+// copy constructor
+}
+
+
 //____________________________________________________________
 AliGenHalo::~AliGenHalo()
 {
+// Destructor
 }
 
 //____________________________________________________________
 void AliGenHalo::Init() 
-{}
+{
+// Initialisation
+}
 
 //____________________________________________________________
 void AliGenHalo::Generate()
 {
+// Generate from input file
     FILE *fp = fopen(fFileName,"r");
     if (fp) {
-       printf("\n File %s opened for reading ! \n ", fFileName);
+       printf("\n File %s opened for reading ! \n ", (char*) &fFileName);
     } else {
-       printf("\n Opening of file %s failed ! \n ", fFileName);
+       printf("\n Opening of file %s failed ! \n ",  (char*) &fFileName);
     }
 //
 // MARS particle codes
-    // const Int_t imars[12]={0,14, 13, 8, 9, 11, 12, 5, 6, 1, 3, 2};
-  const Int_t imars[12]={0,kProton,kNeutron,kPiPlus,kPiMinus,kKPlus,kKMinus,
+  const Int_t kmars[12]={0,kProton,kNeutron,kPiPlus,kPiMinus,kKPlus,kKMinus,
                         kMuonPlus,kMuonMinus,kGamma,kElectron,kPositron};
  
   Float_t polar[3]= {0,0,0};
@@ -79,7 +128,7 @@ void AliGenHalo::Generate()
       if (ncols < 0) break;
       nread++;
       if (fNpart !=-1 && nread > fNpart) break;
-      ipart = imars[ipart];
+      ipart = kmars[ipart];
       amass = TDatabasePDG::Instance()->GetParticle(ipart)->Mass();
       p0=sqrt(ekin*ekin + 2.*amass);
       
@@ -93,16 +142,24 @@ void AliGenHalo::Generate()
       p[1]=p0*ty;
       p[2]=p0*tz;
       fParentWeight=wgt;
-      gAlice->SetTrack(1,-1,ipart,p,origin,polar,0,"Halo+",nt,fParentWeight);
+      SetTrack(fTrackIt,-1,ipart,p,origin,polar,0,kPNoProcess,nt,fParentWeight);
+//    SetTrack(fTrackIt,-1,ipart,p,origin,polar,0,"Halo+",nt,fParentWeight);
       origin[2]=-origin[2];
       p[2]=-p[2];
-      gAlice->SetTrack(1,-1,ipart,p,origin,polar,0,"Halo-",nt,fParentWeight);
+      SetTrack(fTrackIt,-1,ipart,p,origin,polar,0,kPNoProcess,nt,fParentWeight);
+//    SetTrack(fTrackIt,-1,ipart,p,origin,polar,0,"Halo-",nt,fParentWeight);
       origin[2]=-origin[2];
       p[2]=-p[2];
   }
 }
  
 
+AliGenHalo& AliGenHalo::operator=(const  AliGenHalo& rhs)
+{
+// Assignment operator
+    return *this;
+}
+