21 #include "G4StepPoint.hh"
22 #include "G4VPhysicalVolume.hh"
23 #include "G4ThreeVector.hh"
33 namespace BarrelCryostat {
41 , m_backupCalculator(
"BarrelCryostatCalibrationLArCalculator",
name)
50 return StatusCode::SUCCESS;
80 std::vector<G4double> & energies,
92 for (
unsigned int i=0;
i != 4;
i++) energies.push_back( 0. );
108 constexpr
double oneOverDeta = 10.;
109 constexpr
double oneOverDphi = 32./
M_PI;
112 G4VPhysicalVolume* physical =
step->GetPreStepPoint()->GetPhysicalVolume();
114 G4String volumeName = physical->GetLogicalVolume()->GetName();
116 G4StepPoint* pre_step_point =
step->GetPreStepPoint();
117 G4StepPoint* post_step_point =
step->GetPostStepPoint();
119 G4ThreeVector startPoint = pre_step_point->GetPosition();
120 G4ThreeVector endPoint = post_step_point->GetPosition();
121 G4ThreeVector
p = (startPoint + endPoint) * 0.5;
123 G4double
rho =
p.perp();
124 G4double eta = fabs(
p.pseudoRapidity() );
125 G4double phi =
p.phi();
126 if ( phi < 0. ) phi += 2.*
M_PI;
130 G4int sampling = INT_MIN;
131 G4int region = INT_MIN;
134 G4int subdet = (
p.z() > 0.) ? 4 : -4;
136 G4int
phiBin = (
int) ( phi * oneOverDphi );
139 constexpr
double rho12 = 1386.+10.;
157 else if ( eta < 1.5 )
169 etaBin = (
int) ( (eta-1.) * oneOverDeta );
172 else if ( eta < 1.6 )
176 etaBin = (
int) ( (eta-1.5) * oneOverDeta );
178 else if ( eta < 1.8 )
182 etaBin = (
int) ( (eta-1.5) * oneOverDeta );
188 etaBin = (
int) ( (eta-1.3) * oneOverDeta );
195 if (
type == INT_MIN ||
197 sampling == INT_MIN ||
201 #if defined (DEBUG_VOLUMES) || defined (DEBUG_HITS)
202 constexpr G4int messageMax = 10;
203 static std::atomic<G4int> messageCount = 0;
204 if ( messageCount++ < messageMax )
206 std::cout <<
"LArG4::BarrelCryostat::CalibrationMixedCalculator::Process"
207 <<
" (error " << messageCount <<
" of " << messageMax <<
" max displayed)"
210 <<
step->GetPreStepPoint()->GetPhysicalVolume()->GetName()
211 <<
"', using backup calculator"
233 std::cout <<
"LArG4::BarrelCryostat::CalibrationMixedCalculator::Process"
236 <<
" energies=(" << energies[0]
237 <<
"," << energies[1]
238 <<
"," << energies[2]
239 <<
"," << energies[3] <<
")"