Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-18 08:32:06

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.hh
0027 /// \brief Definition of the Run class
0028 
0029 #ifndef Run_h
0030 #define Run_h 1
0031 
0032 #include "G4Run.hh"
0033 #include "G4ThreeVector.hh"
0034 #include "globals.hh"
0035 
0036 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0037 
0038 class Run : public G4Run
0039 {
0040     // This class accumulates relevant quantities (related to the primay decays)
0041     // collected during the run.
0042     // ( Note: these information are provided via calls of accessor methods of
0043     //         this Run class made by SteppingAction::UserSteppingAction. )
0044     // At the end of a run, the  printInfo  method is called by the run-action
0045     // to print out some summary information (typically: mean, min and max) about
0046     // these quantities. In multithreaded (MT) mode, an object of this class is
0047     // filled up for each working thread, and then merged (automatically by the
0048     // Geant4 kernel) into another object (of this class) owned by the master class;
0049     // the  printInfo  method is then called only for the latter run object.
0050     // Note that, for simplicity and brevity, we avoid histograms and print-out
0051     // instead some statistics (compute by ourself) at the end of the run.
0052   public:
0053     Run();
0054     ~Run();
0055 
0056     // This method is called automatically by the Geant4 kernel (not by the user!)
0057     // at the end of each event. In the case of multithreaded mode, it is called
0058     // only for the Working thread that handled that event.
0059     virtual void RecordEvent(const G4Event* anEvent) override;
0060 
0061     // This method is called automatically by the Geant4 kernel (not by the user!)
0062     // only in the case of multithreaded mode and only for Working threads.
0063     virtual void Merge(const G4Run* aRun) override;
0064 
0065     // This method is called by RunAction::EndOfRunAction : in the case
0066     // of multithreaded mode, only the master thread calls it.
0067     void PrintInfo() const;
0068 
0069     void SetPrimaryParticleId(const G4int inputValue) { fPrimaryParticleId = inputValue; }
0070     void SetPrimaryParticleInitialKineticEnergy(const G4double inputValue)
0071     {
0072       fPrimaryParticleInitialKineticEnergy = inputValue;
0073     }
0074     void SetPrimaryParticleInitialTotalEnergy(const G4double inputValue)
0075     {
0076       fPrimaryParticleInitialTotalEnergy = inputValue;
0077     }
0078     void SetPrimaryParticleInitialMomentum(const G4double inputValue)
0079     {
0080       fPrimaryParticleInitialMomentum = inputValue;
0081     }
0082     void SetPrimaryParticleInitialBeta(const G4double inputValue)
0083     {
0084       fPrimaryParticleInitialBeta = inputValue;
0085     }
0086     void SetPrimaryParticleInitialGamma(const G4double inputValue)
0087     {
0088       fPrimaryParticleInitialGamma = inputValue;
0089     }
0090     void SetPrimaryParticleInitial3Momentum(const G4ThreeVector& inputValue)
0091     {
0092       fPrimaryParticleInitial3Momentum = inputValue;
0093     }
0094     void SetPrimaryParticleInitialPosition(const G4ThreeVector& inputValue)
0095     {
0096       fPrimaryParticleInitialPosition = inputValue;
0097     }
0098     void SetToleranceEPviolations(const G4double inputValue)
0099     {
0100       fToleranceEPviolations = inputValue;
0101     }
0102     void SetToleranceDeltaDecayRadius(const G4double inputValue)
0103     {
0104       fToleranceDeltaDecayRadius = inputValue;
0105     }
0106     void SetIsPreassignedDecayEnabled(const G4bool inputValue)
0107     {
0108       fIsPreassignedDecayEnabled = inputValue;
0109     }
0110     void SetIsBoostToLabEnabled(const G4bool inputValue) { fIsBoostToLabEnabled = inputValue; }
0111 
0112     G4int GetPrimaryParticleId() const { return fPrimaryParticleId; }
0113     G4double GetPrimaryParticleInitialKineticEnergy() const
0114     {
0115       return fPrimaryParticleInitialKineticEnergy;
0116     }
0117     G4double GetPrimaryParticleInitialTotalEnergy() const
0118     {
0119       return fPrimaryParticleInitialTotalEnergy;
0120     }
0121     G4double GetPrimaryParticleInitialMomentum() const { return fPrimaryParticleInitialMomentum; }
0122     G4double GetPrimaryParticleInitialBeta() const { return fPrimaryParticleInitialBeta; }
0123     G4double GetPrimaryParticleInitialGamma() const { return fPrimaryParticleInitialGamma; }
0124     G4ThreeVector GetPrimaryParticleInitial3Momentum() const
0125     {
0126       return fPrimaryParticleInitial3Momentum;
0127     }
0128     G4ThreeVector GetPrimaryParticleInitialPosition() const
0129     {
0130       return fPrimaryParticleInitialPosition;
0131     }
0132     G4double GetToleranceEPviolations() const { return fToleranceEPviolations; }
0133     G4double GetToleranceDeltaDecayRadius() const { return fToleranceDeltaDecayRadius; }
0134     G4bool GetIsPreassignedDecayEnabled() const { return fIsPreassignedDecayEnabled; }
0135     G4bool GetIsBoostToLabEnabled() const { return fIsBoostToLabEnabled; }
0136 
0137     void IncrementNumberDecays() { ++fNumDecays; }
0138     void IncrementNumberBadPrimaryDecays() { ++fNumBadDecays; }
0139     void IncrementNumberUnexpectedDecays() { ++fNumUnexpectedDecays; }
0140     void IncrementNumberEviolations() { ++fNumEviolations; }
0141     void IncrementNumberPviolations() { ++fNumPviolations; }
0142     void IncrementNumber_mc_truth_rPos_deltaMax_above() { ++fNum_mc_truth_rPos_deltaMax_above; }
0143     void IncrementNumber_underestimated_mc_truth_rPos_delta_above()
0144     {
0145       ++fNum_underestimated_mc_truth_rPos_delta_above;
0146     }
0147     void IncrementNumber_overestimated_mc_truth_rPos_delta_above()
0148     {
0149       ++fNum_overestimated_mc_truth_rPos_delta_above;
0150     }
0151     void IncrementNumberLargeUnderestimates() { ++fNumLargeUnderestimates; }
0152     void IncrementNumberLargeOverestimates() { ++fNumLargeOverestimates; }
0153 
0154     G4int GetNumberDecays() const { return fNumDecays; };
0155     G4int GetNumberBadDecays() const { return fNumBadDecays; }
0156     G4int GetNumberUnexpectedDecays() const { return fNumUnexpectedDecays; };
0157     G4int GetNumberEviolations() const { return fNumEviolations; };
0158     G4int GetNumberPviolations() const { return fNumPviolations; };
0159     G4int GetNumber_mc_truth_rPos_deltaMax_above() const
0160     {
0161       return fNum_mc_truth_rPos_deltaMax_above;
0162     }
0163     G4int GetNumberUnderestimated_mc_truth_rPos_delta_above() const
0164     {
0165       return fNum_underestimated_mc_truth_rPos_delta_above;
0166     }
0167     G4int GetNumberOverestimated_mc_truth_rPos_delta_above() const
0168     {
0169       return fNum_overestimated_mc_truth_rPos_delta_above;
0170     }
0171     G4int GetNumberLargeUnderestimates() const { return fNumLargeUnderestimates; }
0172     G4int GetNumberLargeOverestimates() const { return fNumLargeOverestimates; }
0173 
0174     void SetDecayT(const G4double inputValue);
0175     void SetDecayR_mc_truth(const G4double inputValue);
0176     void SetDecayR(const G4double inputValue);
0177     void SetDecayX(const G4double inputValue);
0178     void SetDecayY(const G4double inputValue);
0179     void SetDecayZ(const G4double inputValue);
0180     void SetDeltaDecayR(const G4double inputValue);
0181     void SetDeflectionAngle(const G4double inputValue);
0182     void SetDeltaEkin(const G4double inputValue);
0183     void SetDecayEkin(const G4double inputValue);
0184     void SetDecayPx(const G4double inputValue);
0185     void SetDecayPy(const G4double inputValue);
0186     void SetDecayPz(const G4double inputValue);
0187     void SetDecayEtotViolation(const G4double inputValue);
0188     void SetDecayPxViolation(const G4double inputValue);
0189     void SetDecayPyViolation(const G4double inputValue);
0190     void SetDecayPzViolation(const G4double inputValue);
0191     void SetMaxEkin_deltaMax(const G4double inputValue);
0192     void SetMaxEtot_deltaMax(const G4double inputValue);
0193     void SetMaxP_deltaMax(const G4double inputValue);
0194     void SetMaxPdir_deltaMax(const G4double inputValue);
0195     void SetMaxMass_deltaMax1(const G4double inputValue);
0196     void SetMaxMass_deltaMax2(const G4double inputValue);
0197     void SetMaxMass_deltaMax3(const G4double inputValue);
0198     void SetMaxBeta_deltaMax1(const G4double inputValue);
0199     void SetMaxBeta_deltaMax2(const G4double inputValue);
0200     void SetMaxGamma_deltaMax1(const G4double inputValue);
0201     void SetMaxGamma_deltaMax2(const G4double inputValue);
0202     void SetMaxGamma_deltaMax3(const G4double inputValue);
0203     void SetMaxT_proper_deltaMax(const G4double inputValue);
0204     void SetMaxT_lab_deltaMax(const G4double inputValue);
0205     void SetMaxMc_truth_rPos_deltaMax(const G4double inputValue);
0206     void SetMinUnderestimated_mc_truth_rPos_delta(const G4double inputValue);
0207     void SetMaxOverestimated_mc_truth_rPos_delta(const G4double inputValue);
0208     void SetMinUnderestimated_rDeltaPos(const G4double inputValue);
0209     void SetMaxOverestimated_rDeltaPos(const G4double inputValue);
0210     void SetMaxFloat_rDeltaPos_deltaMax(const G4double inputValue);
0211 
0212     G4double GetSumDecayT() const { return fSumDecayT; }
0213     G4double GetMinDecayT() const { return fMinDecayT; }
0214     G4double GetMaxDecayT() const { return fMaxDecayT; }
0215     G4double GetSumDecayR() const { return fSumDecayR; }
0216     G4double GetMinDecayR() const { return fMinDecayR; }
0217     G4double GetMaxDecayR() const { return fMaxDecayR; }
0218     G4double GetSumDecayX() const { return fSumDecayX; }
0219     G4double GetMinDecayX() const { return fMinDecayX; }
0220     G4double GetMaxDecayX() const { return fMaxDecayX; }
0221     G4double GetSumDecayY() const { return fSumDecayY; }
0222     G4double GetMinDecayY() const { return fMinDecayY; }
0223     G4double GetMaxDecayY() const { return fMaxDecayY; }
0224     G4double GetSumDecayZ() const { return fSumDecayZ; }
0225     G4double GetMinDecayZ() const { return fMinDecayZ; }
0226     G4double GetMaxDecayZ() const { return fMaxDecayZ; }
0227     G4double GetSumDeltaDecayR() const { return fSumDeltaDecayR; }
0228     G4double GetMinDeltaDecayR() const { return fMinDeltaDecayR; }
0229     G4double GetMaxDeltaDecayR() const { return fMaxDeltaDecayR; }
0230     G4double GetSumDeflectionAngle() const { return fSumDeflectionAngle; }
0231     G4double GetMinDeflectionAngle() const { return fMinDeflectionAngle; }
0232     G4double GetMaxDeflectionAngle() const { return fMaxDeflectionAngle; }
0233     G4double GetSumDeltaEkin() const { return fSumDeltaEkin; }
0234     G4double GetMinDeltaEkin() const { return fMinDeltaEkin; }
0235     G4double GetMaxDeltaEkin() const { return fMaxDeltaEkin; }
0236     G4double GetSumDecayEkin() const { return fSumDecayEkin; }
0237     G4double GetMinDecayEkin() const { return fMinDecayEkin; }
0238     G4double GetMaxDecayEkin() const { return fMaxDecayEkin; }
0239     G4double GetSumDecayPx() const { return fSumDecayPx; }
0240     G4double GetMinDecayPx() const { return fMinDecayPx; }
0241     G4double GetMaxDecayPx() const { return fMaxDecayPx; }
0242     G4double GetSumDecayPy() const { return fSumDecayPy; }
0243     G4double GetMinDecayPy() const { return fMinDecayPy; }
0244     G4double GetMaxDecayPy() const { return fMaxDecayPy; }
0245     G4double GetSumDecayPz() const { return fSumDecayPz; }
0246     G4double GetMinDecayPz() const { return fMinDecayPz; }
0247     G4double GetMaxDecayPz() const { return fMaxDecayPz; }
0248     G4double GetSumDecayEtotViolation() const { return fSumDecayEtotViolation; }
0249     G4double GetMinDecayEtotViolation() const { return fMinDecayEtotViolation; }
0250     G4double GetMaxDecayEtotViolation() const { return fMaxDecayEtotViolation; }
0251     G4double GetSumDecayPxViolation() const { return fSumDecayPxViolation; }
0252     G4double GetMinDecayPxViolation() const { return fMinDecayPxViolation; }
0253     G4double GetMaxDecayPxViolation() const { return fMaxDecayPxViolation; }
0254     G4double GetSumDecayPyViolation() const { return fSumDecayPyViolation; }
0255     G4double GetMinDecayPyViolation() const { return fMinDecayPyViolation; }
0256     G4double GetMaxDecayPyViolation() const { return fMaxDecayPyViolation; }
0257     G4double GetSumDecayPzViolation() const { return fSumDecayPzViolation; }
0258     G4double GetMinDecayPzViolation() const { return fMinDecayPzViolation; }
0259     G4double GetMaxDecayPzViolation() const { return fMaxDecayPzViolation; }
0260     G4double GetMaxEkin_deltaMax() const { return fMaxEkin_deltaMax; }
0261     G4double GetMaxEtot_deltaMax() const { return fMaxEtot_deltaMax; }
0262     G4double GetMaxP_deltaMax() const { return fMaxP_deltaMax; }
0263     G4double GetMaxPdir_deltaMax() const { return fMaxPdir_deltaMax; }
0264     G4double GetMaxMass_deltaMax1() const { return fMaxMass_deltaMax1; }
0265     G4double GetMaxMass_deltaMax2() const { return fMaxMass_deltaMax2; }
0266     G4double GetSumMass_deltaMax3() const { return fSumMass_deltaMax3; }
0267     G4double GetMaxMass_deltaMax3() const { return fMaxMass_deltaMax3; }
0268     G4double GetMaxBeta_deltaMax1() const { return fMaxBeta_deltaMax1; }
0269     G4double GetMaxBeta_deltaMax2() const { return fMaxBeta_deltaMax2; }
0270     G4double GetMaxGamma_deltaMax1() const { return fMaxGamma_deltaMax1; }
0271     G4double GetMaxGamma_deltaMax2() const { return fMaxGamma_deltaMax2; }
0272     G4double GetMaxGamma_deltaMax3() const { return fMaxGamma_deltaMax3; }
0273     G4double GetMaxT_proper_deltaMax() const { return fMaxT_proper_deltaMax; }
0274     G4double GetMaxT_lab_deltaMax() const { return fMaxT_lab_deltaMax; }
0275     G4double GetSumMc_truth_rPos_deltaMax() const { return fSumMc_truth_rPos_deltaMax; }
0276     G4double GetMaxMc_truth_rPos_deltaMax() const { return fMaxMc_truth_rPos_deltaMax; }
0277     G4double GetSumUnderestimated_mc_truth_rPos_delta() const
0278     {
0279       return fSumUnderestimated_mc_truth_rPos_delta;
0280     }
0281     G4double GetMinUnderestimated_mc_truth_rPos_delta() const
0282     {
0283       return fMinUnderestimated_mc_truth_rPos_delta;
0284     }
0285     G4double GetSumOverestimated_mc_truth_rPos_delta() const
0286     {
0287       return fSumOverestimated_mc_truth_rPos_delta;
0288     }
0289     G4double GetMaxOverestimated_mc_truth_rPos_delta() const
0290     {
0291       return fMaxOverestimated_mc_truth_rPos_delta;
0292     }
0293     G4double GetSumUnderestimated_rDeltaPos() const { return fSumUnderestimated_rDeltaPos; }
0294     G4double GetMinUnderestimated_rDeltaPos() const { return fMinUnderestimated_rDeltaPos; }
0295     G4double GetSumOverestimated_rDeltaPos() const { return fSumOverestimated_rDeltaPos; }
0296     G4double GetMaxOverestimated_rDeltaPos() const { return fMaxOverestimated_rDeltaPos; }
0297     G4double GetMaxFloat_rDeltaPos_deltaMax() const { return fMaxFloat_rDeltaPos_deltaMax; }
0298 
0299   private:
0300     G4int fNumEvents;
0301 
0302     G4int fPrimaryParticleId;
0303     G4double fPrimaryParticleInitialKineticEnergy;
0304     G4double fPrimaryParticleInitialTotalEnergy;
0305     G4double fPrimaryParticleInitialMomentum;
0306     G4double fPrimaryParticleInitialBeta;
0307     G4double fPrimaryParticleInitialGamma;
0308     G4ThreeVector fPrimaryParticleInitial3Momentum;
0309     G4ThreeVector fPrimaryParticleInitialPosition;
0310     G4double fToleranceEPviolations;
0311     G4double fToleranceDeltaDecayRadius;
0312     G4bool fIsPreassignedDecayEnabled;
0313     G4bool fIsBoostToLabEnabled;
0314 
0315     G4int fNumDecays;
0316     G4int fNumBadDecays;
0317     G4int fNumUnexpectedDecays;
0318     G4int fNumEviolations;
0319     G4int fNumPviolations;
0320     G4int fNum_mc_truth_rPos_deltaMax_above;
0321     G4int fNum_underestimated_mc_truth_rPos_delta_above;
0322     G4int fNum_overestimated_mc_truth_rPos_delta_above;
0323     G4int fNumLargeUnderestimates;
0324     G4int fNumLargeOverestimates;
0325 
0326     G4double fDecayT;
0327     G4double fSumDecayT;
0328     G4double fMinDecayT;
0329     G4double fMaxDecayT;
0330     G4double fDecayR_mc_truth;
0331     G4double fDecayR;
0332     G4double fSumDecayR;
0333     G4double fMinDecayR;
0334     G4double fMaxDecayR;
0335     G4double fDecayX;
0336     G4double fSumDecayX;
0337     G4double fMinDecayX;
0338     G4double fMaxDecayX;
0339     G4double fDecayY;
0340     G4double fSumDecayY;
0341     G4double fMinDecayY;
0342     G4double fMaxDecayY;
0343     G4double fDecayZ;
0344     G4double fSumDecayZ;
0345     G4double fMinDecayZ;
0346     G4double fMaxDecayZ;
0347     G4double fDeltaDecayR;
0348     G4double fSumDeltaDecayR;
0349     G4double fMinDeltaDecayR;
0350     G4double fMaxDeltaDecayR;
0351     G4double fDeflectionAngle;  // in degrees
0352     G4double fSumDeflectionAngle;
0353     G4double fMinDeflectionAngle;
0354     G4double fMaxDeflectionAngle;
0355     G4double fDeltaEkin;
0356     G4double fSumDeltaEkin;
0357     G4double fMinDeltaEkin;
0358     G4double fMaxDeltaEkin;
0359     G4double fDecayEkin;
0360     G4double fSumDecayEkin;
0361     G4double fMinDecayEkin;
0362     G4double fMaxDecayEkin;
0363     G4double fDecayPx;
0364     G4double fSumDecayPx;
0365     G4double fMinDecayPx;
0366     G4double fMaxDecayPx;
0367     G4double fDecayPy;
0368     G4double fSumDecayPy;
0369     G4double fMinDecayPy;
0370     G4double fMaxDecayPy;
0371     G4double fDecayPz;
0372     G4double fSumDecayPz;
0373     G4double fMinDecayPz;
0374     G4double fMaxDecayPz;
0375     G4double fDecayEtotViolation;
0376     G4double fSumDecayEtotViolation;
0377     G4double fMinDecayEtotViolation;
0378     G4double fMaxDecayEtotViolation;
0379     G4double fDecayPxViolation;
0380     G4double fSumDecayPxViolation;
0381     G4double fMinDecayPxViolation;
0382     G4double fMaxDecayPxViolation;
0383     G4double fDecayPyViolation;
0384     G4double fSumDecayPyViolation;
0385     G4double fMinDecayPyViolation;
0386     G4double fMaxDecayPyViolation;
0387     G4double fDecayPzViolation;
0388     G4double fSumDecayPzViolation;
0389     G4double fMinDecayPzViolation;
0390     G4double fMaxDecayPzViolation;
0391     G4double fMaxEkin_deltaMax;
0392     G4double fMaxEtot_deltaMax;
0393     G4double fMaxP_deltaMax;
0394     G4double fMaxPdir_deltaMax;
0395     G4double fMaxMass_deltaMax1;
0396     G4double fMaxMass_deltaMax2;
0397     G4double fSumMass_deltaMax3;
0398     G4double fMaxMass_deltaMax3;
0399     G4double fMaxBeta_deltaMax1;
0400     G4double fMaxBeta_deltaMax2;
0401     G4double fMaxGamma_deltaMax1;
0402     G4double fMaxGamma_deltaMax2;
0403     G4double fMaxGamma_deltaMax3;
0404     G4double fMaxT_proper_deltaMax;
0405     G4double fMaxT_lab_deltaMax;
0406     G4double fSumMc_truth_rPos_deltaMax;
0407     G4double fMaxMc_truth_rPos_deltaMax;
0408     G4double fSumUnderestimated_mc_truth_rPos_delta;
0409     G4double fMinUnderestimated_mc_truth_rPos_delta;
0410     G4double fSumOverestimated_mc_truth_rPos_delta;
0411     G4double fMaxOverestimated_mc_truth_rPos_delta;
0412     G4double fSumUnderestimated_rDeltaPos;
0413     G4double fMinUnderestimated_rDeltaPos;
0414     G4double fSumOverestimated_rDeltaPos;
0415     G4double fMaxOverestimated_rDeltaPos;
0416     G4double fMaxFloat_rDeltaPos_deltaMax;
0417 };
0418 
0419 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0420 
0421 #endif