Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

TGeant3TGeo.cxx File Reference

#include <ctype.h>
#include <stdlib.h>
#include "TROOT.h"
#include "TParticle.h"
#include "TDatabasePDG.h"
#include "TLorentzVector.h"
#include "TArrayI.h"
#include "TArrayD.h"
#include "TGeant3TGeo.h"
#include "TGeoManager.h"
#include "TGeoMatrix.h"
#include "TGeoMCGeometry.h"
#include "TCallf77.h"
#include "TVirtualMCDecayer.h"
#include "TPDGCode.h"

Go to the source code of this file.

Defines

#define g3smate   g3smate_
#define g3smixt   g3smixt_
#define g3stmed   g3stmed_
#define g3treve   g3treve_
#define gtreveroot   gtreveroot_
#define gcomad   gcomad_
#define g3brelm   g3brelm_
#define g3prelm   g3prelm_
#define gtreveroot   gtreveroot_

Functions

void type_of_call g3treve ()
void type_of_call gtreveroot ()
void type_of_call g3smate (const Int_t &, DEFCHARD, Float_t &, Float_t &, Float_t &, Float_t &, Float_t &, Float_t *, Int_t &DEFCHARL)
void type_of_call g3smixt (const Int_t &, DEFCHARD, const Float_t *, const Float_t *, const Float_t &, const Int_t &, Float_t *DEFCHARL)
void type_of_call g3stmed (const Int_t &, DEFCHARD, Int_t &, Int_t &, Int_t &, Float_t &, Float_t &, Float_t &, Float_t &, Float_t &, Float_t &, Float_t *, Int_t &DEFCHARL)
void type_of_call gcomad (DEFCHARD, Int_t *&DEFCHARL)
type_of_call void ginvolTGeo (Float_t *, Int_t &)
type_of_call void gtmediTGeo (Float_t *, Int_t &)
type_of_call void gtmanyTGeo (Int_t &)
type_of_call void gtonlyTGeo (Int_t &)
type_of_call void gmediaTGeo (Float_t *, Int_t &, Int_t &)
type_of_call void glvoluTGeo (Int_t &nlev, Int_t *lnam, Int_t *lnum, Int_t &ier)
type_of_call void gtnextTGeo ()
type_of_call void ggperpTGeo (Float_t *, Float_t *, Int_t &)

Variables

Gcvol1_tgcvol1 = 0
TGeoNode * gCurrentNode = 0
R__EXTERN Gctrak_tgctrak
R__EXTERN Gcvolu_tgcvolu
R__EXTERN Gckine_tgckine
R__EXTERN TGeant3geant3
R__EXTERN Gcchan_tgcchan
R__EXTERN Int_t count_ginvol
R__EXTERN Int_t count_gmedia
R__EXTERN Int_t count_gtmedi
R__EXTERN Int_t count_gtnext
R__EXTERN void(* fginvol )(Float_t *, Int_t &)
R__EXTERN void(* fgtmedi )(Float_t *, Int_t &)
R__EXTERN void(* fgtmany )(Int_t &)
R__EXTERN void(* fgtonly )(Int_t &)
R__EXTERN void(* fgmedia )(Float_t *, Int_t &, Int_t &)
R__EXTERN void(* fglvolu )(Int_t &nlev, Int_t *lnam, Int_t *lnum, Int_t &ier)
R__EXTERN void(* fgtnext )()
R__EXTERN void(* fggperp )(Float_t *, Float_t *, Int_t &)


Define Documentation

#define g3brelm   g3brelm_
 

Definition at line 412 of file TGeant3TGeo.cxx.

#define g3prelm   g3prelm_
 

Definition at line 413 of file TGeant3TGeo.cxx.

#define g3smate   g3smate_
 

Definition at line 405 of file TGeant3TGeo.cxx.

#define g3smixt   g3smixt_
 

Definition at line 406 of file TGeant3TGeo.cxx.

#define g3stmed   g3stmed_
 

Definition at line 407 of file TGeant3TGeo.cxx.

#define g3treve   g3treve_
 

Definition at line 408 of file TGeant3TGeo.cxx.

#define gcomad   gcomad_
 

Definition at line 410 of file TGeant3TGeo.cxx.

#define gtreveroot   gtreveroot_
 

Definition at line 496 of file TGeant3TGeo.cxx.

#define gtreveroot   gtreveroot_
 

Definition at line 496 of file TGeant3TGeo.cxx.


Function Documentation

