]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Pass the name of the MC model (Geant3, Geant4, Fluka), and title (G4 Physics list...
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 9 Oct 2011 17:59:42 +0000 (17:59 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 9 Oct 2011 17:59:42 +0000 (17:59 +0000)
EMCAL/AliEMCAL.cxx
EMCAL/AliEMCALEMCGeometry.cxx
EMCAL/AliEMCALEMCGeometry.h
EMCAL/AliEMCALGeometry.cxx
EMCAL/AliEMCALGeometry.h

index e1f925942bf46ba3c43afdda9a94aa9653e9ad3d..d9efcc179dd6ccbbd653ce9f064100dce2a001e6 100644 (file)
@@ -440,12 +440,22 @@ AliEMCALGeometry* AliEMCAL::GetGeometry() const
 {
   //Initializes and returns geometry
   
+  // Pass the transpor model name (Geant3, Geant4, Fluka) and title to the geometry
+  TString mcname   = "";
+  TString mctitle  = "";
+  if(gMC){
+    mcname  = gMC->GetName()  ;
+    mctitle = gMC->GetTitle() ;
+  }
+  
   //Check if run number and requested geometry correspond to the same geometry as
   //in real data taking. To prevent errors in official simulation productions
   if(!(AliEMCALGeometry::GetInstance()))
   {
+    // Check the transport model name and option, set sampling fraction depending on it
+    
     if(!fCheckRunNumberAndGeoVersion){// Set geometry with the name used in the configuration file
-      return AliEMCALGeometry::GetInstance(GetTitle(),"EMCAL") ;
+      return AliEMCALGeometry::GetInstance(GetTitle(),"EMCAL",mcname,mctitle) ;
     }
     else{//Check run number and version and set the corresponding one.
       //Get run number
@@ -466,7 +476,7 @@ AliEMCALGeometry* AliEMCAL::GetGeometry() const
         else {
           AliDebug(1,"Initialized geometry with name <<EMCAL_FIRSTYEARV1>>");}
         
-        return AliEMCALGeometry::GetInstance("EMCAL_FIRSTYEARV1","EMCAL") ;// Set geometry with the name used in the configuration file
+        return AliEMCALGeometry::GetInstance("EMCAL_FIRSTYEARV1","EMCAL",mcname,mctitle) ;// Set geometry with the name used in the configuration file
       }
       else{ //Default geometry
         //Complete EMCAL geometry, 10 SM.
@@ -477,11 +487,12 @@ AliEMCALGeometry* AliEMCAL::GetGeometry() const
         else {
           AliDebug(1,"Initialized geometry with name <<EMCAL_COMPLETEV1>>");}
 
-        return AliEMCALGeometry::GetInstance("EMCAL_COMPLETEV1","EMCAL") ;// Set geometry with the name used in the configuration file
+        return AliEMCALGeometry::GetInstance("EMCAL_COMPLETEV1","EMCAL",mcname,mctitle) ;// Set geometry with the name used in the configuration file
       }
     }
   }// Init geometry for the first time
   
+  
   return AliEMCALGeometry::GetInstance();
     
 }
index 925ba8216f768a9703310460466f2e9f078fef23..ef7473fafe996bd1efaac33d7b6799ffb0d224db 100644 (file)
@@ -111,7 +111,8 @@ AliEMCALEMCGeometry::AliEMCALEMCGeometry()
   AliDebug(2, "AliEMCALEMCGeometry : default ctor ");
 }
 //______________________________________________________________________
-AliEMCALEMCGeometry::AliEMCALEMCGeometry(const Text_t* name, const Text_t* title) :
+AliEMCALEMCGeometry::AliEMCALEMCGeometry(const Text_t* name, const Text_t* title,
+                                         const Text_t* mcname, const Text_t* mctitle ) :
   TNamed(name,title),
     fGeoName(0),fArrayOpts(0),fNAdditionalOpts(0),fECPbRadThickness(0.),fECScintThick(0.),
     fNECLayers(0),fArm1PhiMin(0.),fArm1PhiMax(0.),fArm1EtaMin(0.),fArm1EtaMax(0.),fIPDistance(0.),
