]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Coding rule violations corrected.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 16 Jun 2004 08:52:57 +0000 (08:52 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 16 Jun 2004 08:52:57 +0000 (08:52 +0000)
TFluka/TFlukaGeo.cxx
TFluka/TFlukaGeo.h

index 80b27452762979d23715c3dc4e5dc73476ee68aa..b0f7d1330b8f46ec09879667405474423317c1c7 100644 (file)
 
 /* $Id$ */
 
+//
+// Realisation of the TVirtualMC interface for the FLUKA code
+// (See official web side http://www.fluka.org/).
+//
+// This implementation makes use of the TGeo geometry modeller.
+// User configuration is via automatic generation of FLUKA input cards.
+//
+// Authors:
+// A. Fasso
+// E. Futo
+// A. Gheata
+// A. Morsch
+//
+
 #include <Riostream.h>
 
 //#include "AliModule.h"
@@ -79,7 +93,7 @@ ClassImp(TFluka)
 TFluka::TFluka()
   :TVirtualMC(),
    fVerbosityLevel(0),
-   sInputFileName("")
+   fInputFileName("")
 { 
   //
   // Default constructor
@@ -96,7 +110,7 @@ TFluka::TFluka()
 TFluka::TFluka(const char *title, Int_t verbosity, Bool_t isRootGeometrySupported)
   :TVirtualMC("TFluka",title, isRootGeometrySupported),
    fVerbosityLevel(verbosity),
-   sInputFileName(""),
+   fInputFileName(""),
    fTrackIsEntering(0),
    fTrackIsExiting(0),
    fTrackIsNew(0)
@@ -127,7 +141,9 @@ TFluka::~TFluka() {
 // TFluka control methods
 //______________________________________________________________________________ 
 void TFluka::Init() {
-
+//
+//  Geometry initialisation
+//
     if (fVerbosityLevel >=3) cout << "==> TFluka::Init() called." << endl;
     
     if (!gGeoManager) new TGeoManager("geom", "FLUKA geometry");
@@ -161,9 +177,14 @@ void TFluka::FinishGeometry() {
 
 //______________________________________________________________________________ 
 void TFluka::BuildPhysics() {
+//
+//  Prepare FLUKA input files and call FLUKA physics initialisation
+//
+    
     if (fVerbosityLevel >=3)
        cout << "==> TFluka::BuildPhysics() called." << endl;
-    InitPhysics(); // prepare input file with the current physics settings
+// Prepare input file with the current physics settings
+    InitPhysics(); 
     cout << "\t* InitPhysics() - Prepare input file was called" << endl; 
     
     if (fVerbosityLevel >=2)
@@ -172,8 +193,8 @@ void TFluka::BuildPhysics() {
     GLOBAL.lfdrtr = true;
     
     if (fVerbosityLevel >=2)
-       cout << "\t* Opening file " << sInputFileName << endl;
-    const char* fname = sInputFileName;
+       cout << "\t* Opening file " << fInputFileName << endl;
+    const char* fname = fInputFileName;
     fluka_openinp(lunin, PASSCHARA(fname));
     
     if (fVerbosityLevel >=2)
@@ -181,7 +202,7 @@ void TFluka::BuildPhysics() {
     flukam(1);
     
     if (fVerbosityLevel >=2)
-       cout << "\t* Closing file " << sInputFileName << endl;
+       cout << "\t* Closing file " << fInputFileName << endl;
     fluka_closeinp(lunin);
     
     FinishGeometry();
@@ -196,6 +217,9 @@ void TFluka::BuildPhysics() {
 
 //______________________________________________________________________________ 
 void TFluka::ProcessEvent() {
+//
+// Process one event
+//
   if (fVerbosityLevel >=3)
     cout << "==> TFluka::ProcessEvent() called." << endl;
   fApplication->GeneratePrimaries();
@@ -211,6 +235,10 @@ Bool_t TFluka::ProcessRun(Int_t nevent) {
 #else
 void   TFluka::ProcessRun(Int_t nevent) {
 #endif
+//
+// Run steering
+//
+
   if (fVerbosityLevel >=3)
     cout << "==> TFluka::ProcessRun(" << nevent << ") called." 
         << endl;
@@ -226,7 +254,10 @@ void   TFluka::ProcessRun(Int_t nevent) {
   if (fVerbosityLevel >=3)
     cout << "<== TFluka::ProcessRun(" << nevent << ") called." 
         << endl;
+
+  #if ROOT_VERSION_CODE >= 262150
   return kTRUE;
+  #endif
 }
 
 //_____________________________________________________________________________
@@ -545,6 +576,8 @@ Int_t TFluka::PDGFromId(Int_t id) const
 
 void TFluka::SetProcess(const char* flagName, Int_t flagValue, Int_t imat)
 {
+//  Set process user flag for material imat
+//
     strcpy(&fProcessFlag[fNbOfProc][0],flagName);
     fProcessValue[fNbOfProc] = flagValue;
     fProcessMaterial[fNbOfProc] = imat;
@@ -554,6 +587,9 @@ void TFluka::SetProcess(const char* flagName, Int_t flagValue, Int_t imat)
 //______________________________________________________________________________ 
 void TFluka::SetProcess(const char* flagName, Int_t flagValue)
 {
+//  Set process user flag 
+//
+
   Int_t i;
   if (fNbOfProc < 100) {
     for (i=0; i<fNbOfProc; i++) {
@@ -575,6 +611,8 @@ void TFluka::SetProcess(const char* flagName, Int_t flagValue)
 //______________________________________________________________________________ 
 void TFluka::SetCut(const char* cutName, Double_t cutValue, Int_t imed)
 {
+// Set user cut value for material imed
+//
     strcpy(&fCutFlag[fNbOfCut][0],cutName);
     fCutValue[fNbOfCut]  = cutValue;
     fCutMaterial[fNbOfCut] = imed;
@@ -584,6 +622,8 @@ void TFluka::SetCut(const char* cutName, Double_t cutValue, Int_t imed)
 //______________________________________________________________________________ 
 void TFluka::SetCut(const char* cutName, Double_t cutValue)
 {
+// Set user cut value 
+//
   Int_t i;
   if (fNbOfCut < 100) {
     for (i=0; i<fNbOfCut; i++) {
@@ -610,6 +650,9 @@ Double_t TFluka::Xsec(char*, Double_t, Int_t, Int_t)
 //______________________________________________________________________________ 
 void TFluka::InitPhysics()
 {
+//
+// Physics initialisation with preparation of FLUKA input cards
+//
    printf("=>InitPhysics\n");
   Int_t i, j, k;
   Double_t fCut;
@@ -2019,6 +2062,8 @@ Bool_t   TFluka::IsTrackEntering() const
 //______________________________________________________________________________ 
 Bool_t   TFluka::IsTrackExiting() const
 {
+// True if track is exiting volume
+//
   Int_t caller = GetCaller();
   if (caller == 12)  // bxdraw exiting
     return 1;
@@ -2097,10 +2142,11 @@ Bool_t   TFluka::IsTrackAlive() const
 
 //______________________________________________________________________________ 
 Int_t TFluka::NSecondaries() const
+
+{
 // Number of secondary particles generated in the current step
 // FINUC.np = number of secondaries except light and heavy ions
 // FHEAVY.npheav = number of secondaries for light and heavy secondary ions
-{
   Int_t caller = GetCaller();
   if (caller == 6)  // valid only after usdraw
     return FINUC.np + FHEAVY.npheav;
@@ -2112,6 +2158,9 @@ Int_t TFluka::NSecondaries() const
 void TFluka::GetSecondary(Int_t isec, Int_t& particleId,
                TLorentzVector& position, TLorentzVector& momentum)
 {
+// Copy particles from secondary stack to vmc stack
+//
+
   Int_t caller = GetCaller();
   if (caller == 6) {  // valid only after usdraw
     if (isec >= 0 && isec < FINUC.np) {
@@ -2149,9 +2198,10 @@ void TFluka::GetSecondary(Int_t isec, Int_t& particleId,
 
 //______________________________________________________________________________ 
 TMCProcess TFluka::ProdProcess(Int_t) const
+
+{
 // Name of the process that has produced the secondary particles
 // in the current step
-{
     const TMCProcess kIpNoProc = kPNoProcess;
     const TMCProcess kIpPDecay = kPDecay;
     const TMCProcess kIpPPair = kPPair;
index 8b192f53f8aa0734142e6b10427c6943a6b0c132..915fd0947ea512ad31c91731185dc677a17151b2 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef TFLUKA
-#define TFLUKA
+#ifndef TFLUKA_H
+#define TFLUKA_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
@@ -264,12 +264,12 @@ class TFluka : public TVirtualMC {
   // ------------------------------------------------
   //
   // - Core input file name
-  TString GetCoreInputFileName() const {return sCoreInputFileName;}
-  void SetCoreInputFileName(const char* n) {sCoreInputFileName = n;}
+  TString GetCoreInputFileName() const {return fCoreInputFileName;}
+  void SetCoreInputFileName(const char* n) {fCoreInputFileName = n;}
 
   // - Input file name
-  TString GetInputFileName() const {return sInputFileName;}
-  void SetInputFileName(const char* n) {sInputFileName = n;}
+  TString GetInputFileName() const {return fInputFileName;}
+  void SetInputFileName(const char* n) {fInputFileName = n;}
 
   // - SetProcess and SetCut
   Int_t GetProcessNb() const {return fNbOfProc;}
@@ -301,8 +301,8 @@ class TFluka : public TVirtualMC {
   Int_t GetMreg() const {return fCurrentFlukaRegion;}
   void SetMreg(Int_t l);
 
-  Int_t GetNewreg() const {return iNewreg;}
-  void SetNewreg(Int_t l) {iNewreg = l;}
+  Int_t GetNewreg() const {return fNewReg;}
+  void SetNewreg(Int_t l) {fNewReg = l;}
 
   Double_t GetRull() const {return fRull;}
   void SetRull(Double_t r) {fRull = r;}
@@ -329,21 +329,21 @@ class TFluka : public TVirtualMC {
   void SetTrackIsInside()  {fTrackIsExiting  = kFALSE; fTrackIsEntering = kFALSE;}
   void SetTrackIsNew(Bool_t flag=kTRUE) {fTrackIsNew = flag;}
   Int_t GetMaterialIndex(Int_t idmat) {return fMaterials[idmat];}
-  
+
+      
  private:
   TFluka(const TFluka &mc): TVirtualMC(mc) {;}
   TFluka & operator=(const TFluka &) {return (*this);}
 
- protected:
   
   Int_t   fVerbosityLevel; //Verbosity level (0 lowest - 3 highest)
 
-  TString sInputFileName;     //Name of the real input file (e.g. alice.inp)
-  TString sCoreInputFileName; //Name of the input file (e.g. corealice.inp)
+  TString fInputFileName;     //Name of the real input file (e.g. alice.inp)
+  TString fCoreInputFileName; //Name of the input file (e.g. corealice.inp)
 
   Int_t    fCaller; //Parameter to indicate who is the caller of the Fluka Draw
   Int_t    fIcode;  //Fluka Draw procedures formal parameter 
-  Int_t    iNewreg; //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
@@ -354,14 +354,14 @@ class TFluka : public TVirtualMC {
   Bool_t   fFieldFlag;        // Flag for magnetic field
   Int_t    fDummyBoundary;    // Flag for crossing dummy boundaries
   //variables for SetProcess and SetCut
-  Int_t    fNbOfProc;
-  Int_t    fProcessValue[10000];
-  Int_t    fProcessMaterial[10000];
-  Char_t   fProcessFlag[10000][5];
-  Int_t    fNbOfCut;
-  Double_t fCutValue[10000];
-  Char_t   fCutFlag[10000][7];
-  Int_t    fCutMaterial[10000];
+  Int_t    fNbOfProc;                // Current number of processes 
+  Int_t    fProcessValue[10000];     // User values assigned to processes
+  Int_t    fProcessMaterial[10000];  // Materials assigned to user settings
+  Char_t   fProcessFlag[10000][5];   // User flags assigned to processes
+  Int_t    fNbOfCut;                 // Current number of cuts
+  Double_t fCutValue[10000];         // User values assigned to cuts
+  Char_t   fCutFlag[10000][7];       // User flags assigned to cuts
+  Int_t    fCutMaterial[10000];      // Materials assigned to cuts
 
   //Geometry through TGeo
   Int_t*               fMaterials;         //!Array of indices
@@ -369,6 +369,7 @@ class TFluka : public TVirtualMC {
   Int_t                fCurrentFlukaRegion; //Index of fluka region at each step
   TFlukaMCGeometry    *fGeom;               // TGeo-FLUKA interface
 
+
   ClassDef(TFluka,1)  //C++ interface to Fluka montecarlo
 };