TGeant3gu.cxx File Reference

#include <iostream>
#include "TGeant3.h"
#include "TCallf77.h"
#include "TLorentzVector.h"
#include "TClonesArray.h"
#include "TParticle.h"
#include "TDatabasePDG.h"
#include "TGeoManager.h"
#include "TVirtualGeoTrack.h"

Go to the source code of this file.

Namespaces

namespace  Dither
namespace  Stuck

Defines

#define gudigi   gudigi_
#define guhadr   guhadr_
#define guout   guout_
#define guphad   guphad_
#define gudcay   gudcay_
#define guiget   guiget_
#define guinme   guinme_
#define guinti   guinti_
#define gunear   gunear_
#define guskip   guskip_
#define guview   guview_
#define gupara   gupara_
#define gudtim   gudtim_
#define guplsh   guplsh_
#define gutrev   gutrev_
#define gutrak   gutrak_
#define guswim   guswim_
#define gufld   gufld_
#define gustep   gustep_
#define gukine   gukine_
#define eustep   eustep_
#define calsig   calsig_
#define gcalor   gcalor_
#define gheish   gheish_
#define flufin   flufin_
#define gfmfin   gfmfin_
#define gpghei   gpghei_
#define fldist   fldist_
#define gfmdis   gfmdis_
#define g3helx3   g3helx3_
#define g3helix   g3helix_
#define g3rkuta   g3rkuta_
#define g3track   g3track_
#define gtreveroot   gtreveroot_
#define g3last   g3last_
#define g3invol   g3invol_
#define g3tmedi   g3tmedi_
#define g3media   g3media_
#define g3tmany   g3tmany_
#define g3tnext   g3tnext_
#define ginvol   ginvol_
#define gtmedi   gtmedi_
#define gtmany   gtmany_
#define gtonly   gtonly_
#define gmedia   gmedia_
#define glvolu   glvolu_
#define gtnext   gtnext_

Functions

type_of_call void calsig ()
type_of_call void gcalor ()
type_of_call void gheish ()
type_of_call void flufin ()
type_of_call void gfmfin ()
type_of_call void gpghei ()
type_of_call void fldist ()
type_of_call void gfmdis ()
type_of_call void g3helx3 (Float_t &, Float_t &, Float_t *, Float_t *)
type_of_call void g3helix (Float_t &, Float_t &, Float_t *, Float_t *)
type_of_call void g3rkuta (Float_t &, Float_t &, Float_t *, Float_t *)
type_of_call void g3track ()
type_of_call void gtreveroot ()
type_of_call void g3last ()
type_of_call void g3invol (Float_t *, Int_t &)
type_of_call void g3tmedi (Float_t *, Int_t &)
type_of_call void g3tmany (Int_t &)
type_of_call void g3media (Float_t *, Int_t &, Int_t &)
type_of_call void g3tnext ()
type_of_call void ginvol (Float_t *, Int_t &)
type_of_call void gtmedi (Float_t *, Int_t &)
type_of_call void gtmany (Int_t &)
type_of_call void gtonly (Int_t &)
type_of_call void gmedia (Float_t *, Int_t &, Int_t &)
type_of_call void glvolu (Int_t &nlev, Int_t *lnam, Int_t *lnum, Int_t &ier)
type_of_call void gtnext ()
type_of_call void gudigi ()
void guhadr ()
void guout ()
void guphad ()
void gudcay ()
void guiget (Int_t &, Int_t &, Int_t &)
void guinme (Float_t *, Int_t &, Float_t *, Int_t &IYES)
void guinti ()
void gunear (Int_t &, Int_t &, Float_t *, Int_t &)
void guskip (Int_t &ISKIP)
void guswim (Float_t &CHARGE, Float_t &STEP, Float_t *VECT, Float_t *VOUT)
void guview (Int_t &, Int_t &, DEFCHARD, Int_t &DEFCHARL)
void gupara ()
Float_t gudtim (Float_t &, Float_t &, Int_t &, Int_t &)
Float_t guplsh (Int_t &, Int_t &)
void gutrak ()
void gutrev ()
void gufld (Double_t *xdouble, Double_t *bdouble)
void eustep ()
void gustep ()
void gukine ()

Variables

TGeant3geant3
TGeoManager * gGeoManager
int Dither::gNInOut = 0
int Dither::gLastExitVol = -1
double Dither::gLastExitPos [3] = {0}
const int Dither::kMaxNInOut = 5
int Stuck::gNStuck = 0
double Stuck::gLastZPos = 0.
const int Stuck::kMaxNStuck = 5

Define Documentation

#define calsig   calsig_

Definition at line 36 of file TGeant3gu.cxx.

Referenced by guphad().

#define eustep   eustep_

Definition at line 34 of file TGeant3gu.cxx.

#define fldist   fldist_

Definition at line 43 of file TGeant3gu.cxx.

#define flufin   flufin_

Definition at line 40 of file TGeant3gu.cxx.

#define g3helix   g3helix_

Definition at line 46 of file TGeant3gu.cxx.

#define g3helx3   g3helx3_

Definition at line 45 of file TGeant3gu.cxx.

#define g3invol   g3invol_

Definition at line 51 of file TGeant3gu.cxx.

#define g3last   g3last_

Definition at line 50 of file TGeant3gu.cxx.

#define g3media   g3media_

Definition at line 53 of file TGeant3gu.cxx.

#define g3rkuta   g3rkuta_

Definition at line 47 of file TGeant3gu.cxx.

#define g3tmany   g3tmany_

Definition at line 54 of file TGeant3gu.cxx.

#define g3tmedi   g3tmedi_

Definition at line 52 of file TGeant3gu.cxx.

#define g3tnext   g3tnext_

Definition at line 55 of file TGeant3gu.cxx.

#define g3track   g3track_

Definition at line 48 of file TGeant3gu.cxx.

#define gcalor   gcalor_

Definition at line 37 of file TGeant3gu.cxx.

Referenced by guhadr().

#define gfmdis   gfmdis_

Definition at line 44 of file TGeant3gu.cxx.

#define gfmfin   gfmfin_

Definition at line 41 of file TGeant3gu.cxx.

#define gheish   gheish_

Definition at line 39 of file TGeant3gu.cxx.

#define ginvol   ginvol_

Definition at line 56 of file TGeant3gu.cxx.

#define glvolu   glvolu_

Definition at line 61 of file TGeant3gu.cxx.

#define gmedia   gmedia_

Definition at line 60 of file TGeant3gu.cxx.

#define gpghei   gpghei_

Definition at line 42 of file TGeant3gu.cxx.

#define gtmany   gtmany_

Definition at line 58 of file TGeant3gu.cxx.

#define gtmedi   gtmedi_

Definition at line 57 of file TGeant3gu.cxx.

#define gtnext   gtnext_

Definition at line 62 of file TGeant3gu.cxx.

#define gtonly   gtonly_

Definition at line 59 of file TGeant3gu.cxx.

#define gtreveroot   gtreveroot_

Definition at line 49 of file TGeant3gu.cxx.

#define gudcay   gudcay_

Definition at line 17 of file TGeant3gu.cxx.

#define gudigi   gudigi_

Definition at line 13 of file TGeant3gu.cxx.

#define gudtim   gudtim_

Definition at line 25 of file TGeant3gu.cxx.

#define gufld   gufld_

Definition at line 30 of file TGeant3gu.cxx.

#define guhadr   guhadr_

