113 const static G4String fullPSName = (
m_detectorName.empty()) ?
"LAr::Barrel::Presampler" : G4String(
m_detectorName+
"::LAr::Barrel::Presampler");
114 const static G4String fullCryoName = (
m_detectorName.empty()) ?
"LAr::TBBarrel::Cryostat::LAr" : G4String(
m_detectorName+
"::LAr::TBBarrel::Cryostat::LAr");
115 const static G4String fullModuleName = (
m_detectorName.empty()) ?
"LAr::Barrel::Presampler::Module" : G4String(
m_detectorName+
"::LAr::Barrel::Presampler::Module");
118 const G4NavigationHistory* g4navigation = a_step->GetPreStepPoint()->GetTouchable()->GetHistory();
119 const G4int ndep = g4navigation->GetDepth();
124 for (G4int ii=0;ii<=ndep;ii++) {
126 const G4String& vname = g4navigation->GetVolume(ii)->GetName();
127 if (idep<0 && vname==fullPSName) idep=ii;
128 else if (!iactive && vname==fullModuleName) iactive=
true;
131 if (idep < 0) std::abort();
220 const G4ThreeVector p = (a_step->GetPostStepPoint()->GetPosition() + a_step->GetPreStepPoint()->GetPosition()) * 0.5;
223 ATH_MSG_VERBOSE(
"Position of the step in the ATLAS frame (x,y,z) --> " << p.x() <<
" " << p.y() <<
" " << p.z());
224 ATH_MSG_VERBOSE(
"Eta and Phi in the atlas frame --> " << p.eta() <<
" " << p.phi());
230 const G4NavigationHistory* g4navigation = a_step->GetPreStepPoint()->GetTouchable()->GetHistory();
231 const G4ThreeVector ploc = g4navigation->GetTransform(ind).TransformPoint(p);
232 const G4double radius=sqrt(ploc.x()*ploc.x() + ploc.y()*ploc.y());
235 const G4ThreeVector ploc2(ploc.x(),ploc.y(),ploc.z()+
m_zpres+
m_zminPS);
238 ATH_MSG_VERBOSE(
"Position of the step after traslation (x,y,z) --> " << ploc2.x() <<
" " << ploc2.y() <<
" " << ploc2.z());
239 ATH_MSG_VERBOSE(
"Eta and Phi after translation --> " << ploc2.eta() <<
" " << ploc2.phi());
246 const G4double
phi = (ploc2.phi() < 0.) ? ploc2.phi()+2.*
M_PI : ploc2.phi();
247 const G4double
eta = ploc2.eta();
258 const G4int numberPhiMod = 32;
259 const G4double dphi = ( 2.*
M_PI ) / numberPhiMod;
260 const G4double inv_dphi = 1. / dphi;
261 const G4double PSModuleRmean = 1420 ;
262 const G4double phicheck =
phi - int(
phi * inv_dphi) * dphi - (dphi /2.);
263 const G4double Rcheck = PSModuleRmean / cos(phicheck);
265 if (radius > Rcheck) {
266 currentCellData.
region = 3;
268 currentCellData.
region = 2;
271 const G4double detaDM = 0.1 ;
272 const G4double dphiDM = ( 2 *
M_PI ) / 64. ;
274 currentCellData.
phiBin = G4int(
phi * (1. / dphiDM) );
275 currentCellData.
etaBin = G4int(
eta * (1. / detaDM) );
280 if(currentCellData.
phiBin < 0 ) currentCellData.
phiBin += 64;
284 if ( currentCellData.
phiBin == 64 ) currentCellData.
phiBin = 0;
294 << currentCellData.
phiBin;
297 ATH_MSG_VERBOSE(
"Here the identifier for the presampler DEAD materials ---->");
337 currentCellData.
region = 0;
340 G4double
phi = atan2(yloc,xloc);
345 const G4int numberPhiBins = 64;
346 const G4double dphi = ( 2.*
M_PI ) / numberPhiBins;
347 const G4double inv_dphi = 1. / dphi;
349 currentCellData.
phiBin = G4int(
phi * inv_dphi );
350 if (currentCellData.
phiBin >63) currentCellData.
phiBin=63;
351 if (currentCellData.
phiBin <0) currentCellData.
phiBin=0;
361 currentCellData.
etaBin=60;
366 currentCellData.module=0;
367 for (
int i=1;i<8;i++) {
369 currentCellData.module++;
371 if (currentCellData.module <0 || currentCellData.module > 7)
373 G4cerr <<
"LArBarrelPresampler: invalid module/hit " << currentCellData.module <<
" " << z2 << G4endl;
374 if (currentCellData.module<0) currentCellData.
etaBin=0;
375 if (currentCellData.module>7) currentCellData.
etaBin=60;
381 const G4double phi0= ((double)isect+0.5)*2.*
M_PI/((
double)
m_nsectors);
382 static const G4double r0=1420.4*CLHEP::mm;
383 currentCellData.
dist=(xloc*cos(phi0)+yloc*sin(phi0)-r0);
386 ATH_MSG_VERBOSE(
"sector number, dist along height " << isect <<
" " << currentCellData.
dist);
387 ATH_MSG_VERBOSE(
"z2,module number,m_first_cathod " << z2 <<
" " << currentCellData.module <<
" "
393 G4double deltaz=z2-(
m_first_cathod[currentCellData.module]+currentCellData.
dist*tan(
m_tilt[currentCellData.module]));
395 if (currentCellData.module>0) {
396 currentCellData.module=currentCellData.module-1;
403 currentCellData.
gap = ((int)(deltaz/
m_pitch[currentCellData.module]));
406 ATH_MSG_VERBOSE(
"deltaz from first cathode,gap number " << deltaz <<
" " << currentCellData.
gap);
421 if (currentCellData.
etaBin < 0 || currentCellData.
etaBin > 60) {
422 ATH_MSG_WARNING(
"LArBarrelPresamplerGeometry::findCell etaBin outside range " << currentCellData.
etaBin);
426 const G4double zmiddle=
m_first_cathod[currentCellData.module]+((double)(currentCellData.
gap+0.5))*
m_pitch[currentCellData.module];
431 currentCellData.
xElec=currentCellData.
dist*cos(
m_tilt[currentCellData.module])+(z2-zmiddle)*sin(
m_tilt[currentCellData.module]);
432 currentCellData.
distElec=(z2-zmiddle)*cos(
m_tilt[currentCellData.module]) - currentCellData.
dist*sin(
m_tilt[currentCellData.module]);
virtual bool findCell(CalcData ¤tCellData, G4double xloc, G4double yloc, G4double zloc) const override final
=============================================================================== bool findCell(xloc,...