74 G4cout <<
"AFP_SensitiveDetector::ProcessHits" << G4endl;
79 int nParticleEncoding=-1;
80 float fKineticEnergy=0.0;
81 float fEnergyDeposit=0.0;
82 float fWaveLength=0.0;
89 float fGlobalTime=0.0;
96 bool bIsSIDAuxVSID=
false;
99 G4Track* pTrack = pStep->GetTrack();
100 G4ParticleDefinition* pParticleDefinition = pTrack->GetDefinition();
101 G4StepPoint* pPreStepPoint = pStep->GetPreStepPoint();
102 G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
103 G4ThreeVector PreStepPointPos = pPreStepPoint->GetPosition();
104 G4ThreeVector PostStepPointPos = pPostStepPoint->GetPosition();
106 nTrackID=pTrack->GetTrackID();
107 fKineticEnergy = pPreStepPoint->GetKineticEnergy();
108 fEnergyDeposit = pStep->GetTotalEnergyDeposit();
110 fPreStepX = PreStepPointPos.x();
111 fPreStepY = PreStepPointPos.y();
112 fPreStepZ = PreStepPointPos.z();
113 fPostStepX = PostStepPointPos.x();
114 fPostStepY = PostStepPointPos.y();
115 fPostStepZ = PostStepPointPos.z();
116 nParticleEncoding = pParticleDefinition->GetPDGEncoding();
117 fGlobalTime = pStep->GetPreStepPoint()->GetGlobalTime()/CLHEP::picosecond;
120 G4TouchableHandle touch1 = pPreStepPoint->GetTouchableHandle();
121 G4VPhysicalVolume* volume = touch1->GetVolume();
122 G4String VolumeName = volume->GetName();
126 G4cout <<
"hit volume name is " << VolumeName << G4endl;
127 G4cout <<
"particle code is " << nParticleEncoding <<
"kinetic energy " << fKineticEnergy << G4endl;
128 G4cout <<
"global, x_pre: " << fPreStepX <<
", y_pre: " << fPreStepY <<
", z_pre: " << fPreStepZ << G4endl;
129 G4cout <<
"global, x_post: " << fPostStepX <<
", y_post: " << fPostStepY <<
", z_post: " << fPostStepZ << G4endl;
134 memset(&szbuff[0],0,
sizeof(szbuff));
135 strncpy(szbuff,VolumeName.data(),
sizeof(szbuff));
136 szbuff[
sizeof(szbuff)-1] =
'\0';
137 ppv1=strchr(szbuff,
'[');
138 ppv2=strchr(szbuff,
']');
140 G4cout <<
"ERROR: Invalid format of volume name " << VolumeName << G4endl;
145 nStationID=10*(szbuff[3]-0x30)+(szbuff[4]-0x30);
146 nDetectorID=atoi(ppv1+1);
150#if G4VERSION_NUMBER < 1100
151 if ( (VolumeName.contains(
"TDSensor")) )
153 if ( (G4StrUtil::contains(VolumeName,
"TDSensor")) )
156 nQuarticID=szbuff[7]-0x30;
157 if ( pStep->GetPostStepPoint()->GetProcessDefinedStep() == 0 )
return 1;
158 if ( (pStep->GetPostStepPoint()->GetProcessDefinedStep())->GetProcessName()!=
"OpAbsorption" )
return 1;
159 fWaveLength = 2.*
M_PI*CLHEP::hbarc/(CLHEP::MeV*CLHEP::nm)/fKineticEnergy;
160 if (fWaveLength > 800. || fWaveLength < 200.)
return 1;
163 fWaveLength,fPreStepX,fPreStepY,fPreStepZ,fPostStepX,fPostStepY,
164 fPostStepZ,fGlobalTime,nStationID,nDetectorID,(1+2*nQuarticID));
169#if G4VERSION_NUMBER < 1100
170 if ( (bRes=VolumeName.contains(
"TDQuarticBar[")) )
172 if ( (bRes=G4StrUtil::contains(VolumeName,
"TDQuarticBar[")) )
175 nQuarticID=szbuff[7]-0x30;
181 const G4TouchableHistory* myTouch =
static_cast<const G4TouchableHistory*
>(pPreStepPoint->GetTouchable());
185 const G4AffineTransform transformation = myTouch->GetHistory()->GetTopTransform();
186 G4ThreeVector PreStepPointPos2 = transformation.TransformPoint(PreStepPointPos);
187 G4ThreeVector PostStepPointPos2 = transformation.TransformPoint(PostStepPointPos);
189 G4String shape( myTouch->GetSolid()->GetEntityType() );
191 G4ThreeVector normpX( 1., 0., 0.);
192 G4ThreeVector normnX(-1., 0., 0.);
193 G4ThreeVector normpY( 0., 1., 0.);
194 G4ThreeVector normnY( 0.,-1., 0.);
195 G4ThreeVector normpZ( 0., 0., 1.);
196 G4ThreeVector normnZ( 0., 0.,-1.);
198 G4double PreProtonX = PreStepPointPos2.x();
199 G4double PreProtonY = PreStepPointPos2.y();
200 G4double PreProtonZ = PreStepPointPos2.z();
202 G4double PostProtonX = PostStepPointPos2.x();
203 G4double PostProtonY = PostStepPointPos2.y();
204 G4double PostProtonZ = PostStepPointPos2.z();
206 G4ThreeVector p0 = pStep->GetDeltaPosition().unit();
208 G4Material* mat = pStep->GetTrack()->GetMaterial();
209 G4MaterialPropertiesTable *matPropTable = mat->GetMaterialPropertiesTable();
211 G4MaterialPropertyVector* Rind = matPropTable->GetProperty(
"RINDEX");
213 G4MaterialPropertyVector* Alen = matPropTable->GetProperty(
"ABSLENGTH");
215 const G4double
charge = pParticleDefinition->GetPDGCharge();
216 const G4double beta = (pPreStepPoint->GetBeta() + pPostStepPoint->GetBeta()) / 2.;
217 G4double BetaInverse = 1. / beta;
221#if G4VERSION_NUMBER < 1100
222 G4double Pmin = Rind->GetMinLowEdgeEnergy();
224 G4double Pmax = Rind->GetMaxLowEdgeEnergy();
226 G4double Pmin = Rind->GetMinEnergy();
227 G4double Pmax = Rind->GetMaxEnergy();
229 G4double dp = Pmax - Pmin;
231 G4double maxCosTheta = BetaInverse / Rind->GetMinValue();
232 G4double maxSin2Theta = (1.0 - maxCosTheta) * (1.0 + maxCosTheta);
235 G4double meanRI = .5*(Rind->GetMinValue() + Rind->GetMaxValue());
238 G4double MeanNumberOfPhotons = 370.*(
charge/CLHEP::eplus)*(
charge/CLHEP::eplus)* (1.0 - 1.0/(beta * meanRI * beta * meanRI)) / (CLHEP::cm*CLHEP::eV);
239 if (MeanNumberOfPhotons <= 0.0)
return 1;
241 G4double step_length = pStep->GetStepLength();
243 MeanNumberOfPhotons = MeanNumberOfPhotons * step_length * dp;
244 G4int NumPhotons = (G4int) G4Poisson( MeanNumberOfPhotons );
245 if (NumPhotons <= 0)
return 1;
248 G4int NumPhotonsCuts=0;
249 for (G4int
I = 0;
I < NumPhotons;
I++) {
252 G4double sampledEnergy, sampledRI;
253 G4double cosTheta, sin2Theta;
257 rand = G4UniformRand();
258 sampledEnergy = Pmin + rand * dp;
260 sampledRI = Rind->Value(sampledEnergy);
261 cosTheta = BetaInverse / sampledRI;
263 sin2Theta = (1.0 - cosTheta)*(1.0 + cosTheta);
264 rand = G4UniformRand();
266 }
while (rand * maxSin2Theta > sin2Theta);
269 rand = G4UniformRand();
271 G4double sinPhi = sin(
phi);
272 G4double cosPhi = cos(
phi);
277 G4double sinTheta = std::sqrt(sin2Theta);
278 G4double px = sinTheta*cosPhi;
279 G4double py = sinTheta*sinPhi;
280 G4double pz = cosTheta;
281 G4ParticleMomentum photonMomentum(px, py, pz);
282 photonMomentum.rotateUz(p0);
284 G4double PX = photonMomentum.getX();
285 G4double PY = photonMomentum.getY();
286 G4double PZ = photonMomentum.getZ();
290 G4double PYp = PY/std::sqrt(PX*PX+PY*PY+PZ*PZ);
291 G4double PZp = PZ/std::sqrt(PX*PX+PY*PY+PZ*PZ);
293 G4double PYt = PY/std::sqrt(PY*PY+PZ*PZ);
294 G4double PZt = PZ/std::sqrt(PY*PY+PZ*PZ);
297 cosPhi = (PYp*PYt + PZp*PZt);
298 if (nStationID == 0) cosTheta = ( -PYt*sin(48.*CLHEP::deg) + PZt*cos(48.*CLHEP::deg) );
299 else cosTheta = ( -PYt*sin(48.*CLHEP::deg) - PZt*cos(48.*CLHEP::deg) );
302 G4double cosThetaC = std::sqrt(1.-1./sampledRI/sampledRI);
303 if (std::sqrt(1.-cosPhi*cosPhi)>cosThetaC)
continue;
304 if (std::sqrt(1.-cosTheta*cosTheta)*cosPhi>cosThetaC)
continue;
307 rand = G4UniformRand();
308 G4double PhotonX = PreProtonX + (PostProtonX-PreProtonX)*rand;
309 G4double PhotonY = PreProtonY + (PostProtonY-PreProtonY)*rand;
310 G4double PhotonZ = PreProtonZ + (PostProtonZ-PreProtonZ)*rand;
311 G4ThreeVector PhotonPos(PhotonX,PhotonY,PhotonZ);
312 G4double PhotonR = std::sqrt( (PreProtonX-PhotonX)*(PreProtonX-PhotonX) + (PreProtonY-PhotonY)*(PreProtonY-PhotonY) + (PreProtonZ-PhotonZ)*(PreProtonZ-PhotonZ) );
318 Y0 =
static_cast<G4ReflectedSolid *
>(myTouch->GetSolid())->DistanceToOut(PhotonPos, normnY);
319 Y0 = Y0/cosTheta/cosPhi;
328 float Pabs = 1. - exp( - Y0/Alen->Value(sampledEnergy) );
329 rand = G4UniformRand();
330 if (Pabs>rand)
continue;
333 rand = G4UniformRand();
339 float fGlobalTime2 = fGlobalTime;
340 fGlobalTime2 += ( PhotonR * BetaInverse / CLHEP::c_light )/CLHEP::picosecond;
345 if (sampledEnergy > (Pmin+.5*dp)) EdndE = (sampledRI - Rind->Value(sampledEnergy-0.0001*CLHEP::eV))/0.0001*sampledEnergy/CLHEP::eV;
346 else EdndE = (Rind->Value(sampledEnergy+0.0001*CLHEP::eV) - sampledRI)/0.0001*sampledEnergy/CLHEP::eV;
347 fGlobalTime2 += ( (sampledRI + EdndE)* Y0 * BetaInverse / CLHEP::c_light )/CLHEP::picosecond;
351 G4cout <<
"FastCher EdndE: " << EdndE << G4endl;
353 fWaveLength = 2.*
M_PI*CLHEP::hbarc/sampledEnergy/(CLHEP::MeV*CLHEP::nm);
358 int nSensitiveElementID=-1;
359 if(nQuarticID==0) { nSensitiveElementID=1; }
360 else if(nQuarticID==1) { nSensitiveElementID=3; }
363 fWaveLength,PhotonX,PhotonY,PhotonZ,(PhotonX+PX),(PhotonY+PY),(PhotonZ+PZ),
364 fGlobalTime2,nStationID,nDetectorID,nSensitiveElementID);
369 G4cout <<
"FastCher number of photons: " << NumPhotonsCuts << G4endl;
373#if G4VERSION_NUMBER < 1100
374 else if (VolumeName.contains(
"SIDSensor") || (bIsSIDAuxVSID=VolumeName.contains(
"SIDVacuumSensor"))){
376 else if (G4StrUtil::contains(VolumeName,
"SIDSensor") || (bIsSIDAuxVSID=G4StrUtil::contains(VolumeName,
"SIDVacuumSensor"))){
378 if(!bIsSIDAuxVSID && !(fEnergyDeposit>0.0))
387 fPreStepX,fPreStepY,fPreStepZ,fPostStepX,fPostStepY,fPostStepZ,
388 fGlobalTime,nStationID,nDetectorID,bIsSIDAuxVSID,-1,-1);
396 const G4TouchableHistory* myTouch =
static_cast<const G4TouchableHistory*
>(pPreStepPoint->GetTouchable());
401 const G4AffineTransform transformation = myTouch->GetHistory()->GetTopTransform();
402 G4ThreeVector localPosition_pre = transformation.TransformPoint(PreStepPointPos);
403 G4ThreeVector localPosition_post = transformation.TransformPoint(PostStepPointPos);
405 G4ThreeVector normpX( 1., 0., 0.);
406 G4ThreeVector normnX(-1., 0., 0.);
407 G4ThreeVector normpY( 0., 1., 0.);
408 G4ThreeVector normnY( 0.,-1., 0.);
409 G4ThreeVector normpZ( 0., 0., 1.);
410 G4ThreeVector normnZ( 0., 0.,-1.);
412 G4double BarpX =
static_cast<G4ReflectedSolid *
>(myTouch->GetSolid())->DistanceToOut(localPosition_pre, normpX);
413 G4double BarnX =
static_cast<G4ReflectedSolid *
>(myTouch->GetSolid())->DistanceToOut(localPosition_pre, normnX);
414 G4double BarpY =
static_cast<G4ReflectedSolid *
>(myTouch->GetSolid())->DistanceToOut(localPosition_pre, normpY);
415 G4double BarnY =
static_cast<G4ReflectedSolid *
>(myTouch->GetSolid())->DistanceToOut(localPosition_pre, normnY);
416 G4double BarpZ =
static_cast<G4ReflectedSolid *
>(myTouch->GetSolid())->DistanceToOut(localPosition_pre, normpZ);
417 G4double BarnZ =
static_cast<G4ReflectedSolid *
>(myTouch->GetSolid())->DistanceToOut(localPosition_pre, normnZ);
419 G4double BarHalfX = .5 * (BarpX+BarnX);
420 G4double BarHalfY = .5 * (BarpY+BarnY);
421 G4double BarHalfZ = .5 * (BarpZ+BarnZ);
425 G4double x_det = BarHalfX + localPosition_pre.x();
426 G4double y_det = BarHalfY + localPosition_pre.y();
427 G4double z_det = BarHalfZ + localPosition_pre.z();
429 G4double x_det_post = BarHalfX + localPosition_post.x();
430 G4double y_det_post = BarHalfY + localPosition_post.y();
431 G4double z_det_post = BarHalfZ + localPosition_post.z();
433 G4double track_length_XY = std::sqrt(pow(x_det_post-x_det,2)+pow(y_det_post-y_det,2));
435 G4double angle_phi_global = atan2(fPostStepY-fPreStepY,fPostStepX-fPreStepX);
436 G4double angle_phi = atan2(y_det_post-y_det,x_det_post-x_det);
438 G4double tan_phi = (y_det_post-y_det)/(x_det_post-x_det);
442 G4cout <<
"AFP_SensitiveDetector::ProcessHits: local, x_det: " << x_det <<
", y_det: " << y_det <<
", z_det: " << z_det << G4endl;
443 G4cout <<
"AFP_SensitiveDetector::ProcessHits: local, x_det_post: " << x_det_post <<
", y_det_post: " << y_det_post <<
", z_det_post: " << z_det_post << G4endl;
444 G4cout <<
"AFP_SensitiveDetector::ProcessHits: angle_phi_global in -pi:pi = " << angle_phi_global << G4endl;
446 if (angle_phi_global < 0.) angle_phi_global = 2.*
M_PI + angle_phi_global;
449 G4cout <<
"AFP_SensitiveDetector::ProcessHits: angle_phi_global in 0:2pi = " << angle_phi_global << G4endl;
450 G4cout <<
"AFP_SensitiveDetector::ProcessHits: angle_phi in -pi:pi = " << angle_phi << G4endl;
452 if (angle_phi < 0.) angle_phi = 2.*
M_PI + angle_phi;
455 G4cout <<
"AFP_SensitiveDetector::ProcessHits: angle_phi in 0:2pi = " << angle_phi << G4endl;
462 signed int sign_pixels_x = 0;
463 signed int sign_pixels_y = 0;
465 int number_pixels_x = (int) (abs((post_pixel_x-pre_pixel_x)*1.0));
466 int number_pixels_y = (int) (abs((post_pixel_y-pre_pixel_y)*1.0));
468 if (number_pixels_x > 0)
470 sign_pixels_x = (post_pixel_x-pre_pixel_x)/number_pixels_x;
472 if (number_pixels_y > 0)
474 sign_pixels_y = (post_pixel_y-pre_pixel_y)/number_pixels_y;
482 G4cout <<
"AFP_SensitiveDetector::ProcessHits: pre: pixel["<< pre_pixel_x - n_death_pixels <<
"]["<< pre_pixel_y - n_lower_pixels <<
"] was hit" << G4endl;
483 G4cout <<
"AFP_SensitiveDetector::ProcessHits: post: pixel["<< post_pixel_x - n_death_pixels<<
"]["<< post_pixel_y - n_lower_pixels<<
"] was hit" << G4endl;
484 G4cout <<
"AFP_SensitiveDetector::ProcessHits: chip's length in x: " << 2.*BarHalfX <<
", in y: " << 2.*BarHalfY <<
", in z: " << 2.*BarHalfZ << G4endl;
486 signed int first = -1;
488 G4double x_next_pixel = -9999.;
489 G4double y_next_pixel = -9999.;
491 G4double x_border = -9999.;
492 G4double y_border = -9999.;
494 G4double pixel_track_length_XY = -1.;
495 G4double angle_2pixel = 10.;
499 int act_pixel_x = pre_pixel_x;
500 int act_pixel_y = pre_pixel_y;
504 G4cout <<
"AFP_SensitiveDetector::ProcessHits: actual pixel in x = " << act_pixel_x <<
", in y = " << act_pixel_y << G4endl;
505 G4cout <<
"AFP_SensitiveDetector::ProcessHits: actual compensated pixel in x = " << act_pixel_x - n_death_pixels <<
", in y = " << act_pixel_y - n_lower_pixels << G4endl;
507 if ((number_pixels_x == 0) && (number_pixels_y == 0))
512 G4cout <<
"AFP_SensitiveDetector::ProcessHits: pre and post in the same pixel " << G4endl;
514 if (( pre_pixel_y - n_lower_pixels <= 80) && (pre_pixel_x -n_death_pixels <= 336) && ( pre_pixel_y - n_lower_pixels > 0) && (pre_pixel_x - n_death_pixels > 0))
517 fPreStepX,fPreStepY,fPreStepZ,fPostStepX,fPostStepY,fPostStepZ,
518 fGlobalTime,nStationID,nDetectorID,bIsSIDAuxVSID,
519 (pre_pixel_y - n_lower_pixels - 1),
520 (pre_pixel_x - n_death_pixels - 1));
523 else if(verboseLevel>5)
525 G4cout <<
"AFP_SensitiveDetector::ProcessHits: hit outside of pixel's sensitive area " << G4endl;
532 G4cout <<
"AFP_SensitiveDetector::ProcessHits: pre and post in diferent pixels " << G4endl;
536 while ( (number_pixels_x >= 0) && (number_pixels_y >= 0) )
539 if ((angle_phi >= 0.) && (angle_phi < M_PI_2))
543 angle_2pixel = atan2(y_next_pixel-y_det,x_next_pixel-x_det);
545 if (angle_2pixel < 0.) angle_2pixel = 2*
M_PI + angle_2pixel;
546 if(verboseLevel>5) { G4cout <<
"AFP_SensitiveDetector::ProcessHits: angle_2pixel in 0:2pi = " << angle_2pixel << G4endl; }
548 if (angle_2pixel > angle_phi)
558 else if ((angle_phi >= M_PI_2) && (angle_phi <
M_PI))
562 angle_2pixel = atan2(y_next_pixel-y_det,x_next_pixel-x_det);
564 if (angle_2pixel < 0.) angle_2pixel = 2*
M_PI + angle_2pixel;
565 if(verboseLevel>5) { G4cout <<
"AFP_SensitiveDetector::ProcessHits: angle_2pixel in 0:2pi = " << angle_2pixel << G4endl; }
567 if (angle_2pixel > angle_phi)
577 else if ((angle_phi >=
M_PI) && (angle_phi < 3.*M_PI_2))
581 if(verboseLevel>5) { G4cout <<
"AFP_SensitiveDetector::ProcessHits: next pixel corner, x = " << x_next_pixel <<
", y =" << y_next_pixel << G4endl; }
583 angle_2pixel = atan2(y_next_pixel-y_det,x_next_pixel-x_det);
585 if (angle_2pixel < 0.) angle_2pixel = 2*
M_PI + angle_2pixel;
586 if(verboseLevel>5) { G4cout <<
"AFP_SensitiveDetector::ProcessHits: angle_2pixel in 0:2pi = " << angle_2pixel << G4endl; }
588 if (angle_2pixel > angle_phi)
598 else if ((angle_phi >= 3.*M_PI_2) && (angle_phi < 2.*
M_PI))
602 angle_2pixel = atan2(y_next_pixel-y_det,x_next_pixel-x_det);
604 if (angle_2pixel < 0.) angle_2pixel = 2*
M_PI + angle_2pixel;
605 if(verboseLevel>5) { G4cout <<
"AFP_SensitiveDetector::ProcessHits: angle_2pixel in 0:2pi = " << angle_2pixel << G4endl; }
607 if (angle_2pixel > angle_phi)
619 if(verboseLevel>5) { G4cout <<
"AFP_SensitiveDetector::ProcessHits: something is wrong here!!! " << G4endl; }
624 if(verboseLevel>5) { G4cout <<
"AFP_SensitiveDetector::ProcessHits: something is wrong here!!! " << G4endl; }
625 throw std::runtime_error(
"AFP_SensitiveDetector::ProcessHits: something is wrong here");
630 G4cout <<
"AFP_SensitiveDetector::ProcessHits: actual pixel in x = " << act_pixel_x <<
", in y = " << act_pixel_y << G4endl;
631 G4cout <<
"AFP_SensitiveDetector::ProcessHits: actual compensated pixel in x = " << act_pixel_x - n_death_pixels <<
", in y = " << act_pixel_y - n_lower_pixels << G4endl;
637 if(verboseLevel>5) { G4cout <<
"AFP_SensitiveDetector::ProcessHits: cross is x, " << G4endl; }
638 x_border = x_next_pixel;
640 if ((sign_pixels_x >= 0) && (x_border > x_det_post)) x_border = x_det_post;
641 if ((sign_pixels_x < 0) && (x_border < x_det_post)) x_border = x_det_post;
643 y_border = tan_phi*(x_border-x_det) + y_det;
645 if (( act_pixel_y - n_lower_pixels <= 80) && (act_pixel_x -n_death_pixels <= 336) && ( act_pixel_y - n_lower_pixels > 0) && (act_pixel_x - n_death_pixels > 0))
647 pixel_track_length_XY = std::sqrt(pow(x_border-x_det,2)+pow(y_border-y_det,2));
651 G4cout <<
"AFP_SensitiveDetector::ProcessHits: overall energy = " << fEnergyDeposit << G4endl;
652 G4cout <<
"AFP_SensitiveDetector::ProcessHits: track XY length = " << track_length_XY << G4endl;
653 G4cout <<
"AFP_SensitiveDetector::ProcessHits: actual XY length = " << pixel_track_length_XY << G4endl;
654 G4cout <<
"AFP_SensitiveDetector::ProcessHits: deposited energy = " << fEnergyDeposit*(pixel_track_length_XY/track_length_XY) << G4endl;
659 fEnergyDeposit*(pixel_track_length_XY/track_length_XY),
660 fPreStepX,fPreStepY,fPreStepZ,fPostStepX,fPostStepY,fPostStepZ,
661 fGlobalTime,nStationID,nDetectorID,bIsSIDAuxVSID,
662 (act_pixel_y - n_lower_pixels - 1),
663 (act_pixel_x - n_death_pixels - 1));
665 if(verboseLevel>5) { G4cout <<
"AFP_SensitiveDetector::ProcessHits:pixel["<< act_pixel_x - n_death_pixels <<
"]["<< act_pixel_y - n_lower_pixels <<
"] will be stored, with energy "
666 << fEnergyDeposit*(pixel_track_length_XY/track_length_XY) << G4endl; }
675 number_pixels_x = number_pixels_x - 1;
677 if(verboseLevel>5) { G4cout <<
"AFP_SensitiveDetector::ProcessHits: remaining number of pixels in x = " << number_pixels_x <<
", in y = " << number_pixels_y << G4endl; }
679 act_pixel_x = act_pixel_x + sign_pixels_x;
685 if(verboseLevel>5) { G4cout <<
"AFP_SensitiveDetector::ProcessHits: cross is y, " << G4endl; }
686 y_border = y_next_pixel;
688 if ((sign_pixels_y >= 0) && (y_border > y_det_post)) y_border = y_det_post;
689 if ((sign_pixels_y < 0) && (y_border < y_det_post)) y_border = y_det_post;
691 x_border = (y_border-y_det)/tan_phi + x_det;
693 if (( act_pixel_y - n_lower_pixels <= 80) && (act_pixel_x -n_death_pixels <= 336) && ( act_pixel_y - n_lower_pixels > 0) && (act_pixel_x - n_death_pixels > 0))
695 pixel_track_length_XY = std::sqrt(pow(x_border-x_det,2)+pow(y_border-y_det,2));
699 G4cout <<
"AFP_SensitiveDetector::ProcessHits: overall energy = " << fEnergyDeposit << G4endl;
700 G4cout <<
"AFP_SensitiveDetector::ProcessHits: track XY length = " << track_length_XY << G4endl;
701 G4cout <<
"AFP_SensitiveDetector::ProcessHits: actual XY length = " << pixel_track_length_XY << G4endl;
702 G4cout <<
"AFP_SensitiveDetector::ProcessHits: deposited energy = " << fEnergyDeposit*(pixel_track_length_XY/track_length_XY) << G4endl;
707 fEnergyDeposit*(pixel_track_length_XY/track_length_XY),
708 fPreStepX,fPreStepY,fPreStepZ,fPostStepX,fPostStepY,fPostStepZ,
709 fGlobalTime,nStationID,nDetectorID,bIsSIDAuxVSID,
710 (act_pixel_y - n_lower_pixels - 1),
711 (act_pixel_x - n_death_pixels - 1));
713 if(verboseLevel>5) { G4cout <<
"AFP_SensitiveDetector::ProcessHits:pixel["<< act_pixel_x - n_death_pixels <<
"]["<< act_pixel_y - n_lower_pixels <<
"] will be stored, with energy "
714 << fEnergyDeposit*(pixel_track_length_XY/track_length_XY) << G4endl; }
723 number_pixels_y = number_pixels_y - 1;
725 if(verboseLevel>5) { G4cout <<
"AFP_SensitiveDetector::ProcessHits: remaining number of pixels in x = " << number_pixels_x <<
", in y = " << number_pixels_y << G4endl; }
728 act_pixel_y = act_pixel_y + sign_pixels_y;