Definition at line 14 of file TGeant3gu.cxx.

#define guiget   guiget_

Definition at line 18 of file TGeant3gu.cxx.

#define guinme   guinme_

Definition at line 19 of file TGeant3gu.cxx.

#define guinti   guinti_

Definition at line 20 of file TGeant3gu.cxx.

#define gukine   gukine_

Definition at line 32 of file TGeant3gu.cxx.

#define gunear   gunear_

Definition at line 21 of file TGeant3gu.cxx.

#define guout   guout_

Definition at line 15 of file TGeant3gu.cxx.

#define gupara   gupara_

Definition at line 24 of file TGeant3gu.cxx.

#define guphad   guphad_

Definition at line 16 of file TGeant3gu.cxx.

#define guplsh   guplsh_

Definition at line 26 of file TGeant3gu.cxx.

#define guskip   guskip_

Definition at line 22 of file TGeant3gu.cxx.

#define gustep   gustep_

Definition at line 31 of file TGeant3gu.cxx.

#define guswim   guswim_

Definition at line 29 of file TGeant3gu.cxx.

#define gutrak   gutrak_

Definition at line 28 of file TGeant3gu.cxx.

#define gutrev   gutrev_

Definition at line 27 of file TGeant3gu.cxx.

#define guview   guview_

Definition at line 23 of file TGeant3gu.cxx.


Function Documentation

type_of_call void calsig (  ) 
void eustep (  ) 

Definition at line 654 of file TGeant3gu.cxx.

References Gconst_t::big, Gcmore_t::cleng, MuELoss::e, TGeant3::Erxyzc(), TGeant3::Gcflag(), TGeant3::Gcmore(), TGeant3::Gconst(), TGeant3::Gctrak(), Gcmore_t::iclose, Gcflag_t::idebug, Gcflag_t::iswit, Gcmore_t::p1, Gcmore_t::p2, Gcmore_t::p3, Gcmore_t::pfinal, Particle::Sign(), Gctrak_t::sleng, Gctrak_t::vect, Gcmore_t::wire1, and Gcmore_t::wire2.

00654              {
00655 //
00656 //    ******************************************************************
00657 //    *                                                                *
00658 //    *       User routine called at the end of each tracking step     *
00659 //    *       when using GEANE                                         *
00660 //    ******************************************************************
00661 
00662    Int_t cflag;
00663    static  Int_t icc=0;
00664    static  Int_t icont=0;
00665    Float_t  dist2;
00666    static Float_t prdist2;
00667    Float_t  d2x,d2y,d2z,amodd;
00668 // clear icc when tracking starts
00669    if(geant3->Gctrak()->sleng == 0) icc = 0;
00670    cflag=geant3->Gcmore()->iclose;
00671    if (geant3->Gcflag()->idebug * geant3->Gcflag()->iswit[2] != 0)geant3->Erxyzc();
00672  
00673    // ---------------------------------------
00674    // A. Rotondi and L. Lavezzi (sept 2010)
00675    // changes to be able to approximate a solution when propagating
00676    // along z axis. In that case lambda is 90 deg and 1/cos(lambda)
00677    // becomes inf. Here when the theta angle drops below 1e-4 deg
00678    // we set it to 1e-4 and this allows to propagate (with a small
00679    // approximation) in the forward direction.
00680 
00681    // direction vector set unitary
00682    TVector3 dir(geant3->Gctrak()->vect[3], 
00683                 geant3->Gctrak()->vect[4],
00684                 geant3->Gctrak()->vect[5]);
00685    dir.SetMag(1.);
00686 
00687    if(dir.Mag() != 0.) {
00688      
00689      // if the direction is REALLY along z, (0., 0., 1), change it
00690      // a little
00691      if(dir.Z() == 1) dir.SetMagThetaPhi(1., 1e-9, gRandom->Uniform(0., 2 * TMath::Pi())); 
00692      
00693      Double_t cosLam0 = TMath::Sin(dir.Theta());
00694      
00695      // cos(lambda) < 2.e-6 means theta < 1e-4 deg
00696      if(TMath::Abs(cosLam0) < 2.e-6) {
00697  
00698        // cos(lambda) @ limit angle
00699        Double_t cosLam = TMath::Sign(1., cosLam0) * 2.e-6;
00700        Double_t sinLam = TMath::Sqrt(1 - cosLam * cosLam);
00701        
00702        // px, py, pz reset to limit angle
00703        dir.SetX(dir.X() * (cosLam/cosLam0));
00704        dir.SetY(dir.Y() * (cosLam/cosLam0));
00705        dir.SetZ(sinLam);
00706        dir.SetMag(1.);
00707        geant3->Gctrak()->vect[3] = dir.X();
00708        geant3->Gctrak()->vect[4] = dir.Y();
00709        geant3->Gctrak()->vect[5] = dir.Z();
00710        
00711      }
00712    }
00713    // ---------------------------------------
00714 
00715 
00716 
00717    if(cflag==1){
00718 // distance between the track point and the point
00719       if(icc==0) prdist2=geant3->Gconst()->big;
00720          dist2 = (geant3->Gctrak()->vect[0] - geant3->Gcmore()->pfinal[0])*
00721               (geant3->Gctrak()->vect[0] - geant3->Gcmore()->pfinal[0])+
00722               (geant3->Gctrak()->vect[1] - geant3->Gcmore()->pfinal[1])*
00723               (geant3->Gctrak()->vect[1] - geant3->Gcmore()->pfinal[1])+
00724               (geant3->Gctrak()->vect[2] - geant3->Gcmore()->pfinal[2])*
00725               (geant3->Gctrak()->vect[2] - geant3->Gcmore()->pfinal[2]);
00726 
00727       if((TMath::Sqrt(dist2)-TMath::Sqrt(prdist2)) < 1.e-3){
00728          prdist2 = dist2;
00729          icc = 1;
00730          icont = 1;
00731          geant3->Gcmore()->cleng[0] = geant3->Gcmore()->cleng[1];
00732          geant3->Gcmore()->cleng[1] = geant3->Gcmore()->cleng[2];
00733          geant3->Gcmore()->cleng[2] = geant3->Gctrak()->sleng;
00734          for(Int_t i=0; i<3; i++)geant3->Gcmore()->p1[i] = geant3->Gcmore()->p2[i];  //call ucopy(p2,p1,3)
00735          for(Int_t i=0; i<3; i++)geant3->Gcmore()->p2[i] = geant3->Gcmore()->p3[i];  //call ucopy(p3,p2,3)
00736          for(Int_t i=0; i<3; i++)geant3->Gcmore()->p3[i] = geant3->Gctrak()->vect[i]; //call ucopy(vect,p3,3)
00737       }else{ // store the first point of increasing distance
00738          if(icont == 1) {
00739             geant3->Gcmore()->cleng[0] = geant3->Gcmore()->cleng[1];
00740             geant3->Gcmore()->cleng[1] = geant3->Gcmore()->cleng[2];
00741             geant3->Gcmore()->cleng[2] = geant3->Gctrak()->sleng;
00742             for(Int_t i=0; i<3; i++)geant3->Gcmore()->p1[i] = geant3->Gcmore()->p2[i];  //call ucopy(p2,p1,3)
00743             for(Int_t i=0; i<3; i++)geant3->Gcmore()->p2[i] = geant3->Gcmore()->p3[i];  //call ucopy(p3,p2,3)
00744             for(Int_t i=0; i<3; i++)geant3->Gcmore()->p3[i] = geant3->Gctrak()->vect[i]; //call ucopy(vect,p3,3)
00745             icont = 0;
00746          }
00747       }
00748    }else if(cflag==2) {
00749    //   printf("geant3->Gconst()->big = %F" ,geant3->Gconst());
00750       if(icc == 0) prdist2=geant3->Gconst()->big;
00751       d2x = (geant3->Gcmore()->wire2[1]-geant3->Gcmore()->wire1[1])*
00752             (geant3->Gcmore()->wire1[2]-geant3->Gctrak()->vect[2])-
00753             (geant3->Gcmore()->wire2[2]-geant3->Gcmore()->wire1[2])*
00754             (geant3->Gcmore()->wire1[1]-geant3->Gctrak()->vect[1]);
00755 
00756       d2y = (geant3->Gcmore()->wire2[2]-geant3->Gcmore()->wire1[2])*
00757             (geant3->Gcmore()->wire1[0]-geant3->Gctrak()->vect[0])-
00758             (geant3->Gcmore()->wire2[0]-geant3->Gcmore()->wire1[0])*
00759             (geant3->Gcmore()->wire1[2]-geant3->Gctrak()->vect[2]);
00760 
00761       d2z = (geant3->Gcmore()->wire2[0]-geant3->Gcmore()->wire1[0])*
00762             (geant3->Gcmore()->wire1[1]-geant3->Gctrak()->vect[1])-
00763             (geant3->Gcmore()->wire2[1]-geant3->Gcmore()->wire1[1])*
00764             (geant3->Gcmore()->wire1[0]-geant3->Gctrak()->vect[0]);
00765 
00766       amodd =(geant3->Gcmore()->wire2[0]-geant3->Gcmore()->wire1[0])*
00767              (geant3->Gcmore()->wire2[0]-geant3->Gcmore()->wire1[0])+
00768              (geant3->Gcmore()->wire2[1]-geant3->Gcmore()->wire1[1])*
00769              (geant3->Gcmore()->wire2[1]-geant3->Gcmore()->wire1[1])+
00770              (geant3->Gcmore()->wire2[2]-geant3->Gcmore()->wire1[2])*
00771              (geant3->Gcmore()->wire2[2]-geant3->Gcmore()->wire1[2]);
00772 
00773       dist2 = (d2x*d2x + d2y*d2y + d2z*d2z)/amodd;
00774 
00775 //   distance between the track point and the wire
00776       if((TMath::Sqrt(dist2)-TMath::Sqrt(prdist2)) < 1.e-3) {
00777          prdist2 = dist2;
00778          icc=1;
00779          icont = 1;
00780          geant3->Gcmore()->cleng[0] = geant3->Gcmore()->cleng[1];
00781          geant3->Gcmore()->cleng[1] = geant3->Gcmore()->cleng[2];
00782          geant3->Gcmore()->cleng[2] = geant3->Gctrak()->sleng;
00783          for(Int_t i=0; i<3; i++)geant3->Gcmore()->p1[i] = geant3->Gcmore()->p2[i];  //call ucopy(p2,p1,3)
00784          for(Int_t i=0; i<3; i++)geant3->Gcmore()->p2[i] = geant3->Gcmore()->p3[i];  //call ucopy(p3,p2,3)
00785          for(Int_t i=0; i<3; i++)geant3->Gcmore()->p3[i] = geant3->Gctrak()->vect[i]; //call ucopy(vect,p3,3)
00786       }else{ //     store the first point of increasing distance
00787          if(icont == 1){
00788             geant3->Gcmore()->cleng[0] = geant3->Gcmore()->cleng[1];
00789             geant3->Gcmore()->cleng[1] = geant3->Gcmore()->cleng[2];
00790             geant3->Gcmore()->cleng[2] = geant3->Gctrak()->sleng;
00791             for(Int_t i=0; i<3; i++)geant3->Gcmore()->p1[i] = geant3->Gcmore()->p2[i];  //call ucopy(p2,p1,3)
00792             for(Int_t i=0; i<3; i++)geant3->Gcmore()->p2[i] = geant3->Gcmore()->p3[i];  //call ucopy(p3,p2,3)
00793             for(Int_t i=0; i<3; i++)geant3->Gcmore()->p3[i] = geant3->Gctrak()->vect[i]; //call ucopy(vect,p3,3)
00794             icont = 0;
00795          }
00796       }
00797    }
00798 
00799     // --- Particle leaving the setup ?
00800    if (!gMC->IsTrackOut()) {
00801       TVirtualMCApplication *app = TVirtualMCApplication::Instance();
00802       app->GeaneStepping();
00803    }
00804 
00805 }

