VMC Examples Version 6.6
Loading...
Searching...
No Matches
MCApplication.h
Go to the documentation of this file.
1#ifndef GFLASH_MC_APPLICATION_H
2#define GFLASH_MC_APPLICATION_H
3
4//------------------------------------------------
5// The Virtual Monte Carlo examples
6// Copyright (C) 2007 - 2015 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 Gflash/include/MCApplication.h
14/// \brief Definition of the Gflash::MCApplication class
15///
16/// Geant4 gflash example adapted to Virtual Monte Carlo.
17///
18/// \author I. Hrivnacova; IPN, Orsay
19
20#include <TVirtualMCApplication.h>
21
23#include "SensitiveDetector.h"
24
25#include <TGeoUniformMagField.h>
26#include <TMCVerbose.h>
27#include <TStopwatch.h>
28
29class Ex03MCStack;
30class TMCRootManager;
31
32namespace VMC
33{
34namespace Gflash
35{
36
37class PrimaryGenerator;
38
39/// \ingroup Gflash
40/// \brief Implementation of the TVirtualMCApplication
41///
42/// Geant4 gflash example adapted to Virtual Monte Carlo.
43///
44/// \date 28/10/2015
45/// \author I. Hrivnacova; IPN, Orsay
46
48{
49 public:
50 MCApplication(const char* name, const char* title);
52 virtual ~MCApplication();
53
54 // methods
55 void InitMC(const char* setup);
56 void RunMC(Int_t nofEvents);
57 void FinishRun();
58 void ReadEvent(Int_t i);
59
61 virtual void InitOnWorker();
62 virtual void FinishRunOnWorker();
63
64 virtual void ConstructGeometry();
65 virtual void InitGeometry();
66 virtual void GeneratePrimaries();
67 virtual void BeginEvent();
68 virtual void BeginPrimary();
69 virtual void PreTrack();
70 virtual void Stepping();
71 virtual void PostTrack();
72 virtual void FinishPrimary();
73 virtual void FinishEvent();
74
75 // set methods
76 void SetVerboseLevel(Int_t verboseLevel);
77
78 // get methods
82
83 private:
84 // methods
85 MCApplication(const MCApplication& origin);
86 void RegisterStack() const;
87 void ComputeEventStatistics() const;
88
89 // data members
90 mutable TMCRootManager* fRootManager; //!< Root manager
91 Int_t fEventNo; ///< Event counter
92 TMCVerbose fVerbose; ///< VMC verbose helper
93 Ex03MCStack* fStack; ///< VMC stack
94 DetectorConstruction* fDetConstruction; ///< Dector construction
96 PrimaryGenerator* fPrimaryGenerator; ///< Primary generator
97 Bool_t fIsMaster; ///< If is on master thread
98 TStopwatch* fEventTimer; ///< Event timer
99
100 ClassDef(MCApplication, 1) // Interface to MonteCarlo application
101};
102
103// inline functions
104
105/// Set verbosity
106/// \param verboseLevel The new verbose level value
107inline void MCApplication::SetVerboseLevel(Int_t verboseLevel)
108{
109 fVerbose.SetLevel(verboseLevel);
110}
111
112/// \return The detector construction
117
118/// \return The calorimeter sensitive detector
123
124/// \return The primary generator
129
130} // namespace Gflash
131} // namespace VMC
132
133#endif // GFLASH_MC_APPLICATION_H
Definition of the Gflash::DetectorConstruction class.
Definition of the Gflash::SensitiveDetector class.
Implementation of the TVirtualMCStack interface.
Definition Ex03MCStack.h:36
The detector construction (via TGeo )
Implementation of the TVirtualMCApplication.
virtual TVirtualMCApplication * CloneForWorker() const
Bool_t fIsMaster
If is on master thread.
SensitiveDetector * GetCalorimeterSD() const
Int_t fEventNo
Event counter.
TMCRootManager * fRootManager
Root manager.
DetectorConstruction * fDetConstruction
Dector construction.
void InitMC(const char *setup)
TMCVerbose fVerbose
VMC verbose helper.
Ex03MCStack * fStack
VMC stack.
PrimaryGenerator * fPrimaryGenerator
Primary generator.
SensitiveDetector * fSensitiveDetector
Calorimeter SD.
DetectorConstruction * GetDetectorConstruction() const
void SetVerboseLevel(Int_t verboseLevel)
PrimaryGenerator * GetPrimaryGenerator() const
TStopwatch * fEventTimer
Event timer.
void RunMC(Int_t nofEvents)
The calorimeter sensitive detector.