]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
move setting of geometry file from Reader to CaloUtils, set it automatically at first...
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 1 Nov 2013 09:58:36 +0000 (09:58 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 1 Nov 2013 09:58:36 +0000 (09:58 +0000)
PWG/CaloTrackCorrBase/AliCaloTrackReader.cxx
PWG/CaloTrackCorrBase/AliCaloTrackReader.h
PWG/CaloTrackCorrBase/AliCalorimeterUtils.cxx
PWG/CaloTrackCorrBase/AliCalorimeterUtils.h

index 96eec5bb39d0d537110ceafe8238e15563da22a2..3efa132cee2122fed71a87cd9fa54abe9f03b5e5 100755 (executable)
@@ -125,7 +125,7 @@ fTimeStampRunMin(0),         fTimeStampRunMax(0),
 fNPileUpClusters(-1),        fNNonPileUpClusters(-1),         fNPileUpClustersCut(3),
 fVertexBC(-200),             fRecalculateVertexBC(0),
 fCentralityClass(""),        fCentralityOpt(0),
-fEventPlaneMethod(""),       fImportGeometryFromFile(kFALSE), fImportGeometryFilePath(""),
+fEventPlaneMethod(""),
 fAcceptOnlyHIJINGLabels(0),  fNMCProducedMin(0), fNMCProducedMax(0),
 fFillInputNonStandardJetBranch(kFALSE),
 fNonStandardJets(new TClonesArray("AliAODJet",100)),fInputNonStandardJetBranchName("jets"),
@@ -611,17 +611,7 @@ void AliCaloTrackReader::Init()
     fReadStack          = kFALSE;
     fReadAODMCParticles = kFALSE;
   }
-  
-  // Init geometry, I do not like much to do it like this ...
-  if(fImportGeometryFromFile && !gGeoManager)
-  {
-    if(fImportGeometryFilePath=="") // If not specified, set a default location
-      fImportGeometryFilePath = "$ALICE_ROOT/OADB/EMCAL/geometry_2011.root"; // "$ALICE_ROOT/EVE/alice-data/default_geo.root"
-    
-    printf("AliCaloTrackReader::Init() - Import %s\n",fImportGeometryFilePath.Data());
-    TGeoManager::Import(fImportGeometryFilePath) ; // default need file "geometry.root" in local dir!!!!
-  }
-  
+
   if(!fESDtrackCuts)
     fESDtrackCuts = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts(); //initialize with TPC only tracks
        
@@ -698,8 +688,6 @@ void AliCaloTrackReader::InitParameters()
   fTriggerAnalysis = new AliTriggerAnalysis;
   fAODBranchList   = new TList ;
   
-  fImportGeometryFromFile = kFALSE;
-  
   fPileUpParamSPD[0] = 3   ; fPileUpParamSPD[1] = 0.8 ;
   fPileUpParamSPD[2] = 3.0 ; fPileUpParamSPD[3] = 2.0 ; fPileUpParamSPD[4] = 5.0;
   
index 85d8c286a517051193b3aebd2f0bae604fb887c3..ccb09bfa55e4a6d5b0134deba145097d2a6465fb 100755 (executable)
@@ -497,11 +497,6 @@ public:
   
   virtual Double_t GetBField()                       const { return fInputEvent->GetMagneticField()  ; } 
   
-  void    SetImportGeometryFromFile(Bool_t import, 
-                                    TString path = "")     { 
-                                                             fImportGeometryFromFile = import    ; 
-                                                             fImportGeometryFilePath = path      ; }
-  
   //------------------------------------------------
   // MC analysis specific methods
   //-------------------------------------------------
@@ -745,9 +740,6 @@ public:
   Int_t            fCentralityOpt;              // Option for the returned value of the centrality, possible options 5, 10, 100
   Int_t            fCentralityBin[2];           // Minimum and maximum value of the centrality for the analysis
   TString          fEventPlaneMethod;           // Name of event plane method, by default "Q"
-  
-  Bool_t           fImportGeometryFromFile;     // Import geometry settings in geometry.root file
-  TString          fImportGeometryFilePath;     // path fo geometry.root file
 
   Bool_t           fAcceptOnlyHIJINGLabels;     // Select clusters or tracks that where generated by HIJING, reject other generators in case of cocktail
   Int_t            fNMCProducedMin;             // In case of cocktail, select particles in the list with label from this value