type_of_call void fldist (  ) 
type_of_call void flufin (  ) 
type_of_call void g3helix ( Float_t &  ,
Float_t &  ,
Float_t *  ,
Float_t *   
)
type_of_call void g3helx3 ( Float_t &  ,
Float_t &  ,
Float_t *  ,
Float_t *   
)
type_of_call void g3invol ( Float_t *  ,
Int_t &   
)
type_of_call void g3last (  ) 
type_of_call void g3media ( Float_t *  ,
Int_t &  ,
Int_t &   
)
type_of_call void g3rkuta ( Float_t &  ,
Float_t &  ,
Float_t *  ,
Float_t *   
)
type_of_call void g3tmany ( Int_t &   ) 
type_of_call void g3tmedi ( Float_t *  ,
Int_t &   
)
type_of_call void g3tnext (  ) 
type_of_call void g3track (  ) 
type_of_call void gcalor (  ) 
type_of_call void gfmdis (  ) 
type_of_call void gfmfin (  ) 
type_of_call void gheish (  ) 
type_of_call void ginvol ( Float_t *  ,
Int_t &   
)

Definition at line 6693 of file TGeant3.cxx.

References fginvol.

06694 {
06695    fginvol(x,isame);
06696 }

type_of_call void glvolu ( Int_t &  nlev,
Int_t *  lnam,
Int_t *  lnum,
Int_t &  ier 
)

Definition at line 6757 of file TGeant3.cxx.

References fglvolu.

06758 {
06759   //
06760   //  nlev   number of levels deep into the volume tree
06761   //         size of the arrays lnam and lnum
06762   //  lnam   an integer array who's 4 bytes contain the ASCII code for the
06763   //         volume names
06764   //  lnum   an integer array containing the copy numbers for that specific
06765   //         volume
06766   //
06767   //  This routine fills the volume parameters in common /gcvolu/ for a
06768   //  physical tree, specified by the list lnam and lnum of volume names
06769   //  and numbers, and for all its ascendants up to level 1. This routine
06770   //  is optimized and does not re-compute the part of the history already
06771   //  available in GCVOLU. This means that if it is used in user programs
06772   //  outside the usual framework of the tracking, the user has to initialize
06773   //  to zero NLEVEL in the common GCVOLU. It return 0 if there were no
06774   //  problems in make the call.
06775   //
06776 // printf("glvolu called\n");
06777 
06778   fglvolu(nlev, lnam, lnum, ier);
06779 }

type_of_call void gmedia ( Float_t *  ,
Int_t &  ,
Int_t &   
)

Definition at line 6719 of file TGeant3.cxx.

References count_gmedia, fgmedia, TGeant3::GetPath(), Gctrak_t::safety, Gctrak_t::snext, and Gctrak_t::step.

