| 1 |
|
| 2 |
// $Id: PamVMCApplication.h,v 1.0 2007/06/01 |
| 3 |
// |
| 4 |
// Class PamVMCApplication |
| 5 |
// ----------------------- |
| 6 |
// Implementation of the TVirtualMCApplication |
| 7 |
|
| 8 |
|
| 9 |
#ifndef PAMVMC_APPLICATION_H |
| 10 |
#define PAMVMC_APPLICATION_H |
| 11 |
|
| 12 |
#include <TVirtualMCApplication.h> |
| 13 |
#include <TMCVerbose.h> |
| 14 |
#include <TRandom.h> |
| 15 |
|
| 16 |
#include "PamVMCDetectorSD.h" |
| 17 |
|
| 18 |
#include "PamVMCPrimaryGenerator.h" |
| 19 |
#include "PamVMCDetector.h" |
| 20 |
#include "PamVMCDetPamela.h" |
| 21 |
#include "PamVMCFieldMgr.h" |
| 22 |
|
| 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 |
PamVMCApplication(const char* name, const char *title, const char* filename="pamtest", Int_t seed=0); |
| 45 |
|
| 46 |
virtual ~PamVMCApplication(); |
| 47 |
|
| 48 |
// static access method |
| 49 |
static PamVMCApplication* Instance(); |
| 50 |
|
| 51 |
// methods |
| 52 |
void SetRandom(const char *dname, TRandom3* random){ |
| 53 |
PamVMCDigMgr::Instance()->SetRandom(dname,random); |
| 54 |
} |
| 55 |
|
| 56 |
Int_t GetTrigger(){ return ftrig; } |
| 57 |
|
| 58 |
void InitMC(const char *setup); |
| 59 |
void RunMC(Int_t nofEvents); |
| 60 |
void AddIons(); |
| 61 |
|
| 62 |
void FillEv(); |
| 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 |
virtual void FinishRun(); |
| 75 |
#if ROOT_VERSION_CODE < 333572 |
| 76 |
virtual void Field(const Double_t* x, Double_t* b) const; |
| 77 |
#endif |
| 78 |
// set methods |
| 79 |
void SetVerboseLevel(Int_t verboseLevel); |
| 80 |
|
| 81 |
// get methods |
| 82 |
PamVMCPrimaryGenerator* GetPrimaryGenerator() const; |
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
private: |
| 87 |
|
| 88 |
// data members |
| 89 |
Int_t fEventNo; |
| 90 |
TMCVerbose fVerbose; |
| 91 |
PamVMCStack* fStack; |
| 92 |
PamVMCDetPamela* fdetector; |
| 93 |
PamVMCPrimaryGenerator* fPrimaryGenerator; |
| 94 |
PamRootManager fRootManager; |
| 95 |
TRandom3* frandom; |
| 96 |
fin fdstatus; |
| 97 |
Int_t ftrig; |
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
#ifdef PAMFIELD |
| 104 |
// TrkLevel2 pamfield; |
| 105 |
#endif |
| 106 |
ClassDef(PamVMCApplication,1) //Interface to MonteCarlo application |
| 107 |
}; |
| 108 |
|
| 109 |
// inline functions |
| 110 |
|
| 111 |
inline PamVMCApplication* PamVMCApplication::Instance() |
| 112 |
{ return (PamVMCApplication*)(TVirtualMCApplication::Instance()); } |
| 113 |
|
| 114 |
inline void PamVMCApplication::SetVerboseLevel(Int_t verboseLevel) |
| 115 |
{ fVerbose.SetLevel(verboseLevel); } |
| 116 |
|
| 117 |
inline PamVMCPrimaryGenerator* PamVMCApplication::GetPrimaryGenerator() const |
| 118 |
{ return fPrimaryGenerator; } |
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
#endif //PAMVMC_APPLICATION_H |
| 123 |
|