71 {
72
73
74
75
78 }
79 else {
80 for (
unsigned int i=0;
i != 4;
i++) energies.push_back( 0. );
81 }
82
85 {
86
87
88
89
90
91
92
93
94
95
96 constexpr double oneOverDeta = 10.;
97 constexpr double oneOverDphi = 32./
M_PI;
98
99
100 G4VPhysicalVolume* physical =
step->GetPreStepPoint()->GetPhysicalVolume();
101
102 G4String volumeName = physical->GetLogicalVolume()->GetName();
103
104 G4StepPoint* pre_step_point =
step->GetPreStepPoint();
105 G4StepPoint* post_step_point =
step->GetPostStepPoint();
106
107 G4ThreeVector startPoint = pre_step_point->GetPosition();
108 G4ThreeVector endPoint = post_step_point->GetPosition();
109 G4ThreeVector
p = (startPoint + endPoint) * 0.5;
110
111 G4double
rho =
p.perp();
112 G4double
eta = fabs(
p.pseudoRapidity() );
113 G4double
phi =
p.phi();
115
116
117
118 G4int sampling = INT_MIN;
119 G4int region = INT_MIN;
121
122 G4int subdet = (
p.z() > 0.) ? 4 : -4;
126
127 constexpr double rho12 = 1386.+10.;
128
129
131 {
132 if ( rho < rho12)
133 {
134 sampling = 1;
135 region = 1;
137 }
138 else
139 {
140 sampling = 2;
141 region = 0;
143 }
144 }
145 else if (
eta < 1.5 )
146 {
147 if ( rho < rho12)
148 {
149 sampling = 1;
150 region = 1;
152 }
153 else
154 {
155 sampling = 2;
156 region = 2;
158 }
159 }
160 else if (
eta < 1.6 )
161 {
162 sampling = 1;
163 region = 4;
165 }
166 else if (
eta < 1.8 )
167 {
168 sampling = 1;
169 region = 5;
171 }
172 else
173 {
174 sampling = 1;
175 region = 6;
177 }
178
179
180
181
182
183 if ( type == INT_MIN ||
184 region == INT_MIN ||
185 sampling == INT_MIN ||
186 etaBin == INT_MIN ||
187 phiBin < 0 )
188 {
189#if defined (DEBUG_VOLUMES) || defined (DEBUG_HITS)
190 constexpr G4int messageMax = 10;
191 static std::atomic<G4int> messageCount = 0;
192 if ( messageCount++ < messageMax )
193 {
194 std::cout << "LArG4::BarrelCryostat::CalibrationMixedCalculator::Process"
195 << " (error " << messageCount << " of " << messageMax << " max displayed)"
196 << std::endl
197 << " G4Step in '"
198 <<
step->GetPreStepPoint()->GetPhysicalVolume()->GetName()
199 << "', using backup calculator"
200 << std::endl;
201 }
202#endif
204 }
205 else
206 {
207
209 << subdet
210
212 << sampling
213 << region
216 }
217 }
218
219#ifdef DEBUG_HITS
221 std::cout << "LArG4::BarrelCryostat::CalibrationMixedCalculator::Process"
222 << " ID=" << std::string(identifier)
224 << " energies=(" << energies[0]
225 << "," << energies[1]
226 << "," << energies[2]
227 << "," << energies[3] << ")"
228 << std::endl;
229#endif
230
231
232 return ( identifier != LArG4Identifier() );
233 }
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
CaloG4::SimulationEnergies m_energyCalculator
const std::string process
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setPhiMap phiBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin