]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVGEN/AliGenFixed.cxx
Use local SetTrack, KeepTrack and SetHighWaterMark methods
[u/mrichter/AliRoot.git] / EVGEN / AliGenFixed.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
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  **************************************************************************/
15
16 /*
17 $Log$
18 Revision 1.5  2001/02/24 11:41:59  morsch
19 SetGun allows specify completely the particle kinematics and position in one go. (FCA)
20
21 Revision 1.4  2000/12/21 16:24:06  morsch
22 Coding convention clean-up
23
24 Revision 1.3  2000/11/30 07:12:50  alibrary
25 Introducing new Rndm and QA classes
26
27 Revision 1.2  2000/10/02 15:17:54  morsch
28 Unused includes removed.
29
30 Revision 1.1  2000/06/09 20:24:00  morsch
31 Same class as previously in AliSimpleGen.cxx
32 All coding rule violations except RS3 corrected (AM)
33
34 */
35
36
37
38 // Simple particle gun. 
39 // Momentum, phi and theta of the partice as well as the particle type can be set.
40 // andreas.morsch@cern.ch
41 //Begin_Html
42 /*
43 <img src="picts/AliGeneratorClass.gif">
44 </pre>
45 <br clear=left>
46 <font size=+2 color=red>
47 <p>The responsible person for this module is
48 <a href="mailto:andreas.morsch@cern.ch">Andreas Morsch</a>.
49 </font>
50 <pre>
51 */
52 //End_Html
53 //                                                               //
54 ///////////////////////////////////////////////////////////////////
55
56 #include "AliGenFixed.h"
57 #include "AliRun.h"
58 #include "AliPDG.h"
59   
60 ClassImp(AliGenFixed)
61
62 //_____________________________________________________________________________
63 AliGenFixed::AliGenFixed()
64   :AliGenerator()
65 {
66   //
67   // Default constructor
68   //
69   fIpart = 0;
70   fExplicit = kFALSE;
71 }
72
73 //_____________________________________________________________________________
74 AliGenFixed::AliGenFixed(Int_t npart)
75   :AliGenerator(npart)
76 {
77   //
78   // Standard constructor
79   //
80   fName="Fixed";
81   fTitle="Fixed Particle Generator";
82   // Generate Proton by default
83   fIpart=kProton;
84 }
85
86 //_____________________________________________________________________________
87 void AliGenFixed::Generate()
88 {
89   //
90   // Generate one trigger
91   //
92   Float_t polar[3]= {0,0,0};
93   if(!fExplicit) {
94     fP[0] = fPMin*TMath::Cos(fPhiMin)*TMath::Sin(fThetaMin);
95     fP[1] = fPMin*TMath::Sin(fPhiMin)*TMath::Sin(fThetaMin);
96     fP[2] = fPMin*TMath::Cos(fThetaMin);
97   }
98   Int_t i, nt;
99   //
100   for(i=0;i<fNpart;i++) 
101     SetTrack(fTrackIt,-1,fIpart,fP,fOrigin.GetArray(),polar,0,kPPrimary,nt);
102   
103 }
104   
105 //_____________________________________________________________________________
106 void AliGenFixed::SetSigma(Float_t sx, Float_t sy, Float_t sz)
107 {
108   //
109   // Set the interaction point sigma
110   //
111   printf("Vertex smearing not implemented for fixed generator\n");
112 }