VMC Examples Version 6.6
Loading...
Searching...
No Matches
MCApplication.h
Go to the documentation of this file.
1#ifndef MC_APPLICATION_H
2#define MC_APPLICATION_H
3
4//------------------------------------------------
5// The Virtual Monte Carlo examples
6// Copyright (C) 2018 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 MCApplication.h
14/// \brief Definition of the MCApplication class
15///
16/// Geant4 Monopole example adapted to Virtual Monte Carlo
17///
18/// \author I. Hrivnacova; IPN, Orsay
19
20#include <TGeoUniformMagField.h>
21#include <TVirtualMCApplication.h>
22
24class TMCRootManager;
25class Ex03MCStack;
26
27namespace VMC
28{
29namespace Monopole
30{
31
32class DetectorConstruction;
33
34/// \ingroup Monopole
35/// \brief Implementation of the TVirtualMCApplication
36///
37/// \date 05/04/2002
38/// \author I. Hrivnacova; IPN, Orsay
39
41{
42 public:
43 MCApplication(const char* name, const char* title);
45 virtual ~MCApplication();
46
47 // static access method
48 static MCApplication* Instance();
49
50 // methods
51 void InitMC(const char* setup);
52 void RunMC(Int_t nofEvents);
53 void FinishRun();
54
55 // virtual TVirtualMCApplication* CloneForWorker() const;
56 // virtual void InitOnWorker();
57 // virtual void FinishRunOnWorker()
58
59 virtual void ConstructGeometry();
60 virtual void InitGeometry();
61 virtual void GeneratePrimaries();
62 virtual void BeginEvent();
63 virtual void BeginPrimary();
64 virtual void PreTrack();
65 virtual void Stepping();
66 virtual void PostTrack();
67 virtual void FinishPrimary();
68 virtual void FinishEvent();
69
70 void SetBinSize(Double_t binSize);
71
73
74 private:
75 // methods
76 MCApplication(const MCApplication& origin);
77 void RegisterStack() const;
78
79 // data members
80 mutable TMCRootManager* fRootManager; //!< Root manager
81 Ex03MCStack* fStack; ///< The VMC stack
82 DetectorConstruction* fDetConstruction; ///< Dector construction
83 TGeoUniformMagField* fMagField; ///< Magnetic field
84 Double_t fBinSize; ///< Edep histogram bin size
85 Double_t fOffsetX; ///< The Edep histogram offset
86 Double_t fProjRange; ///< Projected range
87 Double_t fProjRange2; ///< Projected range square
88 Int_t fImedAl; ///< The Aluminium medium Id
89 Int_t fNofEvents; ///< Number of events
90 Bool_t fIsMaster; ///< If is on master thread
91
92 ClassDef(MCApplication, 1) // Interface to MonteCarlo application
93};
94
95// inline functions
96
97/// \return The MC application instance
99{
100 return (MCApplication*)(TVirtualMCApplication::Instance());
101}
102
103/// \return the detector construction
108
109} // namespace Monopole
110} // namespace VMC
111
112#endif // EX01_MC_APPLICATION_H
Implementation of the TVirtualMCStack interface.
Definition Ex03MCStack.h:36
The detector construction (via TGeo )
Implementation of the TVirtualMCApplication.
Ex03MCStack * fStack
The VMC stack.
void InitMC(const char *setup)
Int_t fImedAl
The Aluminium medium Id.
void SetBinSize(Double_t binSize)
Double_t fBinSize
Edep histogram bin size.
Double_t fProjRange
Projected range.
void RunMC(Int_t nofEvents)
Bool_t fIsMaster
If is on master thread.
Int_t fNofEvents
Number of events.
Double_t fOffsetX
The Edep histogram offset.
DetectorConstruction * fDetConstruction
Dector construction.
static MCApplication * Instance()
TMCRootManager * fRootManager
Root manager.
DetectorConstruction * GetDetectorConstruction() const
TGeoUniformMagField * fMagField
Magnetic field.
Double_t fProjRange2
Projected range square.