00001
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
00012 namespace xml {
00013 class IFile;
00014 }
00015 class Box;
00016 class Scintillator;
00017
00023 class Glast : public GlastDetector, public DetectorVisitor {
00024 public:
00026 Glast ();
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;
00049 const_iterator end () const;
00050 const Tower* tower (const unsigned int& i) const;
00051
00053 virtual void printOn(std::ostream&) const;
00054 virtual void read(std::istream&);
00055 virtual void write(std::ostream&) const;
00056 virtual const char* nameOf () const {return "Glast";}
00057
00058
00059 void visit(Tower*);
00060 void visit(Scintillator*);
00061 virtual void accept(DetectorVisitor&);
00062 void abortVisit() {m_visit_flag=false;}
00063
00064
00065 static short x_acd_across() { return xNum + 1; }
00066 static short y_acd_across() { return yNum + 1; }
00067
00068
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
00078 static Glast* instance () { return s_instance; }
00079
00080
00081
00082
00083 virtual DOM_Element persist (DOM_Element&) const;
00084 static const GlastDetector::_PersistKey classPersistKey;
00085
00086 protected:
00087
00088 typedef _towerList::iterator iterator;
00089
00090
00091 Glast ( const DOM_Element& in );
00092
00093
00094 const GlastDetector::_PersistKey& persistKey () const
00095 { return classPersistKey; }
00096
00097
00098 iterator begin ();
00099 iterator end ();
00100
00101
00102 friend class _Factory;
00103
00104 private:
00105 bool m_visit_flag;
00106 static Glast* s_instance;
00107 MCTruth m_truth;
00108 };
00109
00110 #endif