Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4ChannelingFastSimModel.hh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 // Author:      Alexei Sytov
0027 // Co-author:   Gianfranco PaternĂ² (modifications & testing)
0028 // On the base of the CRYSTALRAD realization of channeling model:
0029 // A. I. Sytov, V. V. Tikhomirov, and L. Bandiera PRAB 22, 064601 (2019)
0030 
0031 #ifndef G4ChannelingFastSimModel_h
0032 #define G4ChannelingFastSimModel_h 1
0033 
0034 #include "G4VFastSimulationModel.hh"
0035 #include "globals.hh"
0036 #include "G4ios.hh"
0037 
0038 #include "G4ChannelingFastSimCrystalData.hh"
0039 #include <unordered_map>
0040 #include "G4BaierKatkov.hh"
0041 #include "G4LogicalVolume.hh"
0042 #include "G4ParticleTable.hh"
0043 
0044 /** \file G4ChannelingFastSimModel.hh
0045 * \brief Definition of the G4ChannelingFastSimModel class
0046 * FastSimulation Channeling model: calculates charge particle trajectories
0047 * in oriented crystals in the field of crystal planes/axes either straight or bent.
0048 * It is also possible to simulate radiation using Baier-Katkov method.
0049 */
0050 
0051 class G4ChannelingFastSimModel : public G4VFastSimulationModel
0052 {
0053 public:
0054   // Constructor, destructor
0055   G4ChannelingFastSimModel (const G4String&, G4Region*);
0056   G4ChannelingFastSimModel (const G4String&);
0057   ~G4ChannelingFastSimModel () = default;
0058 
0059   /// -- IsApplicable
0060   G4bool IsApplicable(const G4ParticleDefinition&) override;
0061   /// -- ModelTrigger
0062   G4bool ModelTrigger(const G4FastTrack &) override;
0063   /// -- User method DoIt
0064   void DoIt(const G4FastTrack&, G4FastStep&) override;
0065 
0066   ///special functions
0067   void Input(const G4Material* crystal,
0068              const G4String &lattice)
0069             {Input(crystal,lattice,"");}
0070 
0071   void Input(const G4Material* crystal,
0072              const G4String &lattice,
0073              const G4String &filePath);
0074 
0075   void RadiationModelActivate();
0076 
0077   G4ChannelingFastSimCrystalData* GetCrystalData() {return fCrystalData;}
0078 
0079   G4BaierKatkov* GetRadiationModel() {return fBaierKatkov;}
0080 
0081   G4bool GetIfRadiationModelActive(){return fRad;}
0082 
0083   ///set cuts
0084   void SetLowKineticEnergyLimit(G4double ekinetic, const G4String& particleName)
0085    {fLowEnergyLimit[particleTable->FindParticle(particleName)->
0086               GetParticleDefinitionID()] = ekinetic;}
0087   void SetLindhardAngleNumberHighLimit(G4double angleNumber, const G4String& particleName)
0088    {fLindhardAngleNumberHighLimit[particleTable->FindParticle(particleName)->
0089               GetParticleDefinitionID()]=angleNumber;}
0090   void SetHighAngleLimit(G4double anglemax, const G4String& particleName)
0091    {fHighAngleLimit[particleTable->FindParticle(particleName)->
0092                        GetParticleDefinitionID()] = anglemax;}
0093 
0094   void SetDefaultLowKineticEnergyLimit(G4double ekinetic)
0095            {fDefaultLowEnergyLimit=ekinetic;}
0096   void SetDefaultLindhardAngleNumberHighLimit(G4double angleNumber)
0097            {fDefaultLindhardAngleNumberHighLimit=angleNumber;}
0098   void SetDefaultHighAngleLimit(G4double anglemax)
0099            {fDefaultHighAngleLimit=anglemax;}
0100 
0101 
0102   /// get the maximal number of photons that can be produced per fastStep
0103   /// Caution: is redundant, if the radiation model is not activated
0104   void SetMaxPhotonsProducedPerStep(G4double nPhotons)
0105            {fMaxPhotonsProducedPerStep=nPhotons;}
0106 
0107   ///get cuts
0108   G4double GetLowKineticEnergyLimit(G4int particleDefinitionID)
0109                {return (fLowEnergyLimit.count(particleDefinitionID) == 1)
0110                         ? fLowEnergyLimit[particleDefinitionID]
0111                         : fDefaultLowEnergyLimit;}
0112   G4double GetLindhardAngleNumberHighLimit(G4int particleDefinitionID)
0113                {return (fLindhardAngleNumberHighLimit.count(particleDefinitionID) == 1)
0114                         ? fLindhardAngleNumberHighLimit[particleDefinitionID]
0115                         : fDefaultLindhardAngleNumberHighLimit;}
0116   G4double GetHighAngleLimit(G4int particleDefinitionID)
0117                {return (fHighAngleLimit.count(particleDefinitionID) == 1)
0118                               ? fHighAngleLimit[particleDefinitionID]
0119                               : fDefaultHighAngleLimit;}
0120 
0121   /// get the maximal number of photons that can be produced per fastStep
0122   G4int GetMaxPhotonsProducedPerStep(){return fMaxPhotonsProducedPerStep;}
0123 
0124 private:
0125 
0126   G4ChannelingFastSimCrystalData* fCrystalData{nullptr};
0127   G4BaierKatkov* fBaierKatkov{nullptr};
0128 
0129   G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
0130 
0131   ///flag of radiation model
0132   G4bool fRad = false;
0133 
0134   /// maps of cuts (angular cuts are chosen as std::max of
0135   /// fHighAngleLimit and calculated Lindhard angle)
0136   std::unordered_map<G4int, G4double> fLowEnergyLimit;
0137   std::unordered_map<G4int, G4double> fLindhardAngleNumberHighLimit;
0138   std::unordered_map<G4int, G4double> fHighAngleLimit;
0139 
0140   G4double fDefaultLowEnergyLimit = 200*CLHEP::MeV;
0141   G4double fDefaultLindhardAngleNumberHighLimit = 100.;
0142   G4double fDefaultHighAngleLimit = 0.;
0143 
0144   /// the maximal number of photons that can be produced per fastStep
0145   G4int fMaxPhotonsProducedPerStep=1000.;
0146 
0147 };
0148 #endif
0149 
0150 
0151 
0152