Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-21 08:29:35

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 /// \file Run.cc
0027 /// \brief Implementation of the Run class
0028 
0029 #include "Run.hh"
0030 
0031 #include "G4Run.hh"
0032 #include "G4RunManager.hh"
0033 #include "G4SystemOfUnits.hh"
0034 
0035 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0036 
0037 Run::Run()
0038   : G4Run(),
0039     fNumEvents(0),
0040     fPrimaryParticleId(0),
0041     fPrimaryParticleInitialKineticEnergy(0.0),
0042     fPrimaryParticleInitialTotalEnergy(0.0),
0043     fPrimaryParticleInitialMomentum(0.0),
0044     fPrimaryParticleInitialBeta(0.0),
0045     fPrimaryParticleInitialGamma(0.0),
0046     fPrimaryParticleInitial3Momentum(G4ThreeVector()),
0047     fPrimaryParticleInitialPosition(G4ThreeVector()),
0048     fToleranceEPviolations(0.0),
0049     fToleranceDeltaDecayRadius(0.0),
0050     fIsPreassignedDecayEnabled(true),
0051     fIsBoostToLabEnabled(true),
0052     fNumDecays(0),
0053     fNumBadDecays(0),
0054     fNumUnexpectedDecays(0),
0055     fNumEviolations(0),
0056     fNumPviolations(0),
0057     fNum_mc_truth_rPos_deltaMax_above(0),
0058     fNum_underestimated_mc_truth_rPos_delta_above(0),
0059     fNum_overestimated_mc_truth_rPos_delta_above(0),
0060     fNumLargeUnderestimates(0),
0061     fNumLargeOverestimates(0),
0062     fDecayT(0.0),
0063     fSumDecayT(0.0),
0064     fMinDecayT(999999.9),
0065     fMaxDecayT(-999999.9),
0066     fDecayR_mc_truth(0.0),
0067     fDecayR(0.0),
0068     fSumDecayR(0.0),
0069     fMinDecayR(999999.9),
0070     fMaxDecayR(-999999.9),
0071     fDecayX(0.0),
0072     fSumDecayX(0.0),
0073     fMinDecayX(999999.9),
0074     fMaxDecayX(-999999.9),
0075     fDecayY(0.0),
0076     fSumDecayY(0.0),
0077     fMinDecayY(999999.9),
0078     fMaxDecayY(-999999.9),
0079     fDecayZ(0.0),
0080     fSumDecayZ(0.0),
0081     fMinDecayZ(999999.9),
0082     fMaxDecayZ(-999999.9),
0083     fDeltaDecayR(0.0),
0084     fSumDeltaDecayR(0.0),
0085     fMinDeltaDecayR(999999.9),
0086     fMaxDeltaDecayR(-999999.9),
0087     fDeflectionAngle(0.0),
0088     fSumDeflectionAngle(0.0),
0089     fMinDeflectionAngle(999999.9),
0090     fMaxDeflectionAngle(-999999.9),
0091     fDeltaEkin(0.0),
0092     fSumDeltaEkin(0.0),
0093     fMinDeltaEkin(999999.9),
0094     fMaxDeltaEkin(-999999.9),
0095     fDecayEkin(0.0),
0096     fSumDecayEkin(0.0),
0097     fMinDecayEkin(999999.9),
0098     fMaxDecayEkin(-999999.9),
0099     fDecayPx(0.0),
0100     fSumDecayPx(0.0),
0101     fMinDecayPx(999999.9),
0102     fMaxDecayPx(-999999.9),
0103     fDecayPy(0.0),
0104     fSumDecayPy(0.0),
0105     fMinDecayPy(999999.9),
0106     fMaxDecayPy(-999999.9),
0107     fDecayPz(0.0),
0108     fSumDecayPz(0.0),
0109     fMinDecayPz(999999.9),
0110     fMaxDecayPz(-999999.9),
0111     fDecayEtotViolation(0.0),
0112     fSumDecayEtotViolation(0.0),
0113     fMinDecayEtotViolation(999999.9),
0114     fMaxDecayEtotViolation(-999999.9),
0115     fDecayPxViolation(0.0),
0116     fSumDecayPxViolation(0.0),
0117     fMinDecayPxViolation(999999.9),
0118     fMaxDecayPxViolation(-999999.9),
0119     fDecayPyViolation(0.0),
0120     fSumDecayPyViolation(0.0),
0121     fMinDecayPyViolation(999999.9),
0122     fMaxDecayPyViolation(-999999.9),
0123     fDecayPzViolation(0.0),
0124     fSumDecayPzViolation(0.0),
0125     fMinDecayPzViolation(999999.9),
0126     fMaxDecayPzViolation(-999999.9),
0127     fMaxEkin_deltaMax(0.0),
0128     fMaxEtot_deltaMax(0.0),
0129     fMaxP_deltaMax(0.0),
0130     fMaxPdir_deltaMax(0.0),
0131     fMaxMass_deltaMax1(0.0),
0132     fMaxMass_deltaMax2(0.0),
0133     fSumMass_deltaMax3(0.0),
0134     fMaxMass_deltaMax3(0.0),
0135     fMaxBeta_deltaMax1(0.0),
0136     fMaxBeta_deltaMax2(0.0),
0137     fMaxGamma_deltaMax1(0.0),
0138     fMaxGamma_deltaMax2(0.0),
0139     fMaxGamma_deltaMax3(0.0),
0140     fMaxT_proper_deltaMax(0.0),
0141     fMaxT_lab_deltaMax(0.0),
0142     fSumMc_truth_rPos_deltaMax(0.0),
0143     fMaxMc_truth_rPos_deltaMax(0.0),
0144     fSumUnderestimated_mc_truth_rPos_delta(0.0),
0145     fMinUnderestimated_mc_truth_rPos_delta(999999.9),
0146     fSumOverestimated_mc_truth_rPos_delta(0.0),
0147     fMaxOverestimated_mc_truth_rPos_delta(-999999.9),
0148     fSumUnderestimated_rDeltaPos(0.0),
0149     fMinUnderestimated_rDeltaPos(999999.9),
0150     fSumOverestimated_rDeltaPos(0.0),
0151     fMaxOverestimated_rDeltaPos(-999999.9),
0152     fMaxFloat_rDeltaPos_deltaMax(-999999.9)
0153 {}
0154 
0155 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0156 
0157 Run::~Run() {}
0158 
0159 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0160 
0161 void Run::RecordEvent(const G4Event* anEvent)
0162 {
0163   // This method is called automatically by the Geant4 kernel (not by the user!)
0164   // at the end of each event : in MT-mode, it is called only for the Working thread
0165   // that handled that event.
0166   G4int nEvt = anEvent->GetEventID();
0167   if (nEvt % 1000 == 0) {
0168     G4cout << std::setprecision(6) << " Event#=" << nEvt << " ; t[ns]=" << fDecayT
0169            << " ; r[mm]=" << fDecayR
0170            << " ; deltaR[mum]=" << (fDecayR_mc_truth - fDecayR) / CLHEP::micrometer
0171            << " ; deltaEkin[MeV]=" << fDeltaEkin << " ; deltaAngle(deg)=" << fDeflectionAngle
0172            << G4endl;
0173   }
0174   G4Run::RecordEvent(anEvent);
0175 }
0176 
0177 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0178 
0179 void Run::Merge(const G4Run* aRun)
0180 {
0181   // This method is called automatically by the Geant4 kernel (not by the user!)
0182   // only in the case of multithreaded mode and only for Working threads.
0183   const Run* localRun = static_cast<const Run*>(aRun);
0184   fNumEvents += localRun->GetNumberOfEvent();
0185 
0186   fPrimaryParticleId = localRun->GetPrimaryParticleId();
0187   fPrimaryParticleInitialKineticEnergy = localRun->GetPrimaryParticleInitialKineticEnergy();
0188   fPrimaryParticleInitialTotalEnergy = localRun->GetPrimaryParticleInitialTotalEnergy();
0189   fPrimaryParticleInitialMomentum = localRun->GetPrimaryParticleInitialMomentum();
0190   fPrimaryParticleInitialBeta = localRun->GetPrimaryParticleInitialBeta();
0191   fPrimaryParticleInitialGamma = localRun->GetPrimaryParticleInitialGamma();
0192   fPrimaryParticleInitial3Momentum = localRun->GetPrimaryParticleInitial3Momentum();
0193   fPrimaryParticleInitialPosition = localRun->GetPrimaryParticleInitialPosition();
0194   fToleranceEPviolations = localRun->GetToleranceEPviolations();
0195   fToleranceDeltaDecayRadius = localRun->GetToleranceDeltaDecayRadius();
0196   fIsPreassignedDecayEnabled = localRun->GetIsPreassignedDecayEnabled();
0197   fIsBoostToLabEnabled = localRun->GetIsBoostToLabEnabled();
0198 
0199   fNumDecays += localRun->GetNumberDecays();
0200   fNumBadDecays += localRun->GetNumberBadDecays();
0201   fNumUnexpectedDecays += localRun->GetNumberUnexpectedDecays();
0202   fNumEviolations += localRun->GetNumberEviolations();
0203   fNumPviolations += localRun->GetNumberPviolations();
0204   fNum_mc_truth_rPos_deltaMax_above += localRun->GetNumber_mc_truth_rPos_deltaMax_above();
0205   fNum_underestimated_mc_truth_rPos_delta_above +=
0206     localRun->GetNumberUnderestimated_mc_truth_rPos_delta_above();
0207   fNum_overestimated_mc_truth_rPos_delta_above +=
0208     localRun->GetNumberOverestimated_mc_truth_rPos_delta_above();
0209   fNumLargeUnderestimates += localRun->GetNumberLargeUnderestimates();
0210   fNumLargeOverestimates += localRun->GetNumberLargeOverestimates();
0211 
0212   fSumDecayT += localRun->GetSumDecayT();
0213   fMinDecayT = std::min(fMinDecayT, localRun->GetMinDecayT());
0214   fMaxDecayT = std::max(fMaxDecayT, localRun->GetMaxDecayT());
0215   fSumDecayR += localRun->GetSumDecayR();
0216   fMinDecayR = std::min(fMinDecayR, localRun->GetMinDecayR());
0217   fMaxDecayR = std::max(fMaxDecayR, localRun->GetMaxDecayR());
0218   fSumDecayX += localRun->GetSumDecayX();
0219   fMinDecayX = std::min(fMinDecayX, localRun->GetMinDecayX());
0220   fMaxDecayX = std::max(fMaxDecayX, localRun->GetMaxDecayX());
0221   fSumDecayY += localRun->GetSumDecayY();
0222   fMinDecayY = std::min(fMinDecayY, localRun->GetMinDecayY());
0223   fMaxDecayY = std::max(fMaxDecayY, localRun->GetMaxDecayY());
0224   fSumDecayZ += localRun->GetSumDecayZ();
0225   fMinDecayZ = std::min(fMinDecayZ, localRun->GetMinDecayZ());
0226   fMaxDecayZ = std::max(fMaxDecayZ, localRun->GetMaxDecayZ());
0227   fSumDeltaDecayR += localRun->GetSumDeltaDecayR();
0228   fMinDeltaDecayR = std::min(fMinDeltaDecayR, localRun->GetMinDeltaDecayR());
0229   fMaxDeltaDecayR = std::max(fMaxDeltaDecayR, localRun->GetMaxDeltaDecayR());
0230   fSumDeflectionAngle += localRun->GetSumDeflectionAngle();
0231   fMinDeflectionAngle = std::min(fMinDeflectionAngle, localRun->GetMinDeflectionAngle());
0232   fMaxDeflectionAngle = std::max(fMaxDeflectionAngle, localRun->GetMaxDeflectionAngle());
0233   fSumDeltaEkin += localRun->GetSumDeltaEkin();
0234   fMinDeltaEkin = std::min(fMinDeltaEkin, localRun->GetMinDeltaEkin());
0235   fMaxDeltaEkin = std::max(fMaxDeltaEkin, localRun->GetMaxDeltaEkin());
0236   fSumDecayEkin += localRun->GetSumDecayEkin();
0237   fMinDecayEkin = std::min(fMinDecayEkin, localRun->GetMinDecayEkin());
0238   fMaxDecayEkin = std::max(fMaxDecayEkin, localRun->GetMaxDecayEkin());
0239   fSumDecayPx += localRun->GetSumDecayPx();
0240   fMinDecayPx = std::min(fMinDecayPx, localRun->GetMinDecayPx());
0241   fMaxDecayPx = std::max(fMaxDecayPx, localRun->GetMaxDecayPx());
0242   fSumDecayPy += localRun->GetSumDecayPy();
0243   fMinDecayPy = std::min(fMinDecayPy, localRun->GetMinDecayPy());
0244   fMaxDecayPy = std::max(fMaxDecayPy, localRun->GetMaxDecayPy());
0245   fSumDecayPz += localRun->GetSumDecayPz();
0246   fMinDecayPz = std::min(fMinDecayPz, localRun->GetMinDecayPz());
0247   fMaxDecayPz = std::max(fMaxDecayPz, localRun->GetMaxDecayPz());
0248   fSumDecayEtotViolation += localRun->GetSumDecayEtotViolation();
0249   fMinDecayEtotViolation = std::min(fMinDecayEtotViolation, localRun->GetMinDecayEtotViolation());
0250   fMaxDecayEtotViolation = std::max(fMaxDecayEtotViolation, localRun->GetMaxDecayEtotViolation());
0251   fSumDecayPxViolation += localRun->GetSumDecayPxViolation();
0252   fMinDecayPxViolation = std::min(fMinDecayPxViolation, localRun->GetMinDecayPxViolation());
0253   fMaxDecayPxViolation = std::max(fMaxDecayPxViolation, localRun->GetMaxDecayPxViolation());
0254   fSumDecayPyViolation += localRun->GetSumDecayPyViolation();
0255   fMinDecayPyViolation = std::min(fMinDecayPyViolation, localRun->GetMinDecayPyViolation());
0256   fMaxDecayPyViolation = std::max(fMaxDecayPyViolation, localRun->GetMaxDecayPyViolation());
0257   fSumDecayPzViolation += localRun->GetSumDecayPzViolation();
0258   fMinDecayPzViolation = std::min(fMinDecayPzViolation, localRun->GetMinDecayPzViolation());
0259   fMaxDecayPzViolation = std::max(fMaxDecayPzViolation, localRun->GetMaxDecayPzViolation());
0260 
0261   fMaxEkin_deltaMax = std::max(fMaxEkin_deltaMax, localRun->GetMaxEkin_deltaMax());
0262   fMaxEtot_deltaMax = std::max(fMaxEtot_deltaMax, localRun->GetMaxEtot_deltaMax());
0263   fMaxP_deltaMax = std::max(fMaxP_deltaMax, localRun->GetMaxP_deltaMax());
0264   fMaxPdir_deltaMax = std::max(fMaxPdir_deltaMax, localRun->GetMaxPdir_deltaMax());
0265   fMaxMass_deltaMax1 = std::max(fMaxMass_deltaMax1, localRun->GetMaxMass_deltaMax1());
0266   fMaxMass_deltaMax2 = std::max(fMaxMass_deltaMax2, localRun->GetMaxMass_deltaMax2());
0267   fMaxMass_deltaMax3 = std::max(fMaxMass_deltaMax3, localRun->GetMaxMass_deltaMax3());
0268   fSumMass_deltaMax3 += localRun->GetSumMass_deltaMax3();
0269   fMaxBeta_deltaMax1 = std::max(fMaxBeta_deltaMax1, localRun->GetMaxBeta_deltaMax1());
0270   fMaxBeta_deltaMax2 = std::max(fMaxBeta_deltaMax2, localRun->GetMaxBeta_deltaMax2());
0271   fMaxGamma_deltaMax1 = std::max(fMaxGamma_deltaMax1, localRun->GetMaxGamma_deltaMax1());
0272   fMaxGamma_deltaMax2 = std::max(fMaxGamma_deltaMax2, localRun->GetMaxGamma_deltaMax2());
0273   fMaxGamma_deltaMax3 = std::max(fMaxGamma_deltaMax3, localRun->GetMaxGamma_deltaMax3());
0274   fMaxT_proper_deltaMax = std::max(fMaxT_proper_deltaMax, localRun->GetMaxT_proper_deltaMax());
0275   fMaxT_lab_deltaMax = std::max(fMaxT_lab_deltaMax, localRun->GetMaxT_lab_deltaMax());
0276   fMaxMc_truth_rPos_deltaMax =
0277     std::max(fMaxMc_truth_rPos_deltaMax, localRun->GetMaxMc_truth_rPos_deltaMax());
0278   fSumMc_truth_rPos_deltaMax += localRun->GetSumMc_truth_rPos_deltaMax();
0279 
0280   fMinUnderestimated_mc_truth_rPos_delta = std::min(
0281     fMinUnderestimated_mc_truth_rPos_delta, localRun->GetMinUnderestimated_mc_truth_rPos_delta());
0282   fSumUnderestimated_mc_truth_rPos_delta += localRun->GetSumUnderestimated_mc_truth_rPos_delta();
0283   fMaxOverestimated_mc_truth_rPos_delta = std::max(
0284     fMaxOverestimated_mc_truth_rPos_delta, localRun->GetMaxOverestimated_mc_truth_rPos_delta());
0285   fSumOverestimated_mc_truth_rPos_delta += localRun->GetSumOverestimated_mc_truth_rPos_delta();
0286   fMinUnderestimated_rDeltaPos =
0287     std::min(fMinUnderestimated_rDeltaPos, localRun->GetMinUnderestimated_rDeltaPos());
0288   fSumUnderestimated_rDeltaPos += localRun->GetSumUnderestimated_rDeltaPos();
0289   fMaxOverestimated_rDeltaPos =
0290     std::max(fMaxOverestimated_rDeltaPos, localRun->GetMaxOverestimated_rDeltaPos());
0291   fSumOverestimated_rDeltaPos += localRun->GetSumOverestimated_rDeltaPos();
0292 
0293   fMaxFloat_rDeltaPos_deltaMax =
0294     std::max(fMaxFloat_rDeltaPos_deltaMax, localRun->GetMaxFloat_rDeltaPos_deltaMax());
0295 
0296   G4Run::Merge(aRun);
0297 }
0298 
0299 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0300 
0301 void Run::PrintInfo() const
0302 {
0303   // This method is called by RunAction::EndOfRunAction.
0304   // In MT-mode, only the master thread calls it.
0305   const G4double femtosecond = 0.001 * CLHEP::picosecond;
0306   const G4double NN = (fNumDecays > 0 ? G4double(fNumDecays) : 1.0);
0307   G4cout
0308     << std::setprecision(6) << G4endl << G4endl
0309     << " ============ Run::printInfo() =============== \t RunID = " << GetRunID() << G4endl
0310     << " primary PDG code                     = " << fPrimaryParticleId << G4endl
0311     << " primary initial kinetic energy [GeV] = "
0312     << fPrimaryParticleInitialKineticEnergy / CLHEP::GeV << G4endl
0313     << " primary initial total energy [GeV]   = " << fPrimaryParticleInitialTotalEnergy / CLHEP::GeV
0314     << G4endl
0315     << " primary initial momentum [GeV]       = " << fPrimaryParticleInitialMomentum / CLHEP::GeV
0316     << G4endl << " primary initial Lorentz beta         = " << fPrimaryParticleInitialBeta << G4endl
0317     << " primary initial Lorentz gamma        = " << fPrimaryParticleInitialGamma << G4endl
0318     << " primary initial 3 momentum [GeV]     = " << fPrimaryParticleInitial3Momentum / CLHEP::GeV
0319     << G4endl << " primary initial position [mm]        = " << fPrimaryParticleInitialPosition
0320     << G4endl << " toleranceEPviolations [eV]           = " << fToleranceEPviolations / CLHEP::eV
0321     << G4endl
0322     << " toleranceDeltaDecayRadius [mum]      = " << fToleranceDeltaDecayRadius / CLHEP::micrometer
0323     << G4endl << " isPreassignedDecayEnabled            = " << fIsPreassignedDecayEnabled << G4endl
0324     << " isBoostToLabEnabled                  = " << fIsBoostToLabEnabled << G4endl
0325     << " # Events               = " << (fNumEvents > 0 ? fNumEvents : GetNumberOfEvent()) << G4endl
0326     << " # Decays               = " << fNumDecays << G4endl
0327     << "   (# Bad decays        = " << fNumBadDecays << " )" << G4endl
0328     << "   (# Unexpected decays = " << fNumUnexpectedDecays << " )" << G4endl
0329     << " # E violations         = " << fNumEviolations << G4endl
0330     << " # P violations         = " << fNumPviolations << G4endl
0331     << " decay T [ns] : min=" << fMinDecayT << "\t mean=" << fSumDecayT / NN
0332     << "\t max=" << fMaxDecayT << G4endl << " decay R [mm] : min=" << fMinDecayR
0333     << "\t mean=" << fSumDecayR / NN << "\t max=" << fMaxDecayR << G4endl
0334     << " decay X [mm] : min=" << fMinDecayX << "\t mean=" << fSumDecayX / NN
0335     << "\t max=" << fMaxDecayX << G4endl << " decay Y [mm] : min=" << fMinDecayY
0336     << "\t mean=" << fSumDecayY / NN << "\t max=" << fMaxDecayY << G4endl
0337     << " decay Z [mm] : min=" << fMinDecayZ << "\t mean=" << fSumDecayZ / NN
0338     << "\t max=" << fMaxDecayZ << G4endl << " Delta decay R [mm] : min=" << fMinDeltaDecayR
0339     << "\t mean=" << fSumDeltaDecayR / NN << "\t max=" << fMaxDeltaDecayR << G4endl
0340     << " deflection angle [deg] : min=" << fMinDeflectionAngle
0341     << "\t mean=" << fSumDeflectionAngle / NN << "\t max=" << fMaxDeflectionAngle << G4endl
0342     << " Delta Ekin [MeV] : min=" << fMinDeltaEkin << "\t mean=" << fSumDeltaEkin / NN
0343     << "\t max=" << fMaxDeltaEkin << G4endl
0344     << " decay Ekin [GeV] : min=" << fMinDecayEkin / CLHEP::GeV
0345     << "\t mean=" << fSumDecayEkin / NN / CLHEP::GeV << "\t max=" << fMaxDecayEkin / CLHEP::GeV
0346     << G4endl << " decay Px [GeV]   : min=" << fMinDecayPx / CLHEP::GeV
0347     << "\t mean=" << fSumDecayPx / NN / CLHEP::GeV << "\t max=" << fMaxDecayPx / CLHEP::GeV
0348     << G4endl << " decay Py [GeV]   : min=" << fMinDecayPy / CLHEP::GeV
0349     << "\t mean=" << fSumDecayPy / NN / CLHEP::GeV << "\t max=" << fMaxDecayPy / CLHEP::GeV
0350     << G4endl << " decay Pz [GeV]   : min=" << fMinDecayPz / CLHEP::GeV
0351     << "\t mean=" << fSumDecayPz / NN / CLHEP::GeV << "\t max=" << fMaxDecayPz / CLHEP::GeV
0352     << G4endl << " decay Etot violation [MeV] : min=" << fMinDecayEtotViolation
0353     << "\t mean=" << fSumDecayEtotViolation / NN << "\t max=" << fMaxDecayEtotViolation << G4endl
0354     << " decay Px violation [MeV]   : min=" << fMinDecayPxViolation
0355     << "\t mean=" << fSumDecayPxViolation / NN << "\t max=" << fMaxDecayPxViolation << G4endl
0356     << " decay Py violation [MeV]   : min=" << fMinDecayPyViolation
0357     << "\t mean=" << fSumDecayPyViolation / NN << "\t max=" << fMaxDecayPyViolation << G4endl
0358     << " decay Pz violation [MeV]   : min=" << fMinDecayPzViolation
0359     << "\t mean=" << fSumDecayPzViolation / NN << "\t max=" << fMaxDecayPzViolation << G4endl
0360     << " --- Consistency checks --- " << G4endl
0361     << " maxEkin_deltaMax [eV]           = " << fMaxEkin_deltaMax / CLHEP::eV << G4endl
0362     << " maxEtot_deltaMax [eV]           = " << fMaxEtot_deltaMax / CLHEP::eV << G4endl
0363     << " maxP_deltaMax [eV]              = " << fMaxP_deltaMax / CLHEP::eV << G4endl
0364     << " maxPdir_deltaMax                = " << fMaxPdir_deltaMax << G4endl
0365     << " maxMass_deltaMax{1,2,3} [eV]    = " << fMaxMass_deltaMax1 / CLHEP::eV << " , "
0366     << fMaxMass_deltaMax2 / CLHEP::eV << " , " << fMaxMass_deltaMax3 / CLHEP::eV
0367     << " (mean=" << fSumMass_deltaMax3 / NN / CLHEP::eV << ")" << G4endl
0368     << " maxBeta_deltaMax{1,2}           = " << fMaxBeta_deltaMax1 << " , " << fMaxBeta_deltaMax2
0369     << G4endl << " maxGamma_deltaMax{1,2,3}        = " << fMaxGamma_deltaMax1 << " , "
0370     << fMaxGamma_deltaMax2 << " , " << fMaxGamma_deltaMax3 << G4endl
0371     << " maxT_proper_deltaMax [fs]       = " << fMaxT_proper_deltaMax / femtosecond << G4endl
0372     << " maxT_lab_deltaMax [fs]          = " << fMaxT_lab_deltaMax / femtosecond << G4endl
0373     << " maxMc_truth_rPos_deltaMax [mum] = " << fMaxMc_truth_rPos_deltaMax / CLHEP::micrometer
0374     << " (mean=" << fSumMc_truth_rPos_deltaMax / NN / CLHEP::micrometer
0375     << ")\t (# above threshold = " << fNum_mc_truth_rPos_deltaMax_above << ")" << G4endl
0376     << " --- Extra checks --- " << G4endl << " minUnderestimated_mc_truth_rPos_delta [mum] = "
0377     << fMinUnderestimated_mc_truth_rPos_delta / CLHEP::micrometer
0378     << " (mean=" << fSumUnderestimated_mc_truth_rPos_delta / NN / CLHEP::micrometer
0379     << ")\t (#above threshold = " << fNum_underestimated_mc_truth_rPos_delta_above << ")" << G4endl
0380     << " maxOverestimated_mc_truth_rPos_delta [mum]  = "
0381     << fMaxOverestimated_mc_truth_rPos_delta / CLHEP::micrometer
0382     << " (mean=" << fSumOverestimated_mc_truth_rPos_delta / NN / CLHEP::micrometer
0383     << ")\t (#above threshold = " << fNum_overestimated_mc_truth_rPos_delta_above << ")" << G4endl
0384     << " minUnderestimated_rDeltaPos [mum]           = "
0385     << fMinUnderestimated_rDeltaPos / CLHEP::micrometer
0386     << " (mean=" << fSumUnderestimated_rDeltaPos / NN / CLHEP::micrometer
0387     << ")\t (#above threshold = " << fNumLargeUnderestimates << ")" << G4endl
0388     << " maxOverestimated_rDeltaPos [mum]            = "
0389     << fMaxOverestimated_rDeltaPos / CLHEP::micrometer
0390     << " (mean=" << fSumOverestimated_rDeltaPos / NN / CLHEP::micrometer
0391     << ")\t (#above threshold = " << fNumLargeOverestimates << ")" << G4endl
0392     << " --- float  instead of  double --- " << G4endl
0393     << " fMaxFloat_rDeltaPos_deltaMax [mum] = " << fMaxFloat_rDeltaPos_deltaMax / CLHEP::micrometer
0394     << G4endl << " ============================================= " << G4endl << G4endl;
0395 }
0396 
0397 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0398 
0399 void Run::SetDecayT(const G4double inputValue)
0400 {
0401   fDecayT = inputValue;
0402   fSumDecayT += inputValue;
0403   fMinDecayT = std::min(fMinDecayT, inputValue);
0404   fMaxDecayT = std::max(fMaxDecayT, inputValue);
0405 }
0406 
0407 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0408 
0409 void Run::SetDecayR_mc_truth(const G4double inputValue)
0410 {
0411   fDecayR_mc_truth = inputValue;
0412 }
0413 
0414 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0415 
0416 void Run::SetDecayR(const G4double inputValue)
0417 {
0418   fDecayR = inputValue;
0419   fSumDecayR += inputValue;
0420   fMinDecayR = std::min(fMinDecayR, inputValue);
0421   fMaxDecayR = std::max(fMaxDecayR, inputValue);
0422 }
0423 
0424 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0425 
0426 void Run::SetDecayX(const G4double inputValue)
0427 {
0428   fDecayX = inputValue;
0429   fSumDecayX += inputValue;
0430   fMinDecayX = std::min(fMinDecayX, inputValue);
0431   fMaxDecayX = std::max(fMaxDecayX, inputValue);
0432 }
0433 
0434 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0435 
0436 void Run::SetDecayY(const G4double inputValue)
0437 {
0438   fDecayY = inputValue;
0439   fSumDecayY += inputValue;
0440   fMinDecayY = std::min(fMinDecayY, inputValue);
0441   fMaxDecayY = std::max(fMaxDecayY, inputValue);
0442 }
0443 
0444 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0445 
0446 void Run::SetDecayZ(const G4double inputValue)
0447 {
0448   fDecayZ = inputValue;
0449   fSumDecayZ += inputValue;
0450   fMinDecayZ = std::min(fMinDecayZ, inputValue);
0451   fMaxDecayZ = std::max(fMaxDecayZ, inputValue);
0452 }
0453 
0454 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0455 
0456 void Run::SetDeltaDecayR(const G4double inputValue)
0457 {
0458   fDeltaDecayR = inputValue;
0459   fSumDeltaDecayR += inputValue;
0460   fMinDeltaDecayR = std::min(fMinDeltaDecayR, inputValue);
0461   fMaxDeltaDecayR = std::max(fMaxDeltaDecayR, inputValue);
0462 }
0463 
0464 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0465 
0466 void Run::SetDeflectionAngle(const G4double inputValue)
0467 {
0468   fDeflectionAngle = inputValue;
0469   fSumDeflectionAngle += inputValue;
0470   fMinDeflectionAngle = std::min(fMinDeflectionAngle, inputValue);
0471   fMaxDeflectionAngle = std::max(fMaxDeflectionAngle, inputValue);
0472 }
0473 
0474 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0475 
0476 void Run::SetDeltaEkin(const G4double inputValue)
0477 {
0478   fDeltaEkin = inputValue;
0479   fSumDeltaEkin += inputValue;
0480   fMinDeltaEkin = std::min(fMinDeltaEkin, inputValue);
0481   fMaxDeltaEkin = std::max(fMaxDeltaEkin, inputValue);
0482 }
0483 
0484 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0485 
0486 void Run::SetDecayEkin(const G4double inputValue)
0487 {
0488   fDecayEkin = inputValue;
0489   fSumDecayEkin += inputValue;
0490   fMinDecayEkin = std::min(fMinDecayEkin, inputValue);
0491   fMaxDecayEkin = std::max(fMaxDecayEkin, inputValue);
0492 }
0493 
0494 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0495 
0496 void Run::SetDecayPx(const G4double inputValue)
0497 {
0498   fDecayPx = inputValue;
0499   fSumDecayPx += inputValue;
0500   fMinDecayPx = std::min(fMinDecayPx, inputValue);
0501   fMaxDecayPx = std::max(fMaxDecayPx, inputValue);
0502 }
0503 
0504 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0505 
0506 void Run::SetDecayPy(const G4double inputValue)
0507 {
0508   fDecayPy = inputValue;
0509   fSumDecayPy += inputValue;
0510   fMinDecayPy = std::min(fMinDecayPy, inputValue);
0511   fMaxDecayPy = std::max(fMaxDecayPy, inputValue);
0512 }
0513 
0514 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0515 
0516 void Run::SetDecayPz(const G4double inputValue)
0517 {
0518   fDecayPz = inputValue;
0519   fSumDecayPz += inputValue;
0520   fMinDecayPz = std::min(fMinDecayPz, inputValue);
0521   fMaxDecayPz = std::max(fMaxDecayPz, inputValue);
0522 }
0523 
0524 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0525 
0526 void Run::SetDecayEtotViolation(const G4double inputValue)
0527 {
0528   fDecayEtotViolation = inputValue;
0529   fSumDecayEtotViolation += inputValue;
0530   fMinDecayEtotViolation = std::min(fMinDecayEtotViolation, inputValue);
0531   fMaxDecayEtotViolation = std::max(fMaxDecayEtotViolation, inputValue);
0532 }
0533 
0534 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0535 
0536 void Run::SetDecayPxViolation(const G4double inputValue)
0537 {
0538   fDecayPxViolation = inputValue;
0539   fSumDecayPxViolation += inputValue;
0540   fMinDecayPxViolation = std::min(fMinDecayPxViolation, inputValue);
0541   fMaxDecayPxViolation = std::max(fMaxDecayPxViolation, inputValue);
0542 }
0543 
0544 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0545 
0546 void Run::SetDecayPyViolation(const G4double inputValue)
0547 {
0548   fDecayPyViolation = inputValue;
0549   fSumDecayPyViolation += inputValue;
0550   fMinDecayPyViolation = std::min(fMinDecayPyViolation, inputValue);
0551   fMaxDecayPyViolation = std::max(fMaxDecayPyViolation, inputValue);
0552 }
0553 
0554 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0555 
0556 void Run::SetDecayPzViolation(const G4double inputValue)
0557 {
0558   fDecayPzViolation = inputValue;
0559   fSumDecayPzViolation += inputValue;
0560   fMinDecayPzViolation = std::min(fMinDecayPzViolation, inputValue);
0561   fMaxDecayPzViolation = std::max(fMaxDecayPzViolation, inputValue);
0562 }
0563 
0564 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0565 
0566 void Run::SetMaxEkin_deltaMax(const G4double inputValue)
0567 {
0568   fMaxEkin_deltaMax = std::max(fMaxEkin_deltaMax, inputValue);
0569 }
0570 
0571 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0572 
0573 void Run::SetMaxEtot_deltaMax(const G4double inputValue)
0574 {
0575   fMaxEtot_deltaMax = std::max(fMaxEtot_deltaMax, inputValue);
0576 }
0577 
0578 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0579 
0580 void Run::SetMaxP_deltaMax(const G4double inputValue)
0581 {
0582   fMaxP_deltaMax = std::max(fMaxP_deltaMax, inputValue);
0583 }
0584 
0585 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0586 
0587 void Run::SetMaxPdir_deltaMax(const G4double inputValue)
0588 {
0589   fMaxPdir_deltaMax = std::max(fMaxPdir_deltaMax, inputValue);
0590 }
0591 
0592 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0593 
0594 void Run::SetMaxMass_deltaMax1(const G4double inputValue)
0595 {
0596   fMaxMass_deltaMax1 = std::max(fMaxMass_deltaMax1, inputValue);
0597 }
0598 
0599 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0600 
0601 void Run::SetMaxMass_deltaMax2(const G4double inputValue)
0602 {
0603   fMaxMass_deltaMax2 = std::max(fMaxMass_deltaMax2, inputValue);
0604 }
0605 
0606 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0607 
0608 void Run::SetMaxMass_deltaMax3(const G4double inputValue)
0609 {
0610   fSumMass_deltaMax3 += inputValue;
0611   fMaxMass_deltaMax3 = std::max(fMaxMass_deltaMax3, inputValue);
0612 }
0613 
0614 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0615 
0616 void Run::SetMaxBeta_deltaMax1(const G4double inputValue)
0617 {
0618   fMaxBeta_deltaMax1 = std::max(fMaxBeta_deltaMax1, inputValue);
0619 }
0620 
0621 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0622 
0623 void Run::SetMaxBeta_deltaMax2(const G4double inputValue)
0624 {
0625   fMaxBeta_deltaMax2 = std::max(fMaxBeta_deltaMax2, inputValue);
0626 }
0627 
0628 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0629 
0630 void Run::SetMaxGamma_deltaMax1(const G4double inputValue)
0631 {
0632   fMaxGamma_deltaMax1 = std::max(fMaxGamma_deltaMax1, inputValue);
0633 }
0634 
0635 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0636 
0637 void Run::SetMaxGamma_deltaMax2(const G4double inputValue)
0638 {
0639   fMaxGamma_deltaMax2 = std::max(fMaxGamma_deltaMax2, inputValue);
0640 }
0641 
0642 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0643 
0644 void Run::SetMaxGamma_deltaMax3(const G4double inputValue)
0645 {
0646   fMaxGamma_deltaMax3 = std::max(fMaxGamma_deltaMax3, inputValue);
0647 }
0648 
0649 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0650 
0651 void Run::SetMaxT_proper_deltaMax(const G4double inputValue)
0652 {
0653   fMaxT_proper_deltaMax = std::max(fMaxT_proper_deltaMax, inputValue);
0654 }
0655 
0656 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0657 
0658 void Run::SetMaxT_lab_deltaMax(const G4double inputValue)
0659 {
0660   fMaxT_lab_deltaMax = std::max(fMaxT_lab_deltaMax, inputValue);
0661 }
0662 
0663 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0664 
0665 void Run::SetMaxMc_truth_rPos_deltaMax(const G4double inputValue)
0666 {
0667   fSumMc_truth_rPos_deltaMax += inputValue;
0668   fMaxMc_truth_rPos_deltaMax = std::max(fMaxMc_truth_rPos_deltaMax, inputValue);
0669 }
0670 
0671 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0672 
0673 void Run::SetMinUnderestimated_mc_truth_rPos_delta(const G4double inputValue)
0674 {
0675   fSumUnderestimated_mc_truth_rPos_delta += inputValue;
0676   fMinUnderestimated_mc_truth_rPos_delta =
0677     std::min(fMinUnderestimated_mc_truth_rPos_delta, inputValue);
0678 }
0679 
0680 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0681 
0682 void Run::SetMaxOverestimated_mc_truth_rPos_delta(const G4double inputValue)
0683 {
0684   fSumOverestimated_mc_truth_rPos_delta += inputValue;
0685   fMaxOverestimated_mc_truth_rPos_delta =
0686     std::max(fMaxOverestimated_mc_truth_rPos_delta, inputValue);
0687 }
0688 
0689 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0690 
0691 void Run::SetMinUnderestimated_rDeltaPos(const G4double inputValue)
0692 {
0693   fSumUnderestimated_rDeltaPos += inputValue;
0694   fMinUnderestimated_rDeltaPos = std::min(fMinUnderestimated_rDeltaPos, inputValue);
0695 }
0696 
0697 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0698 
0699 void Run::SetMaxOverestimated_rDeltaPos(const G4double inputValue)
0700 {
0701   fSumOverestimated_rDeltaPos += inputValue;
0702   fMaxOverestimated_rDeltaPos = std::max(fMaxOverestimated_rDeltaPos, inputValue);
0703 }
0704 
0705 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0706 
0707 void Run::SetMaxFloat_rDeltaPos_deltaMax(const G4double inputValue)
0708 {
0709   fMaxFloat_rDeltaPos_deltaMax = std::max(fMaxFloat_rDeltaPos_deltaMax, inputValue);
0710 }
0711 
0712 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......