Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-25 09:12:50

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 ////////////////////////////////////////////////////////////////////////
0027 // Cerenkov Radiation Class Definition
0028 ////////////////////////////////////////////////////////////////////////
0029 //
0030 // File:        G4Cerenkov.hh
0031 // Description: Discrete Process - Generation of Cerenkov Photons
0032 // Version:     2.0
0033 // Created:     1996-02-21
0034 // Author:      Juliet Armstrong
0035 // Updated:     2007-09-30 change inheritance to G4VDiscreteProcess
0036 //              2005-07-28 add G4ProcessType to constructor
0037 //              1999-10-29 add method and class descriptors
0038 //              1997-04-09 by Peter Gumplinger
0039 //              > G4MaterialPropertiesTable; new physics/tracking scheme
0040 //
0041 ////////////////////////////////////////////////////////////////////////
0042 
0043 #ifndef G4Cerenkov_h
0044 #define G4Cerenkov_h 1
0045 
0046 #include "globals.hh"
0047 #include "G4DynamicParticle.hh"
0048 #include "G4ForceCondition.hh"
0049 #include "G4GPILSelection.hh"
0050 #include "G4MaterialPropertyVector.hh"
0051 #include "G4VDiscreteProcess.hh"
0052 
0053 #include <map>
0054 
0055 class G4Material;
0056 class G4ParticleDefinition;
0057 class G4PhysicsTable;
0058 class G4Step;
0059 class G4Track;
0060 class G4VParticleChange;
0061 
0062 class G4Cerenkov : public G4VDiscreteProcess
0063 {
0064  public:
0065   explicit G4Cerenkov(const G4String& processName = "Cerenkov",
0066                       G4ProcessType type = fElectromagnetic);
0067   ~G4Cerenkov() override;
0068 
0069   G4Cerenkov(const G4Cerenkov& right) = delete;
0070   G4Cerenkov& operator=(const G4Cerenkov& right) = delete;
0071 
0072   G4bool IsApplicable(const G4ParticleDefinition& aParticleType) override;
0073   // Returns true -> 'is applicable', for all charged particles
0074   // except short-lived particles.
0075 
0076   void BuildPhysicsTable(const G4ParticleDefinition& aParticleType) override;
0077   // Build table at a right time
0078 
0079   void PreparePhysicsTable(const G4ParticleDefinition& part) override;
0080 
0081   G4double GetMeanFreePath(const G4Track& aTrack, G4double, G4ForceCondition*) override;
0082   // Returns the discrete step limit and sets the 'StronglyForced'
0083   // condition for the DoIt to be invoked at every step.
0084 
0085   G4double PostStepGetPhysicalInteractionLength(const G4Track& aTrack, G4double,
0086                                                 G4ForceCondition*) override;
0087   // Returns the discrete step limit and sets the 'StronglyForced'
0088   // condition for the DoIt to be invoked at every step.
0089 
0090   G4VParticleChange* PostStepDoIt(const G4Track& aTrack,
0091                                   const G4Step& aStep) override;
0092   // This is the method implementing the Cerenkov process.
0093 
0094   void SetTrackSecondariesFirst(const G4bool state);
0095   // If set, the primary particle tracking is interrupted and any
0096   // produced Cerenkov photons are tracked next. When all have
0097   // been tracked, the tracking of the primary resumes.
0098 
0099   G4bool GetTrackSecondariesFirst() const;
0100   // Returns the boolean flag for tracking secondaries first.
0101 
0102   void SetMaxBetaChangePerStep(const G4double d);
0103   // Set the maximum allowed change in beta = v/c in % (perCent) per step.
0104 
0105   G4double GetMaxBetaChangePerStep() const;
0106   // Returns the maximum allowed change in beta = v/c in % (perCent)
0107 
0108   void SetMaxNumPhotonsPerStep(const G4int NumPhotons);
0109   // Set the maximum number of Cerenkov photons allowed to be generated during
0110   // a tracking step. This is an average ONLY; the actual number will vary
0111   // around this average. If invoked, the maximum photon stack will roughly be
0112   // of the size set. If not called, the step is not limited by the number of
0113   // photons generated.
0114 
0115   G4int GetMaxNumPhotonsPerStep() const;
0116   // Returns the maximum number of Cerenkov photons allowed to be
0117   // generated during a tracking step.
0118 
0119   void SetStackPhotons(const G4bool);
0120   // Call by the user to set the flag for stacking the Cerenkov photons
0121 
0122   G4bool GetStackPhotons() const;
0123   // Return the boolean for whether or not the Cerenkov photons are stacked
0124 
0125   G4int GetNumPhotons() const;
0126   // Returns the current number of scint. photons (after PostStepDoIt)
0127 
0128   G4PhysicsTable* GetPhysicsTable() const;
0129   // Returns the address of the physics table.
0130 
0131   void DumpPhysicsTable() const;
0132   // Prints the physics table.
0133 
0134   G4double GetAverageNumberOfPhotons(const G4double charge, const G4double beta,
0135                                      const G4Material* aMaterial,
0136                                      G4MaterialPropertyVector* Rindex) const;
0137 
0138   void DumpInfo() const override;
0139   void ProcessDescription(std::ostream& out) const override;
0140 
0141   void SetVerboseLevel(G4int);
0142   // sets verbosity
0143 
0144  protected:
0145   G4PhysicsTable* thePhysicsTable;
0146   std::map<std::size_t, std::size_t> fIndexMPT;
0147 
0148  private:
0149   void Initialise();
0150 
0151   G4double fMaxBetaChange;
0152   
0153   G4int fMaxPhotons;
0154   G4int fNumPhotons;
0155 
0156   G4bool fStackingFlag;
0157   G4bool fTrackSecondariesFirst;
0158 
0159   G4int secID = -1;  // creator modelID
0160 };
0161 
0162 inline G4bool G4Cerenkov::GetTrackSecondariesFirst() const
0163 {
0164   return fTrackSecondariesFirst;
0165 }
0166 
0167 inline G4double G4Cerenkov::GetMaxBetaChangePerStep() const
0168 {
0169   return fMaxBetaChange;
0170 }
0171 
0172 inline G4int G4Cerenkov::GetMaxNumPhotonsPerStep() const { return fMaxPhotons; }
0173 
0174 inline G4bool G4Cerenkov::GetStackPhotons() const { return fStackingFlag; }
0175 
0176 inline G4int G4Cerenkov::GetNumPhotons() const { return fNumPhotons; }
0177 
0178 inline G4PhysicsTable* G4Cerenkov::GetPhysicsTable() const
0179 {
0180   return thePhysicsTable;
0181 }
0182 
0183 #endif /* G4Cerenkov_h */