@@ -764,7 +756,7 @@ public:
   AliCaloTrackReader(              const AliCaloTrackReader & r) ; // cpy ctor
   AliCaloTrackReader & operator = (const AliCaloTrackReader & r) ; // cpy assignment
   
-  ClassDef(AliCaloTrackReader,61)
+  ClassDef(AliCaloTrackReader,62)
   
 } ;
 
index f6f2013193ba2f02cc133dac8eebc11ade6fe562..232a6f37bc82adaf84af721f0eadd0717c2462ce 100755 (executable)
@@ -1214,6 +1214,9 @@ void AliCalorimeterUtils::InitParameters()
   fOADBFilePathEMCAL = "$ALICE_ROOT/OADB/EMCAL" ;          
   fOADBFilePathPHOS  = "$ALICE_ROOT/OADB/PHOS"  ;     
   
+  fImportGeometryFromFile = kTRUE;
+  fImportGeometryFilePath = "";
+  
 }
 
 
@@ -1282,6 +1285,24 @@ void AliCalorimeterUtils::InitEMCALGeometry(Int_t runnumber)
     
                fEMCALGeo = AliEMCALGeometry::GetInstance(fEMCALGeoName);
     
+    // Init geometry, I do not like much to do it like this ...
+    if(fImportGeometryFromFile && !gGeoManager)
+    {
+      if(fImportGeometryFilePath=="") // If not specified, set location depending on run number
+      {
+        // "$ALICE_ROOT/EVE/alice-data/default_geo.root"
+        if     (runnumber <  140000 &&
+                runnumber >= 100000) fImportGeometryFilePath = "$ALICE_ROOT/OADB/EMCAL/geometry_2010.root";
+        if     (runnumber >= 140000 &&
+                runnumber <  171000) fImportGeometryFilePath = "$ALICE_ROOT/OADB/EMCAL/geometry_2011.root";
+        else                         fImportGeometryFilePath = "$ALICE_ROOT/OADB/EMCAL/geometry_2012.root"; // 2012-2013
+
+      }
+      printf("AliCalorimeterUtils::InitEMCALGeometry() - Import %s\n",fImportGeometryFilePath.Data());
+      TGeoManager::Import(fImportGeometryFilePath) ; // default need file "geometry.root" in local dir!!!!
+    }
+
+    
                if(fDebug > 0)
     {
                        printf("AliCalorimeterUtils::InitEMCALGeometry(run=%d)",runnumber);
index 669d2c66be2d7b4160802ad382ac23d6a1bc9345..7c5cb91b53a85ea1a3ff50f0717b54a422bcaff5 100755 (executable)
@@ -86,6 +86,11 @@ class AliCalorimeterUtils : public TObject {
 
   void          AccessGeometry(AliVEvent* inputEvent) ;
        
+  void          SetImportGeometryFromFile(Bool_t import,
+                                          TString path = ""){
+                                                             fImportGeometryFromFile = import    ;
+                                                             fImportGeometryFilePath = path      ; } // EMCAL
+  
   void          SwitchOnLoadOwnEMCALGeometryMatrices()     { fLoadEMCALMatrices = kTRUE   ; }
   void          SwitchOffLoadOwnEMCALGeometryMatrices()    { fLoadEMCALMatrices = kFALSE  ; }
   void          SetEMCALGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fEMCALMatrix[i] = m ; }
@@ -321,11 +326,13 @@ class AliCalorimeterUtils : public TObject {
   Bool_t             fOADBForPHOS ;          //  Get calibration from OADB for PHOS
   TString            fOADBFilePathEMCAL ;    //  Default path $ALICE_ROOT/OADB/EMCAL, if needed change
   TString            fOADBFilePathPHOS ;     //  Default path $ALICE_ROOT/OADB/PHOS, if needed change
-  
+  Bool_t             fImportGeometryFromFile;// Import geometry settings in geometry.root file
+  TString            fImportGeometryFilePath;// path fo geometry.root file
+
   AliCalorimeterUtils(              const AliCalorimeterUtils & cu) ; // cpy ctor
   AliCalorimeterUtils & operator = (const AliCalorimeterUtils & cu) ; // cpy assignment
   
-  ClassDef(AliCalorimeterUtils,14)
+  ClassDef(AliCalorimeterUtils,15)
 } ;