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 **************************************************************************/
18 Revision 1.1 2001/11/06 17:19:41 cblume
19 Add detailed geometry and simple simulator
23 ///////////////////////////////////////////////////////////////////////////////
25 // Particle generator for the simplescopic TRD simulator //
27 ///////////////////////////////////////////////////////////////////////////////
32 #include <TMCProcess.h>
36 #include "AliTRDsimpleGen.h"
37 #include "AliTRDsimpleMC.h"
39 ClassImp(AliTRDsimpleGen)
41 //_____________________________________________________________________________
42 AliTRDsimpleGen::AliTRDsimpleGen():TObject()
45 // AliTRDsimpleGen default constructor
54 //_____________________________________________________________________________
55 AliTRDsimpleGen::AliTRDsimpleGen(const AliTRDsimpleGen &g)
58 // AliTRDsimpleGen copy constructor
61 ((AliTRDsimpleGen &) g).Copy(*this);
65 //_____________________________________________________________________________
66 AliTRDsimpleGen::~AliTRDsimpleGen()
69 // AliTRDsimpleGen destructor
74 //_____________________________________________________________________________
75 AliTRDsimpleGen &AliTRDsimpleGen::operator=(const AliTRDsimpleGen &g)
78 // Assignment operator
81 if (this != &g) ((AliTRDsimpleGen &) g).Copy(*this);
86 //_____________________________________________________________________________
87 void AliTRDsimpleGen::Copy(TObject &g)
93 ((AliTRDsimpleGen &) g).fPdg = fPdg;
94 ((AliTRDsimpleGen &) g).fMomMin = fMomMin;
95 ((AliTRDsimpleGen &) g).fMomMax = fMomMax;
99 //_____________________________________________________________________________
100 void AliTRDsimpleGen::NewParticle(Int_t ievent)
103 // Generate a new particle and initialize the MC object
108 printf("<AliTRDsimpleGen> Generate particles with PDG code %d\n",fPdg);
109 if (fMomMax > fMomMin) {
110 printf("<AliTRDsimpleGen> Momentum range = %4.2f - %4.2f GeV/c\n"
114 printf("<AliTRDsimpleGen> Fixed momentum = %4.2f GeV/c\n"
119 // Add one dummy particle to the stack so that AddHit will work
120 Float_t mom[3] = { 0.0 };
121 Float_t vtx[3] = { 0.0 };
122 Float_t pol[3] = { 0.0 };
124 gAlice->SetTrack(0,-1,fPdg,mom,vtx,pol,0.0,kPPrimary,ntr);
128 Double_t p = fMomMax;
129 if (fMomMax > fMomMin) {
130 p = (fMomMax - fMomMin) * gRandom->Rndm() + fMomMin;
137 ((AliTRDsimpleMC *) gMC)->NewTrack(ievent,fPdg,px,py,pz);