VMC Examples Version 6.6
Loading...
Searching...
No Matches
Ex02MCApplication.h
Go to the documentation of this file.
1#ifndef EX02_MC_APPLICATION_H
2#define EX02_MC_APPLICATION_H
3
4//------------------------------------------------
5// The Virtual Monte Carlo examples
6// Copyright (C) 2007 - 2014 Ivana Hrivnacova
7// All rights reserved.
8//
9// For the licensing terms see geant4_vmc/LICENSE.
10// Contact: root-vmc@cern.ch
11//-------------------------------------------------
12
13/// \file Ex02MCApplication.h
14/// \brief Definition of the Ex02MCApplication class
15///
16/// Geant4 ExampleN02 adapted to Virtual Monte Carlo
17///
18/// \author I. Hrivnacova; IPN, Orsay
19
20#include <TVirtualMCApplication.h>
21
23#include "Ex02TrackerSD.h"
24
25#include <TMCRootManager.h>
26
27class Ex02MCStack;
28
30
31/// \ingroup E02
32/// \brief Implementation of the TVirtualMCApplication
33///
34/// \date 21/04/2002
35/// \author I. Hrivnacova; IPN, Orsay
36
38{
39 public:
40 Ex02MCApplication(const char* name, const char* title);
42 virtual ~Ex02MCApplication();
43
44 // methods
45 void InitMC(const char* setup);
46 void RunMC(Int_t nofEvents);
47 void FinishRun();
48
50 virtual void InitOnWorker();
51 virtual void FinishRunOnWorker();
52
53 virtual void ConstructGeometry();
54 virtual void InitGeometry();
55 virtual void GeneratePrimaries();
56 virtual void BeginEvent();
57 virtual void BeginPrimary();
58 virtual void PreTrack();
59 virtual void Stepping();
60 virtual void PostTrack();
61 virtual void FinishPrimary();
62 virtual void FinishEvent();
63
64 void ReadEvent(Int_t i);
65
66 // method for tests
67 void SetOldGeometry(Bool_t oldGeometry = kTRUE);
68
69 private:
70 // methods
72 void RegisterStack() const;
73
74 // data members
75 mutable TMCRootManager* fRootManager; //!< Root manager
76 Ex02MCStack* fStack; ///< VMC stack
78 Ex02TrackerSD* fTrackerSD; ///< Tracker SD
79 TVirtualMagField* fMagField; ///< Magnetic field
80 Bool_t fOldGeometry; ///< Option for geometry definition
81
82 ClassDef(Ex02MCApplication, 1) // Interface to MonteCarlo application
83};
84
85// inline functions
86
87/// Switch on/off the old geometry definition (via VMC functions)
88/// \param oldGeometry If true, geometry definition via VMC functions
89inline void Ex02MCApplication::SetOldGeometry(Bool_t oldGeometry)
90{
91 fOldGeometry = oldGeometry;
92}
93
94#endif // EX02_MC_APPLICATION_H
Definition of the Ex02DetectorConstruction class.
Definition of the Ex02TrackerSD class.
The detector construction (via TGeo )
Implementation of the TVirtualMCApplication.
virtual void FinishPrimary()
virtual void GeneratePrimaries()
TVirtualMagField * fMagField
Magnetic field.
void SetOldGeometry(Bool_t oldGeometry=kTRUE)
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.
Ex02TrackerSD * fTrackerSD
Tracker SD.
virtual void BeginEvent()
Implementation of the TVirtualMCStack interface.
Definition Ex02MCStack.h:33
The tracker sensitive detector.