64 const G4StepPoint *pPreStepPoint(pStep->GetPreStepPoint());
65 const G4StepPoint *pPostStepPoint(pStep->GetPostStepPoint());
67 const double kineticEnergy(pPreStepPoint->GetKineticEnergy());
69 const G4ThreeVector preStepPoint(pPreStepPoint->GetPosition());
70 const G4ThreeVector postStepPoint(pPostStepPoint->GetPosition());
73 const G4String vol_name(pPreStepPoint->GetTouchableHandle()->GetVolume()->GetName());
75 const double preStepX(preStepPoint.x());
76 const double preStepY(preStepPoint.y());
77 const double preStepZ(preStepPoint.z());
79 const double postStepX(postStepPoint.x());
80 const double postStepY(postStepPoint.y());
81 const double postStepZ(postStepPoint.z());
90 const G4Track *pTrack(pStep->GetTrack());
91 const int particleEncoding(pTrack->GetDefinition()->GetPDGEncoding());
93 const double globalTime(pTrack->GetGlobalTime());
94 const int trackID(pTrack->GetTrackID());
96 std::string vol_test_str = vol_name.substr(0,7);
99 if(vol_name.find(
"GVS") != std::string::npos)
102 if(vol_name.find(
"B7L1") != std::string::npos) n_station=0;
103 else if(vol_name.find(
"A7L1") != std::string::npos) n_station=1;
104 else if(vol_name.find(
"A7R1") != std::string::npos) n_station=2;
105 else if(vol_name.find(
"B7R1") != std::string::npos) n_station=3;
110 (
float)
energyDeposit,(
float) preStepX, (
float) preStepY, (
float) preStepZ,
111 (
float) postStepX, (
float) postStepY, (
float) postStepZ,(
float) globalTime,
112 -1, 100, -1, (
int) n_station);
119 G4Exception(
"ALFA_SensitiveDetector",
"InvalidHitColl1", FatalException,
description);
124 if (vol_test_str.compare(
"ALFA_Fi") == 0)
128 std::string substring (vol_name);
129 std::string num_string (vol_name);
132 std::string test_str (
"A");
133 test_str = substring.substr(
m_pos2,1);
135 if (test_str.compare(
"U") == 0)
140 if (test_str.compare(
"V") == 0)
146 for (
int k = 0;
k < 3;
k++ )
148 substring = substring.substr(
m_pos2+1);
152 std::istringstream is(num_string);
156 n_station =
m_num[0];
166 (
float) kineticEnergy,
168 (
float) preStepX, (
float) preStepY, (
float) preStepZ,
169 (
float) postStepX, (
float) postStepY, (
float) postStepZ,
171 (
int) sign_fiber, (
int) n_plate, (
int) n_fiber, (
int) n_station
179 G4Exception(
"ALFA_SensitiveDetector",
"InvalidHitColl2", FatalException,
description);
184 if (vol_test_str.compare(
"ODFiber") == 0)
188 std::string substring (vol_name);
189 std::string num_string (std::move(vol_name));
191 std::string test_str = substring.substr(
m_pos2,1);
193 if (test_str.compare(
"U") == 0)
198 if (test_str.compare(
"V") == 0)
203 std::string test_str_side (
"A");
204 test_str_side = substring.substr(
m_pos2+1,1);
207 if (test_str_side.compare(
"0") == 0)
212 if (test_str_side.compare(
"1") == 0)
217 for (
int k = 0;
k < 3;
k++ )
219 substring = substring.substr(
m_pos2+1);
223 std::istringstream is(num_string);
227 n_station =
m_num[0];
236 (
float) kineticEnergy,
238 (
float) preStepX, (
float) preStepY, (
float) preStepZ,
239 (
float) postStepX, (
float) postStepY, (
float) postStepZ,
241 (
int) sign_fiber, (
int) OD_side, (
int) n_plate, (
int) n_fiber, (
int) n_station
249 G4Exception(
"ALFA_SensitiveDetector",
"InvalidHitColl3", FatalException,
description);