Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:27

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 // G4VSteppingVerbose
0027 //
0028 // Class description:
0029 //
0030 // This class manages the verbose outputs in G4SteppingManager.
0031 // The instance should be a singleton. Users can inherit this
0032 // class to make their own verbosity class.
0033 
0034 // Contact:
0035 //   Questions and comments to this code should be sent to
0036 //     Katsuya Amako  (e-mail: Katsuya.Amako@kek.jp)
0037 //     Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
0038 // --------------------------------------------------------------------
0039 #ifndef G4VSteppingVerbose_hh
0040 #define G4VSteppingVerbose_hh 1
0041 
0042 #include "G4ForceCondition.hh"  // enum 'track'
0043 #include "G4GPILSelection.hh"  // enum 'track'
0044 #include "G4StepStatus.hh"  // Include from 'track'
0045 #include "G4TouchableHandle.hh"
0046 #include "G4TrackVector.hh"  // Include from 'tracking'
0047 #include "G4VProcess.hh"
0048 #include "globals.hh"  // Include from 'global'
0049 
0050 #include "trkgdefs.hh"
0051 
0052 #include <vector>
0053 
0054 class G4SteppingManager;
0055 class G4Navigator;
0056 class G4VPhysicalVolume;
0057 class G4VSensitiveDetector;
0058 class G4ProcessVector;
0059 class G4SteppingManager;
0060 class G4Track;
0061 class G4UserSteppingAction;
0062 class G4StepPoint;
0063 class G4VParticleChange;
0064 
0065 class G4VSteppingVerbose
0066 {
0067  public:
0068   virtual ~G4VSteppingVerbose();
0069 
0070   // static methods to set/get the object's pointer
0071 
0072   static void SetInstance(G4VSteppingVerbose* Instance);
0073   static G4VSteppingVerbose* GetInstance();
0074   static G4VSteppingVerbose* GetMasterInstance();
0075   static G4int GetSilent();
0076   static void SetSilent(G4int fSilent);
0077   static G4int GetSilentStepInfo();
0078   static void SetSilentStepInfo(G4int fSilent);
0079 
0080   virtual G4VSteppingVerbose* Clone();
0081 
0082   // these method are invoked by G4SteppingManager
0083 
0084   virtual void NewStep() = 0;
0085   void CopyState();
0086   virtual void SetManager(G4SteppingManager* const);
0087   virtual void AtRestDoItInvoked() = 0;
0088   virtual void AlongStepDoItAllDone() = 0;
0089   virtual void PostStepDoItAllDone() = 0;
0090   virtual void AlongStepDoItOneByOne() = 0;
0091   virtual void PostStepDoItOneByOne() = 0;
0092   virtual void StepInfo() = 0;
0093   virtual void TrackingStarted() = 0;
0094   virtual void DPSLStarted() = 0;
0095   virtual void DPSLUserLimit() = 0;
0096   virtual void DPSLPostStep() = 0;
0097   virtual void DPSLAlongStep() = 0;
0098   virtual void VerboseTrack() = 0;
0099   virtual void VerboseParticleChange() = 0;
0100 
0101  protected:
0102   G4VSteppingVerbose();  // 'singleton'
0103 
0104   static G4ThreadLocal G4VSteppingVerbose* fInstance;  // pointer to the instance
0105   static G4VSteppingVerbose* fMasterInstance;  // pointer to the instance in master thread
0106   G4TRACKING_DLL static G4ThreadLocal G4int Silent;  // flag for verbosity
0107   G4TRACKING_DLL static G4ThreadLocal G4int SilentStepInfo;  // another flag for verbosity
0108 
0109   G4SteppingManager* fManager = nullptr;
0110   G4UserSteppingAction* fUserSteppingAction = nullptr;
0111 
0112   G4double PhysicalStep = 0.0;
0113   G4double GeometricalStep = 0.0;
0114   G4double CorrectedStep = 0.0;
0115   G4bool PreStepPointIsGeom = false;
0116   G4bool FirstStep = false;
0117   G4StepStatus fStepStatus = fUndefined;
0118 
0119   G4double TempInitVelocity = 0.0;
0120   G4double TempVelocity = 0.0;
0121   G4double Mass = 0.0;
0122 
0123   G4double sumEnergyChange = 0.0;
0124 
0125   G4VParticleChange* fParticleChange = nullptr;
0126   G4Track* fTrack = nullptr;
0127   G4TrackVector* fSecondary = nullptr;
0128   G4Step* fStep = nullptr;
0129   G4StepPoint* fPreStepPoint = nullptr;
0130   G4StepPoint* fPostStepPoint = nullptr;
0131 
0132   G4VPhysicalVolume* fCurrentVolume = nullptr;
0133   G4VSensitiveDetector* fSensitive = nullptr;
0134   G4VProcess* fCurrentProcess = nullptr;  // The pointer to the process whose DoIt() or
0135                                           // GetPhysicalInteractionLength() has been just executed
0136 
0137   G4ProcessVector* fAtRestDoItVector = nullptr;
0138   G4ProcessVector* fAlongStepDoItVector = nullptr;
0139   G4ProcessVector* fPostStepDoItVector = nullptr;
0140 
0141   G4ProcessVector* fAtRestGetPhysIntVector = nullptr;
0142   G4ProcessVector* fAlongStepGetPhysIntVector = nullptr;
0143   G4ProcessVector* fPostStepGetPhysIntVector = nullptr;
0144 
0145   std::size_t MAXofAtRestLoops = 0;
0146   std::size_t MAXofAlongStepLoops = 0;
0147   std::size_t MAXofPostStepLoops = 0;
0148 
0149   G4double currentMinimumStep = 0.0;
0150   G4double numberOfInteractionLengthLeft = 0.0;
0151 
0152   std::size_t fAtRestDoItProcTriggered = 0;
0153   std::size_t fAlongStepDoItProcTriggered = 0;
0154   std::size_t fPostStepDoItProcTriggered = 0;
0155 
0156   G4int fN2ndariesAtRestDoIt = 0;
0157   G4int fN2ndariesAlongStepDoIt = 0;
0158   G4int fN2ndariesPostStepDoIt = 0;
0159   // These are the numbers of secondaries generated by the process
0160   // just executed
0161 
0162   G4Navigator* fNavigator = nullptr;
0163 
0164   G4int verboseLevel = 0;
0165 
0166   using G4SelectedAtRestDoItVector = std::vector<G4int>;
0167   using G4SelectedAlongStepDoItVector = std::vector<G4int>;
0168   using G4SelectedPostStepDoItVector = std::vector<G4int>;
0169 
0170   G4SelectedAtRestDoItVector* fSelectedAtRestDoItVector = nullptr;
0171   G4SelectedAlongStepDoItVector* fSelectedAlongStepDoItVector = nullptr;
0172   G4SelectedPostStepDoItVector* fSelectedPostStepDoItVector = nullptr;
0173 
0174   G4double fPreviousStepSize = 0.0;
0175 
0176   G4TouchableHandle fTouchableHandle;
0177 
0178   G4SteppingControl StepControlFlag = NormalCondition;
0179 
0180   G4double physIntLength = 0.0;
0181   G4ForceCondition fCondition = InActivated;
0182   G4GPILSelection fGPILSelection = NotCandidateForSelection;
0183   // Above three variables are for the method DefinePhysicalStepLength().
0184   // To pass this information to the method Verbose(), they are kept at
0185   // here. Need a more elegant mechanism
0186 };
0187 
0188 #endif