00001 00057 #ifndef GGPOSITIONERTOOL_H 00058 #define GGPOSITIONERTOOL_H 00059 00060 #include "GaudiKernel/RndmGenerators.h" 00061 #include "GaudiAlg/GaudiTool.h" 00062 00063 #include "GenTools/IHepMCEventMutator.h" 00064 00065 class IDetectorElement; 00066 00067 class GtPositionerTool : public GaudiTool, 00068 virtual public IHepMCEventMutator 00069 { 00070 public: 00071 GtPositionerTool(const std::string& type, 00072 const std::string& name, 00073 const IInterface* parent); 00074 virtual ~GtPositionerTool(); 00075 00076 virtual StatusCode initialize(); 00077 virtual StatusCode finalize(); 00078 00079 virtual StatusCode mutate(HepMC::GenEvent& event); 00080 00082 const IDetectorElement* detelem(); 00083 00084 private: 00085 00087 00091 std::string m_volume; 00092 00094 std::string m_strategy; 00095 00097 std::string m_mode; 00098 00100 std::vector<double> m_position; 00101 00103 double m_spread; 00104 00106 std::vector<std::string> m_fillVolumes; 00107 00109 std::vector<std::string> m_fillMaterials; 00110 00111 00112 private: 00113 // GaudiTools are broken as they are initialized before there is a 00114 // chance for the user to set parameters. At least when 00115 // toolSvc.create() is called from Python. 00116 StatusCode really_initialize(); 00117 bool m_really_initialized; 00118 00119 Rndm::Numbers m_uni, m_gauss; 00120 std::vector<double> m_min, m_max; 00121 void setPosition(std::vector<double>& pos, HepMC::GenEvent& event); 00122 bool genPosition(std::vector<double>& pos); 00123 bool getPoint(std::vector<double>& pos); 00124 std::string baseName(const std::string& path); 00125 00126 IDetectorElement* m_detelem; 00127 }; 00128 00129 00130 00131 #endif // GGPOSITIONERTOOL_H