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

Glast.h

Go to the documentation of this file.
00001 //  $Header: /nfs/slac/g/glast/ground/cvs/instrument/instrument/Glast.h,v 1.5 2000/11/22 16:19:16 jrb Exp $
00002 //
00003 
00004 #ifndef GLAST_GLAST_H
00005 #define GLAST_GLAST_H 1
00006 
00007 #include "instrument/GlastDetector.h"
00008 #include "instrument/DetectorVisitor.h"
00009 #include "instrument/MCTruth.h"
00010 
00011 // forward declarations
00012 namespace xml {
00013   class IFile;
00014 }
00015 class Box;
00016 class Scintillator;
00017 
00023 class Glast : public GlastDetector, public DetectorVisitor { // abstract class
00024  public:
00026   Glast (); // default
00027     
00029   virtual ~Glast ();
00030     
00032   class _Factory : public GlastDetector::_Factory {
00033   public:
00034     virtual xml::PersistentObject*   create (const DOM_Element& elem) 
00035       { return new Glast (elem); }
00036   };
00037   typedef std::vector<Tower*> _towerList;
00038   typedef _childList::const_iterator  const_iterator;
00039 
00041   typedef Tower           TowerType;
00042   typedef Scintillator    ACDTileType;
00043     
00045   static void loadParameters (xml::IFile&);
00046     
00048   const_iterator  begin () const;   // allows access to towers as a list
00049   const_iterator  end () const;     // same
00050   const Tower*    tower (const unsigned int& i) const; // access to tower i
00051     
00053   virtual void    printOn(std::ostream&) const; // print Glast specific data
00054   virtual void    read(std::istream&);        // read in Glast specific data
00055   virtual void    write(std::ostream&) const; // write out Glast specific data
00056   virtual const char* nameOf () const {return "Glast";}
00057     
00058   // detector visitor
00059   void    visit(Tower*);          // visit a tower & add to children
00060   void    visit(Scintillator*);   // visit a scintiallator & add to children
00061   virtual void  accept(DetectorVisitor&);   // accept visitors
00062   void abortVisit() {m_visit_flag=false;}   // abort after visiting just Glast
00063 
00064   // how many tiles across is the ACD configuration?
00065   static short    x_acd_across() { return xNum + 1; }  // x direction
00066   static short    y_acd_across() { return yNum + 1; }  // y direction
00067 
00068   // static parameters
00069   static int xNum;
00070   static int yNum;
00071   static double wall_gap;
00072   static double ke_cutoff;
00073   static double zModDepth;
00074   static double zModCntr;
00075   static double Width;
00076     
00077   // singleton
00078   static Glast*   instance () { return s_instance; }
00079     
00080     
00081   // persistence
00082   //  virtual DOM_Element& persist (DOM_Element&) const; // convert to xml(dom)
00083   virtual DOM_Element persist (DOM_Element&) const; // convert to xml(dom)
00084   static const GlastDetector::_PersistKey   classPersistKey;
00085     
00086  protected:
00087   // typedef    
00088   typedef _towerList::iterator  iterator;
00089         
00090   // constructors
00091   Glast ( const DOM_Element& in );
00092         
00093   // persistence
00094   const GlastDetector::_PersistKey& persistKey () const 
00095     { return classPersistKey; }
00096         
00097   // access
00098   iterator    begin ();
00099   iterator    end ();
00100         
00101   // friends
00102   friend class _Factory;
00103         
00104  private:
00105   bool      m_visit_flag;   // allows abortion of the visit chain
00106   static Glast*   s_instance;   // singleton instance
00107   MCTruth         m_truth;
00108 };
00109 
00110 #endif

Generated at Wed Nov 21 12:22:39 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000