@@ -133,9 +134,9 @@ AliEMCALEMCGeometry::AliEMCALEMCGeometry(const Text_t* name, const Text_t* title
     f2Trd2Dy2(0.), fEmptySpace(0.), fTubsR(0.), fTubsTurnAngle(0.)
 {
   // ctor only for internal usage (singleton)
-  AliDebug(2, Form("AliEMCALEMCGeometry(%s,%s) ", name,title));
+  AliDebug(2, Form("AliEMCALEMCGeometry(%s,%s,%s,%s) ", name,title,mcname,mctitle));
 
-  Init();
+  Init(mcname,mctitle);
 
   //  CreateListOfTrd1Modules();
 
@@ -227,7 +228,7 @@ AliEMCALEMCGeometry::~AliEMCALEMCGeometry(void){
 }
 
 //______________________________________________________________________
-void AliEMCALEMCGeometry::Init(void){
+void AliEMCALEMCGeometry::Init(const Text_t* mcname, const Text_t* mctitle){
   //
   // Initializes the EMCAL parameters based on the name
   // Only Shashlyk geometry is available, but various combinations of
@@ -413,7 +414,7 @@ void AliEMCALEMCGeometry::Init(void){
   }
 
   //called after setting of scintillator and lead layer parameters
-  DefineSamplingFraction();
+  DefineSamplingFraction(mcname,mctitle);
 
   
   // TRU parameters - Apr 29,08 by PAI. 
@@ -536,12 +537,14 @@ void AliEMCALEMCGeometry::CheckAdditionalOptions()
 }
 
 //__________________________________________________________________
-void AliEMCALEMCGeometry::DefineSamplingFraction()
+void AliEMCALEMCGeometry::DefineSamplingFraction(const Text_t* mcname, const Text_t* mctitle)
 {
   // Jun 05,2006
   // Look http://rhic.physics.wayne.edu/~pavlinov/ALICE/SHISHKEBAB/RES/linearityAndResolutionForTRD1.html
   // Keep for compatibilty
   //
+  
+  // Sampling factor for G3
   fSampling = 10.87; // Default value - Nov 25,2010
   if(fNECLayers == 69) {        // 10% layer reduction
     fSampling = 12.55;
@@ -558,6 +561,25 @@ void AliEMCALEMCGeometry::DefineSamplingFraction()
       fSampling = 8.93; // fECScintThick = 0.192, fECPbRadThickness=0.128;
     }
   }
+
+  // Default sampling factor for G3, modify it for other transport model
+  TString mcName  = mcname;
+  TString mcTitle = mctitle;
+
+  Float_t samplingFactorTranportModel = 1. ;
+  if     (mcName.Contains("Geant3")) samplingFactorTranportModel = 1.;//0.988 // Do nothing
+  else if(mcName.Contains("Fluka") ) samplingFactorTranportModel = 1.; // To be set
+  else if(mcName.Contains("Geant4")){
+    if(mcTitle.Contains("EMV"))      samplingFactorTranportModel = 1.096; // 0.906, 0.896 (OPT)
+    else                             samplingFactorTranportModel = 0.86; // 1.15 (CHIPS), 1.149 (BERT), 1.147 (BERT_CHIPS) 
+  }      
+  
+  AliDebug(2,Form("MC modeler <%s>, Title <%s>: Sampling %f, model fraction with respect to G3 %f, final sampling %f \n",
+               mcName.Data(),mcTitle.Data(),fSampling,samplingFactorTranportModel,fSampling*samplingFactorTranportModel));
+
+  
+  fSampling*=samplingFactorTranportModel;
+  
 }
 
 //________________________________________________________________________________________________
index 6cabc0adf69095b9f2c064f9742843e21d272699..a1a61fc4138fcfe89e8d2daa608925e6d94d5b5a 100644 (file)
@@ -32,7 +32,8 @@ public:
   AliEMCALEMCGeometry(); // default ctor only for internal usage (singleton)
   AliEMCALEMCGeometry(const AliEMCALEMCGeometry& geom);
   // ctor only for internal usage (singleton)
-  AliEMCALEMCGeometry(const Text_t* name, const Text_t* title);
+  AliEMCALEMCGeometry(const Text_t* name, const Text_t* title,
+                      const Text_t* mcname="", const Text_t* mctitle="");
 
   virtual ~AliEMCALEMCGeometry(void); 
 
@@ -49,9 +50,9 @@ public:
   static const Char_t* GetDefaultGeometryName() {return fgkDefaultGeometryName;}
   void   PrintGeometry();        //*MENU*  
   
-  void   Init(void);                     // initializes the parameters of EMCAL
+  void   Init(const Text_t* mcname="", const Text_t* mctitle=""); // initializes the parameters of EMCAL
   void   CheckAdditionalOptions();        //
-  void   DefineSamplingFraction();        // Jun 5, 2006
+  void   DefineSamplingFraction(const Text_t* mcname="", const Text_t* mctitle="");        
 
   //////////////////////////////////////
   // Return EMCAL geometrical parameters
index 7a3b3c605cd4f6dc894c66731e8bb219b186692d..de3e7ceb8ff0213ab41b22e6b18af59e939d53b8 100644 (file)
@@ -171,7 +171,8 @@ AliEMCALGeometry::AliEMCALGeometry(const AliEMCALGeometry & geo)
 }
 
 //____________________________________________________________________________
-AliEMCALGeometry::AliEMCALGeometry(const Text_t* name, const Text_t* title) 
+AliEMCALGeometry::AliEMCALGeometry(const Text_t* name,   const Text_t* title,
+                                   const Text_t* mcname, const Text_t* mctitle) 
   : TNamed(name, title),
     fEMCGeometry(0x0),fGeoName(0),
     fKey110DEG(0),fNCellsInSupMod(0),fNETAdiv(0),fNPHIdiv(0),
@@ -187,8 +188,8 @@ AliEMCALGeometry::AliEMCALGeometry(const Text_t* name, const Text_t* title)
 { 
 
   // ctor only for normal usage 
-
-  fEMCGeometry = new AliEMCALEMCGeometry(name,title);
+  
+  fEMCGeometry = new AliEMCALEMCGeometry(name,title,mcname,mctitle);
 
   fGeoName = fEMCGeometry->GetGeoName();
   fKey110DEG = fEMCGeometry->GetKey110DEG();
@@ -285,16 +286,16 @@ AliEMCALGeometry *  AliEMCALGeometry::GetInstance(){
 }
 
 //______________________________________________________________________
-AliEMCALGeometry* AliEMCALGeometry::GetInstance(const Text_t* name,
-                                                const Text_t* title){
+AliEMCALGeometry* AliEMCALGeometry::GetInstance(const Text_t* name,   const Text_t* title,
+                                                const Text_t* mcname, const Text_t* mctitle ){
   // Returns the pointer of the unique instance
-  
+    
   AliEMCALGeometry * rv = 0; 
   if ( fgGeom == 0 ) {
     if ( strcmp(name,"") == 0 ) { // get default geometry
-      fgGeom = new AliEMCALGeometry(fgkDefaultGeometryName, title);
+      fgGeom = new AliEMCALGeometry(fgkDefaultGeometryName, title,mcname,mctitle);
     } else {
-      fgGeom = new AliEMCALGeometry(name, title);
+      fgGeom = new AliEMCALGeometry(name, title,mcname,mctitle);
     }  // end if strcmp(name,"")
     if ( AliEMCALEMCGeometry::fgInit ) rv = (AliEMCALGeometry * ) fgGeom;
     else {
index 95de54d0b82811c60d7e08070932775710b357dc..4da437550588e965bdc314e0886d078a5d3c9990 100644 (file)
@@ -35,14 +35,15 @@ class AliEMCALGeometry : public TNamed {
 public: 
 
   AliEMCALGeometry();
-  AliEMCALGeometry(const Text_t* name, const Text_t* title="");
+  AliEMCALGeometry(const Text_t* name, const Text_t* title="",
+                   const Text_t* mcname="", const Text_t* mctitle="");
   AliEMCALGeometry(const AliEMCALGeometry & geom);
   
   virtual ~AliEMCALGeometry(void); 
   AliEMCALGeometry & operator = (const AliEMCALGeometry  & rvalue);
   
-  static AliEMCALGeometry * GetInstance(const Text_t* name,
-                                       const Text_t* title="") ; 
+  static AliEMCALGeometry * GetInstance(const Text_t* name,      const Text_t* title="",
+                                        const Text_t* mcname="TGeant3", const Text_t* mctitle="") ; 
   static AliEMCALGeometry * GetInstance();