Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

FluxSource.h

Go to the documentation of this file.
00001 //      $Header: /nfs/slac/g/glast/ground/cvs/FluxSvc/FluxSvc/FluxSource.h,v 1.26 2002/09/20 00:29:01 srobinsn Exp $
00002 
00003 #ifndef FluxSource_h
00004 #define FluxSource_h 1
00005 
00014 #include "FluxSvc/EventSource.h"
00015 #include "FluxSvc/ISpectrum.h"
00016 #include "geometry/Point.h"
00017 
00018 // forward declarations
00019 class Box;
00020 class DOM_Element;
00021 
00022 // 
00024 
00025 
00026 class FluxSource : public EventSource  
00027 {
00028 public:      
00030     FluxSource ( ISpectrum* aSpec = 0, double aFlux = 0 );
00031     FluxSource ( const DOM_Element& xelem );
00032     FluxSource::FluxSource(double aFlux, ISpectrum* aSpec,  double l, double b);
00033     
00035     virtual ~FluxSource();
00036     
00038     virtual FluxSource* event(double time);
00039     
00041     virtual std::string fullTitle () const;
00042     
00044     virtual std::string displayTitle () const;
00045     
00047     virtual void computeLaunch (double time=0);
00048     
00049     virtual double flux(double time)const; // calculate flux for attached spectrum
00050     
00052     double solidAngle()const;
00053     
00055     void setPhiRange(double min_phi, double max_phi);
00056     void setCosThetaRange(double min_cos, double max_cos);
00057     
00061     void useSpectrumDirection();
00062     
00063     void setAcceptance ();
00064     
00067     void setLaunch(const Vector& dir, const Point& pos);
00068     void setLaunch(const Vector& dir);
00069     void setLaunch(double theta, double phi);
00070     void setLaunch(double xMax, double xMin, double yMax, double yMin, 
00071         double zTop, double zBot, bool fan);
00072     void FluxSource::setLaunch(double theta, double phi, double xMax, 
00073         double xMin, double yMax, double yMin, 
00074         double zTop, double zBot);
00075     
00076     void unSetLaunch();
00077     
00078     // return of angle & solid angle parameters
00079     double minPhi() const      {return _minPhi;}
00080     double maxPhi() const      {return _maxPhi;}
00081     double minCosTheta() const {return _minCos;}
00082     double maxCosTheta() const {return _maxCos;}
00083     double phi() const         {return _phi;}
00084     double theta() const       {return _theta;}
00085     
00086     
00087     void getSurfacePosDir(); // setup position & direction for Surface illumination
00088     
00090     std::string title()const;
00091     
00093     void  printOn ( std::ostream&  ) {}
00094     
00096     void spectrum(ISpectrum* s, double emax=-1);
00097     ISpectrum* spectrum() const{ return m_spectrum; }
00098     
00099     
00100     double calculateInterval (double time);
00101     double interval(double ){return m_interval;}
00102     
00103     void FluxSource::getGalacticDir(double l,double b);
00104     
00106     double maxEnergy()const { return m_maxEnergy;}
00107     void setMaxEnergy(double e) { m_maxEnergy = e; }
00108     
00109     
00111     void FluxSource::correctForTiltAngle();
00112 
00114     void spreadTheDirection();
00115     
00117     enum LaunchType { 
00118         NONE,         
00119             POINT,        
00120             DIRECTION ,   
00121             SURFACE,      
00122             SPECTRUM, 
00123             SPECGAL,   
00124             PATCHFIXED,   
00125             GALACTIC,  
00126             SPREAD   
00127     } m_launch;
00128     
00129     enum PointType { 
00130         NOPOINT,         
00131             SINGLE,        
00132             PATCH   
00133     } m_pointtype;
00134     
00137     enum EnergyScale { 
00138         MeV,        
00139             GeV         
00140     } m_energyscale;
00141     
00143     bool occluded();
00144     
00145     virtual int eventNumber()const;
00146     
00147     double energy()const { return m_energy;}
00148     const Vector& rawDir()const {return m_launchDir;}
00149     const Vector& launchDir()const {return m_correctedDir;}//m_correctForTilt*m_launchDir;}
00150     const Point&  launchPoint()const { return m_launchPoint;}
00151     
00152     void refLaunch(LaunchType launch);
00153     void refPoint(PointType point);
00154     int refLaunch()const {return m_launch;}
00155     int refPoint()const {return m_pointtype;}
00156     
00157   private:
00158       
00159       static    double  s_radius, s_backoff;
00160       
00161       ISpectrum*         m_spectrum;        // spectrum to generate
00162       
00163       double m_maxEnergy; // max kinetic energy allowed when running a spectrum
00164       
00165       double _minCos, _maxCos, _minPhi, _maxPhi;
00166       // solid angle, with respect to z-axis
00167       
00168       double m_rmin, m_rmax;
00169       // minimum, maxumum value for random number (fraction of spectrum)
00170       
00171       double  _phi, _theta;
00172       //  angles, with respect to z-axis
00173       
00174       // galactic position of source - for use with GALACTIC
00175       double m_galb, m_gall;
00176       // dimensions of patch to be illuminated  -- for use with SURFACE
00177       double patchHeight, patchBottom, patchTop, patchXmax, patchXmin;
00178       double patchYmax, patchYmin, patchWidX, patchWidY, Fratio;
00179       double patchRange, patchOffset;
00180       // for use with SURFACE -- sidePatch means illumination of ONE side
00181       // fanBeam == false means polar beam
00182       bool sidePatch, fanBeam;
00183       Box* illumBox;
00184       double m_interval; //the current value of the interval in time to the next particle.
00185       
00188       //void transformDirection();
00189       
00190       Vector m_launchDir;
00191       
00192       //Vector m_transformDir;
00193       Point  m_launchPoint;
00194       double m_energy;
00195       // associated with a specific launch
00196 
00198       double m_degreespread;
00199       
00201       Rotation m_correctForTilt;
00202       
00204       Vector m_correctedDir;
00206       double m_extime;
00207       
00208       void randomLaunchPoint(); 
00209       // calculate a random launch point in a plane perpendicular to _launchDir
00210       
00212       double FluxSource::explicitInterval (double time);
00213 };
00214 #endif

Generated on Wed Oct 16 14:01:29 2002 by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001