void type_of_call g3smate const Int_t &  ,
DEFCHARD  ,
Float_t &  ,
Float_t &  ,
Float_t &  ,
Float_t &  ,
Float_t &  ,
Float_t *  ,
Int_t &  DEFCHARL
 

void type_of_call g3smixt const Int_t &  ,
DEFCHARD  ,
const Float_t *  ,
const Float_t *  ,
const Float_t &  ,
const Int_t &  ,
Float_t *  DEFCHARL
 

void type_of_call g3stmed const Int_t &  ,
DEFCHARD  ,
Int_t &  ,
Int_t &  ,
Int_t &  ,
Float_t &  ,
Float_t &  ,
Float_t &  ,
Float_t &  ,
Float_t &  ,
Float_t &  ,
Float_t *  ,
Int_t &  DEFCHARL
 

void type_of_call g3treve  ) 
 

void type_of_call gcomad DEFCHARD  ,
Int_t *&  DEFCHARL
 

void ggperpTGeo Float_t *  ,
Float_t *  ,
Int_t & 
 

Definition at line 2304 of file TGeant3TGeo.cxx.

02305 {
02306 // Computes the normal to the next crossed surface, assuming that
02307 // FindNextBoundary() was already called.
02308    ierr = 0;
02309    Double_t *dblnorm = gGeoManager->FindNormalFast();
02310    if (!dblnorm) {
02311       ierr = 1;
02312       return;
02313    }
02314    norm[0] = -dblnorm[0];
02315    norm[1] = -dblnorm[1];
02316    norm[2] = -dblnorm[2];
02317 }

void ginvolTGeo Float_t *  ,
Int_t & 
 

Definition at line 2132 of file TGeant3TGeo.cxx.

02133 {
02134    if (gGeoManager->IsSameLocation(x[0], x[1], x[2])) isame = 1;
02135    else isame = 0;
02136 }

void glvoluTGeo Int_t &  nlev,
Int_t *  lnam,
Int_t *  lnum,
Int_t &  ier
 

Definition at line 2208 of file TGeant3TGeo.cxx.

References gcvol1, gcvolu, Gcvol1_t::lvolu1, Gcvolu_t::lvolum, Gcvolu_t::names, Gcvolu_t::nlevel, and Gcvolu_t::number.

02209 {
02210   //
02211   //  nlev   number of levels deap into the volume tree
02212   //         size of the arrays lnam and lnum
02213   //  lnam   an integer array whos 4 bytes contain the askii code for the
02214   //         volume names
02215   //  lnum   an integer array containing the copy numbers for that specific
02216   //         volume
02217   //
02218   //  This routine fills the volume parameters in common /gcvolu/ for a
02219   //  physical tree, specified by the list lnam and lnum of volume names
02220   //  and numbers, and for all its ascendants up to level 1. This routine
02221   //  is optimised and does not re-compute the part of the history already
02222   //  available in GCVOLU. This means that if it is used in user programs
02223   //  outside the usual framework of the tracking, the user has to initialize
02224   //  to zero NLEVEL in the common GCVOLU. It return 0 if there were no
02225   //  problems in make the call.
02226   //
02227    TGeoVolume *vol = gGeoManager->GetTopVolume();
02228    TGeoVolume *vdaughter = 0;
02229    TGeoNode *node = 0;
02230    Int_t nd;
02231    Bool_t found = kFALSE;
02232    ier = 0;
02233    gGeoManager->CdTop();
02234    if (nlev<1) nlev = 1;
02235    gcvolu->nlevel = nlev;
02236    if (nlev==1) return;
02237    Int_t *lvol = gcvol1->lvolu1;
02238    memcpy(gcvolu->names, lnam,  nlev*sizeof(Int_t));
02239    memcpy(gcvolu->number, lnum, nlev*sizeof(Int_t));
02240    memcpy(gcvolu->lvolum, lvol, nlev*sizeof(Int_t));
02241 //   for (Int_t i=0;i<nlev;i++) printf(" #%i: %i  %i  %i\n", i, lnam[i], lnum[i],lvol[i]);
02242    
02243    for (Int_t i=1; i<nlev; i++) {
02244       nd = vol->GetNdaughters();
02245       found = kFALSE;
02246       for (Int_t id=0; id<nd; id++) {
02247          node = vol->GetNode(id);
02248          vdaughter = node->GetVolume();
02249          if (vdaughter->GetNumber() == lvol[i]) {
02250             if (node->GetNumber()==lnum[i]) {
02251                found = kTRUE;
02252                gGeoManager->CdDown(id);
02253                vol = vdaughter;
02254                break;
02255             } 
02256          }
02257       }
02258       if (!found) {
02259          printf("### ERROR in TGeant3TGeo::glvoluTGeo(): cannot restore path\n");
02260          ier = 1;
02261          return;
02262       }           
02263    }   
02264 }

