72 {
73
74
75
76
79 }
80 else {
81 for (
unsigned int i=0;
i != 4;
i++) energies.push_back( 0. );
82 }
83
86 {
87
88
89
90
91
92
93
94
95
96
97 constexpr double oneOverDeta = 10.;
98 constexpr double oneOverDphi = 32./
M_PI;
99
100
101 G4VPhysicalVolume* physical =
step->GetPreStepPoint()->GetPhysicalVolume();
102
103 G4String volumeName = physical->GetLogicalVolume()->GetName();
104
105 G4StepPoint* pre_step_point =
step->GetPreStepPoint();
106 G4StepPoint* post_step_point =
step->GetPostStepPoint();
107
108 G4ThreeVector startPoint = pre_step_point->GetPosition();
109 G4ThreeVector endPoint = post_step_point->GetPosition();
110 G4ThreeVector
p = (startPoint + endPoint) * 0.5;
111
112 G4double
rho =
p.perp();
113 G4double
eta = fabs(
p.pseudoRapidity() );
114 G4double
phi =
p.phi();
116
117
118
119 G4int sampling = INT_MIN;
120 G4int region = INT_MIN;
122
123 G4int subdet = (
p.z() > 0.) ? 4 : -4;
127
128 constexpr double rho12 = 1386.+10.;
129
130
132 {
133 if ( rho < rho12)
134 {
135 sampling = 1;
136 region = 1;
138 }
139 else
140 {
141 sampling = 2;
142 region = 0;
144 }
145 }
146 else if (
eta < 1.5 )
147 {
148 if ( rho < rho12)
149 {
150 sampling = 1;
151 region = 1;
153 }
154 else
155 {
156 sampling = 2;
157 region = 2;
159 }
160 }
161 else if (
eta < 1.6 )
162 {
163 sampling = 1;
164 region = 4;
166 }
167 else if (
eta < 1.8 )
168 {
169 sampling = 1;
170 region = 5;
172 }
173 else
174 {
175 sampling = 1;
176 region = 6;
178 }
179
180
181
182
183
184 if ( type == INT_MIN ||
185 region == INT_MIN ||
186 sampling == INT_MIN ||
187 etaBin == INT_MIN ||
188 phiBin < 0 )
189 {
190#if defined (DEBUG_VOLUMES) || defined (DEBUG_HITS)
191 constexpr G4int messageMax = 10;
192 static std::atomic<G4int> messageCount = 0;
193 if ( messageCount++ < messageMax )
194 {
195 std::cout << "LArG4::BarrelCryostat::CalibrationMixedCalculator::Process"
196 << " (error " << messageCount << " of " << messageMax << " max displayed)"
197 << std::endl
198 << " G4Step in '"
199 <<
step->GetPreStepPoint()->GetPhysicalVolume()->GetName()
200 << "', using backup calculator"
201 << std::endl;
202 }
203#endif
205 }
206 else
207 {
208
210 << subdet
211
213 << sampling
214 << region
217 }
218 }
219
220#ifdef DEBUG_HITS
222 std::cout << "LArG4::BarrelCryostat::CalibrationMixedCalculator::Process"
223 << " ID=" << std::string(identifier)
225 << " energies=(" << energies[0]
226 << "," << energies[1]
227 << "," << energies[2]
228 << "," << energies[3] << ")"
229 << std::endl;
230#endif
231
232
233 return ( identifier != LArG4Identifier() );
234 }
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