21 #include "G4StepPoint.hh" 
   22 #include "G4VPhysicalVolume.hh" 
   23 #include "G4ThreeVector.hh" 
   34   namespace BarrelCryostat {
 
   51       return StatusCode::SUCCESS;
 
   55                                              std::vector<G4double> & energies,
 
   67         for (
unsigned int i=0; 
i != 4; 
i++) energies.push_back( 0. );
 
   83           constexpr 
double oneOverDeta = 10.;       
 
   84           constexpr 
double oneOverDphi = 32./
M_PI;  
 
   86           constexpr 
double rhoMinPresamplerMother = 1385.*
CLHEP::mm;
 
   92           constexpr 
double rhoAlignmentSafety = 10.*
CLHEP::mm;
 
   93           constexpr 
double rhoInFrontOfColdWall = rhoMinPresamplerMother - rhoAlignmentSafety;
 
   95           constexpr 
double RCUT12  = 1593.9*
CLHEP::mm;
 
   96           constexpr 
double RCUT23  = 1866.1*
CLHEP::mm;
 
   98           static const double rhoOuterAccordionWithSafety = ROUT_AC - rhoAlignmentSafety;
 
  101           static const double zMaxAccordionWithSafety = LArEMBZmax - 10.*
CLHEP::mm;
 
  106           G4StepPoint* pre_step_point = 
step->GetPreStepPoint();
 
  107           G4StepPoint* post_step_point = 
step->GetPostStepPoint();
 
  109           G4ThreeVector startPoint = pre_step_point->GetPosition();
 
  110           G4ThreeVector endPoint   = post_step_point->GetPosition();
 
  111           G4ThreeVector 
p = (startPoint + endPoint) * 0.5;
 
  113           G4double 
rho = 
p.perp();
 
  114           G4double 
eta = fabs( 
p.pseudoRapidity() );
 
  115           G4double 
phi = 
p.phi();
 
  119           G4int subdet = ( 
p.z() > 0.) ? 4 : -4;
 
  125           G4int 
type = INT_MIN;
 
  126           G4int sampling = INT_MIN;
 
  127           G4int region = INT_MIN;
 
  131           if(std::fabs(
p.z())< 10 &&  eta < 0.1 && rho > rhoMinPresamplerMother && 
rho < ROUT_AC )
 
  140               if ( 
rho < RIN_AC )      { sampling = 0; }
 
  141               else if ( 
rho < RCUT12 ) { sampling = 1; }
 
  142               else if ( 
rho < RCUT23 ) { sampling = 2; }
 
  143               else                     { sampling = 3; }
 
  156                   if ( 
rho < rhoInFrontOfColdWall ) 
 
  168                   else if ( 
rho < rhoMiddlePresampler )
 
  178                   else if ( 
rho < rhoOuterAccordionWithSafety &&
 
  179                             fabs( 
p.z()) < zMaxAccordionWithSafety )
 
  205               else if ( 
eta < 1.6 )
 
  211               else if ( 
eta < 1.8 )
 
  217               else if ( 
eta < 3.2 )
 
  232           if ( 
type     == INT_MIN  ||
 
  234                sampling == INT_MIN  ||
 
  238 #if defined (DEBUG_VOLUMES) || defined (DEBUG_HITS) 
  239               constexpr G4int messageMax = 10;
 
  240               static std::atomic<G4int> messageCount = 0;
 
  241               if ( messageCount++ < messageMax )
 
  243                   std::cout << 
"LArG4::BarrelCryostat::CalibrationLArCalculator::Process" 
  244                             << 
" (error " << messageCount << 
" of " << messageMax << 
" max displayed)" 
  246                             << 
"   G4Step in LAr at unexpected place: (x,y,z) [mm] = (" 
  251                             << 
", phi=" << 
phi << std::endl
 
  252                             << 
"   using default calculator" 
  274       std::cout << 
"LArG4::BarrelCryostat::CalibrationLArCalculator::Process" 
  277                 << 
" energies=(" << energies[0]
 
  278                 << 
"," << energies[1]
 
  279                 << 
"," << energies[2]
 
  280                 << 
"," << energies[3] << 
")"