06720 {
06721    fgmedia(x,numed,check);
06722 #ifdef STATISTICS
06723   statcode = 1;
06724   statsame = 0;
06725   for (int j=0;j<6;j++) if (j <3) oldvect[j] = x[j]; else oldvect[j]=0;
06726   oldsafety = gctrak->safety;
06727   oldstep   = gctrak->step;
06728   sprintf(statpath,"%s",geant3->GetPath());
06729   statsnext=gctrak->snext;
06730   statsafety=gctrak->safety;
06731   stattree->Fill();
06732   count_gmedia++;
06733 #endif
06734 }

type_of_call void gpghei (  ) 
type_of_call void gtmany ( Int_t &   ) 

Definition at line 6737 of file TGeant3.cxx.

References fgtmany.

06738 {
06739    fgtmany(level1);
06740 }

type_of_call void gtmedi ( Float_t *  ,
Int_t &   
)

Definition at line 6700 of file TGeant3.cxx.

References count_gtmedi, fgtmedi, TGeant3::GetPath(), Gcchan_t::lsamvl, Gctrak_t::safety, Gctrak_t::snext, and Gctrak_t::step.

06701 {
06702    fgtmedi(x,numed);
06703 #ifdef STATISTICS
06704    statcode = 2;
06705    statsame = gcchan->lsamvl;
06706    for (int j=0;j<6;j++) if (j <3) oldvect[j] = x[j]; else oldvect[j]=0;
06707    oldsafety = gctrak->safety;
06708    oldstep   = gctrak->step;
06709    sprintf(statpath,"%s",geant3->GetPath());
06710    statsnext=gctrak->snext;
06711    statsafety=gctrak->safety;
06712    stattree->Fill();
06713    count_gtmedi++;
06714 #endif
06715 }

type_of_call void gtnext (  ) 

Definition at line 6783 of file TGeant3.cxx.

References count_gtnext, fgtnext, TGeant3::GetPath(), Gctrak_t::safety, Gctrak_t::snext, Gctrak_t::step, and Gctrak_t::vect.

06784 {
06785 #ifdef STATISTICS
06786    count_gtnext++;
06787    statcode = 3;
06788    statsame = 1;
06789    for (int j=0;j<6;j++) oldvect[j] = gctrak->vect[j];
06790    oldsafety = gctrak->safety;
06791    oldstep   = gctrak->step;
06792    sprintf(statpath,"%s",geant3->GetPath());
06793 #endif
06794 
06795    fgtnext();
06796 
06797 #ifdef STATISTICS
06798   statsnext=gctrak->snext;
06799   statsafety=gctrak->safety;
06800   stattree->Fill();
06801 #endif
06802 }

type_of_call void gtonly ( Int_t &   ) 

Definition at line 6750 of file TGeant3.cxx.

References fgtonly.

06751 {
06752    //with Geant3, return gonly(nlevel);
06753    fgtonly(isOnly);
06754 }

type_of_call void gtreveroot (  ) 
void gudcay (  ) 

Definition at line 266 of file TGeant3gu.cxx.

References TGeant3::Gckin3(), TGeant3::Gckine(), TGeant3::Gcking(), TGeant3::Gctrak(), Gctrak_t::getot, TGeant3::GetUserDecayProductStableMinLifetime(), Gcking_t::gkin, Gckin3_t::gpos, Gckine_t::ipart, Gcking_t::ngkine, TGeant3::SkipNeutrinos(), Gcking_t::tofd, and Gctrak_t::vect.

00267 {
00268 //
00269 //    ******************************************************************
00270 //    *                                                                *
00271 //    *       User routine to decay particles                          *
00272 //    *                                                                *
00273 //    *    ==>Called by : G3DECAY                                      *
00274 //    *                                                                *
00275 //    ******************************************************************
00276 //
00277 //
00278 //    ------------------------------------------------------------------
00279 //
00280 
00281     // set decay table
00282     if (!gMC->GetDecayer()) return;
00283     gMC->GetDecayer()->ForceDecay();
00284 
00285 //sk:begin Modified 2007/09/06 to add support for configuring user decay 
00286     // Minimum lifetime in order to consider decay products stable
00287     Double_t minLifetime = geant3->GetUserDecayProductStableMinLifetime();
00288 //sk:end 
00289 
00290 // Initialize 4-momentum vector    
00291     Int_t ipart = geant3->Gckine()->ipart;
00292     static TLorentzVector p;
00293 
00294     Float_t pmom = geant3->Gctrak()->vect[6];
00295 
00296     p[0] = pmom * (geant3->Gctrak()->vect[3]);
00297     p[1] = pmom * (geant3->Gctrak()->vect[4]);
00298     p[2] = pmom * (geant3->Gctrak()->vect[5]);
00299     p[3] = geant3->Gctrak()->getot;
00300 
00301 
00302 // Convert from geant to lund particle code
00303     Int_t iplund=gMC->PDGFromId(ipart);
00304 
00305 // Particle list
00306     static TClonesArray *particles;
00307     if(!particles) particles=new TClonesArray("TParticle",1000);
00308 // Decay
00309     gMC->GetDecayer()->Decay(iplund, &p);
00310 
00311 // Fetch Particles
00312     Int_t np = geant3->GetDecayer()->ImportParticles(particles);
00313     if (np <=1) return;
00314 
00315     TParticle *  iparticle = (TParticle *) particles->At(0);
00316     Int_t ipF = 0, ipL = 0 ;
00317     Int_t i,j;
00318 
00319 // Array to flag deselected particles
00320     Int_t*  pFlag = new Int_t[np];
00321     for (i=0; i<np; i++) pFlag[i]=0;
00322 // Particle loop
00323     for (i=1; i < np; i++)
00324     {
00325         iparticle = (TParticle *) particles->At(i);
00326         ipF = iparticle->GetFirstDaughter();
00327         ipL = iparticle->GetLastDaughter();
00328         Int_t kf = iparticle->GetPdgCode();
00329         Int_t ks = iparticle->GetStatusCode();
00330 //
00331 // Deselect daughters of deselected particles
00332 // and jump skip the current particle
00333         if (pFlag[i] == 1) {
00334             if (ipF > 0) for (j=ipF-1; j<ipL; j++) pFlag[j]=1;
00335             continue;
00336         } // deselected ??
00337 // Particles with long life-time are put on the stack for further tracking
00338 // Decay products are deselected
00339 //
00340         if (ks != 1) {
00341             Double_t lifeTime = gMC->GetDecayer()->GetLifetime(kf);
00342 //sk:begin Modified 2007/09/06 to add support for configuring user decay 
00343             if (lifeTime > minLifetime) {
00344 //sk:end
00345                 if (ipF > 0) for (j=ipF-1; j<ipL; j++) pFlag[j]=1;
00346             } else{
00347                 continue;
00348             }
00349         } // ks==1 ?
00350 // Skip neutrinos
00351         if (geant3->SkipNeutrinos()) {
00352            if (kf==12 || kf ==-12) continue;
00353            if (kf==14 || kf ==-14) continue;
00354            if (kf==16 || kf ==-16) continue;
00355         }
00356 
00357         Int_t index=geant3->Gcking()->ngkine;
00358 // Put particle on geant stack
00359 // momentum vector
00360 
00361         (geant3->Gcking()->gkin[index][0]) = iparticle->Px();
00362         (geant3->Gcking()->gkin[index][1]) = iparticle->Py();
00363         (geant3->Gcking()->gkin[index][2]) = iparticle->Pz();
00364         (geant3->Gcking()->gkin[index][3]) = iparticle->Energy();
00365         Int_t ilu = gMC->IdFromPDG(kf);
00366 
00367 // particle type
00368         (geant3->Gcking()->gkin[index][4]) = Float_t(ilu);
00369 // position
00370         (geant3->Gckin3()->gpos[index][0]) = geant3->Gctrak()->vect[0];
00371         (geant3->Gckin3()->gpos[index][1]) = geant3->Gctrak()->vect[1];
00372         (geant3->Gckin3()->gpos[index][2]) = geant3->Gctrak()->vect[2];
00373 // time of flight offset (mm)
00374         (geant3->Gcking()->tofd[index])    = 0.;
00375 // increase stack counter
00376         (geant3->Gcking()->ngkine)=index+1;
00377     }
00378     delete[] pFlag;
00379 }

