1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
20 ///////////////////////////////////////////////////////////////////////////////
22 // Particle generator for the simplescopic TRD simulator //
24 ///////////////////////////////////////////////////////////////////////////////
30 #include "AliTRDsimpleGen.h"
31 #include "AliTRDsimpleMC.h"
33 ClassImp(AliTRDsimpleGen)
35 //_____________________________________________________________________________
36 AliTRDsimpleGen::AliTRDsimpleGen():TObject()
39 // AliTRDsimpleGen default constructor
48 //_____________________________________________________________________________
49 AliTRDsimpleGen::AliTRDsimpleGen(const AliTRDsimpleGen &g)
52 // AliTRDsimpleGen copy constructor
55 ((AliTRDsimpleGen &) g).Copy(*this);
59 //_____________________________________________________________________________
60 AliTRDsimpleGen::~AliTRDsimpleGen()
63 // AliTRDsimpleGen destructor
68 //_____________________________________________________________________________
69 AliTRDsimpleGen &AliTRDsimpleGen::operator=(const AliTRDsimpleGen &g)
72 // Assignment operator
75 if (this != &g) ((AliTRDsimpleGen &) g).Copy(*this);
80 //_____________________________________________________________________________
81 void AliTRDsimpleGen::Copy(TObject &g)
87 ((AliTRDsimpleGen &) g).fPdg = fPdg;
88 ((AliTRDsimpleGen &) g).fMomMin = fMomMin;
89 ((AliTRDsimpleGen &) g).fMomMax = fMomMax;
93 //_____________________________________________________________________________
94 void AliTRDsimpleGen::NewParticle(Int_t ievent)
97 // Generate a new particle and initialize the MC object
102 printf("<AliTRDsimpleGen> Generate particles with PDG code %d\n",fPdg);
103 if (fMomMax > fMomMin) {
104 printf("<AliTRDsimpleGen> Momentum range = %4.2f - %4.2f GeV/c\n"
108 printf("<AliTRDsimpleGen> Fixed momentum = %4.2f GeV/c\n"
114 Double_t p = fMomMax;
115 if (fMomMax > fMomMin) {
116 p = (fMomMax - fMomMin) * gRandom->Rndm() + fMomMin;
123 ((AliTRDsimpleMC *) gMC)->NewTrack(ievent,fPdg,px,py,pz);