VMC Examples Version 6.6
Loading...
Searching...
No Matches
Ex01MCApplication.h
Go to the documentation of this file.
1#ifndef EX01_MC_APPLICATION_H
2#define EX01_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 Ex01MCApplication.h
14/// \brief Definition of the Ex01MCApplication class
15///
16/// Geant4 ExampleN01 adapted to Virtual Monte Carlo
17///
18/// \author I. Hrivnacova; IPN, Orsay
19
20#include <TVirtualMCApplication.h>
21#include <TVirtualMCStack.h>
22
24
25/// \ingroup E01
26/// \brief Implementation of the TVirtualMCApplication
27///
28/// \date 05/04/2002
29/// \author I. Hrivnacova; IPN, Orsay
30
32{
33 public:
34 Ex01MCApplication(const char* name, const char* title);
36 virtual ~Ex01MCApplication();
37
38 // static access method
40
41 // methods
42 void InitMC(const char* setup);
43 void RunMC(Int_t nofEvents);
44 void FinishRun();
45
47 virtual void InitOnWorker();
48 virtual void ConstructGeometry();
49 virtual void InitGeometry();
50 virtual void GeneratePrimaries();
51 virtual void BeginEvent();
52 virtual void BeginPrimary();
53 virtual void PreTrack();
54 virtual void Stepping();
55 virtual void PostTrack();
56 virtual void FinishPrimary();
57 virtual void FinishEvent();
58
59 // methods for tests
60 void SetOldGeometry(Bool_t oldGeometry = kTRUE);
62
63 private:
64 // methods
65 void ConstructMaterials();
66 void ConstructVolumes();
67
68 // data members
69 TVirtualMCStack* fStack; ///< The VMC stack
70 TVirtualMagField* fMagField; ///< The magnetic field
71 Int_t fImedAr; ///< The Argon gas medium Id
72 Int_t fImedAl; ///< The Aluminium medium Id
73 Int_t fImedPb; ///< The Lead medium Id
74 Bool_t fOldGeometry; ///< Option for geometry definition
75
76 ClassDef(Ex01MCApplication, 1) // Interface to MonteCarlo application
77};
78
79// inline functions
80
82{
83 /// \return The MC application instance
84 return (Ex01MCApplication*)(TVirtualMCApplication::Instance());
85}
86
87inline void Ex01MCApplication::SetOldGeometry(Bool_t oldGeometry)
88{
89 /// Select old geometry definition (via TVirtualMC)
90 fOldGeometry = oldGeometry;
91}
92
93#endif // EX01_MC_APPLICATION_H
Implementation of the TVirtualMCApplication.
Int_t fImedAl
The Aluminium medium Id.
static Ex01MCApplication * Instance()
virtual void BeginPrimary()
virtual void InitGeometry()
virtual void InitOnWorker()
Int_t fImedAr
The Argon gas medium Id.
Int_t fImedPb
The Lead medium Id.
virtual TVirtualMCApplication * CloneForWorker() const
virtual void ConstructGeometry()
virtual void FinishEvent()
TVirtualMCStack * fStack
The VMC stack.
virtual void FinishPrimary()
virtual void BeginEvent()
TVirtualMagField * fMagField
The magnetic field.
void InitMC(const char *setup)
void RunMC(Int_t nofEvents)
Bool_t fOldGeometry
Option for geometry definition.
virtual void GeneratePrimaries()
void SetOldGeometry(Bool_t oldGeometry=kTRUE)