void gmediaTGeo Float_t *  ,
Int_t &  ,
Int_t & 
 

Definition at line 2163 of file TGeant3TGeo.cxx.

References gCurrentNode, gcvolu, Gcvolu_t::lvolum, Gcvolu_t::names, Gcvolu_t::nlevel, and Gcvolu_t::number.

02164 {
02165    gCurrentNode = gGeoManager->FindNode(x[0],x[1],x[2]);
02166    if (gGeoManager->IsOutside()) {
02167       numed=0;
02168    } else {
02169       gcvolu->nlevel = 1 + gGeoManager->GetLevel();
02170       gGeoManager->GetBranchNames(gcvolu->names);
02171       gGeoManager->GetBranchNumbers(gcvolu->number,gcvolu->lvolum);
02172       TGeoVolume *vol = gCurrentNode->GetVolume();
02173       if (vol) {
02174          TGeoMedium *medium = vol->GetMedium();
02175          if (medium) numed = medium->GetId();
02176       } else {
02177          printf("ERROR: gmedia: NULL volume\n");
02178       }
02179    }
02180 }

void gtmanyTGeo Int_t &   ) 
 

Definition at line 2183 of file TGeant3TGeo.cxx.

References gcvol1, gcvolu, Gcvol1_t::lvolu1, Gcvolu_t::lvolum, Gcvolu_t::names, Gcvol1_t::names1, Gcvolu_t::nlevel, Gcvol1_t::nlevl1, Gcvolu_t::number, and Gcvol1_t::numbr1.

02184 {
02185    if (level1==1) {
02186       Int_t nlevel = gcvolu->nlevel;
02187 //      printf("gtmanyTGeo nlevel=%i %s\n",nlevel,gGeoManager->GetPath());
02188       gcvol1->nlevl1 = nlevel;
02189       if (nlevel>0) {
02190          memcpy(gcvol1->names1, gcvolu->names, nlevel*sizeof(Int_t));
02191          memcpy(gcvol1->numbr1, gcvolu->number, nlevel*sizeof(Int_t));
02192          memcpy(gcvol1->lvolu1, gcvolu->lvolum, nlevel*sizeof(Int_t));
02193       }  
02194    }   
02195 }

void gtmediTGeo Float_t *  ,
Int_t & 
 

Definition at line 2140 of file TGeant3TGeo.cxx.

References gcchan, gCurrentNode, gcvolu, Gcchan_t::lsamvl, Gcvolu_t::lvolum, Gcvolu_t::names, Gcvolu_t::nlevel, and Gcvolu_t::number.

02141 {
02142    gcchan->lsamvl = kTRUE;
02143    gCurrentNode = gGeoManager->FindNode(x[0],x[1],x[2]);
02144    gcchan->lsamvl = gGeoManager->IsSameLocation();
02145    if (gGeoManager->IsOutside()) {
02146       numed=0;
02147    } else {
02148       gcvolu->nlevel = 1 + gGeoManager->GetLevel();
02149       gGeoManager->GetBranchNames(gcvolu->names);
02150       gGeoManager->GetBranchNumbers(gcvolu->number,gcvolu->lvolum);
02151       TGeoVolume *vol = gCurrentNode->GetVolume();
02152       if (vol) {
02153          TGeoMedium *medium = vol->GetMedium();
02154          if (medium) numed = medium->GetId();
02155       } else {
02156          printf("ERROR: gtmedi: NULL volume\n");
02157       }
02158    }
02159 }

void gtnextTGeo  ) 
 

Definition at line 2268 of file TGeant3TGeo.cxx.

References gckine, gctrak, Gctrak_t::ignext, Gckine_t::itrtyp, Gctrak_t::safety, Gctrak_t::snext, Gctrak_t::step, and Gctrak_t::vect.

