* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-Revision 1.18 2003/06/10 11:22:28 morsch
-Physics configuration via modified input cards. (E. Futo)
-
-Revision 1.17 2003/06/05 10:22:57 morsch
-All printout under verbosity level control.
-
-Revision 1.16 2003/03/26 13:30:35 morsch
-SetTrackIsExiting, SetTrackIsEntering, SetTrackIsInside added.
-
-Revision 1.15 2003/02/18 16:12:17 morsch
-Protect mpdgha against negative argument.
-
-Revision 1.14 2003/02/18 12:47:59 morsch
-Gmtod and Gdtom added.
-
-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)
-
-Revision 1.9 2002/12/06 12:41:29 morsch
-Mess from last merge cleaned up.
-
-Revision 1.8 2002/12/06 12:28:44 morsch
-Region to media mapping corrected and improved.
-
-Revision 1.7 2002/12/06 12:21:32 morsch
-User stepping methods added (E. Futo)
-
-Revision 1.6 2002/11/21 18:40:06 iglez2
-Media handling added
-
-Revision 1.5 2002/11/07 17:59:10 iglez2
-Included the geometry through geant4_vmc/FLUGG
-
-Revision 1.4 2002/11/04 16:00:46 iglez2
-The conversion between ID and PDG now uses Fluka routines and arrays which is more consistent.
-
-Revision 1.3 2002/10/22 15:12:14 alibrary
-Introducing Riostream.h
-
-Revision 1.2 2002/10/14 14:57:40 hristov
-Merging the VirtualMC branch to the main development branch (HEAD)
-
-Revision 1.1.2.8 2002/10/08 16:33:17 iglez2
-LSOUIT is set to true before the second call to flukam.
-
-Revision 1.1.2.7 2002/10/08 09:30:37 iglez2
-Solved stupid missing ;
-
-Revision 1.1.2.6 2002/10/07 13:40:22 iglez2
-First implementations of the PDG <--> Fluka Id conversion routines
-
-Revision 1.1.2.5 2002/09/26 16:26:03 iglez2
-Added verbosity
-Call to gAlice->Generator()->Generate()
-
-Revision 1.1.2.4 2002/09/26 13:22:23 iglez2
-Naive implementation of ProcessRun and ProcessEvent
-Opening/Closing of input file (sInputFileName) with FORTRAN unit 5 before/after the first call to flukam inside Init()
-
-Revision 1.1.2.3 2002/09/20 15:35:51 iglez2
-Modification of LFDRTR. Value is passed to FLUKA !!!
-
-Revision 1.1.2.2 2002/09/18 14:34:44 iglez2
-Revised version with all pure virtual methods implemented
-
-Revision 1.1.2.1 2002/07/24 08:49:41 alibrary
-Adding TFluka to VirtualMC
-
-Revision 1.1 2002/07/05 13:10:07 morsch
-First commit of Fluka interface.
-
-*/
+/* $Id$ */
#include <Riostream.h>
//
}
-TFluka::TFluka(const char *title, Int_t verbosity)
- :TVirtualMC("TFluka",title),
+TFluka::TFluka(const char *title, Int_t verbosity, Bool_t isRootGeometrySupported)
+ :TVirtualMC("TFluka",title, isRootGeometrySupported),
fVerbosityLevel(verbosity),
sInputFileName(""),
fTrackIsEntering(0),
//_____________________________________________________________________________
Int_t TFluka::IdFromPDG(Int_t pdg) const
{
- //
- // Return Fluka code from PDG and pseudo ENDF code
-
- // MCIHAD() goes from pdg to fluka internal.
- Int_t intfluka = mcihad(pdg);
- // KPTOIP array goes from internal to official
- return GetFlukaKPTOIP(intfluka);
+ //
+ // Return Fluka code from PDG and pseudo ENDF code
+
+ // Catch the feedback photons
+ if (pdg == 50000051) return (-1);
+ // MCIHAD() goes from pdg to fluka internal.
+ Int_t intfluka = mcihad(pdg);
+ // KPTOIP array goes from internal to official
+ return GetFlukaKPTOIP(intfluka);
}
Int_t TFluka::PDGFromId(Int_t id) const
{
+
//
// Return PDG code and pseudo ENDF code from Fluka code
//IPTOKP array goes from official to internal
+
+ if (id == -1) {
+// Cerenkov photon
+ if (fVerbosityLevel >= 1)
+ printf("\n PDGFromId: Cerenkov Photon \n");
+ return 50000050;
+ }
+
if (id == 0) {
- if (fVerbosityLevel >= 1)
- printf("PDGFromId: Error id = 0");
+ if (fVerbosityLevel >= 1)
+ printf("PDGFromId: Error id = 0\n");
return -1;
}
- Int_t intfluka = GetFlukaIPTOKP(id);
+ Int_t intfluka = GetFlukaIPTOKP(id);
if (intfluka == 0) {
- if (fVerbosityLevel >= 1)
- printf("PDGFromId: Error intfluka = 0");
+ if (fVerbosityLevel >= 1)
+ printf("PDGFromId: Error intfluka = 0: %d\n", id);
return -1;
} else if (intfluka < 0) {
- if (fVerbosityLevel >= 1)
- printf("PDGFromId: Error intfluka < 0");
+ if (fVerbosityLevel >= 1)
+ printf("PDGFromId: Error intfluka < 0: %d\n", id);
return -1;
}
if (fVerbosityLevel >= 3)
- printf("mpdgha called with %d %d \n", id, intfluka);
- return mpdgha(intfluka);
+ printf("mpdgha called with %d %d \n", id, intfluka);
+ return mpdgha(intfluka);
}
//_____________________________________________________________________________
// TRACKR.ytrack = y-position of the last point
// TRACKR.ztrack = z-position of the last point
Int_t caller = GetCaller();
- if (caller == 1 || caller == 3 || caller == 6) { //bxdraw,endraw,usdraw
+ if (caller == 1 || caller == 3 || caller == 6 || caller == 11 || caller == 12) { //bxdraw,endraw,usdraw
position.SetX(GetXsco());
position.SetY(GetYsco());
position.SetZ(GetZsco());
// TRACKR.ytrack = y-position of the last point
// TRACKR.ztrack = z-position of the last point
Int_t caller = GetCaller();
- if (caller == 1 || caller == 3 || caller == 6) { //bxdraw,endraw,usdraw
+ if (caller == 1 || caller == 3 || caller == 6 || caller == 11 || caller == 12) { //bxdraw,endraw,usdraw
x = GetXsco();
y = GetYsco();
z = GetZsco();
// True if this is the first step of the track in the current volume
Int_t caller = GetCaller();
- if (caller == 11 || caller == 4) // bxdraw entering
+ if (caller == 11) // bxdraw entering
return 1;
else return 0;
}
// Icode = 32: escape - call from Kasneu
// Icode = 40: escape - call from Kashea
// Icode = 51: escape - call from Kasoph
- if (iIcode == 14 ||
- iIcode == 23 ||
- iIcode == 32 ||
- iIcode == 40 ||
- iIcode == 51) return 1;
+ if (fIcode == 14 ||
+ fIcode == 23 ||
+ fIcode == 32 ||
+ fIcode == 40 ||
+ fIcode == 51) return 1;
else return 0;
}
Bool_t TFluka::IsTrackDisappeared() const
{
// means all inelastic interactions and decays
-// iIcode from usdraw
- if (iIcode == 101 || // inelastic interaction
- iIcode == 102 || // particle decay
- iIcode == 214 || // in-flight annihilation
- iIcode == 215 || // annihilation at rest
- iIcode == 217 || // pair production
- iIcode == 221) return 1;
+// fIcode from usdraw
+ if (fIcode == 101 || // inelastic interaction
+ fIcode == 102 || // particle decay
+ fIcode == 214 || // in-flight annihilation
+ fIcode == 215 || // annihilation at rest
+ fIcode == 217 || // pair production
+ fIcode == 221) return 1;
else return 0;
}
// Icode = 33: time kill - call from Kasneu
// Icode = 41: time kill - call from Kashea
// Icode = 52: time kill - call from Kasoph
- if (iIcode == 12 ||
- iIcode == 15 ||
- iIcode == 21 ||
- iIcode == 22 ||
- iIcode == 24 ||
- iIcode == 31 ||
- iIcode == 33 ||
- iIcode == 41 ||
- iIcode == 52) return 1;
+ if (fIcode == 12 ||
+ fIcode == 15 ||
+ fIcode == 21 ||
+ fIcode == 22 ||
+ fIcode == 24 ||
+ fIcode == 31 ||
+ fIcode == 33 ||
+ fIcode == 41 ||
+ fIcode == 52) return 1;
else return 0;
}
Warning("GetSecondary","no secondaries available");
} // end of GetSecondary
-TMCProcess TFluka::ProdProcess(Int_t isec) const
+TMCProcess TFluka::ProdProcess() const
// Name of the process that has produced the secondary particles
// in the current step
{
// const TMCProcess kIpPSynchrotron = kPSynchrotron;
Int_t mugamma = TRACKR.jtrack == 7 || TRACKR.jtrack == 10 || TRACKR.jtrack == 11;
- if (iIcode == 102) return kIpPDecay;
- else if (iIcode == 104 || iIcode == 217) return kIpPPair;
-// else if (iIcode == 104) return kIpPairFromPhoton;
-// else if (iIcode == 217) return kIpPPairFromVirtualPhoton;
- else if (iIcode == 219) return kIpPCompton;
- else if (iIcode == 221) return kIpPPhotoelectric;
- else if (iIcode == 105 || iIcode == 208) return kIpPBrem;
-// else if (iIcode == 105) return kIpPBremFromHeavy;
-// else if (iIcode == 208) return kPBremFromElectronOrPositron;
- else if (iIcode == 103 || iIcode == 400) return kIpPDeltaRay;
- else if (iIcode == 210 || iIcode == 212) return kIpPDeltaRay;
-// else if (iIcode == 210) return kIpPMoller;
-// else if (iIcode == 212) return kIpPBhabha;
- else if (iIcode == 214 || iIcode == 215) return kIpPAnnihilation;
-// else if (iIcode == 214) return kIpPAnnihilInFlight;
-// else if (iIcode == 215) return kIpPAnnihilAtRest;
- else if (iIcode == 101) return kIpPHadronic;
- else if (iIcode == 101) {
+ if (fIcode == 102) return kIpPDecay;
+ else if (fIcode == 104 || fIcode == 217) return kIpPPair;
+// else if (fIcode == 104) return kIpPairFromPhoton;
+// else if (fIcode == 217) return kIpPPairFromVirtualPhoton;
+ else if (fIcode == 219) return kIpPCompton;
+ else if (fIcode == 221) return kIpPPhotoelectric;
+ else if (fIcode == 105 || fIcode == 208) return kIpPBrem;
+// else if (fIcode == 105) return kIpPBremFromHeavy;
+// else if (fIcode == 208) return kPBremFromElectronOrPositron;
+ else if (fIcode == 103 || fIcode == 400) return kIpPDeltaRay;
+ else if (fIcode == 210 || fIcode == 212) return kIpPDeltaRay;
+// else if (fIcode == 210) return kIpPMoller;
+// else if (fIcode == 212) return kIpPBhabha;
+ else if (fIcode == 214 || fIcode == 215) return kIpPAnnihilation;
+// else if (fIcode == 214) return kIpPAnnihilInFlight;
+// else if (fIcode == 215) return kIpPAnnihilAtRest;
+ else if (fIcode == 101) return kIpPHadronic;
+ else if (fIcode == 101) {
if (!mugamma) return kIpPHadronic;
else if (TRACKR.jtrack == 7) return kIpPPhotoFission;
else return kIpPMuonNuclear;
}
- else if (iIcode == 225) return kIpPRayleigh;
+ else if (fIcode == 225) return kIpPRayleigh;
// Fluka codes 100, 300 and 400 still to be investigasted
else return kIpNoProc;
}
// Returns the material number for a given volume ID
//
if (fVerbosityLevel >= 3)
- printf("VolId2Mate %d %d\n", id, fMediaByRegion[id]);
+ printf("VolId2Mate %d %d\n", id, fMediaByRegion[id-1]);
return fMediaByRegion[id-1];
}
//
int ir = fCurrentFlukaRegion;
int id = (FGeometryInit::GetInstance())->CurrentVolID(ir, copyNo);
+ copyNo++;
if (fVerbosityLevel >= 3)
printf("CurrentVolID: %d %d %d \n", ir, id, copyNo);
return id;
-
}
Int_t TFluka::CurrentVolOffID(Int_t off, Int_t& copyNo) const
int ir = fCurrentFlukaRegion;
int id = (FGeometryInit::GetInstance())->CurrentVolOffID(ir, off, copyNo);
+ copyNo++;
if (fVerbosityLevel >= 3)
printf("CurrentVolOffID: %d %d %d \n", ir, id, copyNo);
if (id == -1)
// 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];
+ (FGeometryInit::GetInstance())->Gmtod(xm, xd, iflag);
}
void TFluka::Gdtom(Float_t* xd, Float_t* xm, Int_t iflag)
// 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(xdD, xmD, iflag);
+ xm[0] = xmD[0]; xm[1] = xmD[1]; xm[2] = xmD[2];
}
void TFluka::Gdtom(Double_t* xd, Double_t* xm, Int_t iflag)
{
//
// ---
- (FGeometryInit::GetInstance())->Gdtom(xm, xd, iflag);
+ (FGeometryInit::GetInstance())->Gdtom(xd, xm, iflag);
}
// ===============================================================