include/BDSElement.hh

00001 /* BDSIM code.    Version 1.0
00002    Author: John C. Carter, Royal Holloway, Univ. of London.
00003    Last modified 02.12.2004
00004    Copyright (c) 2004 by J.C.Carter.  ALL RIGHTS RESERVED. 
00005 */
00006 
00007 #ifndef BDSElement_h
00008 #define BDSElement_h 
00009 
00010 #include "globals.hh"
00011 #include "BDSAcceleratorComponent.hh"
00012 #include "BDSMaterials.hh"
00013 #include "G4LogicalVolume.hh"
00014 
00015 #include "G4FieldManager.hh"
00016 #include "G4ChordFinder.hh"
00017 #include "G4Mag_UsualEqRhs.hh"
00018 #include "G4Mag_EqRhs.hh"
00019 #include "G4UserLimits.hh"
00020 #include "G4VisAttributes.hh"
00021 #include "G4UniformMagField.hh"
00022 #include "BDSField.hh"
00023 #include "BDSMagField.hh"
00024 #include "BDSXYMagField.hh"
00025 
00026 #include "G4EqMagElectricField.hh"
00027 #include "G4ClassicalRK4.hh"
00028 #include "BDSRK4Stepper.hh"
00029 
00030 
00031 class BDSElement :public BDSAcceleratorComponent
00032 {
00033 public:
00034   BDSElement(G4String aName, G4String geometry, G4String bmap, G4double aLength, 
00035              G4double bpRad, G4double outR, G4String aTunnelMaterial="", G4double tunnelRadius=0., G4double tunnelOffsetX=BDSGlobalConstants::Instance()->GetTunnelOffsetX(), G4String aTunnelCavityMaterial="Air", int aPrecisionRegion=0);
00036   ~BDSElement();
00037 
00038   void BuildElementMarkerLogicalVolume();
00039   void BuildGeometry();
00040   void PlaceComponents(G4String geometry, G4String bmap);
00041   void BuildMagField(G4bool forceToAllDaughters=false);
00042 
00043   // creates a field mesh in global coordinates in case it is given by map
00044   void PrepareField(G4VPhysicalVolume *referenceVolume);
00045 
00046   void AlignComponent(G4ThreeVector& TargetPos, 
00047                       G4RotationMatrix *TargetRot,
00048                       G4RotationMatrix& globalRotation,
00049                       G4ThreeVector& rtot,
00050                       G4ThreeVector& rlast,
00051                       G4ThreeVector& localX,
00052                       G4ThreeVector& localY,
00053                       G4ThreeVector& localZ); 
00054    
00055 protected:
00056   
00057   G4VisAttributes* SetVisAttributes();  
00058 
00059 private:
00060   G4String itsFieldVolName;
00061   G4bool itsFieldIsUniform;
00062   G4ChordFinder* fChordFinder;
00063 
00064   G4MagIntegratorStepper* itsFStepper;
00065   G4EqMagElectricField* itsFEquation;
00066   G4Mag_UsualEqRhs* itsEqRhs;
00067 
00068   BDSField *itsField;
00069   BDSMagField *itsMagField;
00070   G4UniformMagField *itsUniformMagField;
00071   G4double itsOuterR;
00072   // Volume to align incoming beamline on inside the marker volume
00073   // (set during Geometery construction)
00074   G4VPhysicalVolume* align_in_volume;
00075   // Volume to align outgoing beamline on inside the marker volume
00076   // (set during Geometery construction)
00077   G4VPhysicalVolume* align_out_volume;
00078 
00079 };
00080 
00081 
00082 #endif

Generated on 27 Aug 2013 for BDSIM by  doxygen 1.4.7