02269 {
02270    Float_t *x = gctrak->vect;
02271    Double_t step = gctrak->step;
02272    Int_t itrtyp = gckine->itrtyp;
02273    gGeoManager->SetCurrentPoint(x[0],x[1],x[2]);
02274    gGeoManager->SetCurrentDirection(x[3],x[4],x[5]);
02275    if (step<=0) {
02276       gctrak->safety = 0.;
02277       gctrak->snext = 0.;
02278       gctrak->ignext = 0;
02279       return;
02280    }
02281    // Find distance to next boundary. Global matrix computed only if
02282    // gtnext is called by gtckov.
02283    if (itrtyp==7) gGeoManager->FindNextBoundary(-step);
02284    else           gGeoManager->FindNextBoundary(step);
02285    gctrak->safety = gGeoManager->GetSafeDistance();
02286    Double_t snext  = gGeoManager->GetStep();
02287    if (snext<=0) {
02288       gctrak->safety = 0.;
02289       gctrak->snext = 0.;
02290       gctrak->ignext = 1;
02291       return;
02292    }
02293    if (snext < step) {
02294       gctrak->snext  = snext;
02295       gctrak->ignext = 1;
02296    } else {
02297       gctrak->ignext = 0;
02298       gctrak->snext = gctrak->step;
02299    }
02300 }

void gtonlyTGeo Int_t &   ) 
 

Definition at line 2198 of file TGeant3TGeo.cxx.

02199 {
02200    //with Geant3, return gonly(nlevel);
02201 //   if (gGeoManager->IsCurrentOverlapping()) isOnly = 0;
02202 //   else isOnly = 1;
02203    // With TGeo, G3 is seeing a ONLY geometry
02204    isOnly = 1;
02205 }

void type_of_call gtreveroot  ) 
 


Variable Documentation

R__EXTERN Int_t count_ginvol
 

Definition at line 523 of file TGeant3TGeo.cxx.

R__EXTERN Int_t count_gmedia
 

Definition at line 524 of file TGeant3TGeo.cxx.

R__EXTERN Int_t count_gtmedi
 

Definition at line 525 of file TGeant3TGeo.cxx.

R__EXTERN Int_t count_gtnext
 

Definition at line 526 of file TGeant3TGeo.cxx.

R__EXTERN void(* fggperp)(Float_t *, Float_t *, Int_t &)
 

Definition at line 535 of file TGeant3TGeo.cxx.

Referenced by ggperp().

R__EXTERN void(* fginvol)(Float_t *, Int_t &)
 

Definition at line 528 of file TGeant3TGeo.cxx.

Referenced by ginvol().

R__EXTERN void(* fglvolu)(Int_t &nlev, Int_t *lnam, Int_t *lnum, Int_t &ier)
 

Definition at line 533 of file TGeant3TGeo.cxx.

Referenced by glvolu().

R__EXTERN void(* fgmedia)(Float_t *, Int_t &, Int_t &)
 

Definition at line 532 of file TGeant3TGeo.cxx.

Referenced by gmedia().

R__EXTERN void(* fgtmany)(Int_t &)
 

Definition at line 530 of file TGeant3TGeo.cxx.

Referenced by gtmany().

R__EXTERN void(* fgtmedi)(Float_t *, Int_t &)
 

Definition at line 529 of file TGeant3TGeo.cxx.

Referenced by gtmedi().

R__EXTERN void(* fgtnext)()
 

Definition at line 534 of file TGeant3TGeo.cxx.

R__EXTERN void(* fgtonly)(Int_t &)
 

Definition at line 531 of file TGeant3TGeo.cxx.

Referenced by gtonly().

R__EXTERN Gcchan_t* gcchan
 

Definition at line 522 of file TGeant3TGeo.cxx.

R__EXTERN Gckine_t* gckine
 

Definition at line 520 of file TGeant3TGeo.cxx.

R__EXTERN Gctrak_t* gctrak
 

Definition at line 518 of file TGeant3TGeo.cxx.

TGeoNode* gCurrentNode = 0
 

Definition at line 517 of file TGeant3TGeo.cxx.

Referenced by TGeant3TGeo::Gmedia(), gmediaTGeo(), and gtmediTGeo().

Gcvol1_t* gcvol1 = 0
 

Definition at line 516 of file TGeant3TGeo.cxx.

Referenced by glvoluTGeo(), gtmanyTGeo(), and TGeant3TGeo::LoadAddress().

R__EXTERN Gcvolu_t* gcvolu
 

Definition at line 519 of file TGeant3TGeo.cxx.

R__EXTERN TGeant3* geant3
 

Definition at line 521 of file TGeant3TGeo.cxx.


Generated on Mon Feb 15 11:08:14 2010 for loon by  doxygen 1.3.9.1