/************************************************************************** * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ /* $Log$ */ #include #include "AliGeant3.h" #include "AliRun.h" #include "TGeant3.h" #include "AliCallf77.h" #ifndef WIN32 # define rxgtrak rxgtrak_ # define rxstrak rxstrak_ # define rxkeep rxkeep_ # define rxouth rxouth_ #else # define rxgtrak RXGTRAK # define rxstrak RXSTRAK # define rxkeep RXKEEP # define rxouth RXOUTH #endif ClassImp(AliGeant3) AliGeant3::AliGeant3() { new TGeant3(); } AliGeant3::AliGeant3(const char *title) : AliVMC("ALICE Virtual MC for Geant3",title) { new TGeant3(title); } void AliGeant3::FinishGeometry() { gMC->FinishGeometry(); //Create the color table gMC->SetColors(); } void AliGeant3::BuildPhysics() { ((TGeant3*)gMC)->Gphysi(); } void AliGeant3::ProcessEvent() { ((TGeant3*)gMC)->Gtrigi(); ((TGeant3*)gMC)->Gtrigc(); ((TGeant3*)gMC)->Gtrig(); } //_____________________________________________________________________________ // // Interfaces to Fortran // //_____________________________________________________________________________ extern "C" void type_of_call rxgtrak (Int_t &mtrack, Int_t &ipart, Float_t *pmom, Float_t &e, Float_t *vpos, Float_t *polar, Float_t &tof) { // // Fetches next track from the ROOT stack for transport. Called by the // modified version of GTREVE. // // Track number in the ROOT stack. If MTRACK=0 no // mtrack more tracks are left in the stack to be // transported. // ipart Particle code in the GEANT conventions. // pmom[3] Particle momentum in GeV/c // e Particle energy in GeV // vpos[3] Particle position // tof Particle time of flight in seconds // Int_t pdg; gAlice->GetNextTrack(mtrack, pdg, pmom, e, vpos, polar, tof); ipart = gMC->IdFromPDG(pdg); mtrack++; } //_____________________________________________________________________________ extern "C" void type_of_call #ifndef WIN32 rxstrak (Int_t &keep, Int_t &parent, Int_t &ipart, Float_t *pmom, Float_t *vpos, Float_t &tof, const char* cmech, Int_t &ntr, const int cmlen) #else rxstrak (Int_t &keep, Int_t &parent, Int_t &ipart, Float_t *pmom, Float_t *vpos, Float_t &tof, const char* cmech, const int cmlen, Int_t &ntr) #endif { // // Fetches next track from the ROOT stack for transport. Called by GUKINE // and GUSTEP. // // Status of the track. If keep=0 the track is put // keep on the ROOT stack but it is not fetched for // transport. // parent Parent track. If parent=0 the track is a primary. // In GUSTEP the routine is normally called to store // secondaries generated by the current track whose // ROOT stack number is MTRACK (common SCKINE. // ipart Particle code in the GEANT conventions. // pmom[3] Particle momentum in GeV/c // vpos[3] Particle position // tof Particle time of flight in seconds // // cmech (CHARACTER*10) Particle origin. This field is user // defined and it is not used inside the GALICE code. // ntr Number assigned to the particle in the ROOT stack. // char mecha[11]; Float_t polar[3]={0.,0.,0.}; for(int i=0; i<10 && iPDGFromId(ipart); gAlice->SetTrack(keep, parent-1, pdg, pmom, vpos, polar, tof, mecha, ntr); ntr++; } //_____________________________________________________________________________ extern "C" void type_of_call rxkeep(const Int_t &n) { if( NULL==gAlice ) exit(1); if( n<=0 || n>gAlice->Particles()->GetEntries() ) { printf(" Bad index n=%d must be 0Particles()->GetEntries()); exit(1); } ((TParticle*)(gAlice->Particles()->UncheckedAt(n-1)))->SetBit(Keep_Bit); } //_____________________________________________________________________________ extern "C" void type_of_call rxouth () { // // Called by Gtreve at the end of each primary track // gAlice->FinishPrimary(); }