StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
starsim.reader.C
1 
19 class St_geant_Maker;
20 St_geant_Maker *geant_maker = 0;
21 
22 class StarGenEvent;
23 StarGenEvent *event = 0;
24 
25 class StarPrimaryMaker;
26 StarPrimaryMaker *_primary = 0;
27 
28 class StarGenEventReader;
29 StarGenEventReader *eventreader = 0;
30 
31 // ----------------------------------------------------------------------------
32 void trig( Int_t n=1 )
33 {
34  for ( Int_t i=0; i<n; i++ ) {
35  chain->Clear();
36  chain->Make();
37  }
38 }
39 // ----------------------------------------------------------------------------
40 // ----------------------------------------------------------------------------
41 // ----------------------------------------------------------------------------
42 
43 // ----------------------------------------------------------------------------
44 // ----------------------------------------------------------------------------
45 // ----------------------------------------------------------------------------
46 void reader( Int_t nevents=1, UInt_t rngSeed = 12345 )
47 {
48 
49  gROOT->ProcessLine(".L bfc.C");
50  {
51  TString simple = "tables nodefault";
52  bfc(0, simple );
53  }
54 
55  gSystem->Load( "libVMC.so");
56  gSystem->Load( "St_g2t.so" );
57  gSystem->Load( "St_geant_Maker.so" );
58 
59  gSystem->Load( "StarGeneratorUtil.so" );
60  gSystem->Load( "StarGeneratorEvent.so" );
61  gSystem->Load( "StarGeneratorBase.so" );
62 
63  gSystem->Load( "libMathMore.so" );
64  gSystem->Load( "libStarGenEventReader.so" );
65 
66  //
67  // Create the primary event generator and insert it
68  // before the geant maker
69  //
70  // StarPrimaryMaker *
71  _primary = new StarPrimaryMaker();
72  {
73  _primary -> SetFileName( "output.pythia6.starsim.root");
74  }
75 
76  eventreader = new StarEventReader();
77  eventreader -> SetInputFile("pythia6.starsim.root","genevents","primaryEvent");
78  _primary->AddGenerator(eventreader);
79 
80 
81  //
82  // Initialize random number generator
83  //
84  StarRandom &random = StarRandom::Instance();
85  random.capture(); // maps all ROOT TRandoms to StarRandom
86  random.seed( rngSeed );
87 
88 
89  //
90  // Setup cuts on which particles get passed to geant for
91  // simulation. (To run generator in standalone mode,
92  // set ptmin=1.0E9.)
93  // ptmin ptmax
94  _primary->SetPtRange (0, -1.0); // GeV
95  // etamin etamax
96  _primary->SetEtaRange ( -3.0, +3.0 );
97  // phimin phimax
98  _primary->SetPhiRange ( 0., TMath::TwoPi() );
99 
100 
101  //
102  // Setup a realistic z-vertex distribution:
103  // x = 0 gauss width = 1mm
104  // y = 0 gauss width = 1mm
105  // z = 0 gauss width = 30cm
106  //
107  _primary->SetVertex( 0., 0., 0. );
108  _primary->SetSigma( 0.1, 0.1, 30.0 );
109 
110  //
111  // Initialize primary event generator and all sub makers
112  //
113  _primary -> Init();
114 
115  //
116  // Trigger on nevents
117  //
118  trig( nevents );
119 
120 }
121 // ----------------------------------------------------------------------------
122 
static StarRandom & Instance()
Obtain the single instance of the random number generator.
Definition: StarRandom.cxx:87
void SetSigma(Double_t sx, Double_t sy, Double_t sz, Double_t rho=0)
void SetPhiRange(Double_t phimin, Double_t phimax)
Set phi range. Particles falling outside this range will be dropped from simulation.
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
void AddGenerator(StarGenerator *gener)
A class for providing random number generation.
Definition: StarRandom.h:30
virtual Int_t Make()
Definition: StChain.cxx:110
static void seed(UInt_t s)
Definition: StarRandom.cxx:119
Base class for event records.
Definition: StarGenEvent.h:81
Main steering class for event generation.
void SetPtRange(Double_t ptmin, Double_t ptmax=-1)
Set PT range. Particles falling outside this range will be dropped from simulation.
static void capture()
Capture gRandom random number generator.
Definition: StarRandom.cxx:57
void SetEtaRange(Double_t etamin, Double_t etamax)
Set rapidity range. Particles falling outside this range will be dropped from simulation.
void SetVertex(Double_t x, Double_t y, Double_t z)
Set the x, y and z vertex position.