VMC Examples Version 6.6
Loading...
Searching...
No Matches
A01MCApplication.h
Go to the documentation of this file.
1#ifndef A01_MC_APPLICATION_H
2#define A01_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 A01MCApplication.h
14/// \brief Definition of the A01MCApplication class
15///
16/// Geant4 example A01 adapted to Virtual Monte Carlo
17///
18/// \author I. Hrivnacova; IPN, Orsay
19
20#include "TMCVerbose.h"
21#include <TGeoUniformMagField.h>
22#include <TVirtualMCApplication.h>
23
25
26class Ex03MCStack;
27class A01MagField;
32class A01HodoscopeSD;
33
34class TMCRootManager;
35
36/// \ingroup A01
37/// \brief Implementation of the TVirtualMCApplication
38///
39/// \date 12/05/2012
40/// \author I. Hrivnacova; IPN, Orsay
41
43{
44 public:
45 A01MCApplication(const char* name, const char* title);
47 virtual ~A01MCApplication();
48
49 // methods
50 void InitMC(const char* setup);
51 void RunMC(Int_t nofEvents);
52 void FinishRun();
53 void ReadEvent(Int_t i);
54
56 virtual void InitOnWorker();
57 virtual void FinishRunOnWorker();
58
59 virtual void ConstructGeometry();
60 virtual void InitGeometry();
61 virtual void AddParticles();
62 virtual void AddIons();
63 virtual void GeneratePrimaries();
64 virtual void BeginEvent();
65 virtual void BeginPrimary();
66 virtual void PreTrack();
67 virtual void Stepping();
68 virtual void PostTrack();
69 virtual void FinishPrimary();
70 virtual void FinishEvent();
71
72 // set methods
73 void SetCuts();
74 void SetWriteStack(Bool_t writeStack);
75 void SetWriteHits(Bool_t writeHits);
76 void SetUseLocalMagField(Bool_t localMagField);
77 void SetVerboseLevel(Int_t verboseLevel);
78
79 // get methods
88 Bool_t GetUseLocalMagField() const;
89
90 private:
91 // methods
93 void RegisterStack() const;
94
95 // data members
96 mutable TMCRootManager* fRootManager; //!< Root manager
97 Bool_t fWriteStack; ///< Option to write stack
98 Bool_t fWriteHits; ///< Option to write hits
99 /// Option to use local magnetic field (working only with Geant4 !)
101 TMCVerbose fVerbose; ///< VMC verbose helper
102 Ex03MCStack* fStack; ///< VMC stack
104 A01DriftChamberSD* fDriftChamberSD1; ///< Drift Chamber 1 SD
105 A01DriftChamberSD* fDriftChamberSD2; ///< Drift Chamber 2 SD
106 A01EmCalorimeterSD* fEmCalorimeterSD; ///< Em Calorimeter SD
107 A01HadCalorimeterSD* fHadCalorimeterSD; ///< Had Calorimeter SD
108 A01HodoscopeSD* fHodoscopeSD1; ///< Hodoscope 1 SD
109 A01HodoscopeSD* fHodoscopeSD2; ///< Hodoscope 2 SD
110 A01PrimaryGenerator* fPrimaryGenerator; ///< Primary generator
111 A01MagField* fMagField; ///< Magnetic field
112 Bool_t fIsMaster; ///< If is on master thread
113
114 ClassDef(A01MCApplication, 1) // Interface to MonteCarlo application
115};
116
117// inline functions
118
119/// (In)Activate writing stack on file
120/// \param writeStack The new value of the option
121inline void A01MCApplication::SetWriteStack(Bool_t writeStack)
122{
123 fWriteStack = writeStack;
124}
125
126/// Set verbosity
127/// \param verboseLevel The new verbose level value
128inline void A01MCApplication::SetVerboseLevel(Int_t verboseLevel)
129{
130 fVerbose.SetLevel(verboseLevel);
131}
132
133// Set magnetic field
134// \param bz The new field value in z
135// inline void A01MCApplication::SetField(Double_t bz)
136//{ fMagField->SetFieldValue(0., 0., bz); }
137
138/// \return The detector construction
144
145/// \return The primary generator
150
151/// \return The Drift Chamber 1 SD
156
157/// \return The Drift Chamber 2 SD
162
163/// \return The Em Calorimeter SD
168
169/// \return The Had Calorimeter SD
174
175/// \return The Hodoscope 1 SD
180
181/// \return The Hodoscope 2 SD
186
187/// \return The option to use local magnetic field (working only with Geant4 !)
189{
190 return fUseLocalMagField;
191}
192
193#endif // A01_MC_APPLICATION_H
Definition of the A01RootDetectorConstruction class.
The calorimeter sensitive detector.
The EM calorimeter sensitive detector.
The hadron calorimeter sensitive detector.
The calorimeter sensitive detector.
Implementation of the TVirtualMCApplication.
void SetVerboseLevel(Int_t verboseLevel)
void ReadEvent(Int_t i)
void SetWriteHits(Bool_t writeHits)
void RunMC(Int_t nofEvents)
A01HodoscopeSD * fHodoscopeSD2
Hodoscope 2 SD.
A01MagField * fMagField
Magnetic field.
void SetWriteStack(Bool_t writeStack)
virtual void GeneratePrimaries()
A01DriftChamberSD * fDriftChamberSD1
Drift Chamber 1 SD.
virtual void Stepping()
A01PrimaryGenerator * GetPrimaryGenerator() const
virtual void BeginPrimary()
Bool_t fIsMaster
If is on master thread.
A01RootDetectorConstruction * fDetConstruction
Detector construction.
virtual void PreTrack()
A01HodoscopeSD * GetHodoscopeSD2() const
virtual void AddParticles()
virtual void FinishRunOnWorker()
virtual void ConstructGeometry()
virtual void FinishEvent()
virtual void FinishPrimary()
A01DriftChamberSD * GetDriftChamberSD2() const
A01DriftChamberSD * fDriftChamberSD2
Drift Chamber 2 SD.
void InitMC(const char *setup)
A01RootDetectorConstruction * GetDetectorConstruction() const
A01HodoscopeSD * GetHodoscopeSD1() const
virtual void InitGeometry()
TMCVerbose fVerbose
VMC verbose helper.
A01HadCalorimeterSD * fHadCalorimeterSD
Had Calorimeter SD.
A01EmCalorimeterSD * GetEmCalorimeterSD() const
Bool_t fWriteStack
Option to write stack.
Bool_t fUseLocalMagField
Option to use local magnetic field (working only with Geant4 !)
Ex03MCStack * fStack
VMC stack.
virtual void BeginEvent()
Bool_t GetUseLocalMagField() const
A01PrimaryGenerator * fPrimaryGenerator
Primary generator.
A01DriftChamberSD * GetDriftChamberSD1() const
void SetUseLocalMagField(Bool_t localMagField)
A01HadCalorimeterSD * GetHadCalorimeterSD() const
virtual void InitOnWorker()
virtual void AddIons()
virtual TVirtualMCApplication * CloneForWorker() const
virtual void PostTrack()
TMCRootManager * fRootManager
Root manager.
void RegisterStack() const
A01EmCalorimeterSD * fEmCalorimeterSD
Em Calorimeter SD.
A01HodoscopeSD * fHodoscopeSD1
Hodoscope 1 SD.
Definition of a uniform magnetic field within a given region.
Definition A01MagField.h:30
The primary generator.
The detector construction (via TGeo )
Implementation of the TVirtualMCStack interface.
Definition Ex03MCStack.h:36