51 {
52
53
54
55
56
57 G4SDManager *SDM=G4SDManager::GetSDMpointer();
58 m_SDMDT = (G4VSensitiveDetector*) SDM->FindSensitiveDetector(
"AMS");
59 m_SDTGC = (G4VSensitiveDetector*) SDM->FindSensitiveDetector(
"TMS");
60 m_SDCSC = (G4VSensitiveDetector*) SDM->FindSensitiveDetector(
"CMS");
61 m_SDRPC = (G4VSensitiveDetector*) SDM->FindSensitiveDetector(
"RMS");
62
63
64
68
69
70 G4LogicalVolumeStore *
store = G4LogicalVolumeStore::GetInstance();
71
72 G4LogicalVolume* atlas =
store->GetVolume(
"Atlas::Atlas");
73
74
75
76 std::vector<G4LogicalVolume*> logvec;
77 logvec.push_back(atlas);
78
79
80 std::vector<G4VPhysicalVolume*> physvec;
81
82
84
85
86 while(counter !=
m_config.VolumeDepthLevel){
87
89
90
91 std::vector<G4LogicalVolume*> tmplogvec;
92
93
94 for(G4LogicalVolume* logvol : logvec) {
95 for(
unsigned int k=0;
k<logvol->GetNoDaughters();
k++){
96
97 tmplogvec.push_back(logvol->GetDaughter(k)->GetLogicalVolume());
98
99 if((logvol->GetDaughter(k)->GetLogicalVolume()->GetMaterial()->GetRadlen()<100*CLHEP::cm) || (counter ==
m_config.VolumeDepthLevel)){
100 physvec.push_back(logvol->GetDaughter(k));
101 }
102 }
103 }
104
105
106
107 logvec=std::move(tmplogvec);
108
109 }
110
111
112
113 for (G4VPhysicalVolume* physvol : physvec) {
114 std::string fulldaughtername = physvol->GetName();
115 std::string daughtername;
116 std::string::size_type npos;
117 npos=fulldaughtername.find("::");
118
119 if(npos!=std::string::npos &&
m_config.VolumeDepthLevel==1) daughtername = fulldaughtername.substr(0,npos);
120 else daughtername = std::move(fulldaughtername);
122 }
123
124
125
128
129
130
132 treeMap[
p.first]=
new TTree(TString(
p.first), TString(
p.first));
134 }
135
136
137 if(
m_hSvc.retrieve().isFailure())
return;
138
139
140
141
143 std::string
filename=
"/RadLengthAction/";
146
159 }
160 }
std::map< std::string, TTree * > treeMap
std::map< std::string, G4VPhysicalVolume * > topvolmap