/home/cern/BDSIM_new/include/BDSRBend.hh

00001 //  
00002 //   BDSIM, (C) 2001-2007
00003 //   
00004 //   version 0.4
00005 //  
00006 //
00007 //
00008 //   Rectangular bending magnet class
00009 //   - itsLength parameter internally stores the geometrical length 
00010 //   - itsAngle parameter internally stores the bending angle
00011 //   - to get the arc length use the GetArcLength() function
00012 //   - the volume is a trapezoid with pole faces perpendicular to the ideal
00013 //     orbit
00014 //     
00015 //   History
00016 //
00017 //
00018 
00019 #ifndef BDSRBend_h
00020 #define BDSRBend_h 
00021 
00022 #include "globals.hh"
00023 #include "BDSMaterials.hh"
00024 #include "G4LogicalVolume.hh"
00025 #include "BDSHelixStepper.hh"
00026 #include "myQuadStepper.hh"
00027 
00028 #include "G4FieldManager.hh"
00029 #include "G4ChordFinder.hh"
00030 #include "G4Mag_UsualEqRhs.hh"
00031 #include "G4UserLimits.hh"
00032 #include "G4VisAttributes.hh"
00033 #include "G4PVPlacement.hh"               
00034 
00035 #include "BDSMultipole.hh"
00036 #include "BDSSbendMagField.hh"
00037 #include "G4Mag_EqRhs.hh"
00038 
00039 class BDSRBend :public BDSMultipole
00040 {
00041 public:
00042   BDSRBend(G4String aName, G4double aLength,
00043            G4double bpRad, G4double FeRad,
00044            G4double bField, G4double angle, G4double outR,
00045            G4double tilt = 0, G4double bGrad=0, 
00046            G4String aMaterial = "", G4int nSegments=1);
00047   ~BDSRBend();
00048 
00049   void SynchRescale(G4double factor);
00050 
00051   virtual const G4double GetArcLength() const;
00052 
00053 protected:
00054 
00055 private:
00056   G4double itsBField;
00057   G4double itsBGrad;
00058 
00059   void BuildBPFieldAndStepper();
00060   void BuildRBMarkerLogicalVolume();
00061   void BuildRBBeampipe();
00062   void BuildRBOuterLogicalVolume(G4bool OuterMaterialIsVacuum=false);
00063 
00064   G4VisAttributes* SetVisAttributes();
00065   G4Trd* markerSolidVolume;
00066 
00067   // field related objects:
00068   myQuadStepper* itsStepper;
00069   BDSSbendMagField* itsMagField;
00070   G4Mag_EqRhs* itsEqRhs;
00071 
00072 };
00073 
00074 inline const G4double BDSRBend::GetArcLength() const
00075 {
00076   // arc length = radius*angle
00077   //            = (geometrical length/(2.0*sin(angle/2))*angle
00078   if (itsAngle == 0.0)
00079     return itsLength;
00080   else
00081     return (itsLength * (0.5*itsAngle) / sin(0.5*itsAngle));
00082 }
00083 
00084 #endif

Generated on Wed Mar 5 17:25:22 2008 for BDSIM by  doxygen 1.5.3