20 TString nameParticle =
"mu+";
21 float numParticles = 5;
24 void geometry( TString tag, Bool_t agml=
true )
26 TString cmd =
"DETP GEOM "; cmd += tag +
" field=-5.0";
27 if ( !geant_maker ) geant_maker = (
St_geant_Maker *)chain->GetMaker(
"geant");
28 geant_maker -> LoadGeometry(cmd);
32 void command( TString cmd )
34 if ( !geant_maker ) geant_maker = (
St_geant_Maker *)chain->GetMaker(
"geant");
35 geant_maker -> Do( cmd );
38 void trig( Int_t n=1 )
42 for ( Int_t i=0; i<n; i++ ) {
47 kinematics->
Kine( numParticles, nameParticle.Data(), 0.2, 5.0, 2.0, 4.50 );
53 TTable* hits = chain->GetDataSet(
"bfc/.make/geant/.data/g2t_stg_hit");
56 hNumHits->Fill(
double(i), nhits / 4.0 / numParticles );
57 std::cout <<
"N hits = " << nhits << std::endl;
72 gSystem->Load(
"libKinematics.so");
80 void gen( Int_t nevents=100, Int_t rngSeed=12352342 )
83 cout <<
"Generating: " << nevents <<
" events with seed: " << rngSeed << endl;
84 gSystem->Load(
"libStarRoot.so" );
85 gROOT->SetMacroPath(
".:/star-sw/StRoot/macros/:./StRoot/macros:./StRoot/macros/graphics:./StRoot/macros/analysis:./StRoot/macros/test:./StRoot/macros/examples:./StRoot/macros/html:./StRoot/macros/qa:./StRoot/macros/calib:./StRoot/macros/mudst:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/graphics:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/analysis:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/test:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/examples:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/html:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/qa:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/calib:/afs/rhic.bnl.gov/star/packages/DEV/StRoot/macros/mudst:/afs/rhic.bnl.gov/star/ROOT/36/5.34.38/.sl73_x8664_gcc485/rootdeb/macros:/afs/rhic.bnl.gov/star/ROOT/36/5.34.38/.sl73_x8664_gcc485/rootdeb/tutorials");
87 gROOT->ProcessLine(
".L bfc.C");
89 TString simple =
"sdt20211016 y2023 geant gstar usexgeom agml ";
93 gSystem->Load(
"libVMC.so");
95 gSystem->Load(
"StarGeneratorUtil.so" );
96 gSystem->Load(
"StarGeneratorEvent.so" );
97 gSystem->Load(
"StarGeneratorBase.so" );
99 gSystem->Load(
"libMathMore.so" );
100 gSystem->Load(
"xgeometry.so" );
113 _primary -> SetFileName(
"sim.root");
114 chain -> AddBefore(
"geant", _primary );
123 _primary->
SetSigma( 0.1, 0.1, 0.1 );
130 command(
"gkine -4 0");
131 command(
"gfile o sim.fzd");
134 hNumHits =
new TH1F(
"hNumEvents",
"Nhits/plane/incident track vs event number",nevents + 1, -0.5, (
float)( nevents ) + 0.5 );
164 command(
"call agexit");
void SetSigma(Double_t sx, Double_t sy, Double_t sz, Double_t rho=0)
Star Simple Kinematics Generator.
virtual void Clear(Option_t *option="")
User defined functions.
void AddGenerator(StarGenerator *gener)
Int_t Init()
Initialize generator.
virtual Long_t GetNRows() const
Returns the number of the used rows for the wrapped table.
static void seed(UInt_t s)
Base class for event records.
Main steering class for event generation.
static void capture()
Capture gRandom random number generator.
Sparse class to hold track kinematics.
void Kine(Int_t ntrack, const Char_t *type="pi+,pi-,K+,K-,proton,antiproton", Double_t ptlow=0.0, Double_t pthigh=500.0, Double_t ylow=-10.0, Double_t yhigh=+10.0, Double_t philow=0.0, Double_t phihigh=TMath::TwoPi())
void SetVertex(Double_t x, Double_t y, Double_t z)
Set the x, y and z vertex position.