/[PAMELA software]/PamCAL/include/PamVMCApplication.h
ViewVC logotype

Contents of /PamCAL/include/PamVMCApplication.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Mon Nov 12 10:10:18 2007 UTC (17 years ago) by nikolas
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/plain
More basic files added

1 // $Id: PamVMCApplication.h,v 1.0 2007/06/01
2 //
3 // Class PamVMCApplication
4 // -----------------------
5 // Implementation of the TVirtualMCApplication
6
7 //#define PAMFIELD 1
8
9 #ifndef PAMVMC_APPLICATION_H
10 #define PAMVMC_APPLICATION_H
11
12 #include <TVirtualMCApplication.h>
13 #include "TMCVerbose.h"
14
15 #include "PamVMCCaloSD.h"
16 #include "PamVMCTrkSD.h"
17 #include "PamVMCTofSD.h"
18 #include "PamVMCCardSD.h"
19 #include "PamVMCCasSD.h"
20 #include "PamVMCCatSD.h"
21 #include "PamVMCS4SD.h"
22 #include "PamVMCNDSD.h"
23 #include "PamVMCDetectorSD.h"
24 #include "PamRootManager.h"
25 #include "PamVMCDetectorHit.h"
26 #include <TMap.h>
27 //#include <TLorentzVector.h>
28
29 #ifdef PAMFIELD
30 #include "TrkLevel2.h"
31 #endif
32
33 class PamVMCStack;
34 class PamVMCDetectorConstruction;
35 class PamVMCPrimaryGenerator;
36 class PamVMCCaloSD;
37 class PamVMCTrkSD;
38 class PamVMCTofSD;
39 class PamVMCCardSD;
40 class PamVMCCasSD;
41 class PamVMCCatSD;
42 class PamVMCS4SD;
43 class PamVMCNDSD;
44
45 class PamVMCApplication : public TVirtualMCApplication
46 {
47 public:
48 PamVMCApplication(const char* name, const char *title);
49 PamVMCApplication();
50 virtual ~PamVMCApplication();
51
52 // static access method
53 static PamVMCApplication* Instance();
54
55 // methods
56 void InitMC(const char *setup);
57 void RunMC(Int_t nofEvents);
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 virtual void FinishRun();
70 virtual void Field(const Double_t* x, Double_t* b) const;
71
72 // set methods
73 void SetVerboseLevel(Int_t verboseLevel);
74
75 // get methods
76 PamVMCPrimaryGenerator* GetPrimaryGenerator() const;
77
78
79
80 private:
81
82
83 // data members
84 Int_t fEventNo;
85 TMCVerbose fVerbose;
86 PamVMCStack* fStack;
87 PamVMCDetectorConstruction* fDetConstruction;
88 PamVMCPrimaryGenerator* fPrimaryGenerator;
89 PamRootManager fRootManager;
90 pHitData ftemphit;
91 TMap fdetmap;
92 fin fdstatus;
93
94
95 // methods
96 void RegisterStack();
97
98 // void CleanTempHit(){ ftemphit.Clean();}
99 void FillTempHit();
100 void Register() {
101
102 std::cout <<" Into Register() " << std::endl;
103 // fdetmap.Print();
104 TMapIter *n= (TMapIter *)fdetmap.MakeIterator();
105 TObject *o; while( o=(TObject *) n->Next()) {
106
107 cout<<"!!KEY=<<"<< endl;
108 ((PamVMCDetectorSD *)fdetmap.GetValue(o))->Register();
109 }
110 };
111
112
113
114 #ifdef PAMFIELD
115 TrkLevel2 pamfield;
116 #endif
117 ClassDef(PamVMCApplication,1) //Interface to MonteCarlo application
118 };
119
120 // inline functions
121
122 inline PamVMCApplication* PamVMCApplication::Instance()
123 { return (PamVMCApplication*)(TVirtualMCApplication::Instance()); }
124
125 inline void PamVMCApplication::SetVerboseLevel(Int_t verboseLevel)
126 { fVerbose.SetLevel(verboseLevel); }
127
128 inline PamVMCPrimaryGenerator* PamVMCApplication::GetPrimaryGenerator() const
129 { return fPrimaryGenerator; }
130
131
132
133 #endif //PAMVMC_APPLICATION_H
134

  ViewVC Help
Powered by ViewVC 1.1.23