Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "EcalFastSimG4Tool.h"
#include "G4Region.hh"
#include "G4RegionStore.hh"
#include "G4VFastSimulationModel.hh"
#include "EcalFastSimG4Model.h"
DECLARE_COMPONENT(EcalFastSimG4Tool);
StatusCode EcalFastSimG4Tool::initialize() {
StatusCode sc;
return sc;
}
StatusCode EcalFastSimG4Tool::finalize() {
StatusCode sc;
return sc;
}
bool EcalFastSimG4Tool::CreateFastSimulationModel() {
// In this method:
// * Retrieve the G4Region
// * Create Model
// * Associate model and region
G4String model_name = "EcalFastSimG4Model";
for (auto region_name: m_regions.value()) {
G4Region* aEnvelope = G4RegionStore::GetInstance()->GetRegion(region_name);
if (!aEnvelope) {
error() << "Failed to find G4Region '" << region_name << "'" << endmsg;
return false;
}
EcalFastSimG4Model* model = new EcalFastSimG4Model(model_name+region_name, aEnvelope);
info() << "Create Model " << model_name << " for G4Region " << region_name << endmsg;
}
return true;
}