type_of_call void gudigi (  ) 

Definition at line 168 of file TGeant3gu.cxx.

00169 {
00170 //
00171 //    ******************************************************************
00172 //    *                                                                *
00173 //    *       User routine to digitize one event                       *
00174 //    *                                                                *
00175 //    *    ==>Called by : GTRIG                                        *
00176 //    *                                                                *
00177 //    ******************************************************************
00178 
00179 }

Float_t gudtim ( Float_t &  ,
Float_t &  ,
Int_t &  ,
Int_t &   
)

Definition at line 544 of file TGeant3gu.cxx.

00545 {
00546 //
00547 //    ******************************************************************
00548 //    *                                                                *
00549 //    *       User function called by GCDRIF to return drift time      *
00550 //    *                                                                *
00551 //    *    ==>Called by : GCDRIF                                       *
00552 //    *                                                                *
00553 //    ******************************************************************
00554 //
00555 //
00556 //    ------------------------------------------------------------------
00557 //
00558       return 0;
00559 }

void gufld ( Double_t *  xdouble,
Double_t *  bdouble 
)

Definition at line 629 of file TGeant3gu.cxx.

References warn().

00630 {
00631 #endif
00632 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,23,0)
00633   if ( gMC->GetMagField() ) {
00634     gMC->GetMagField()->Field(xdouble,bdouble);
00635   }
00636   else {  
00637     static Bool_t warn = true;   
00638     if (warn) { 
00639       Warning("gufld", "Using deprecated function TVirtualMCApplication::Field().");
00640       Warning("gufld", "New TVirtualMagField interface should be used instead.");
00641       warn = false;
00642     }        
00643 #endif
00644     TVirtualMCApplication::Instance()->Field(xdouble,bdouble);
00645 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,23,0)
00646   }  
00647 #endif
00648 
00649 #ifdef SINGLEFIELD
00650   for (Int_t j=0; j<3; j++) b[j] = bdouble[j];
00651 #endif
00652 }

void guhadr (  ) 

Definition at line 183 of file TGeant3gu.cxx.

References flufin, gcalor, TGeant3::Gcphys(), gfmfin, gheish, and Gcphys_t::ihadr.

00184 {
00185 //
00186 //    ******************************************************************
00187 //    *                                                                *
00188 //    *       User routine to generate one hadronic interaction        *
00189 //    *                                                                *
00190 //    *    ==>Called by : GTHADR,GTNEUT                                *
00191 //    *                                                                *
00192 //    ******************************************************************
00193 //
00194 //
00195 //    ------------------------------------------------------------------
00196 //
00197 //sk:begin
00198 // Modified S. Kasahara 2006/02/08 Add gcalor call.  Hadronic codes defined 
00199 // such that
00200 //  ihadr < 4 => GHEISHA
00201 //        = 4 => FLUKA
00202 //        = 5 => MICAP(low E)/FLUKA(high E)
00203 //        = 6 => GCALOR
00204       Int_t ihadr = geant3->Gcphys()->ihadr;
00205       if (ihadr==4)      flufin();
00206       else if (ihadr==5) gfmfin();
00207       else if (ihadr==6) gcalor();
00208       else               gheish();
00209 //sk:end
00210 
00211 }

void guiget ( Int_t &  ,
Int_t &  ,
Int_t &   
)

Definition at line 382 of file TGeant3gu.cxx.

00383 {
00384 //
00385 //    ******************************************************************
00386 //    *                                                                *
00387 //    *       User routine for interactive control of GEANT            *
00388 //    *                                                                *
00389 //    *    ==>Called by : <GXINT>, GINCOM                              *
00390 //    *                                                                *
00391 //    ******************************************************************
00392 //
00393 //
00394 //    ------------------------------------------------------------------
00395 //
00396 }

void guinme ( Float_t *  ,
Int_t &  ,
Float_t *  ,
Int_t &  IYES 
)

Definition at line 399 of file TGeant3gu.cxx.

00400 {
00401 //
00402 //    **********************************************
00403 //    *                                            *
00404 //    *    USER ROUTINE TO PROVIDE GINME FUNCTION  *
00405 //    *    FOR ALL USER SHAPES IDENTIFIED BY THE   *
00406 //    *    SHAPE NUMBER SH. POINT IS GIVEN IN X    *
00407 //    *    THE PARAMETERS ARE GIVEN IN P. IYES IS  *
00408 //    *    RETURNED 1 IF POINT IS IN, 0 IF POINT   *
00409 //    *    IS OUT AND LESS THAN ZERO IF SHAPE      *
00410 //    *    NUMBER IS NOT SUPPORTED.                *
00411 //    *                                            *
00412 //    *    ==>Called by : GINME                    *
00413 //    *                                            *
00414 //    **********************************************
00415 //
00416       IYES=-1;
00417 }

void guinti (  ) 

Definition at line 420 of file TGeant3gu.cxx.

00421 {
00422 //
00423 //    ******************************************************************
00424 //    *                                                                *
00425 //    *       User routine for interactive version                     *
00426 //    *                                                                *
00427 //    *    ==>Called by : <GXINT>,  GINTRI                             *
00428 //    *                                                                *
00429 //    ******************************************************************
00430 //
00431 //
00432 //    ------------------------------------------------------------------
00433 //
00434 }

void gukine (  ) 

Definition at line 1011 of file TGeant3gu.cxx.

01012 {
01013 //
01014 //    ******************************************************************
01015 //    *                                                                *
01016 //    *       Read or Generates Kinematics for primary tracks          *
01017 //    *                                                                *
01018 //    *    ==>Called by : GTRIG                                        *
01019 //    *                                                                *
01020 //    ******************************************************************
01021 //
01022 //
01023 //    ------------------------------------------------------------------
01024 //
01025 
01026   TVirtualMCApplication::Instance()->GeneratePrimaries();
01027 }

void gunear ( Int_t &  ,
Int_t &  ,
Float_t *  ,
Int_t &   
)

Definition at line 437 of file TGeant3gu.cxx.

00438 {
00439 //
00440 //    ******************************************************************
00441 //    *                                                                *
00442 //    *    User search                                                 *
00443 //    *       ISEARC to identify the given volume                      *
00444 //    *       ICALL  to identify the calling routine                   *
00445 //    *              1 GMEDIA like                                     *
00446 //    *              2 GNEXT like                                      *
00447 //    *       X      coordinates (+direction for ICALL=2)              *
00448 //    *       JNEAR  address of default list of neighbours             *
00449 //    *              (list to be overwriten by user)                   *
00450 //    *                                                                *
00451 //    *    Called by : GFTRAC, GINVOL, GTMEDI, GTNEXT, GNEXT, GMEDIA   *
00452 //    *                                                                *
00453 //    ******************************************************************
00454 //
00455 //
00456 //    ------------------------------------------------------------------
00457 //
00458 }

