Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-04 08:05:19

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