VMC Examples Version 6.6
Loading...
Searching...
No Matches
MCApplication.h
Go to the documentation of this file.
1#ifndef GARFIELD_MC_APPLICATION_H
2#define GARFIELD_MC_APPLICATION_H
3
4//------------------------------------------------
5// The Virtual Monte Carlo examples
6// Copyright (C) 2007 - 2016 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 ExGarfield/include/MCApplication.h
14/// \brief Definition of the ExGarfield::MCApplication class
15///
16/// Garfield garfieldpp 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 ExGarfield
35{
36
37class PrimaryGenerator;
38
39/// \ingroup ExGarfield
40/// \brief Implementation of the TVirtualMCApplication
41///
42/// Garfield garfieldpp 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
88 // data members
89 mutable TMCRootManager* fRootManager; //!< Root manager
90 Int_t fEventNo; ///< Event counter
91 TMCVerbose fVerbose; ///< VMC verbose helper
92 Ex03MCStack* fStack; ///< VMC stack
93 DetectorConstruction* fDetConstruction; ///< Dector construction
95 PrimaryGenerator* fPrimaryGenerator; ///< Primary generator
96 Bool_t fIsMaster; ///< If is on master thread
97
98 ClassDef(MCApplication, 1) // Interface to MonteCarlo application
99};
100
101// inline functions
102
103/// Set verbosity
104/// \param verboseLevel The new verbose level value
105inline void MCApplication::SetVerboseLevel(Int_t verboseLevel)
106{
107 fVerbose.SetLevel(verboseLevel);
108}
109
110/// \return The detector construction
115
116/// \return The calorimeter sensitive detector
121
122/// \return The primary generator
127
128} // namespace ExGarfield
129} // namespace VMC
130
131#endif // GARFIELD_MC_APPLICATION_H
Definition of the ExGarfield::DetectorConstruction class.
Definition of the ExGarfield::SensitiveDetector class.
Implementation of the TVirtualMCStack interface.
Definition Ex03MCStack.h:36
The detector construction (via TGeo )
Implementation of the TVirtualMCApplication.
void SetVerboseLevel(Int_t verboseLevel)
Int_t fEventNo
Event counter.
Bool_t fIsMaster
If is on master thread.
void InitMC(const char *setup)
DetectorConstruction * GetDetectorConstruction() const
virtual TVirtualMCApplication * CloneForWorker() const
DetectorConstruction * fDetConstruction
Dector construction.
TMCRootManager * fRootManager
Root manager.
PrimaryGenerator * GetPrimaryGenerator() const
SensitiveDetector * fSensitiveDetector
Calorimeter SD.
TMCVerbose fVerbose
VMC verbose helper.
SensitiveDetector * GetCalorimeterSD() const
Ex03MCStack * fStack
VMC stack.
PrimaryGenerator * fPrimaryGenerator
Primary generator.
The calorimeter sensitive detector.