]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TFluka/TFluka.h
Buffer for correct particle 4-vector after interaction added.
[u/mrichter/AliRoot.git] / TFluka / TFluka.h
index 8715af8e7f65f1e117ade3141f127f69791c59b9..d0eea0df31fe0f67ba91c8234504b0d5e4a18f0b 100644 (file)
 
 
 #include "TVirtualMC.h"
+#include "TMCOptical.h"
 #include "TFlukaCodes.h"
+#include "TFlukaMCGeometry.h"
+
 //Forward declaration
 class TGeoMCGeometry;
-class TFlukaMCGeometry;
+//class TFlukaMCGeometry;
 class TGeoMaterial;
 
 class TFluka : public TVirtualMC {
@@ -27,6 +30,9 @@ class TFluka : public TVirtualMC {
   TFluka(const char *title, Int_t verbosity = 0,  Bool_t isRootGeometrySupported = 0);
   TFluka();
   virtual ~TFluka();
+  virtual Bool_t IsRootGeometrySupported() const { return kTRUE;}
+  
+  Int_t         GetNstep() { return fGeom->GetNstep(); } // to be removed
   
   //
   // Methods for building/management of geometry
@@ -127,7 +133,22 @@ class TFluka : public TVirtualMC {
   virtual void   SetCerenkov(Int_t itmed, Int_t npckov, Double_t *ppckov,
                             Double_t *absco, Double_t *effic, Double_t *rindex, Double_t *rfl);
   
+//
+  virtual void   DefineOpSurface(const char* name, EMCOpSurfaceModel model, EMCOpSurfaceType surface,
+                                EMCOpSurfaceFinish surfaceFinish, Double_t sigmaAlpha);
+  
+  virtual void  SetBorderSurface(const char* name, const char* vol1Name, int vol1CopyNo, const char* vol2Name, int vol2CopyNo,
+                                const char* opSurfaceName);
+  
+  
+  virtual void  SetSkinSurface(const char* name, const char* volName, const char* opSurfaceName);
   
+  virtual void  SetMaterialProperty(Int_t itmed, const char* propertyName, Int_t np, Double_t* pp, Double_t* values);
+
+  virtual void  SetMaterialProperty(Int_t itmed, const char* propertyName, Double_t value);
+
+  virtual void  SetMaterialProperty(const char* surfaceName, const char* propertyName, Int_t np, Double_t* pp, Double_t* values);
+
   // Functions for drawing
   virtual void   DrawOneSpec(const char* /*name*/)
       {Warning("DrawOneSpec",  "Not yet implemented !\n");}
@@ -147,6 +168,9 @@ class TFluka : public TVirtualMC {
   virtual const  char* VolName(Int_t id) const;
   virtual Int_t  NofVolumes() const {return fNVolumes;}
   virtual Int_t  VolId2Mate(Int_t id) const;
+  // Return the unique numeric identifier for medium name mediumName
+  virtual Int_t MediumId(const Text_t* mediumName) const;
+
   //
   // Methods for physics management
   // ------------------------------------------------
@@ -157,6 +181,7 @@ class TFluka : public TVirtualMC {
   virtual void       SetProcess(const char* flagName, Int_t flagValue, Int_t imed);
   virtual Bool_t     SetCut(const char* cutName, Double_t cutValue);
   virtual void       SetCut(const char* cutName, Double_t cutValue, Int_t imed);
+  virtual void       SetModelParameter(const char* parName, Double_t parValue, Int_t imed);
   virtual TObjArray* GetListOfUserConfigs() {return fUserConfig;}
   virtual Double_t   Xsec(char*, Double_t, Int_t, Int_t);
 
@@ -222,6 +247,7 @@ class TFluka : public TVirtualMC {
   virtual Double_t TrackTime() const;
   virtual Double_t Edep() const;
   // Static properties
+  virtual Int_t    CorrectFlukaId() const;
   virtual Int_t    TrackPid() const;
   virtual Double_t TrackCharge() const;
   virtual Double_t TrackMass() const;
@@ -304,8 +330,8 @@ class TFluka : public TVirtualMC {
   // FLUKA Scoring specific methods
   // ------------------------------
   //
-  virtual void SetUserScoring(const char* option, Int_t npr,char* outfile, Float_t* what);
-  virtual void SetUserScoring(const char* option, Int_t npr,char* outfile, Float_t* what,
+  virtual void SetUserScoring(const char* option, const char* sdum, Int_t npr,char* outfile, Float_t* what);
+  virtual void SetUserScoring(const char* option, const char* sdum, Int_t npr,char* outfile, Float_t* what,
                              const char* det1, const char* det2, const char* det3);
   //
   // New Getter and Setters
@@ -323,93 +349,90 @@ class TFluka : public TVirtualMC {
   Int_t GetVerbosityLevel() const {return fVerbosityLevel;}
   void SetVerbosityLevel(Int_t l) {fVerbosityLevel = l;}
 
-  // - Fluka Draw procedures identifiers
-  // bxdraw = 1  inside
-  // bxdraw = 11 entering
-  // bxdraw = 12 exiting
-  // eedraw = 2
-  // endraw = 3
-  // mgdraw = 4
-  // sodraw = 5
-  // usdraw = 6
+  //
+  // - Fluka Draw procedures identifiers, see TFlukaCodes.h
+  //
   FlukaCallerCode_t GetCaller() const {return fCaller;}
-  void SetCaller(FlukaCallerCode_t l) {fCaller = l;}
-  
   FlukaProcessCode_t GetIcode() const {return fIcode;}
-  void  SetIcode(FlukaProcessCode_t l) {fIcode = l;}
-
   Int_t GetMreg() const {return fCurrentFlukaRegion;}
-  void SetMreg(Int_t l, Int_t lttc);
-
   Int_t GetNewreg() const {return fNewReg;}
-  void SetNewreg(Int_t l, Int_t /*lttc*/) {fNewReg = l;}
-
   Double_t GetRull() const {return fRull;}
-  void SetRull(Double_t r) {fRull = r;}
-
   Double_t GetXsco() const {return fXsco;}
-  void SetXsco(Double_t x) {fXsco = x;}
-
   Double_t GetYsco() const {return fYsco;}
-  void SetYsco(Double_t y) {fYsco = y;}
-
   Double_t GetZsco() const {return fZsco;}
-  void SetZsco(Double_t z) {fZsco = z;}
-
-  void SetCurrentFlukaRegion(Int_t reg) {fCurrentFlukaRegion=reg;}
-  Int_t GetCurrentFlukaRegion() const {return fCurrentFlukaRegion;}
+  Int_t              GetCurrentFlukaRegion() const {return fCurrentFlukaRegion;}
+  // - Fluka Draw Setters
+  void  SetCurrentFlukaRegion(Int_t reg) {fCurrentFlukaRegion=reg;}
+  void  SetCaller(FlukaCallerCode_t l) {fCaller = l;}
+  void  SetIcode(FlukaProcessCode_t l) {fIcode = l;}
+  void  SetMreg(Int_t l, Int_t lttc);
+  void  SetNewreg(Int_t l, Int_t /*lttc*/) {fNewReg = l;}
+  void  SetRull(Double_t r) {fRull = r;}
+  void  SetXsco(Double_t x) {fXsco = x;}
+  void  SetYsco(Double_t y) {fYsco = y;}
+  void  SetZsco(Double_t z) {fZsco = z;}
+  void  SetPint(Double_t px, Double_t py, Double_t pz, Double_t e) {fPint[0] = px; fPint[1] = py; fPint[2] = pz; fPint[3] = e;}
+  void  SetTrackIsEntering(){fTrackIsEntering = kTRUE; fTrackIsExiting = kFALSE;}
+  void  SetTrackIsExiting() {fTrackIsExiting  = kTRUE; fTrackIsEntering = kFALSE;}
+  void  SetTrackIsInside()  {fTrackIsExiting  = kFALSE; fTrackIsEntering = kFALSE;}
+  void  SetTrackIsNew(Bool_t flag = kTRUE);
 
   void   SetDummyBoundary(Int_t mode) {fDummyBoundary = mode;}
   Int_t  GetDummyBoundary() const {return fDummyBoundary;}
   Bool_t IsDummyBoundary() const {return (fDummyBoundary==0)?kFALSE:kTRUE;}
   
-  void   SetGeneratePemf(Bool_t flag = kTRUE) {fGeneratePemf = flag;}
-  Bool_t IsGeneratePemf() const {return fGeneratePemf;}
-  
   void   EnableField(Bool_t flag=kTRUE) {fFieldFlag = flag;}
   Bool_t IsFieldEnabled() const {return fFieldFlag;}
-  void SetTrackIsEntering(){fTrackIsEntering = kTRUE; fTrackIsExiting = kFALSE;}
-  void SetTrackIsExiting() {fTrackIsExiting  = kTRUE; fTrackIsEntering = kFALSE;}
-  void SetTrackIsInside()  {fTrackIsExiting  = kFALSE; fTrackIsEntering = kFALSE;}
-  void SetTrackIsNew(Bool_t flag = kTRUE);
-  
-  Int_t GetMaterialIndex(Int_t idmat) const {return fMaterials[idmat];}
-  TObjArray *GetFlukaMaterials();
-  virtual void SetRootGeometry() {;} // Dummy
+  
+  Int_t  GetMaterialIndex(Int_t idmat) const {return fMaterials[idmat];}
+
+  TObjArray *          GetFlukaMaterials();
+  virtual void         SetRootGeometry() {;} // Dummy
   virtual Int_t        NofVolDaughters(const char* volName) const;
   virtual const char*  VolDaughterName(const char* volName, Int_t i) const;
   virtual Int_t        VolDaughterCopyNo(const char* volName, Int_t i) const;
   virtual const char*  CurrentVolPath();
   virtual void         ForceDecayTime(Float_t){;}
-  private:
-  void PrintHeader();
-  void AddParticlesToPdgDataBase() const;
-  TFluka(const TFluka &mc): TVirtualMC(mc) {;}
-  TFluka & operator=(const TFluka &) {return (*this);}
-
+  //
+  // Info about primary ionization electrons
+  Int_t    GetNPrimaryElectrons();
+  Double_t GetPrimaryElectronKineticEnergy(Int_t i) const;
+  void     GetPrimaryElectronPosition(Int_t i, Double_t& x, Double_t& y, Double_t& z) const;
+  void     SetCurrentPrimaryElectronIndex(Int_t i)  {fPrimaryElectronIndex = i;}
+  void     PrimaryIonisationStepping(Int_t nprim);  
+ private:
+   
+  // Copy constructor and operator= declared but not implemented (-Weff++ flag)
+  TFluka(const TFluka &mc); //: TVirtualMC(mc) {;}
+  TFluka & operator=(const TFluka &); // {return (*this);}
+  void  PrintHeader();
+  void  AddParticlesToPdgDataBase() const;
+  Int_t GetIonPdg(Int_t z, Int_t a, Int_t i = 0) const;
 
-  
+  //
   Int_t   fVerbosityLevel; //Verbosity level (0 lowest - 3 highest)
   Int_t   fNEvent;         //Current event number
   TString fInputFileName;     //Name of the real input file 
   TString fCoreInputFileName; //Name of the input file 
 
-  FlukaCallerCode_t     fCaller; //Parameter to indicate who is the caller of the Fluka Draw
-  FlukaProcessCode_t    fIcode;  //Fluka Draw procedures formal parameter 
-  Int_t    fNewReg; //Fluka Draw procedures formal parameter
-  Double_t fRull;   //Fluka Draw procedures formal parameter
-  Double_t fXsco;   //Fluka Draw procedures formal parameter
-  Double_t fYsco;   //Fluka Draw procedures formal parameter
-  Double_t fZsco;   //Fluka Draw procedures formal parameter
-  Bool_t   fTrackIsEntering;  // Flag for track entering
-  Bool_t   fTrackIsExiting;   // Flag for track exiting  
-  Bool_t   fTrackIsNew;       // Flag for new track
-  Bool_t   fFieldFlag;        // Flag for magnetic field
-  Bool_t   fGeneratePemf;     // Flag for automatic .pemf generation
-  Int_t    fDummyBoundary;    // Flag for crossing dummy boundaries
-  Bool_t   fStopped;          // Flag for stopping 
-  Bool_t   fStopEvent;        // Flag for stopped event
-  Bool_t   fStopRun;          // Flag for stopped run 
+  FlukaCallerCode_t     fCaller;           // Parameter to indicate who is the caller of the Fluka Draw
+  FlukaProcessCode_t    fIcode;            // Fluka Draw procedures formal parameter 
+  Int_t                 fNewReg;           // Fluka Draw procedures formal parameter
+  Double_t              fRull;             // Fluka Draw procedures formal parameter
+  Double_t              fXsco;             // Fluka Draw procedures formal parameter
+  Double_t              fYsco;             // Fluka Draw procedures formal parameter
+  Double_t              fZsco;             // Fluka Draw procedures formal parameter
+  Double_t              fPint[4];          // 4-vector of particle after interaction
+  Bool_t   fTrackIsEntering;      // Flag for track entering
+  Bool_t   fTrackIsExiting;       // Flag for track exiting  
+  Bool_t   fTrackIsNew;           // Flag for new track
+  Bool_t   fFieldFlag;            // Flag for magnetic field
+  Int_t    fDummyBoundary;        // Flag for crossing dummy boundaries
+  Bool_t   fStopped;              // Flag for stopping 
+  Bool_t   fStopEvent;            // Flag for stopped event
+  Bool_t   fStopRun;              // Flag for stopped run 
+  Int_t    fPrimaryElectronIndex; // Primary electron Index
   
   //
   //Geometry through TGeo
@@ -425,6 +448,7 @@ class TFluka : public TVirtualMC {
   TObjArray* fUserConfig;            // List of user physics configuration 
   TObjArray* fUserScore;             // List of user scoring options
   
+
   ClassDef(TFluka,1)  //C++ interface to Fluka montecarlo
 
 
@@ -447,6 +471,45 @@ class TFluka : public TVirtualMC {
   }
 
 
+inline void TFluka::DefineOpSurface(const char* /*name*/, EMCOpSurfaceModel /*model*/, EMCOpSurfaceType /*surface*/,
+                                   EMCOpSurfaceFinish /*surfaceFinish*/, Double_t /*sigmaAlpha*/)
+{
+    Warning("DefineOpSurface", "New function - not yet implemented.");
+}
+
+
+inline void TFluka::SetBorderSurface(const char* /*name*/, const char* /*vol1Name*/, int /*vol1CopyNo*/, const char* /*vol2Name*/,
+                                    int /*vol2CopyNo*/, const char* /*opSurfaceName*/)
+{
+    Warning("SetBorderSurface", "New function - not yet implemented."); 
+}
+
+  
+inline void TFluka::SetSkinSurface(const char* /*name*/, const char* /*volName*/, const char* /*opSurfaceName*/)
+{
+    Warning("SetSkinSurface", "New function - not yet implemented.");
+}
+
+  
+inline void TFluka::SetMaterialProperty(Int_t /*itmed*/, const char* /*propertyName*/, Int_t /*np*/, Double_t* /*pp*/, Double_t* /*values*/)
+{
+    Warning("SetMaterialProperty", "New function - not yet implemented."); 
+}
+
+
+inline void TFluka::SetMaterialProperty(Int_t /*itmed*/, const char* /*propertyName*/, Double_t /*value*/)
+{
+    Warning("SetMaterialProperty", "New function - not yet implemented.");
+}
+
+
+inline void TFluka::SetMaterialProperty(const char* /*surfaceName*/, const char* /*propertyName*/, Int_t /*np*/,
+                                       Double_t* /*pp*/, Double_t* /*values*/)
+{
+    Warning("SetMaterialProperty", "New function - not yet implemented.");      
+}
+
+
 
 #endif //TFLUKA