24#include <TGeoManager.h>
25#include <TInterpreter.h>
26#include <TMCRootManager.h>
29#include <TVirtualGeoTrack.h>
30#include <TVirtualMC.h>
71 fDetConstruction(origin.fDetConstruction),
147 if (TString(setup) !=
"") {
148 gROOT->LoadMacro(setup);
149 gInterpreter->ProcessLine(
"Config()");
152 "InitMC",
"Processing Config() has failed. (No MC is instantiated.)");
157#if ROOT_VERSION_CODE >= 336402
160 fRootManager =
new TMCRootManager(GetName(), TMCRootManager::kWrite);
165 fRootManager =
new TMCRootManager(GetName(), TMCRootManager::kWrite);
186 gMC->ProcessRun(nofEvents);
215 fRootManager =
new TMCRootManager(GetName(), TMCRootManager::kWrite);
245 cerr <<
"Selected MC does not support TGeo geometry" << endl;
246 cerr <<
"Exiting program" << endl;
251 cout <<
"Geometry will be defined via TGeo" << endl;
256 cout <<
"Geometry will be defined via VMC" << endl;
298 Double_t kinEnergy = 3.0;
299 Double_t mass = 0.9382723;
300 Double_t e = mass + kinEnergy;
306 pz = sqrt(e * e - mass * mass);
309 fStack->
PushTrack(toBeDone, -1, pdg, px, py, pz, e, vx, vy, vz, tof, polx,
310 poly, polz, kPPrimary, ntr, 1., 0);
367 if (gGeoManager && gGeoManager->GetListOfTracks() &&
368 gGeoManager->GetTrack(0) &&
369 ((TVirtualGeoTrack*)gGeoManager->GetTrack(0))->HasPoints()) {
371 gGeoManager->SetVisOption(0);
372 gGeoManager->SetTopVisible();
373 gGeoManager->DrawTracks(
"/*");
391 fRootManager =
new TMCRootManager(GetName(), TMCRootManager::kRead);
Definition of the Ex02DetectorConstructionOld class.
Definition of the Ex02MCApplication class.
Definition of the Ex02MCStack class.
Definition of the Ex02MagField class.
The old detector construction (via VMC functions)
void ConstructMaterials()
void ConstructMaterials()
Double_t GetWorldFullLength()
Implementation of the TVirtualMCApplication.
virtual void FinishPrimary()
virtual void GeneratePrimaries()
void RegisterStack() const
TVirtualMagField * fMagField
Magnetic field.
Bool_t fOldGeometry
Option for geometry definition.
virtual TVirtualMCApplication * CloneForWorker() const
void RunMC(Int_t nofEvents)
virtual void FinishRunOnWorker()
virtual void BeginPrimary()
virtual void InitOnWorker()
TMCRootManager * fRootManager
Root manager.
virtual void FinishEvent()
void InitMC(const char *setup)
virtual void InitGeometry()
Ex02MCStack * fStack
VMC stack.
virtual void ConstructGeometry()
Ex02DetectorConstruction fDetConstruction
Dector construction.
virtual ~Ex02MCApplication()
Ex02TrackerSD * fTrackerSD
Tracker SD.
virtual void BeginEvent()
Implementation of the TVirtualMCStack interface.
virtual void Print(Option_t *option="") const
virtual void PushTrack(Int_t toBeDone, Int_t parent, Int_t pdg, Double_t px, Double_t py, Double_t pz, Double_t e, Double_t vx, Double_t vy, Double_t vz, Double_t tof, Double_t polx, Double_t poly, Double_t polz, TMCProcess mech, Int_t &ntr, Double_t weight, Int_t is)
Definition of a uniform magnetic field.
The tracker sensitive detector.
virtual void Print(const Option_t *option=0) const