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 
0028 #ifndef G4Channeling_h
0029 #define G4Channeling_h 1
0030 
0031 #include "G4ios.hh"
0032 #include "globals.hh"
0033 #include "G4VDiscreteProcess.hh"
0034 #include "G4ChannelingMaterialData.hh"
0035 #include "G4ExtendedMaterial.hh"
0036 #include "G4LogicalCrystalVolume.hh"
0037 
0038 class G4ChannelingTrackData;
0039 
0040 class G4Channeling : public G4VDiscreteProcess
0041 {
0042 public:
0043     
0044     G4Channeling();
0045     virtual ~G4Channeling();
0046     virtual G4VParticleChange* PostStepDoIt(const G4Track&,
0047                                             const G4Step&);
0048     virtual G4bool IsApplicable(const G4ParticleDefinition& aPD){
0049         return(aPD.GetPDGCharge() != 0.);
0050     };
0051     virtual void BuildPhysicsTable(const G4ParticleDefinition&){;};
0052     
0053 protected:
0054     virtual G4double GetMeanFreePath(const G4Track&,
0055                                      G4double,
0056                                      G4ForceCondition*);
0057 
0058 private:
0059     G4ParticleDefinition* GetParticleDefinition(const G4Track& aTrack){
0060         return const_cast<G4ParticleDefinition*>(aTrack.GetParticleDefinition());
0061     }
0062 private:
0063     G4StepPoint* GetPre(const G4Track& aTrack){return aTrack.GetStep()->GetPreStepPoint();}
0064     G4StepPoint* GetPost(const G4Track& aTrack){return aTrack.GetStep()->GetPostStepPoint();}
0065     
0066     
0067 private:
0068     G4ChannelingMaterialData* GetMatData(const G4Track& aTrack){
0069         G4LogicalVolume* aLV = aTrack.GetVolume()->GetLogicalVolume();
0070         if(aLV->IsExtended() == true){
0071             G4ExtendedMaterial* aEM = (G4ExtendedMaterial*) aTrack.GetVolume()->GetLogicalVolume()->GetMaterial();
0072             return (G4ChannelingMaterialData*) aEM->RetrieveExtension("channeling");
0073         }
0074         else{
0075             return nullptr;
0076         }
0077     }
0078     
0079     //----------------------------------------
0080     // Functions for the calculations of
0081     // parameters related to channeling
0082     //----------------------------------------
0083 public:
0084     G4double GetCriticalAngle(const G4Track& aTrack){
0085         return std::sqrt(2.0*GetMatData(aTrack)->GetPot()->GetMaxMin()
0086                          /GetPre(aTrack)->GetTotalEnergy());}
0087     G4double GetOscillationPeriod(const G4Track& aTrack){
0088         return (CLHEP::pi * GetMatData(aTrack)->GetPot()->GetIntSp(0)
0089                 / GetCriticalAngle(aTrack));
0090     }
0091     //----------------------------------------
0092     // Channeling Auxiliary Track Information
0093     //----------------------------------------
0094 private:
0095     G4int fChannelingID;
0096     G4ChannelingTrackData* GetTrackData(const G4Track&);
0097 
0098     //----------------------------------------
0099     // Variables for the integration
0100     // of the particle trajectory
0101     //----------------------------------------
0102 private:
0103     G4bool UpdateIntegrationStep(const G4Track&,
0104                                  G4ThreeVector&,
0105                                  G4double&);
0106     G4bool UpdateParameters(const G4Track&);
0107 
0108     void GetEF(const G4Track&,G4ThreeVector&,G4ThreeVector&);
0109 
0110 public:
0111     void PosToLattice(G4StepPoint* step,G4ThreeVector&);
0112     
0113 public:
0114     G4double GetTransverseVariationMax() {return fTransverseVariationMax;};
0115     void SetTransverseVariationMax(G4double aDouble) {fTransverseVariationMax = aDouble;};
0116     
0117     G4double GetTimeStepMin() {return fTimeStepMin;};
0118     void SetTimeStepMin(G4double aDouble) {fTimeStepMin = aDouble;};
0119     
0120 private:
0121     G4double fTimeStepMin;
0122     G4double fTimeStepMax;
0123 
0124     G4double fTransverseVariationMax;
0125     
0126     const G4ThreeVector k010;
0127     G4ThreeVector fSpin;
0128 };
0129 
0130 #endif
0131 
0132 
0133 
0134 
0135 
0136 
0137 
0138 
0139 
0140