240 if (aStep->GetStepLength() < 1.0e-6)
return;
241 G4StepPoint* prePtr = aStep->GetPreStepPoint();
242 G4StepPoint* postPtr = aStep->GetPostStepPoint();
243 if (prePtr == 0)
return;
244 if (postPtr == 0)
return;
245 G4LogicalVolume *volPre = prePtr->GetPhysicalVolume()->GetLogicalVolume();
246 if (volPre == 0)
return;
248 double zStart = std::nan(
"");
249 double rStart = std::nan(
"");
250 double zWidth = std::nan(
"");
251 double rWidth = std::nan(
"");
252 bool isRelevantRTag =
false;
257 if (volNamePre.find(volR.c_str()) != std::string::npos) {
258 isRelevantRTag =
true;
264 bool isRelevantZTag =
false;
269 if (volNamePre.find(volZ.c_str()) != std::string::npos) {
270 isRelevantZTag =
true;
276 if ((!isRelevantRTag) && (!isRelevantZTag))
return;
282 const double x = 0.5*(prePtr->GetPosition()[0] + postPtr->GetPosition()[0]);
283 const double y = 0.5*(prePtr->GetPosition()[1] + postPtr->GetPosition()[1]);
284 const double z = 0.5*(prePtr->GetPosition()[2] + postPtr->GetPosition()[2]);
285 const double r = std::sqrt(x*x + y*y);
286 double phi = std::atan2(y,x);
287 if (phi < 0.) phi += 2.0*M_PI;
288 unsigned int tag = 0;
289 if (isRelevantRTag) tag =
getTagFromR(r, rStart, rWidth, phi);
290 if (isRelevantZTag) tag =
getTagFromZ(z, zStart, zWidth, phi);
292 if (volNamePre.find(
"Water") != std::string::npos) tag += 1000000;
293 if (volNamePre.find(
"RingSuppIC") != std::string::npos) tag += 2000000;
294 if (volNamePre.find(
"WeldIC0toIC1") != std::string::npos) tag += 3000000;
296 if (it ==
fMap.end()) {
306 const double edd = aStep->GetTotalEnergyDeposit();
307 const G4Track *aTr = aStep->GetTrack();
308 it->second.eDep += edd;
309 it->second.eDepSq += edd*edd;
310 const int pid= aTr->GetParticleDefinition()->GetPDGEncoding();
311 const double zPre = prePtr->GetPosition()[2];
312 const double zPost = postPtr->GetPosition()[2];
313 const double rPre = std::sqrt(prePtr->GetPosition()[0]*prePtr->GetPosition()[0] +
314 prePtr->GetPosition()[1]*prePtr->GetPosition()[1]);
315 const double rPost = std::sqrt(postPtr->GetPosition()[0]*postPtr->GetPosition()[0] +
316 postPtr->GetPosition()[1]*postPtr->GetPosition()[1]);
320 if (
std::abs(aTr->GetParticleDefinition()->GetPDGCharge()) > 1.0e-30) it->second.nEntries += 1;
321 if ((tag == 2072) || (tag == 102072) || (tag == 202072) || (tag == 302072) ||
322 (tag == 402072) || (tag == 402072)) {
324 (
std::abs(aTr->GetParticleDefinition()->GetPDGCharge()) > 1.0e-30)) {
328 aa.
length = aStep->GetStepLength();
334 aa.
eKin = aTr->GetKineticEnergy();
std::vector< std::string > G4NamesInMapZTag
std::vector< double > rStarts
std::vector< LBNFDeDxEntryInCell > fVectSpecialCell
std::vector< double > rWidths
unsigned int getTagFromZ(double z, double zStart, double zWidth, double f) const
std::vector< double > zStarts
std::vector< double > zWidths
std::map< unsigned int, LBNFDeDxCell > fMap
std::vector< std::string > G4NamesInMapRTag
unsigned int getTagFromR(double r, double rStart, double rWidth, double f) const