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;
87 constexpr double rhoMiddlePresampler = (1385.*CLHEP::mm + 1447.*CLHEP::mm)/2.;
92 constexpr double rhoAlignmentSafety = 10.*CLHEP::mm;
93 constexpr double rhoInFrontOfColdWall = rhoMinPresamplerMother - rhoAlignmentSafety;
94 static const double RIN_AC =
m_parameters->GetValue(
"LArEMBRadiusInnerAccordion");
95 constexpr double RCUT12 = 1593.9*CLHEP::mm;
96 constexpr double RCUT23 = 1866.1*CLHEP::mm;
97 static const double ROUT_AC =
m_parameters->GetValue(
"LArEMBRadiusOuterAccordion");
98 static const double rhoOuterAccordionWithSafety = ROUT_AC - rhoAlignmentSafety;
99 static const double LArEMBZmax =
m_parameters->GetValue(
"LArEMBZmax");
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;
120 G4int phiBin = (int) (
phi * oneOverDphi );
121 if (phiBin>63) phiBin=0;
125 G4int
type = INT_MIN;
126 G4int sampling = INT_MIN;
127 G4int region = INT_MIN;
128 G4int etaBin = 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 )
166 etaBin = (int) (
eta * oneOverDeta );
168 else if ( rho < rhoMiddlePresampler )
176 etaBin = (int) (
eta * oneOverDeta );
178 else if ( rho < rhoOuterAccordionWithSafety &&
179 fabs( p.z()) < zMaxAccordionWithSafety )
187 etaBin = (int) (
eta * oneOverDeta );
196 etaBin = (int) (
eta * oneOverDeta );
201 etaBin = (int) ( (
eta-1.) * oneOverDeta );
205 else if (
eta < 1.6 )
209 etaBin = (int) ( (
eta-1.5) * oneOverDeta );
211 else if (
eta < 1.8 )
215 etaBin = (int) ( (
eta-1.6) * oneOverDeta );
217 else if (
eta < 3.2 )
221 etaBin = (int) ( (
eta-1.8) * oneOverDeta );
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] = ("
247 << p.x()/CLHEP::mm <<
","
248 << p.y()/CLHEP::mm <<
","
251 <<
", phi=" <<
phi << std::endl
252 <<
" using default calculator"
273 G4double energy =
accumulate(energies.begin(),energies.end(),0.);
274 std::cout <<
"LArG4::BarrelCryostat::CalibrationLArCalculator::Process"
275 <<
" ID=" << std::string(identifier)
276 <<
" energy=" << energy
277 <<
" energies=(" << energies[0]
278 <<
"," << energies[1]
279 <<
"," << energies[2]
280 <<
"," << energies[3] <<
")"