Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:01

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 "G4VProcess.hh"
0052 
0053 class G4Material;
0054 class G4ParticleDefinition;
0055 class G4PhysicsTable;
0056 class G4Step;
0057 class G4Track;
0058 class G4VParticleChange;
0059 
0060 class G4Cerenkov : public G4VProcess
0061 {
0062  public:
0063   explicit G4Cerenkov(const G4String& processName = "Cerenkov",
0064                       G4ProcessType type          = fElectromagnetic);
0065   ~G4Cerenkov();
0066 
0067   explicit G4Cerenkov(const G4Cerenkov& right);
0068 
0069   G4Cerenkov& operator=(const G4Cerenkov& right) = delete;
0070 
0071   G4bool IsApplicable(const G4ParticleDefinition& aParticleType) override;
0072   // Returns true -> 'is applicable', for all charged particles
0073   // except short-lived particles.
0074 
0075   void BuildPhysicsTable(const G4ParticleDefinition& aParticleType) override;
0076   // Build table at a right time
0077 
0078   void PreparePhysicsTable(const G4ParticleDefinition& part) override;
0079   void Initialise();
0080 
0081   G4double GetMeanFreePath(const G4Track& aTrack, G4double, G4ForceCondition*);
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   //  no operation in  AtRestDoIt and  AlongStepDoIt
0095   virtual G4double AlongStepGetPhysicalInteractionLength(
0096     const G4Track&, G4double, G4double, G4double&, G4GPILSelection*) override
0097   {
0098     return -1.0;
0099   };
0100 
0101   virtual G4double AtRestGetPhysicalInteractionLength(
0102     const G4Track&, G4ForceCondition*) override
0103   {
0104     return -1.0;
0105   };
0106 
0107   //  no operation in  AtRestDoIt and  AlongStepDoIt
0108   virtual G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&) override
0109   {
0110     return nullptr;
0111   };
0112 
0113   virtual G4VParticleChange* AlongStepDoIt(const G4Track&,
0114                                            const G4Step&) override
0115   {
0116     return nullptr;
0117   };
0118 
0119   void SetTrackSecondariesFirst(const G4bool state);
0120   // If set, the primary particle tracking is interrupted and any
0121   // produced Cerenkov photons are tracked next. When all have
0122   // been tracked, the tracking of the primary resumes.
0123 
0124   G4bool GetTrackSecondariesFirst() const;
0125   // Returns the boolean flag for tracking secondaries first.
0126 
0127   void SetMaxBetaChangePerStep(const G4double d);
0128   // Set the maximum allowed change in beta = v/c in % (perCent) per step.
0129 
0130   G4double GetMaxBetaChangePerStep() const;
0131   // Returns the maximum allowed change in beta = v/c in % (perCent)
0132 
0133   void SetMaxNumPhotonsPerStep(const G4int NumPhotons);
0134   // Set the maximum number of Cerenkov photons allowed to be generated during
0135   // a tracking step. This is an average ONLY; the actual number will vary
0136   // around this average. If invoked, the maximum photon stack will roughly be
0137   // of the size set. If not called, the step is not limited by the number of
0138   // photons generated.
0139 
0140   G4int GetMaxNumPhotonsPerStep() const;
0141   // Returns the maximum number of Cerenkov photons allowed to be
0142   // generated during a tracking step.
0143 
0144   void SetStackPhotons(const G4bool);
0145   // Call by the user to set the flag for stacking the scint. photons
0146 
0147   G4bool GetStackPhotons() const;
0148   // Return the boolean for whether or not the scint. photons are stacked
0149 
0150   G4int GetNumPhotons() const;
0151   // Returns the current number of scint. photons (after PostStepDoIt)
0152 
0153   G4PhysicsTable* GetPhysicsTable() const;
0154   // Returns the address of the physics table.
0155 
0156   void DumpPhysicsTable() const;
0157   // Prints the physics table.
0158 
0159   G4double GetAverageNumberOfPhotons(const G4double charge, const G4double beta,
0160                                      const G4Material* aMaterial,
0161                                      G4MaterialPropertyVector* Rindex) const;
0162 
0163   void DumpInfo() const override {ProcessDescription(G4cout);};
0164   void ProcessDescription(std::ostream& out) const override;
0165 
0166   void SetVerboseLevel(G4int);
0167   // sets verbosity
0168 
0169  protected:
0170   G4PhysicsTable* thePhysicsTable;
0171 
0172  private:
0173   G4double fMaxBetaChange;
0174   
0175   G4int fMaxPhotons;
0176   G4int fNumPhotons;
0177 
0178   G4bool fStackingFlag;
0179   G4bool fTrackSecondariesFirst;
0180 
0181   G4int secID = -1;  // creator modelID
0182 
0183 };
0184 
0185 inline G4bool G4Cerenkov::GetTrackSecondariesFirst() const
0186 {
0187   return fTrackSecondariesFirst;
0188 }
0189 
0190 inline G4double G4Cerenkov::GetMaxBetaChangePerStep() const
0191 {
0192   return fMaxBetaChange;
0193 }
0194 
0195 inline G4int G4Cerenkov::GetMaxNumPhotonsPerStep() const { return fMaxPhotons; }
0196 
0197 inline G4bool G4Cerenkov::GetStackPhotons() const { return fStackingFlag; }
0198 
0199 inline G4int G4Cerenkov::GetNumPhotons() const { return fNumPhotons; }
0200 
0201 inline G4PhysicsTable* G4Cerenkov::GetPhysicsTable() const
0202 {
0203   return thePhysicsTable;
0204 }
0205 
0206 #endif /* G4Cerenkov_h */