1 |
nikolas |
1.1 |
// $Id: PamVMCApplication.h,v 1.0 2007/06/01 |
2 |
|
|
// |
3 |
|
|
// Class PamVMCApplication |
4 |
|
|
// ----------------------- |
5 |
|
|
// Implementation of the TVirtualMCApplication |
6 |
|
|
|
7 |
pizzolot |
1.6 |
#define PAMFIELD 1 // switch the magnetic field ON/OFF |
8 |
nikolas |
1.1 |
|
9 |
|
|
#ifndef PAMVMC_APPLICATION_H |
10 |
|
|
#define PAMVMC_APPLICATION_H |
11 |
|
|
|
12 |
|
|
#include <TVirtualMCApplication.h> |
13 |
pam-rm2 |
1.5 |
#include <TMCVerbose.h> |
14 |
|
|
#include <TRandom.h> |
15 |
nikolas |
1.1 |
|
16 |
|
|
#include "PamVMCDetectorSD.h" |
17 |
|
|
|
18 |
pam-rm2 |
1.5 |
#include "PamVMCPrimaryGenerator.h" |
19 |
nikolas |
1.1 |
#include "PamVMCDetector.h" |
20 |
|
|
#include "PamVMCDetPamela.h" |
21 |
pam-rm2 |
1.5 |
#include "PamVMCFieldMgr.h" |
22 |
nikolas |
1.1 |
|
23 |
|
|
#include "PamRootManager.h" |
24 |
|
|
#include "PamVMCDetectorHit.h" |
25 |
|
|
#include <TMap.h> |
26 |
|
|
|
27 |
|
|
|
28 |
|
|
#ifdef PAMFIELD |
29 |
|
|
#include "TrkParams.h" |
30 |
|
|
#endif |
31 |
|
|
|
32 |
|
|
//class PamVMCDetector; |
33 |
|
|
|
34 |
|
|
class PamVMCStack; |
35 |
|
|
//class PamVMCDetectorConstruction; |
36 |
|
|
class PamVMCPrimaryGenerator; |
37 |
|
|
|
38 |
|
|
|
39 |
|
|
class PamVMCDetPamela; |
40 |
|
|
|
41 |
|
|
class PamVMCApplication : public TVirtualMCApplication |
42 |
|
|
{ |
43 |
|
|
public: |
44 |
pam-rm2 |
1.5 |
PamVMCApplication(const char* name, const char *title, const char* filename="pamtest", Int_t seed=0); |
45 |
|
|
|
46 |
nikolas |
1.1 |
virtual ~PamVMCApplication(); |
47 |
|
|
|
48 |
|
|
// static access method |
49 |
|
|
static PamVMCApplication* Instance(); |
50 |
|
|
|
51 |
|
|
// methods |
52 |
|
|
void InitMC(const char *setup); |
53 |
|
|
void RunMC(Int_t nofEvents); |
54 |
|
|
void AddIons(); |
55 |
|
|
|
56 |
|
|
virtual void ConstructGeometry(); |
57 |
|
|
virtual void InitGeometry(); |
58 |
|
|
virtual void GeneratePrimaries(); |
59 |
|
|
virtual void BeginEvent(); |
60 |
|
|
virtual void BeginPrimary(); |
61 |
|
|
virtual void PreTrack(); |
62 |
|
|
virtual void Stepping(); |
63 |
|
|
virtual void PostTrack(); |
64 |
|
|
virtual void FinishPrimary(); |
65 |
|
|
virtual void FinishEvent(); |
66 |
|
|
virtual void FinishRun(); |
67 |
pam-rm2 |
1.5 |
#if ROOT_VERSION_CODE < 333572 |
68 |
nikolas |
1.1 |
virtual void Field(const Double_t* x, Double_t* b) const; |
69 |
pam-rm2 |
1.5 |
#endif |
70 |
nikolas |
1.1 |
// set methods |
71 |
|
|
void SetVerboseLevel(Int_t verboseLevel); |
72 |
|
|
|
73 |
|
|
// get methods |
74 |
|
|
PamVMCPrimaryGenerator* GetPrimaryGenerator() const; |
75 |
|
|
|
76 |
|
|
|
77 |
|
|
|
78 |
|
|
private: |
79 |
|
|
|
80 |
pam-rm2 |
1.5 |
Bool_t IsInsideCavity(); |
81 |
nikolas |
1.1 |
|
82 |
|
|
// data members |
83 |
|
|
Int_t fEventNo; |
84 |
|
|
TMCVerbose fVerbose; |
85 |
|
|
PamVMCStack* fStack; |
86 |
pam-rm2 |
1.5 |
PamVMCDetPamela* fdetector; |
87 |
|
|
PamVMCPrimaryGenerator* fPrimaryGenerator; |
88 |
|
|
PamRootManager fRootManager; |
89 |
|
|
TRandom3* frandom; |
90 |
|
|
fin fdstatus; |
91 |
nikolas |
1.1 |
|
92 |
|
|
|
93 |
|
|
|
94 |
|
|
|
95 |
|
|
|
96 |
|
|
|
97 |
|
|
#ifdef PAMFIELD |
98 |
|
|
// TrkLevel2 pamfield; |
99 |
|
|
#endif |
100 |
|
|
ClassDef(PamVMCApplication,1) //Interface to MonteCarlo application |
101 |
|
|
}; |
102 |
|
|
|
103 |
|
|
// inline functions |
104 |
|
|
|
105 |
|
|
inline PamVMCApplication* PamVMCApplication::Instance() |
106 |
|
|
{ return (PamVMCApplication*)(TVirtualMCApplication::Instance()); } |
107 |
|
|
|
108 |
|
|
inline void PamVMCApplication::SetVerboseLevel(Int_t verboseLevel) |
109 |
|
|
{ fVerbose.SetLevel(verboseLevel); } |
110 |
|
|
|
111 |
|
|
inline PamVMCPrimaryGenerator* PamVMCApplication::GetPrimaryGenerator() const |
112 |
|
|
{ return fPrimaryGenerator; } |
113 |
|
|
|
114 |
|
|
|
115 |
|
|
|
116 |
|
|
#endif //PAMVMC_APPLICATION_H |
117 |
|
|
|