/scratch0/jsnuveri/BDSIM/BDSIMgit/bdsim/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 "BDSMagField.hh"
00014 #include "BDSTiltOffset.hh"
00015 
00016 #include "G4CachedMagneticField.hh"
00017 #include "G4ChordFinder.hh"
00018 #include "G4EqMagElectricField.hh"
00019 #include "G4FieldManager.hh"
00020 #include "G4LogicalVolume.hh"
00021 #include "G4Mag_UsualEqRhs.hh"
00022 #include "G4Mag_EqRhs.hh"
00023 #include "G4UserLimits.hh"
00024 #include "G4UniformMagField.hh"
00025 
00026 class BDSElement :public BDSAcceleratorComponent
00027 {
00028 public:
00029   BDSElement(G4String      name,
00030              G4double      length, 
00031              G4String      geometry,
00032              G4String      bmap,
00033              G4double      aBmapZOffset,
00034              BDSTiltOffset tiltOffset = BDSTiltOffset());
00035   ~BDSElement();
00036 
00037   // creates a field mesh in global coordinates in case it is given by map
00038   void PrepareField(G4VPhysicalVolume *referenceVolume);
00039 
00040   void AlignComponent(G4ThreeVector& TargetPos, 
00041                       G4RotationMatrix *TargetRot,
00042                       G4RotationMatrix& globalRotation,
00043                       G4ThreeVector& rtot,
00044                       G4ThreeVector& rlast,
00045                       G4ThreeVector& localX,
00046                       G4ThreeVector& localY,
00047                       G4ThreeVector& localZ); 
00048    
00049 private:
00050 
00051   virtual void BuildContainerLogicalVolume();
00052   void SetVisAttributes();  
00053 
00054   void BuildElementMarkerLogicalVolume();
00055   void BuildGeometry();
00056   void PlaceComponents(G4String geometry, G4String bmap);
00057   void BuildMagField(G4bool forceToAllDaughters=false);
00058 
00059   G4String itsGeometry;
00060   G4String itsBmap;
00061 
00062   G4String itsFieldVolName;
00063   G4bool itsFieldIsUniform;
00064   G4ChordFinder* fChordFinder;
00065 
00066   G4MagIntegratorStepper* itsFStepper;
00067   G4EqMagElectricField* itsFEquation;
00068   G4Mag_UsualEqRhs* itsEqRhs;
00069 
00070   BDSMagField *itsMagField;
00071   G4CachedMagneticField *itsCachedMagField;
00072   G4UniformMagField *itsUniformMagField;
00073   G4double itsOuterR;
00074   G4double itsBmapZOffset;
00075   // Volume to align incoming beamline on inside the marker volume
00076   // (set during Geometery construction)
00077   G4VPhysicalVolume* align_in_volume;
00078   // Volume to align outgoing beamline on inside the marker volume
00079   // (set during Geometery construction)
00080   G4VPhysicalVolume* align_out_volume;
00081 
00082 };
00083 
00084 
00085 #endif

Generated on 28 Jun 2015 for BDSIM by  doxygen 1.4.7