21 float numParticles = 1;
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++ ) {
48 Double_t masses[2] = { 0.13957, 0.938} ;
50 TGenPhaseSpace genEvent;
53 W.SetXYZM( 0, 0, 5, 1.11568 );
54 genEvent.SetDecay(W, 2, masses);
57 for (
int j = 0; j < numParticles; j++ ){
58 Double_t weight = genEvent.Generate();
59 TLorentzVector *pPion = genEvent.GetDecay(0);
60 TLorentzVector *pProton = genEvent.GetDecay(1);
61 lv = *pPion + *pProton;
66 pion->
SetPx(pPion->Px());
67 pion->
SetPy(pPion->Py());
68 pion->
SetPz(pPion->Pz());
75 proton->
SetPx(pProton->Px());
76 proton->
SetPy(pProton->Py());
77 proton->
SetPz(pProton->Pz());
82 cout <<
"pion eta = " << pPion->Eta() << endl;
83 cout <<
"proton eta = " << pProton->Eta() << endl;
111 gSystem->Load(
"libKinematics.so");
119 void lambda( Int_t nevents=100, Int_t rngSeed=12352342 )
121 hMll =
new TH1F(
"hMll",
";Mll;counts [10MeV]", 200, 2.0, 4.0 );
122 cout <<
"Generating: " << nevents <<
" events with seed: " << rngSeed << endl;
123 cout <<
"Simulating J/psi->e+e-" << endl;
125 gSystem->Load(
"libStarRoot.so" );
126 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");
128 gROOT->ProcessLine(
".L bfc.C");
130 TString simple =
"sdt20211016 y2023 geant gstar usexgeom agml ";
134 gSystem->Load(
"libVMC.so");
136 gSystem->Load(
"StarGeneratorUtil.so" );
137 gSystem->Load(
"StarGeneratorEvent.so" );
138 gSystem->Load(
"StarGeneratorBase.so" );
140 gSystem->Load(
"libMathMore.so" );
141 gSystem->Load(
"xgeometry.so" );
154 _primary -> SetFileName(
"lambda_fwd_gun.root");
155 chain -> AddBefore(
"geant", _primary );
164 _primary->
SetSigma( 0.1, 0.1, 0.1 );
171 command(
"gkine -4 0");
172 command(
"gfile o lambda_fwd_gun.fzd");
175 hNumHits =
new TH1F(
"hNumEvents",
"Nhits/plane/incident track vs event number",nevents + 1, -0.5, (
float)( nevents ) + 0.5 );
182 TFile * f =
new TFile(
"lambda_gen.root",
"RECREATE" );
187 command(
"call agexit");
StarGenParticle * AddParticle()
void SetPx(Float_t px)
Set the x-component of the momentum.
void SetSigma(Double_t sx, Double_t sy, Double_t sz, Double_t rho=0)
Star Simple Kinematics Generator.
Yet another particle class.
virtual void Clear(Option_t *option="")
User defined functions.
void AddGenerator(StarGenerator *gener)
void SetPz(Float_t pz)
Set the z-component of the momentum.
Int_t Init()
Initialize generator.
void SetMass(Float_t mass)
Set the mass.
static void seed(UInt_t s)
Base class for event records.
Main steering class for event generation.
void SetPy(Float_t py)
Set the y-component of the momentum.
static void capture()
Capture gRandom random number generator.
Sparse class to hold track kinematics.
void SetVertex(Double_t x, Double_t y, Double_t z)
Set the x, y and z vertex position.