void guout (  ) 

Definition at line 214 of file TGeant3gu.cxx.

00215 {
00216 //
00217 //    ******************************************************************
00218 //    *                                                                *
00219 //    *       User routine called at the end of each event             *
00220 //    *                                                                *
00221 //    *    ==>Called by : GTRIG                                        *
00222 //    *                                                                *
00223 //    ******************************************************************
00224 //
00225 //
00226 //    ------------------------------------------------------------------
00227 //
00228   //printf("count_gmedia= %8d\n",count_gmedia);
00229   //printf("count_gtmedi= %8d\n",count_gtmedi);
00230   //printf("count_ginvol= %8d\n",count_ginvol);
00231   //printf("count_gtnext= %8d\n",count_gtnext);
00232 }

void gupara (  ) 

Definition at line 524 of file TGeant3gu.cxx.

00525 {
00526 //
00527 //    ******************************************************************
00528 //    *                                                                *
00529 //    *       User routine called every time a particle falls below    *
00530 //    *       parametrization threshold. This routine should create    *
00531 //    *       the parametrization stack, and, when this is full,       *
00532 //    *       parametrize the shower and track the geantinos.          *
00533 //    *                                                                *
00534 //    *    ==>Called by : GTRACK                                       *
00535 //    *                                                                *
00536 //    ******************************************************************
00537 //
00538 //
00539 //    ------------------------------------------------------------------
00540 //
00541 }

void guphad (  ) 

Definition at line 235 of file TGeant3gu.cxx.

References calsig, fldist, TGeant3::Gcphys(), gfmdis, gpghei, and Gcphys_t::ihadr.

00236 {
00237 //
00238 //    ******************************************************************
00239 //    *                                                                *
00240 //    *       User routine to compute Hadron. inter. probabilities     *
00241 //    *                                                                *
00242 //    *    ==>Called by : GTHADR,GTNEUT                                *
00243 //    *                                                                *
00244 //    ******************************************************************
00245 //
00246 //
00247 //    ------------------------------------------------------------------
00248 //
00249 //sk:begin
00250 // Modified S. Kasahara 2006/02/08 Add calsig call.  Hadronic codes defined 
00251 // such that
00252 //  ihadr < 4 => GHEISHA
00253 //        = 4 => FLUKA
00254 //        = 5 => MICAP(low E)/FLUKA(high E)
00255 //        = 6 => GCALOR
00256       Int_t ihadr = geant3->Gcphys()->ihadr;
00257       if      (ihadr==4) fldist();
00258       else if (ihadr==5) gfmdis();
00259       else if (ihadr==6) calsig();
00260       else               gpghei();
00261 //sk:end
00262 
00263 }

Float_t guplsh ( Int_t &  ,
Int_t &   
)

Definition at line 563 of file TGeant3gu.cxx.

00564 {
00565 //
00566 //    ******************************************************************
00567 //    *                                                                *
00568 //    *                                                                *
00569 //    *    ==>Called by : GLISUR                                       *
00570 //    *                                                                *
00571 //    ******************************************************************
00572 //
00573 //
00574 //    ------------------------------------------------------------------
00575 //
00576 //
00577 //*** By default this defines perfect smoothness
00578       return 1;
00579 }

void guskip ( Int_t &  ISKIP  ) 

Definition at line 461 of file TGeant3gu.cxx.

00462 {
00463 //
00464 //    ******************************************************************
00465 //    *                                                                *
00466 //    *   User routine to skip unwanted tracks                         *
00467 //    *                                                                *
00468 //    *   Called by : GSSTAK                                           *
00469 //    *   Author    : F.Bruyant                                        *
00470 //    *                                                                *
00471 //    ******************************************************************
00472 //
00473 //
00474 //    ------------------------------------------------------------------
00475 //
00476       ISKIP = 0;
00477 }

void gustep (  ) 

Definition at line 807 of file TGeant3gu.cxx.

References Gctmed_t::epsil, TGeant3::Gcflag(), TGeant3::Gckin2(), TGeant3::Gckin3(), TGeant3::Gckine(), TGeant3::Gcking(), TGeant3::Gctmed(), TGeant3::Gctrak(), TGeant3::Gdebug(), gGeoManager, Gcking_t::gkin, Dither::gLastExitPos, Dither::gLastExitVol, Stuck::gLastZPos, Dither::gNInOut, Stuck::gNStuck, Gckin3_t::gpos, Gcflag_t::idebug, Gctmed_t::ifield, Gckine_t::ipart, Dither::kMaxNInOut, Stuck::kMaxNStuck, Gcking_t::ngkine, Gckin2_t::ngphot, Gctrak_t::nstep, Gctrak_t::safety, TGeant3::SetTrack(), TGeant3::SkipNeutrinos(), Gctrak_t::tofg, TGeant3::TrackPosition(), Gctrak_t::vect, and Gckin2_t::xphot.

