21 #include "G4StepPoint.hh"
22 #include "G4VPhysicalVolume.hh"
23 #include "G4ThreeVector.hh"
33 namespace BarrelCryostat {
47 return StatusCode::SUCCESS;
69 std::vector<G4double> & energies,
80 for (
unsigned int i=0;
i != 4;
i++) energies.push_back( 0. );
96 constexpr
double oneOverDeta = 10.;
97 constexpr
double oneOverDphi = 32./
M_PI;
100 G4VPhysicalVolume* physical =
step->GetPreStepPoint()->GetPhysicalVolume();
102 G4String volumeName = physical->GetLogicalVolume()->GetName();
104 G4StepPoint* pre_step_point =
step->GetPreStepPoint();
105 G4StepPoint* post_step_point =
step->GetPostStepPoint();
107 G4ThreeVector startPoint = pre_step_point->GetPosition();
108 G4ThreeVector endPoint = post_step_point->GetPosition();
109 G4ThreeVector
p = (startPoint + endPoint) * 0.5;
111 G4double
rho =
p.perp();
112 G4double eta = fabs(
p.pseudoRapidity() );
113 G4double phi =
p.phi();
114 if ( phi < 0. ) phi += 2.*
M_PI;
118 G4int sampling = INT_MIN;
119 G4int region = INT_MIN;
122 G4int subdet = (
p.z() > 0.) ? 4 : -4;
124 G4int
phiBin = (
int) ( phi * oneOverDphi );
127 constexpr
double rho12 = 1386.+10.;
145 else if ( eta < 1.5 )
157 etaBin = (
int) ( (eta-1.) * oneOverDeta );
160 else if ( eta < 1.6 )
164 etaBin = (
int) ( (eta-1.5) * oneOverDeta );
166 else if ( eta < 1.8 )
170 etaBin = (
int) ( (eta-1.5) * oneOverDeta );
176 etaBin = (
int) ( (eta-1.3) * oneOverDeta );
183 if (
type == INT_MIN ||
185 sampling == INT_MIN ||
189 #if defined (DEBUG_VOLUMES) || defined (DEBUG_HITS)
190 constexpr G4int messageMax = 10;
191 static std::atomic<G4int> messageCount = 0;
192 if ( messageCount++ < messageMax )
194 std::cout <<
"LArG4::BarrelCryostat::CalibrationMixedCalculator::Process"
195 <<
" (error " << messageCount <<
" of " << messageMax <<
" max displayed)"
198 <<
step->GetPreStepPoint()->GetPhysicalVolume()->GetName()
199 <<
"', using backup calculator"
221 std::cout <<
"LArG4::BarrelCryostat::CalibrationMixedCalculator::Process"
224 <<
" energies=(" << energies[0]
225 <<
"," << energies[1]
226 <<
"," << energies[2]
227 <<
"," << energies[3] <<
")"