| 29 |
|
|
| 30 |
ClassImp(PamVMCApplication) |
ClassImp(PamVMCApplication) |
| 31 |
|
|
| 32 |
PamVMCApplication::PamVMCApplication(const char *name, const char *title) |
PamVMCApplication::PamVMCApplication(const char *name, const char *title, const char *filename, UInt_t seed) |
| 33 |
: TVirtualMCApplication(name,title), |
: TVirtualMCApplication(name,title), |
| 34 |
fEventNo(0), |
fEventNo(0), |
| 35 |
fVerbose(2), |
fVerbose(2), |
| 36 |
fStack(0), |
fStack(0), |
| 37 |
fdetector(0), |
fdetector(0), |
| 38 |
fPrimaryGenerator(0), |
//fPrimaryGenerator(0,seed), |
| 39 |
fRootManager("pamtest",kWrite) |
fRootManager(filename,kWrite) |
| 40 |
{ |
{ |
| 41 |
// Standard constructor |
// Standard constructor |
| 42 |
|
|
| 43 |
// Create a user stack |
// Create a user stack |
| 44 |
fStack = new PamVMCStack(1000); |
fStack = new PamVMCStack(1000); |
| 45 |
|
|
|
|
|
| 46 |
// Create a primary generator |
// Create a primary generator |
| 47 |
fPrimaryGenerator = new PamVMCPrimaryGenerator(fStack); |
fPrimaryGenerator = new PamVMCPrimaryGenerator(fStack, seed); |
|
|
|
| 48 |
|
|
| 49 |
fdetector = new PamVMCDetPamela(); |
fdetector = new PamVMCDetPamela(); |
| 50 |
|
|
| 51 |
PamVMCFieldMgr::Instance()->LoadField(); |
PamVMCFieldMgr::Instance()->LoadField(); |
| 52 |
|
|
| 53 |
} |
} |
| 54 |
|
|
| 55 |
|
|
| 56 |
|
|
| 57 |
PamVMCApplication::PamVMCApplication() |
PamVMCApplication::PamVMCApplication() |
| 58 |
: TVirtualMCApplication(), |
: TVirtualMCApplication(), |
| 59 |
fEventNo(0), |
fEventNo(0), |
| 66 |
// Default constructor |
// Default constructor |
| 67 |
} |
} |
| 68 |
|
|
| 69 |
|
|
| 70 |
PamVMCApplication::~PamVMCApplication() |
PamVMCApplication::~PamVMCApplication() |
| 71 |
{ |
{ |
| 72 |
// Destructor |
// Destructor |
| 79 |
} |
} |
| 80 |
|
|
| 81 |
|
|
| 82 |
void PamVMCApplication::InitMC(const char* setup) |
void PamVMCApplication::InitMC(const char* setup, const char *filename, UInt_t seed ) |
| 83 |
{ |
{ |
| 84 |
// Initialize MC. |
// Initialize MC. |
| 85 |
|
|
| 86 |
fVerbose.InitMC(); |
fVerbose.InitMC(); |
| 87 |
|
|
| 88 |
gROOT->LoadMacro(setup); |
gROOT->LoadMacro(setup); |
| 89 |
gInterpreter->ProcessLine("Config()"); |
gInterpreter->ProcessLine("Config()"); |
| 90 |
gMC->SetStack(fStack); |
gMC->SetStack(fStack); |
| 91 |
std::cout<<"!!! BEFORE INIT GMC"<<std::endl; |
std::cout<<"!!! BEFORE INIT GMC"<<std::endl; |
| 92 |
|
|
| 93 |
gMC->Init(); |
gMC->Init(); |
| 94 |
cout<<"INIT MC"<<endl; |
cout<<"INIT MC"<<endl; |
| 95 |
gMC->BuildPhysics(); |
gMC->BuildPhysics(); |
| 96 |
cout<<"PHYSICS BUILDED"<<endl; |
cout<<"PHYSICS BUILDED"<<endl; |
| 97 |
|
|
| 98 |
|
PamVMCRawMgr::Instance(filename); |
|
fdetector->InitMC(); |
|
|
|
|
|
// fdetector->Print(); |
|
| 99 |
|
|
| 100 |
PamVMCSDMgr::Instance()->Register(); |
// Initialize seed for random generation // Cecilia |
| 101 |
|
PamVMCDigMgr::Instance(seed); |
| 102 |
|
|
| 103 |
PamVMCDigMgr::Instance()->LoadCalib(); |
fdetector->InitMC(); |
| 104 |
PamVMCRawMgr::Instance()->WriteToFile(); |
// fdetector->Print(); |
| 105 |
|
|
| 106 |
fPrimaryGenerator->Register(); |
PamVMCSDMgr::Instance()->Register(); |
| 107 |
|
|
| 108 |
std::cout<<"LIST OF ACTIVE SD'S:"<<std::endl; |
PamVMCDigMgr::Instance()->LoadCalib(); |
| 109 |
|
PamVMCRawMgr::Instance(filename)->WriteToFile(); |
| 110 |
PamVMCSDMgr::Instance()->Print(); |
|
| 111 |
|
fPrimaryGenerator->Register(); |
| 112 |
|
|
| 113 |
|
std::cout<<"LIST OF ACTIVE SD'S:"<<std::endl; |
| 114 |
|
PamVMCSDMgr::Instance()->Print(); |
| 115 |
} |
} |
| 116 |
|
|
| 117 |
|
|
| 118 |
void PamVMCApplication::RunMC(Int_t nofEvents) |
void PamVMCApplication::RunMC(Int_t nofEvents) |
| 119 |
{ |
{ |
| 120 |
// MC run. |
// MC run. |