22 void geometry( TString tag, Bool_t agml=
true )
24 TString cmd =
"DETP GEOM "; cmd += tag;
25 if ( !geant_maker ) geant_maker = (
St_geant_Maker *)chain->GetMaker(
"geant");
26 geant_maker -> LoadGeometry(cmd);
30 void command( TString cmd )
32 if ( !geant_maker ) geant_maker = (
St_geant_Maker *)chain->GetMaker(
"geant");
33 geant_maker -> Do( cmd );
36 void trig( Int_t n=1 )
38 for ( Int_t i=0; i<n; i++ ) {
44 kinematics->
Kine( 1,
"D0", 10.0, 100.0, -2.0, 2.0 );
51 command(
"gprint kine");
59 gSystem->Load(
"libKinematics.so");
65 void starsim( Int_t nevents=1, Int_t rngSeed=1234 )
68 gROOT->ProcessLine(
".L bfc.C");
70 TString simple =
"y2012 geant gstar usexgeom agml ";
74 gSystem->Load(
"libVMC.so");
76 gSystem->Load(
"StarGeneratorUtil.so" );
77 gSystem->Load(
"StarGeneratorEvent.so" );
78 gSystem->Load(
"StarGeneratorBase.so" );
79 gSystem->Load(
"StarGeneratorDecay.so" );
80 gSystem->Load(
"libPythia8_1_62.so");
82 gSystem->Load(
"libMathMore.so" );
83 gSystem->Load(
"xgeometry.so" );
98 _primary -> SetFileName(
"kinematics.starsim.root");
99 chain -> AddBefore(
"geant", _primary );
113 decayPy8->
Set(
"WeakSingleBoson:all = on");
119 double mass, lifetime, charge;
120 int tracktype, pdgcode, g3code;
143 command(
"gkine -4 0");
144 command(
"gfile o kinematics.starsim.fzd");
166 TTable* gtable = (
TTable* ) chain->GetDataSet(
"g2t_track");
174 for (
int itable=1; itable<ntable; itable++ )
176 g2t_track_st*
track = (g2t_track_st*)gtable->
At(itable);
177 if ( 0 == track->eg_label ) { Etest += track->e; }
180 cout <<
"Egener = " << Etotal << endl;
181 cout <<
"Egeant = " << Etest << endl;
182 cout <<
"Violation = " << 100*(Etest / Etotal - 1) <<
"%" << endl;
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.
Float_t GetEnergy()
Get the energy.
static StarParticleData & instance()
Returns a reference to the single instance of this class.
TParticlePDG * GetParticle(const Char_t *name)
Get a particle by name.
Interface to PDG information.
void AddGenerator(StarGenerator *gener)
Connects VMC to class(es) which handle particle decays.
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.
StarGenEvent * event()
Return a pointer to the event.
Main steering class for event generation.
void AddDecayer(Int_t pdgid, TVirtualMCDecayer *decayer)
void SetDebug(int dbg=1)
Set the debug level.
void Print(const Option_t *opts="") const
Print the particle.
const void * At(Int_t i) const
Returns a pointer to the i-th row of the table.
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())
TParticlePDG * AddParticleToG3(const char *name, const double mass, const double lifetime, const double charge, const int tracktype, const int pdgcode, const int g3code, const double *bratio=0, const int *mode=0)
void Set(const char *cmd)
Modify pythia8 behavior.