/*
$Log$
+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.
:TVirtualMC(),
fVerbosityLevel(0),
fInputFileName(""),
- fDetector(0)
+ fDetector(0),
+ fCurrentFlukaRegion(-1)
{
//
// Default constructor
:TVirtualMC("TFluka",title),
fVerbosityLevel(verbosity),
fInputFileName(""),
- fDetector(0)
+ fDetector(0),
+ fCurrentFlukaRegion(-1)
{
if (fVerbosityLevel >=3)
cout << "==> TFluka::TFluka(" << title << ") constructor called." << endl;
fGeometryManager->Ggclos();
+ FGeometryInit* flugg = FGeometryInit::GetInstance();
+ map<TString, Int_t, less<TString> >::iterator i;
+ for (fVolumeMediaMap.begin(); i != fVolumeMediaMap.end(); i++) {
+ TString volName = (*i).first;
+ Int_t media = (*i).second;
+ Int_t region = flugg->GetRegionFromName(volName);
+ fMediaByRegion[region] = media;
+ }
+
if (fVerbosityLevel >=3)
cout << "<== TFluka::FinishGeometry() called." << endl;
}
Int_t TFluka::Gsvolu(const char *name, const char *shape, Int_t nmed,
Float_t *upar, Int_t np) {
//
+ fVolumeMediaMap[TString(name)] = nmed;
return fGeometryManager->Gsvolu(name, shape, nmed, upar, np);
}
Int_t TFluka::Gsvolu(const char *name, const char *shape, Int_t nmed,
+//_____________________________________________________________________________
+// methods needed by the stepping
+//____________________________________________________________________________
+Int_t TFluka::GetMedium() const {
+ return fMediaByRegion[fCurrentFlukaRegion];
+}
///////////////////////////////////////////////////////////////////////////////
// //
// //
-// FLUKA implementation of the TVirtualMC Interface //
+// FLUKA implementation of the AliMC Interface //
// //
// //
///////////////////////////////////////////////////////////////////////////////
#include "TVirtualMC.h"
#include "TMCProcess.h"
+#include <map>
+#include <vector>
+
//Forward declaration
class TG4GeometryManager;
class TG4DetConstruction;
{printf("WARNING: MaxStep not yet implemented !\n"); return -1.;}
virtual Int_t GetMaxNStep() const
{printf("WARNING: GetMaxNStep not yet implemented !\n"); return -1;}
- virtual Int_t GetMedium() const
- {printf("WARNING: GetMedium not yet implemented !\n"); return -1;}
+ virtual Int_t GetMedium() const;
// tracking particle
// dynamic properties
// - Verbosity level
Int_t GetVerbosityLevel() const {return fVerbosityLevel;}
void SetVerbosityLevel(Int_t l) {fVerbosityLevel = l;}
+ void SetCurrentFlukaRegion(Int_t reg) {fCurrentFlukaRegion=reg;}
+ Int_t GetCurrentFlukaRegion() const {return fCurrentFlukaRegion;}
private:
TFluka(const TFluka &mc){}
protected:
Int_t fVerbosityLevel; //Verbosity level (0 lowest - 3 highest)
- TString fInputFileName; //Name of the input file (f.e. mu.inp)
+ TString fInputFileName; //Name of the input file (f.e. alice.inp)
TG4GeometryManager* fGeometryManager; //geometry manager
TG4DetConstruction* fDetector; //Detector
+ //Index of fluka region at each step
+ Int_t fCurrentFlukaRegion;
+ //Map between volume name and media indices
+ map<TString, Int_t, less<TString> > fVolumeMediaMap;
+ //Map between region and media indices
+ vector<Int_t> fMediaByRegion;
+
ClassDef(TFluka,1) //C++ interface to Fluka montecarlo
};