00808 {
00809 //
00810 //    ******************************************************************
00811 //    *                                                                *
00812 //    *       User routine called at the end of each tracking step     *
00813 //    *       INWVOL is different from 0 when the track has reached    *
00814 //    *              a volume boundary                                 *
00815 //    *       ISTOP is different from 0 if the track has stopped       *
00816 //    *                                                                *
00817 //    *    ==>Called by : GTRACK                                       *
00818 //    *                                                                *
00819 //    ******************************************************************
00820 //
00821   Int_t ipp, jk, nt;
00822   Float_t polar[3]={0,0,0};
00823   Float_t mom[3];
00824   static TMCProcess pProc;
00825 
00826   TVirtualMCApplication *app = TVirtualMCApplication::Instance();
00827   TVirtualMCStack* stack = gMC->GetStack();
00828   //     Stop particle if outside user defined tracking region
00829   Double_t x, y, z, rmax;
00830   geant3->TrackPosition(x,y,z);
00831 
00832   if (gMC->IsCollectTracks()) {
00833      Int_t nstep = geant3->Gctrak()->nstep;
00834      Int_t cpdg = gMC->PDGFromId(geant3->Gckine()->ipart);
00835      Bool_t isnew = kFALSE; // gMC->IsNewTrack() returns true just for new used indices
00836      if (nstep==0) isnew = kTRUE;
00837      Int_t cid = stack->GetCurrentTrackNumber();
00838      Int_t mid = stack->GetCurrentParentTrackNumber();
00839      Double_t tofg = geant3->Gctrak()->tofg;
00840      //printf("id=%i mid=%i pdg=%i nstep=%i (%f,%f,%f)\n",cid,mid,cpdg,nstep,x,y,z);
00841      TVirtualGeoTrack *parent = 0;
00842      if (mid>=0) {
00843         parent = gGeoManager->FindTrackWithId(mid);
00844         if (!parent) printf("Error: no parent track with id=%i\n",mid);
00845      }
00846      TVirtualGeoTrack *track;
00847      if (isnew) {
00848         if (parent) {
00849            //printf("Adding daughter %i of %i\n",cid,mid);
00850            track = parent->AddDaughter(cid, cpdg);
00851            gGeoManager->SetCurrentTrack(track);
00852         } else {
00853            Int_t itrack = gGeoManager->AddTrack(cid, cpdg);
00854            //printf("Added new primary %i\n",cid);
00855            gGeoManager->SetCurrentTrack(itrack);
00856            track = gGeoManager->GetCurrentTrack();
00857         }
00858         TDatabasePDG *pdgdb = TDatabasePDG::Instance();
00859         if (pdgdb) {
00860            TParticlePDG *part = pdgdb->GetParticle(cpdg);
00861            if (part) {
00862               track->SetName(part->GetName());
00863               track->SetParticle(part);
00864            }
00865         }
00866      } else {
00867         track = gGeoManager->GetCurrentTrack();
00868      }
00869      Double_t xo,yo,zo,to;
00870      Bool_t skippoint = kFALSE;
00871      if (track->HasPoints()) {
00872         track->GetLastPoint(xo,yo,zo,to);
00873         Double_t rdist = TMath::Sqrt((xo-x)*(xo-x)+(yo-y)*(yo-y)+(zo-z)*(zo-z));
00874         if (rdist<0.01) skippoint=kTRUE;
00875      }
00876      if (!skippoint) track->AddPoint(x,y,z,tofg);
00877   } /*end collecting tracks*/
00878 
00879   rmax = app->TrackingRmax();
00880   if (x*x+y*y > rmax*rmax ||
00881       TMath::Abs(z) > app->TrackingZmax()) {
00882         gMC->StopTrack();
00883   }
00884 
00885   // --- Add new created particles
00886   if (gMC->NSecondaries() > 0) {
00887     pProc=gMC->ProdProcess(0);
00888     for (jk = 0; jk < geant3->Gcking()->ngkine; ++jk) {
00889       ipp = Int_t (geant3->Gcking()->gkin[jk][4]+0.5);
00890       // --- Skip neutrinos!
00891       if (ipp != 4 || !(geant3->SkipNeutrinos())) {
00892         geant3->SetTrack(1,stack->GetCurrentTrackNumber(),gMC->PDGFromId(ipp), geant3->Gcking()->gkin[jk],
00893                          geant3->Gckin3()->gpos[jk], polar,geant3->Gctrak()->tofg, pProc, nt, 1., 0);
00894       }
00895     }
00896   }
00897   // Cherenkov photons here
00898   if ( geant3->Gckin2()->ngphot ) {
00899     for (jk = 0; jk < geant3->Gckin2()->ngphot; ++jk) {
00900       mom[0]=geant3->Gckin2()->xphot[jk][3]*geant3->Gckin2()->xphot[jk][6];
00901       mom[1]=geant3->Gckin2()->xphot[jk][4]*geant3->Gckin2()->xphot[jk][6];
00902       mom[2]=geant3->Gckin2()->xphot[jk][5]*geant3->Gckin2()->xphot[jk][6];
00903       geant3->SetTrack(1, stack->GetCurrentTrackNumber(), gMC->PDGFromId(50),
00904                        mom,                             //momentum
00905                        geant3->Gckin2()->xphot[jk],     //position
00906                        &geant3->Gckin2()->xphot[jk][7], //polarisation
00907                        geant3->Gckin2()->xphot[jk][10], //time of flight
00908                        kPCerenkov, nt, 1., 0);
00909       }
00910   }
00911   // --- Particle leaving the setup ?
00912   if (!gMC->IsTrackOut()) app->Stepping();
00913 
00914 // sk:begin
00915 // Modified 2006/06/01 S. Kasahara, to apply a push if the track is stuck 
00916 // at the boundary of a volume, repeatedly entering/exiting the same 
00917 // volume.  Modeled after similar idea in R. Hatcher's gminos.
00918   Int_t volcopy=0;
00919   if ( gMC->IsNewTrack() ) {
00920     Dither::gLastExitVol = -1;
00921     Dither::gNInOut = 0;
00922     for ( int ic = 0; ic < 3; ic++ ) Dither::gLastExitPos[ic] = 0.;
00923   }
00924   else if ( gMC->IsTrackExiting() ) {
00925     if ( Dither::gNInOut >= Dither::kMaxNInOut ) {
00926       // Track has been stuck for several iterations in this volume,
00927       // apply a push.  magnitude increases with each stuck iteration.
00928       Float_t strength = (Float_t)(Dither::gNInOut-Dither::kMaxNInOut+2);
00929       Float_t steppush = strength*(geant3->Gctmed()->epsil);
00930       
00931       geant3->Gctrak()->vect[0] = geant3->Gctrak()->vect[0]
00932                                 + steppush*(geant3->Gctrak()->vect[3]);
00933       geant3->Gctrak()->vect[1] = geant3->Gctrak()->vect[1]
00934                                 + steppush*(geant3->Gctrak()->vect[4]);
00935       geant3->Gctrak()->vect[2] = geant3->Gctrak()->vect[2]
00936                                 + steppush*(geant3->Gctrak()->vect[5]);
00937     }
00938     
00939     // Store this volume and position at track exit
00940     Dither::gLastExitVol = gMC->CurrentVolID(volcopy);
00941     Dither::gLastExitPos[0] = geant3->Gctrak()->vect[0];
00942     Dither::gLastExitPos[1] = geant3->Gctrak()->vect[1];
00943     Dither::gLastExitPos[2] = geant3->Gctrak()->vect[2];
00944   }
00945   else if (gMC->IsTrackEntering()) {
00946     
00947     if ( gMC->CurrentVolID(volcopy) == Dither::gLastExitVol ) {
00948       
00949       // same track is exiting same volume as last time, check position
00950       Float_t stepinout2 =
00951           pow((geant3->Gctrak()->vect[0]-Dither::gLastExitPos[0]),2)
00952         + pow((geant3->Gctrak()->vect[1]-Dither::gLastExitPos[1]),2)
00953         + pow((geant3->Gctrak()->vect[2]-Dither::gLastExitPos[2]),2);
00954       Float_t epsil = geant3->Gctmed()->epsil;
00955       
00956       if ( stepinout2 < 4.*epsil*epsil ) Dither::gNInOut++;
00957       else Dither::gNInOut = 0; // reset
00958       
00959     }
00960     else {
00961       Dither::gNInOut = 0;  // reset if entering new volume
00962     }
00963   }  
00964 // sk:end
00965 
00966 // sk:begin
00967 // Modified 2006/07/09 S. Kasahara, to apply a push if the track is stuck 
00968 // at the boundary of a volume, unable to exit.  This has only been observed to
00969 // occur for low zenith angle muons riding nearly parallel to the face of a
00970 // steel plane.  Test first to determine if this is a region with a magnetic
00971 // field before applying a push.   
00972   if ( gMC->IsNewTrack() || gMC->IsTrackExiting() || gMC->IsTrackEntering() ) {
00973     Stuck::gNStuck = 0;
00974     Stuck::gLastZPos = 0.;
00975   }
00976 
00977   if ( geant3->Gctmed()->ifield > 0 ) {
00978     // Region with a field
00979     if ( geant3->Gctrak()->safety <= 0. && 
00980          geant3->Gctrak()->vect[2] == Stuck::gLastZPos ) {
00981       Stuck::gNStuck++;
00982     }
00983     else Stuck::gNStuck = 0; // reset counter
00984 
00985     if ( Stuck::gNStuck >= Stuck::kMaxNStuck ) {
00986       // Track has been stuck for several iterations at the edge of this vol,
00987       // apply a push.  Magnitude of push increases with each stuck iteration.
00988       Float_t strength = (Float_t)(Stuck::gNStuck-Stuck::kMaxNStuck+2);
00989       Float_t steppush = strength*(geant3->Gctmed()->epsil);
00990       
00991       geant3->Gctrak()->vect[0] = geant3->Gctrak()->vect[0]
00992                                 + steppush*(geant3->Gctrak()->vect[3]);
00993       geant3->Gctrak()->vect[1] = geant3->Gctrak()->vect[1]
00994                                 + steppush*(geant3->Gctrak()->vect[4]);
00995       geant3->Gctrak()->vect[2] = geant3->Gctrak()->vect[2]
00996                                 + steppush*(geant3->Gctrak()->vect[5]);
00997     }
00998     
00999     Stuck::gLastZPos = geant3->Gctrak()->vect[2];   
01000     
01001   }
01002 // sk:end
01003 
01004 
01005   // --- Standard GEANT debug routine 
01006   //g3pcxyz();
01007   if(geant3->Gcflag()->idebug) geant3->Gdebug();
01008 }

