18#include "MCApplication.h"
19#include "Ex03MCStack.h"
21#include "PrimaryGenerator.h"
23#include <TMCRootManager.h>
26#include <TGeoManager.h>
27#include <TInterpreter.h>
33#include <TVirtualGeoTrack.h>
34#include <TVirtualMC.h>
55 fSensitiveDetector(0),
81 fVerbose(origin.fVerbose),
83 fDetConstruction(origin.fDetConstruction),
84 fSensitiveDetector(0),
109 fSensitiveDetector(0),
110 fPrimaryGenerator(0),
161 if (TString(setup) !=
"") {
162 gROOT->LoadMacro(setup);
163 gInterpreter->ProcessLine(
"Config()");
166 "InitMC",
"Processing Config() has failed. (No MC is instantiated.)");
171#if ROOT_VERSION_CODE >= 336402
174 fRootManager =
new TMCRootManager(GetName(), TMCRootManager::kWrite);
179 fRootManager =
new TMCRootManager(GetName(), TMCRootManager::kWrite);
198 gMC->ProcessRun(nofEvents);
227 fRootManager =
new TMCRootManager(GetName(), TMCRootManager::kWrite);
299 if (TString(gMC->GetName()) ==
"TGeant3TGeo" &&
300 gGeoManager->GetListOfTracks() && gGeoManager->GetTrack(0) &&
301 ((TVirtualGeoTrack*)gGeoManager->GetTrack(0))->HasPoints()) {
303 gGeoManager->ClearTracks();
308 cout <<
" Start generating event Nr " <<
fEventNo << endl;
341 static Int_t trackId = 0;
342 if (TString(gMC->GetName()) ==
"TFluka" &&
343 gMC->GetStack()->GetCurrentTrackNumber() != trackId) {
345 trackId = gMC->GetStack()->GetCurrentTrackNumber();
Implementation of the TVirtualMCStack interface.
The detector construction (via TGeo )
Implementation of the TVirtualMCApplication.
Int_t fEventNo
Event counter.
Bool_t fIsMaster
If is on master thread.
virtual void FinishEvent()
void InitMC(const char *setup)
virtual TVirtualMCApplication * CloneForWorker() const
virtual void FinishRunOnWorker()
virtual void GeneratePrimaries()
DetectorConstruction * fDetConstruction
Dector construction.
virtual void InitGeometry()
TMCRootManager * fRootManager
Root manager.
virtual void BeginPrimary()
void RunMC(Int_t nofEvents)
SensitiveDetector * fSensitiveDetector
Calorimeter SD.
void RegisterStack() const
TMCVerbose fVerbose
VMC verbose helper.
virtual void BeginEvent()
virtual void InitOnWorker()
Ex03MCStack * fStack
VMC stack.
virtual void ConstructGeometry()
PrimaryGenerator * fPrimaryGenerator
Primary generator.
virtual void FinishPrimary()
virtual void GeneratePrimaries(const TVector3 &worldSize)
The calorimeter sensitive detector.
Bool_t UpdateFromGarfield()