include/BDSBeamline.hh

00001 #ifndef __BDSBEAMLINE_H
00002 #define __BDSBEAMLINE_H
00003 
00004 #include <list>
00005 
00006 #include "globals.hh"
00007 
00008 #include "BDSAcceleratorComponent.hh"
00009 
00010 class BDSBeamline{
00011 public:
00012 
00013   static BDSBeamline* Instance();
00014   ~BDSBeamline();
00015   
00016   void addComponent(BDSAcceleratorComponent* var);
00017   void print();
00018   void printNavigation();
00019   BDSAcceleratorComponent* currentItem();
00020   BDSAcceleratorComponent* lastItem();
00021   void first();
00022   bool isDone();
00023   void next();
00024 
00025   G4double s_total();
00026 
00027   G4RotationMatrix* rotation();
00028   G4RotationMatrix* rotationGlobal();
00029   G4ThreeVector* position();
00030   G4double       positionS();
00031   G4ThreeVector* positionStart();
00032   G4ThreeVector* positionEnd();
00033   G4ThreeVector* positionFromCurrentCenter();
00034 
00035   G4int size();
00036 
00037 private: 
00038   BDSBeamline();
00039   static BDSBeamline* _instance;
00040   std::list <BDSAcceleratorComponent*> _componentList;
00041 
00042   std::list<BDSAcceleratorComponent*>::const_iterator _iterComponent;
00043   std::list<BDSAcceleratorComponent*>::const_iterator _iterLastComponent;
00044   void setRefTransform(BDSAcceleratorComponent* var);
00045 
00046 
00047 
00048   //Navigation 
00049   void doNavigation();
00050   G4ThreeVector* _localX; 
00051   G4ThreeVector* _localY; 
00052   G4ThreeVector* _localZ; 
00053   G4ThreeVector* _position;
00054   G4ThreeVector* _positionStart;
00055   G4ThreeVector* _positionEnd;
00056   G4ThreeVector* _positionFromCurrentCenter;
00057   G4double _positionS;//Position along the curvilinear coordiante "s"
00058   G4ThreeVector* _zHalfAngle;
00059   G4RotationMatrix* _rotationLocal;
00060   G4RotationMatrix* _rotationGlobal;
00061   G4RotationMatrix* _rotation;
00062 
00063   std::list <G4RotationMatrix*> _rotationList;
00064   std::list <G4RotationMatrix*> _rotationGlobalList;
00065   std::list <G4ThreeVector*> _positionList;
00066   std::list <G4ThreeVector*> _positionStartList;
00067   std::list <G4ThreeVector*> _positionEndList;
00068   std::list <G4ThreeVector*> _positionFromCurrentCenterList;
00069   std::list <G4double> _positionSList; //Position along the curvilinear coordinate "s"
00070 
00071   std::list<G4RotationMatrix*>::const_iterator  _iterRotation;
00072   std::list<G4RotationMatrix*>::const_iterator  _iterRotationGlobal;
00073   std::list<G4ThreeVector*>::const_iterator  _iterPosition;
00074   std::list<G4ThreeVector*>::const_iterator  _iterPositionStart;
00075   std::list<G4ThreeVector*>::const_iterator  _iterPositionEnd;
00076   std::list<G4ThreeVector*>::const_iterator  _iterPositionFromCurrentCenter;
00077   std::list<G4double>::const_iterator _iterPositionS; //Position along the curvilinear coordinate "s"
00078   G4double _s_local, _s_total;
00079 };
00080 
00081 #endif

Generated on 27 Aug 2013 for BDSIM by  doxygen 1.4.7