/home/cern/BDSIM_new/include/BDSBunch.hh

00001 // Provide interface to generating
00002 // the primary particles
00003 
00004 
00005 #ifndef BDSBunch_h
00006 #define BDSBunch_h 
00007 
00008 #include "parser/gmad.h"
00009 #include "Randomize.hh"
00010 #include "globals.hh"
00011 #include <fstream>
00012 
00013 #if CLHEP_VERSION > 8 
00014 using namespace CLHEP;
00015 #endif
00016 
00017 // CLHEP < 1.9
00018 //class RandGauss;
00019 //class RandFlat;
00020 
00021 
00022 struct Doublet {
00023 
00024   G4String name;
00025   G4double unit; // relative to SI units, i.e. mm=0.001 etc.
00026 
00027 };
00028 
00029 class BDSBunch {
00030 
00031 public: 
00032   BDSBunch(); // default constructor
00033   ~BDSBunch();
00034 
00035 public:
00036 
00037   void SetOptions(struct Options&);
00038 
00039   G4double GetSigmaT();  // get initial bunch distribution parameters in Gaussian case 
00040   G4double GetSigmaX(); 
00041   G4double GetSigmaY(); 
00042   G4double GetSigmaXp();
00043   G4double GetSigmaYp();
00044 
00045   // get next coordinate 
00046   G4double GetNextX(); 
00047   G4double GetNextY(); 
00048   G4double GetNextZ(); 
00049   G4double GetNextXp();
00050   G4double GetNextYp();
00051   G4double GetNextT(); 
00052   // the same in a bulk
00053   void GetNextParticle(G4double& x0,G4double& y0,G4double& z0,
00054                        G4double& xp,G4double& yp,G4double& zp,
00055                        G4double& t, G4double& E);
00056   
00057 
00058   G4double GetEmitX();
00059   G4double GetEmitY();
00060 
00061   G4double GetAlphaX();
00062   G4double GetAlphaY();
00063 
00064   G4double GetBetaX();
00065   G4double GetBetaY();
00066 
00067 
00068   void SetSigmaT(double);  // set initial bunch distribution parameters in Gaussian case 
00069   void SetSigmaX(double); 
00070   void SetSigmaY(double); 
00071   void SetSigmaXp(double);
00072   void SetSigmaYp(double);
00073 
00074   void SetX0(double); 
00075   void SetY0(double); 
00076   void SetXp0(double);
00077   void SetYp0(double);
00078 
00079   void SetEmitX(double);
00080   void SetEmitY(double);
00081 
00082   void SetAlphaX(double);
00083   void SetAlphaY(double);
00084 
00085   void SetBetaX(double);
00086   void SetBetaY(double);
00087 
00088   std::ifstream fifoReader;
00089 
00090 private:
00091   // distribution centre
00092   G4double X0;
00093   G4double Y0;
00094   G4double Z0;
00095   G4double T0;
00096 
00097   G4double Xp0;
00098   G4double Yp0;
00099   G4double Zp0;
00100 
00101   // parameters for Gaussian distribution
00102   G4double sigmaX; // sigmas for Gaussian bunches (m)
00103   G4double sigmaY;
00104   G4double sigmaT;
00105   G4double sigmaXp;
00106   G4double sigmaYp;
00107   
00108   // parameters for ring distribution
00109   G4double rMin;
00110   G4double rMax;
00111 
00112   // parameters for the elliptic shell distribution
00113   G4double shellx, shelly, shellxp, shellyp;
00114   
00115   G4double betaX;
00116   G4double betaY;
00117   G4double alphaX;
00118   G4double alphaY;
00119   G4double emitX;
00120   G4double emitY;
00121 
00122   int distribType;
00123   G4double energySpread;
00124 
00125   list<struct Doublet> fields;
00126 
00127   // input filename
00128   G4String inputfile;
00129   std::ifstream InputBunchFile;
00130 
00131  // Gaussian Random number generator:
00132   RandGauss* GaussGen;
00133   RandFlat* FlatGen;
00134   
00135   // event number for phase for ellipse for SR rescaling
00136   G4int partId;
00137 
00138   G4int ignoreLines; // number of lines to ignore from opt
00139 };
00140 
00141 #endif

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