5 class G4VPhysicalVolume;
18 , _sensor_resolution_x(0)
19 , _sensor_resolution_y(0)
36 G4VPhysicalVolume*
volume =
37 aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume();
39 G4TouchableHandle touch = aStep->GetPreStepPoint()->GetTouchableHandle();
41 G4double edep = aStep->GetTotalEnergyDeposit() /
GeV;
42 G4double eion = (aStep->GetTotalEnergyDeposit() - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
44 const G4Track* aTrack = aStep->GetTrack();
46 TVector3 sensorPosition;
50 bool geantino =
false;
61 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0 && aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino") != std::string::npos)
65 G4StepPoint* prePoint = aStep->GetPreStepPoint();
66 G4StepPoint* postPoint = aStep->GetPostStepPoint();
71 switch (prePoint->GetStepStatus())
80 hit->
set_x(0, prePoint->GetPosition().x() /
cm);
81 hit->
set_y(0, prePoint->GetPosition().y() /
cm);
82 hit->
set_z(0, prePoint->GetPosition().z() /
cm);
84 hit->
set_t(0, prePoint->GetGlobalTime() / nanosecond);
87 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
124 hit->
set_x(1, postPoint->GetPosition().x() /
cm);
125 hit->
set_y(1, postPoint->GetPosition().y() /
cm);
126 hit->
set_z(1, postPoint->GetPosition().z() /
cm);
128 hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
140 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
143 dynamic_cast<PHG4TrackUserInfoV1*>(
p))
155 if (postPoint->GetStepStatus() == fGeomBoundary ||
156 postPoint->GetStepStatus() == fWorldBoundary ||
157 postPoint->GetStepStatus() == fAtRestDoItProc ||
158 aTrack->GetTrackStatus() == fStopAndKill)
196 int sensor_ID_0 = -1;
197 int sensor_ID_1 = -1;
202 G4double baseplate_length = 43.1 *
mm;
203 G4double baseplate_width = 56.5 *
mm / 2;
204 G4double baseSH_width = baseplate_width / 2;
205 G4double _module_x_dimension = baseplate_length;
206 G4double _module_y_dimension = baseplate_width + baseSH_width;
208 G4double sensor_y_dimension = 21.2 *
mm;
209 G4double sensor_x_dimension = 42.0 *
mm;
214 TVector3 prePointVec(prePoint->GetPosition().x(),prePoint->GetPosition().y(),prePoint->GetPosition().z());
216 float prePoint_Phi = prePointVec.Phi()+
M_PI;
219 if(prePoint->GetPosition().z()>0){
220 layer_ID = prePoint->GetPosition().z()>
_z_pos_TTL ? 1 : 0;
222 layer_ID = prePoint->GetPosition().z()<
_z_pos_TTL ? 1 : 0;
226 sensor_ID_0 = (int) ( ( ( prePoint->GetPosition().x() + (prePoint->GetPosition().x()<0 ? -_module_x_dimension /2 : _module_x_dimension/2) ) ) / _module_x_dimension );
227 sensor_ID_1 = (int) ( ( ( prePoint->GetPosition().y() + (prePoint->GetPosition().y()<0 ? -_module_y_dimension /2 : _module_y_dimension/2) ) ) / _module_y_dimension );
229 float sensorcorner_x = sensor_ID_0*_module_x_dimension - sensor_x_dimension/2;
230 float sensorcorner_y = 0;
231 if((sensor_ID_1%2==0 && layer_ID==0) || (sensor_ID_1%2!=0 && layer_ID==1) ){
233 sensorcorner_y = sensor_ID_1*_module_y_dimension - _module_y_dimension/2 + (0.1 *
mm / 2);
236 sensorcorner_y = sensor_ID_1*_module_y_dimension + _module_y_dimension/2 - sensor_y_dimension - (0.1 *
mm / 2);
245 sensorposition.SetZ( prePoint->GetPosition().z() );
249 module_ret = module_ID;
251 sensor_0 = sensor_ID_0;
252 sensor_1 = sensor_ID_1;
265 std::string hitnodename;
276 hits_ = findNode::getClass<PHG4HitContainer>(topNode, hitnodename.c_str());
281 std::cout <<
"PHG4TTLSteppingAction::SetTopNode - unable to find "
282 << hitnodename << std::endl;