133 #ifndef STAR_St_geant_Maker
134 #define STAR_St_geant_Maker
143 #include <functional>
162 TGeoVolume* fTopGeoVolume;
167 virtual TShape *MakeShape(TString *name, Int_t ivo);
168 virtual TVolume *MakeVolume(TString *name, Int_t ivo, Int_t Nlevel, Int_t *Names, Int_t *Numbers);
169 virtual void ClearRootGeoms();
172 St_geom_gdat *m_geom_gdat;
175 Int_t nwgeant=20,Int_t nwpaw=0, Int_t iwtype=0);
178 virtual Int_t Init();
179 virtual Int_t InitRun(Int_t run);
180 virtual void SetDateTime(
int idat=0,
int itim=0);
181 void SetFieldOpt(
const char *opt) {mFieldOpt = opt;}
183 virtual void Do(
const Char_t *option =
"dcut cave x 0.1 10 10 0.03 0.03");
184 virtual void Draw(
const char* opt=
"IN");
185 virtual Int_t
Make();
187 virtual void LoadGeometry (
const Char_t *option =
"detp geometry field_only");
188 virtual void SetNwGEANT (Int_t n=2) {fNwGeant = n;}
189 virtual void SetNwPAW (Int_t n=0) {fNwPaw = n;}
190 virtual void SetIwtype (Int_t n=0) {fIwType = n;}
191 virtual Int_t GetNwGEANT () {
return fNwGeant;}
192 virtual Int_t GetNwPAW () {
return fNwPaw ;}
193 virtual Int_t GetIwtype () {
return fIwType ;}
196 virtual Int_t Skip(Int_t Nskip=1);
198 virtual void Mark(
TVolume *topvol);
199 virtual void Call(
const Char_t *name);
200 virtual TRotMatrix *GetMatrix(
float theta1,
float phi1,
201 float theta2,
float phi2,
202 float theta3,
float phi3);
205 Int_t SetInputFile(
const char* file);
207 TDataSet* GetVolume() {
return fVolume; }
208 const TFileSet *GetGeoDirectory()
const {
return fGeoDirectory;}
209 TGeoVolume* GetTopGeoVolume() {
return fTopGeoVolume;}
210 static void RootMapTable(Char_t *Cdest,Char_t *Table, Char_t*
Spec,
211 Int_t &k, Char_t *iq);
212 virtual void Geometry();
213 virtual Int_t Agstroot();
214 virtual Int_t AgstHits();
215 virtual Int_t G2t_volume_id(
const Char_t *name, Int_t *numbv);
216 virtual Int_t Agvolume(
TVolume *&node,Float_t *&par,Float_t *&pos,Float_t *&mot,
217 Int_t &who, Int_t ©,Float_t *&par1,Int_t &npar,
char mat[21]);
218 virtual void Agnzgete (Int_t &ILK, Int_t &IDE,
219 Int_t &NPART, Int_t &IRUN,
220 Int_t &IEVT,
const Char_t *CGNAM,
221 Float_t *VERT,Int_t &IWTFL,Float_t &WEIGH);
223 virtual void Gfxzrm(Int_t & Nlevel,
224 Float_t &x, Float_t &y, Float_t &z,
225 Float_t &Theta1, Float_t & Phi1,
226 Float_t &Theta2, Float_t & Phi2,
227 Float_t &Theta3, Float_t & Phi3,
229 virtual void Dzddiv(Int_t& idiv ,Int_t &Ldummy,
230 const Char_t* path,
const Char_t* opt,
231 Int_t& one,Int_t &two,Int_t &three,Int_t& iw);
234 void DumpIndex(
const Char_t *name,
const Char_t *vers,
const Char_t *fmt, TArrayI &NVmax, TArrayI &Ids);
236 TString GetVolumeSrcFile(
const char *volumeName)
const;
237 Int_t KinematicsFromMuDst(Int_t flag=0);
238 Int_t SetDatimeFromMuDst();
240 static void usflux();
241 static Int_t ipartx(Int_t
id);
242 static Float_t dose(Float_t Z);
246 virtual TDataSet *FindDataSet (
const char* logInput,
248 const StMaker *dowMk=0)
const ;
250 static TGiant3 *geant3;
252 TString mInitialization;
254 static Quest_t *cquest;
255 static Gclink_t *clink;
256 static Gcflag_t *cflag;
257 static Gcvolu_t *cvolu;
258 static Gcnum_t *cnum;
259 static Int_t *z_iq, *z_lq;
261 static Gcsets_t *csets;
262 static Gckine_t *ckine;
263 static Gcking_t *cking;
265 static Gcmate_t *cmate;
266 static Gccuts_t *ccuts;
267 static Gcphys_t *cphys;
280 template<
typename T,
typename F>
281 int AddHits( std::string container, std::vector<std::string> volumes, std::string tablename, F g2t,
bool verbose=
false ){
282 int ntotal = 0, nhits = 0;
283 for (
auto v : volumes ) {
284 geant3->Gfnhit( container.c_str(), v.c_str(), nhits );
285 std::string key = container +
":" + v;
286 LOG_DEBUG << key <<
" found nhits=" << nhits << endm;
287 if (nhits) { mHitCounts[key] += nhits; mHitCounts[
"ALL"] += nhits; }
290 if ( ntotal <= 0 )
return ntotal;
291 T* table =
new T( tablename.c_str(), ntotal );
293 auto* g2t_track = (St_g2t_track*)
FindByName(
"g2t_track");
294 g2t( g2t_track, table );
296 for (
auto hit : (*table) ) {
299 mHitSum[container] = sum;
300 if ( Debug() > 1 || verbose ) table->Print(0,10);
303 std::map<std::string, int> mHitCounts;
304 std::map<std::string, double> mHitSum;
306 virtual const char *GetCVS()
const
307 {
static const char cvs[]=
"Tag $Name: $ $Id: St_geant_Maker.h,v 1.60 2020/02/26 21:26:20 jwebb Exp $ built " __DATE__
" " __TIME__ ;
return cvs;}
virtual void AddData(TDataSet *data, const char *dir=".data")
User methods.
int AddHits(std::string container, std::vector< std::string > volumes, std::string tablename, F g2t, bool verbose=false)
TGiant3 * Geant3()
Returns a pointer to the GEANT3 VMC interface.
virtual void Do(const Char_t *option="dcut cave x 0.1 10 10 0.03 0.03")
Executes a KUIP command.
Bool_t fRemakeGeometry
pointer to Event Header
virtual TDataSet * FindByName(const char *name, const char *path="", Option_t *opt="") const
virtual void LoadGeometry(const Char_t *option="detp geometry field_only")
Specifies GEANT3 geometry command.