}
return id;
}
+
+void FGeometryInit::Gmtod(double* xm, double* xd, int iflag)
+{
+// Transforms a position from the world reference frame
+// to the current volume reference frame.
+//
+// Geant3 desription:
+// ==================
+// Computes coordinates XD (in DRS)
+// from known coordinates XM in MRS
+// The local reference system can be initialized by
+// - the tracking routines and GMTOD used in GUSTEP
+// - a call to GMEDIA(XM,NUMED)
+// - a call to GLVOLU(NLEVEL,NAMES,NUMBER,IER)
+// (inverse routine is GDTOM)
+//
+// If IFLAG=1 convert coordinates
+// IFLAG=2 convert direction cosinus
+//
+// ---
+ FluggNavigator * ptrNavig = getNavigatorForTracking();
+ //setting variables (and dimension: Fluka uses cm.!)
+ G4ThreeVector pGlob(xm[0],xm[1],xm[2]);
+ pGlob *= 10.0; // in millimeters
+ G4ThreeVector pLoc;
+
+ if (iflag == 1) {
+ pLoc =
+ ptrNavig->ComputeLocalPoint(pGlob);
+ } else if (iflag == 2) {
+ pLoc =
+ ptrNavig->ComputeLocalAxis(pGlob);
+ } else {
+ G4cout << "Flugg FGeometryInit::Gmtod called with undefined flag" << G4endl;
+ }
+
+ xd[0] = pLoc[0]; xd[1] = pLoc[1]; xd[2] = pLoc[2];
+}
+
+void FGeometryInit::Gdtom(double* xd, double* xm, int iflag)
+{
+// Transforms a position from the current volume reference frame
+// to the world reference frame.
+//
+// Geant3 desription:
+// ==================
+// Computes coordinates XM (Master Reference System
+// knowing the coordinates XD (Detector Ref System)
+// The local reference system can be initialized by
+// - the tracking routines and GDTOM used in GUSTEP
+// - a call to GSCMED(NLEVEL,NAMES,NUMBER)
+// (inverse routine is GMTOD)
+//
+// If IFLAG=1 convert coordinates
+// IFLAG=2 convert direction cosinus
+//
+// ---
+
+ FluggNavigator * ptrNavig = getNavigatorForTracking();
+ G4ThreeVector pLoc(xd[0],xd[1],xd[2]);
+ G4ThreeVector pGlob;
+ if (iflag == 1) {
+ pGlob = ptrNavig->GetLocalToGlobalTransform().
+ TransformPoint(pLoc);
+ } else if (iflag == 2) {
+ pGlob = ptrNavig->GetLocalToGlobalTransform().
+ TransformAxis(pLoc);
+ } else {
+ G4cout << "Flugg FGeometryInit::Gdtom called with undefined flag" << G4endl;
+ }
+
+ xm[0] = pGlob[0]; xm[1] = pGlob[1]; xm[2] = pGlob[2];
+}
G4int GetMedium(int) const;
int CurrentVolID(int ir, int& copyNo);
int CurrentVolOffID(int ir, int off, int& copyNo);
-
+ void Gmtod(double* xm, double* xd, int iflag);
+ void Gdtom(double* xd, double* xm, int iflag);
protected:
void BuildRegionsMap();
/*
$Log$
+Revision 1.13 2003/01/31 14:01:51 morsch
+Major update on
+- Getters related to geometry.
+- Communication with run manager (event steering)
+
Revision 1.12 2003/01/31 12:18:53 morsch
Corrected indices. (E. Futo)
return med;
}
+void TFluka::Gmtod(Float_t* xm, Float_t* xd, Int_t iflag)
+ {
+// Transforms a position from the world reference frame
+// to the current volume reference frame.
+//
+// Geant3 desription:
+// ==================
+// Computes coordinates XD (in DRS)
+// from known coordinates XM in MRS
+// The local reference system can be initialized by
+// - the tracking routines and GMTOD used in GUSTEP
+// - a call to GMEDIA(XM,NUMED)
+// - a call to GLVOLU(NLEVEL,NAMES,NUMBER,IER)
+// (inverse routine is GDTOM)
+//
+// If IFLAG=1 convert coordinates
+// IFLAG=2 convert direction cosinus
+//
+// ---
+ Double_t xmD[3], xdD[3];
+ xmD[0] = xm[0]; xmD[1] = xm[1]; xmD[2] = xm[2];
+ (FGeometryInit::GetInstance())->Gmtod(xmD, xdD, iflag);
+ xd[0] = xdD[0]; xd[1] = xdD[1]; xd[2] = xdD[2];
+ }
+
+
+void TFluka::Gmtod(Double_t* xm, Double_t* xd, Int_t iflag)
+ {
+// Transforms a position from the world reference frame
+// to the current volume reference frame.
+//
+// Geant3 desription:
+// ==================
+// Computes coordinates XD (in DRS)
+// from known coordinates XM in MRS
+// The local reference system can be initialized by
+// - the tracking routines and GMTOD used in GUSTEP
+// - a call to GMEDIA(XM,NUMED)
+// - a call to GLVOLU(NLEVEL,NAMES,NUMBER,IER)
+// (inverse routine is GDTOM)
+//
+// If IFLAG=1 convert coordinates
+// IFLAG=2 convert direction cosinus
+//
+// ---
+ Double_t xmD[3], xdD[3];
+ xdD[0] = xd[0]; xdD[1] = xd[1]; xdD[2] = xd[2];
+ (FGeometryInit::GetInstance())->Gdtom(xmD, xdD, iflag);
+ xm[0] = xmD[0]; xm[1] = xmD[1]; xm[2] = xmD[2];
+ }
+
+void TFluka::Gdtom(Float_t* xd, Float_t* xm, Int_t iflag)
+ {
+// Transforms a position from the current volume reference frame
+// to the world reference frame.
+//
+// Geant3 desription:
+// ==================
+// Computes coordinates XM (Master Reference System
+// knowing the coordinates XD (Detector Ref System)
+// The local reference system can be initialized by
+// - the tracking routines and GDTOM used in GUSTEP
+// - a call to GSCMED(NLEVEL,NAMES,NUMBER)
+// (inverse routine is GMTOD)
+//
+// If IFLAG=1 convert coordinates
+// IFLAG=2 convert direction cosinus
+//
+// ---
+
+
+ }
+void TFluka::Gdtom(Double_t* xd, Double_t* xm, Int_t iflag)
+ {
+// Transforms a position from the current volume reference frame
+// to the world reference frame.
+//
+// Geant3 desription:
+// ==================
+// Computes coordinates XM (Master Reference System
+// knowing the coordinates XD (Detector Ref System)
+// The local reference system can be initialized by
+// - the tracking routines and GDTOM used in GUSTEP
+// - a call to GSCMED(NLEVEL,NAMES,NUMBER)
+// (inverse routine is GMTOD)
+//
+// If IFLAG=1 convert coordinates
+// IFLAG=2 convert direction cosinus
+//
+// ---
+
+ (FGeometryInit::GetInstance())->Gdtom(xm, xd, iflag);
+ }
// ===============================================================
void TFluka::FutoTest()
Float_t &dens, Float_t &radl, Float_t &absl) const;
virtual Int_t CurrentEvent() const
{printf("WARNING: CurrentEvent not yet implemented !\n"); return -1;}
- virtual void Gmtod(Float_t* xm, Float_t* xd, Int_t iflag)
- {printf("WARNING: Gmtod not yet implemented !\n");}
- virtual void Gmtod(Double_t* xm, Double_t* xd, Int_t iflag)
- {printf("WARNING: Gmtod not yet implemented !\n");}
- virtual void Gdtom(Float_t* xd, Float_t* xm, Int_t iflag)
- {printf("WARNING: Gdtom not yet implemented !\n");}
- virtual void Gdtom(Double_t* xd, Double_t* xm, Int_t iflag)
- {printf("WARNING: Gdtom not yet implemented !\n");}
+ virtual void Gmtod(Float_t* xm, Float_t* xd, Int_t iflag);
+
+ virtual void Gmtod(Double_t* xm, Double_t* xd, Int_t iflag);
+
+ virtual void Gdtom(Float_t* xd, Float_t* xm, Int_t iflag);
+
+ virtual void Gdtom(Double_t* xd, Double_t* xm, Int_t iflag);
+
virtual Double_t MaxStep() const
{printf("WARNING: MaxStep not yet implemented !\n"); return -1.;}
virtual Int_t GetMaxNStep() const