void guswim ( Float_t &  CHARGE,
Float_t &  STEP,
Float_t *  VECT,
Float_t *  VOUT 
)

Definition at line 480 of file TGeant3gu.cxx.

References Gctmed_t::fieldm, g3helix, g3helx3, g3rkuta, TGeant3::Gctmed(), and Gctmed_t::ifield.

00481 {
00482 //
00483 //    ******************************************************************
00484 //    *                                                                *
00485 //    *       User routine to control tracking of one track            *
00486 //    *       in a magnetic field                                      *
00487 //    *                                                                *
00488 //    *    ==>Called by : GTELEC,GTHADR,GTMUON                         *
00489 //    *                                                                *
00490 //    ******************************************************************
00491 //
00492 //
00493 //    ------------------------------------------------------------------
00494 //
00495   Int_t   ifield = geant3->Gctmed()->ifield;
00496   Float_t fieldm = geant3->Gctmed()->fieldm;
00497 
00498   if (ifield==3) {
00499     Float_t fldcharge = fieldm*CHARGE;
00500     g3helx3(fldcharge,STEP,VECT,VOUT);
00501   }
00502   else if (ifield==2) g3helix(CHARGE,STEP,VECT,VOUT);
00503   else                g3rkuta(CHARGE,STEP,VECT,VOUT);
00504 }

void gutrak (  ) 

Definition at line 582 of file TGeant3gu.cxx.

References g3track.

00583 {
00584 //
00585 //    ******************************************************************
00586 //    *                                                                *
00587 //    *       User routine to control tracking of one track            *
00588 //    *                                                                *
00589 //    *    ==>Called by : GTREVE                                       *
00590 //    *                                                                *
00591 //    ******************************************************************
00592 //
00593 //
00594 //    ------------------------------------------------------------------
00595 //
00596      TVirtualMCApplication::Instance()->PreTrack();
00597 
00598      g3track();
00599 
00600      TVirtualMCApplication::Instance()->PostTrack();
00601 }

void gutrev (  ) 

Definition at line 604 of file TGeant3gu.cxx.

References gtreveroot.

00605 {
00606 //
00607 //    ******************************************************************
00608 //    *                                                                *
00609 //    *       User routine to control tracking of one event            *
00610 //    *                                                                *
00611 //    *    ==>Called by : GTRIG                                        *
00612 //    *                                                                *
00613 //    ******************************************************************
00614 //
00615 //
00616 //    ------------------------------------------------------------------
00617 //
00618   gtreveroot();
00619 }

void guview ( Int_t &  ,
Int_t &  ,
DEFCHARD  ,
Int_t &  DEFCHARL 
)

Definition at line 507 of file TGeant3gu.cxx.

00508 {
00509 //
00510 //    ******************************************************************
00511 //    *                                                                *
00512 //    *       User routine for interactive version                     *
00513 //    *                                                                *
00514 //    *    ==>Called by : <GXINT>, GINC1                               *
00515 //    *                                                                *
00516 //    ******************************************************************
00517 //
00518 //
00519 //    ------------------------------------------------------------------
00520 //
00521 }


Variable Documentation

TGeoManager* gGeoManager

Referenced by GeoStripVolume::AddPstyreneNodes(), PTSimApplication::BeginEvent(), EvtKinNuModule::BeginJob(), GeoSwimApplication::BeginPrimary(), GenieModule::BeginRun(), GeoScintMdlVolume::Build4Corners(), GeoGeometry::BuildFarCoilAirGapVolume(), GeoSteelPlnVolume::BuildFarCoilVolume(), GeoScintPlnVolume::BuildFarCoilVolume(), GeoGeometry::BuildFarLeadStacks(), GeoGeometry::BuildFarMARS(), GeoGeometry::BuildHallExtent(), GeoMediumMap::BuildMediums(), GeoGeometry::BuildNearCoilAirGapVolume(), GeoSteelPlnVolume::BuildNearCoilVolume(), GeoScintPlnVolume::BuildNearCoilVolume(), GeoScintMdlVolume::BuildNeariXtru(), GeoScintMdlVolume::BuildNearIXtru(), GeoShieldGroup::BuildNode(), TGeant3TGeo::CurrentBoundaryNormal(), TGeant3TGeo::CurrentVolID(), TGeant3TGeo::CurrentVolName(), TGeant3TGeo::CurrentVolOffID(), TGeant3TGeo::CurrentVolOffName(), MCApplication::Field(), TGeant3TGeo::FinishGeometry(), TGeant3TGeo::Gdtom(), TGeant3TGeo::GeomIter(), GeoScintMdlVolume::GeoScintMdlVolume(), GeoScintPlnVolume::GeoScintPlnVolume(), GeoSteelPlnVolume::GeoSteelPlnVolume(), GeoStripVolume::GeoStripVolume(), GeoVolume::GetExistingShape(), TGeant3TGeo::GetMaterial(), TGeant3TGeo::GetMedium(), TGeant3TGeo::GetNodeName(), TGeant3TGeo::GetPath(), ggperpTGeo(), ginvolTGeo(), glvoluTGeo(), TGeant3TGeo::Gmedia(), gmediaTGeo(), TGeant3TGeo::Gmtod(), TGeant3TGeo::Gprotm(), TGeant3TGeo::Gsatt(), TGeant3TGeo::Gsdvs(), TGeant3TGeo::Gsdvs2(), TGeant3TGeo::Gsmate(), TGeant3TGeo::Gsrotm(), TGeant3TGeo::Gstmed(), gtmediTGeo(), gtnextTGeo(), gustep(), MCApplication::InitMedia(), PTSimApplication::InitRockdEdXMin(), PTSimApplication::IsRockVetoed(), TGeant3TGeo::NextVolUp(), GeoCheckOverlaps::RunAllTests(), TGeant3TGeo::SetColors(), GeoMediumMap::SetMedium(), PTSimApplication::Stepping(), MCApplication::UpdateGlobalGeoManager(), UgliGeomHandle::UpdateGlobalManager(), GeoVolume::UpdateGlobalManager(), GeoNode::UpdateGlobalManager(), GeoMediumMap::UpdateGlobalManager(), GeoGeometry::UpdateGlobalManager(), and GeoNode::UpdateGlobalMatrix().


Generated on 15 Nov 2018 for loon by  doxygen 1.6.1