00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090 #ifndef STAR_St_geant_Maker
00091 #define STAR_St_geant_Maker
00092
00094
00095
00096
00098 #include "StMaker.h"
00099
00100 #ifdef DetectorIndex
00101 #include "TArrayI.h"
00102 #endif
00103 class TVolume;
00104 class TGiant3;
00105 class TRotMatrix;
00106 class TH1F;
00107 class TShape;
00108 class TGeoVolume;
00109 class St_geom_gdat;
00110 class TFileSet;
00111
00112 class St_geant_Maker : public StMaker {
00113 protected:
00114 Int_t fNwGeant;
00115 Int_t fNwPaw;
00116 Int_t fIwType;
00117 TDataSet* fVolume;
00118 TGeoVolume* fTopGeoVolume;
00119 TString fInputFile;
00120 TFileSet *fGeoDirectory;
00121 StEvtHddr *fEvtHddr;
00122 Bool_t fRemakeGeometry;
00123 virtual TShape *MakeShape(TString *name, Int_t ivo);
00124 virtual TVolume *MakeVolume(TString *name, Int_t ivo, Int_t Nlevel, Int_t *Names, Int_t *Numbers);
00125 virtual void ClearRootGeoms();
00126 private:
00127
00128 St_geom_gdat *m_geom_gdat;
00129 public:
00130 St_geant_Maker(const char *name="geant",
00131 Int_t nwgeant=20,Int_t nwpaw=0, Int_t iwtype=0);
00132 virtual ~St_geant_Maker(){};
00133 virtual Int_t Finish(){SafeDelete(m_DataSet); return kStOK;}
00134 virtual Int_t Init();
00135 virtual Int_t InitRun(Int_t run);
00136 virtual void SetDateTime(int idat=0,int itim=0);
00137 void SetFieldOpt(const char *opt) {mFieldOpt = opt;}
00138 virtual void Do(const Char_t *option = "dcut cave x 0.1 10 10 0.03 0.03");
00139 virtual void Draw(const char* opt="IN");
00140 virtual Int_t Make();
00141 virtual void LoadGeometry (const Char_t *option = "detp geometry field_only");
00142 virtual void SetNwGEANT (Int_t n=2) {fNwGeant = n;}
00143 virtual void SetNwPAW (Int_t n=0) {fNwPaw = n;}
00144 virtual void SetIwtype (Int_t n=0) {fIwType = n;}
00145 virtual Int_t GetNwGEANT () {return fNwGeant;}
00146 virtual Int_t GetNwPAW () {return fNwPaw ;}
00147 virtual Int_t GetIwtype () {return fIwType ;}
00148 Bool_t Remake() const { return fRemakeGeometry;}
00149 void SetRemake(Bool_t remake=kTRUE) {fRemakeGeometry=remake;}
00150 virtual Int_t Skip(Int_t Nskip=1);
00151 virtual TDataSet *Work();
00152 virtual void Mark(TVolume *topvol);
00153 virtual void Call(const Char_t *name);
00154 virtual TRotMatrix *GetMatrix(float theta1, float phi1,
00155 float theta2, float phi2,
00156 float theta3, float phi3);
00157
00158
00159 Int_t SetInputFile(const char* file);
00160
00161 TDataSet* GetVolume() { return fVolume; }
00162 const TFileSet *GetGeoDirectory() const { return fGeoDirectory;}
00163 TGeoVolume* GetTopGeoVolume() {return fTopGeoVolume;}
00164 static void RootMapTable(Char_t *Cdest,Char_t *Table, Char_t* Spec,
00165 Int_t &k, Char_t *iq);
00166 virtual void Geometry();
00167 virtual Int_t Agstroot();
00168 virtual Int_t AgstHits();
00169 virtual Int_t G2t_volume_id(const Char_t *name, Int_t *numbv);
00170 virtual Int_t Agvolume(TVolume *&node,Float_t *&par,Float_t *&pos,Float_t *&mot,
00171 Int_t &who, Int_t ©,Float_t *&par1,Int_t &npar, char mat[21]);
00172 virtual void Agnzgete (Int_t &ILK, Int_t &IDE,
00173 Int_t &NPART, Int_t &IRUN,
00174 Int_t &IEVT, const Char_t *CGNAM,
00175 Float_t *VERT,Int_t &IWTFL,Float_t &WEIGH);
00176
00177 virtual void Gfxzrm(Int_t & Nlevel,
00178 Float_t &x, Float_t &y, Float_t &z,
00179 Float_t &Theta1, Float_t & Phi1,
00180 Float_t &Theta2, Float_t & Phi2,
00181 Float_t &Theta3, Float_t & Phi3,
00182 Float_t &Type);
00183 virtual void Dzddiv(Int_t& idiv ,Int_t &Ldummy,
00184 const Char_t* path,const Char_t* opt,
00185 Int_t& one,Int_t &two,Int_t &three,Int_t& iw);
00186 #ifdef DetectorIndex
00187 void DetSetIndex();
00188 void DumpIndex(const Char_t *name, const Char_t *vers, const Char_t *fmt, TArrayI &NVmax, TArrayI &Ids);
00189 #endif
00190 TString GetVolumeSrcFile(const char *volumeName) const;
00191 Int_t KinematicsFromMuDst(Int_t flag=0);
00192 Int_t SetDatimeFromMuDst();
00193 static St_geant_Maker *instance() {return fgGeantMk;}
00194 protected:
00195 virtual TDataSet *FindDataSet (const char* logInput,
00196 const StMaker *uppMk=0,
00197 const StMaker *dowMk=0) const ;
00198 static TDataSet *fgGeom;
00199 static TGiant3 *geant3;
00200 static St_geant_Maker *fgGeantMk;
00201 TString mInitialization;
00202 TString mFieldOpt;
00203 virtual const char *GetCVS() const
00204 {static const char cvs[]="Tag $Name: $ $Id: St_geant_Maker.h,v 1.51 2011/09/11 20:57:14 fisyak Exp $ built "__DATE__" "__TIME__ ; return cvs;}
00205 ClassDef(St_geant_Maker,0)
00206 };
00207
00208 #endif
00209