23 void geometry( TString tag, Bool_t agml=
true ){
24 TString cmd =
"DETP GEOM "; cmd += tag; cmd += Form(
" field=%f", field);
25 if ( !geant_maker ) geant_maker = (
St_geant_Maker *)chain->GetMaker(
"geant");
26 geant_maker -> LoadGeometry(cmd);
30 void command( TString cmd ){
31 if ( !geant_maker ) geant_maker = (
St_geant_Maker *)chain->GetMaker(
"geant");
32 geant_maker -> Do( cmd );
35 void trig( Int_t n=1,
char* pid=
"ele",
float e=0.0,
float pt=1.5,
int npart=1,
int print=0){
39 if(pid[0]==
'e' && pid[1]==
'l' && pid[2]==
'e') PID=ele;
40 if(pid[0]==
'p' && pid[1]==
'o' && pid[2]==
's') PID=pos;
41 for ( Int_t i=0; i<n; i++ ) {
42 double pi=3.141592654;
43 cout <<
"==== Event="<<i<<
"===="<<endl;
47 kinematics->SetAttr(
"energy",1);
51 kinematics->
Kine(npart, PID, e-0.01, e+0.01, 3.0, 3.01, -pi/2, pi);
56 kinematics->SetAttr(
"energy",0);
57 kinematics->
Kine(npart, PID, pt-0.001, pt+0.001, 2.0, 4.4, 0.0, 2*pi);
71 cout << Form(
" ===> e=%6.3f pt=%7.3f eta=%7.3f phi=%7.3f\n",v.E(),v.Pt(),v.Eta(),v.Phi());
74 if(print>2) command(
"gpri hits");
80 gSystem->Load(
"libKinematics.so");
85 void runSimFlat( Int_t nevents=1000, Int_t run=1,
86 char* pid=
"ele",
float e=0.0,
float pt=1.5,
float vz=0.0,
int npart=1,
87 int ecal=1,
int print=0){
88 gROOT->ProcessLine(
".L bfc.C");{
89 TString simple =
"y2017 geant gstar agml usexgeom";
92 gSystem->Load(
"libVMC.so");
93 gSystem->Load(
"StarGeneratorUtil.so" );
94 gSystem->Load(
"StarGeneratorEvent.so" );
95 gSystem->Load(
"StarGeneratorBase.so" );
96 gSystem->Load(
"libMathMore.so" );
97 gSystem->Load(
"xgeometry.so" );
103 chain -> AddBefore(
"geant", primary );
106 primary -> SetFileName(Form(
"%s.e%d.vz%d.run%i.root",pid,(
int)e,(
int)vz,run));
108 primary -> SetFileName(Form(
"%s.pt%3.1f.vz%d.run%i.root",pid,pt,(
int)vz,run));
111 primary -> SetVertex( 0., 0., vz );
112 primary -> SetSigma ( 0., 0., 0. );
124 geometry(
"dev2022=1");
125 command(
"gkine -4 0");
127 command(Form(
"gfile o %s.e%d.vz%d.run%d.fzd",pid,(
int)e,(
int)vz,run));
129 command(Form(
"gfile o %s.pt%3.1f.vz%d.run%d.fzd",pid,pt,(
int)vz,run));
132 cout <<
"TURNING OFF ECAL!!!"<<endl;
133 command(
"DETP WCAL wver.active=0");
137 const Char_t *cmds[] = {
140 for ( UInt_t i=0;i<
sizeof(cmds)/
sizeof(Char_t*); i++ ){command( cmds[i] );}
143 trig(nevents, pid, e, pt, npart, print);
145 command(
"call agexit");
void Print(const Option_t *opts="head") const
Star Simple Kinematics Generator.
Yet another particle class.
virtual void Clear(Option_t *option="")
User defined functions.
void AddGenerator(StarGenerator *gener)
Int_t Init()
Initialize generator.
TLorentzVector momentum()
Return the 4-momentum of the particle.
static void seed(UInt_t s)
Base class for event records.
StarGenEvent * event()
Return a pointer to the event.
Main steering class for event generation.
TIter IterAll(Bool_t dir=kIterForward)
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())