Setter for directory
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 12 Jan 2011 22:29:00 +0000 (22:29 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 12 Jan 2011 22:29:00 +0000 (22:29 +0000)
Default OADB
(C. Loizides)

ANALYSIS/AliCentralitySelectionTask.cxx
ANALYSIS/AliCentralitySelectionTask.h

index 0be76bc..57bcb22 100644 (file)
@@ -75,6 +75,7 @@ AliAnalysisTaskSE(),
   fDebug(0),
   fAnalysisInput("ESD"),
   fIsMCInput(kFALSE),
+  fDirName("$ALICE_ROOT/opt/alice/aliroot/trunk/OADB/COMMON/CENTRALITY/data"),
   fFile(0),
   fFile2(0),
   fCurrentRun(-1),
@@ -131,6 +132,7 @@ AliCentralitySelectionTask::AliCentralitySelectionTask(const char *name):
   fDebug(0),
   fAnalysisInput("ESD"),
   fIsMCInput(kFALSE),
+  fDirName("$ALICE_ROOT/opt/alice/aliroot/trunk/OADB/COMMON/CENTRALITY/data"),
   fFile(0),
   fFile2(0),
   fCurrentRun(-1),
@@ -198,6 +200,7 @@ AliCentralitySelectionTask::AliCentralitySelectionTask(const AliCentralitySelect
   fDebug(ana.fDebug),    
   fAnalysisInput(ana.fDebug),
   fIsMCInput(ana.fIsMCInput),
+  fDirName(ana.fDirName),
   fFile(ana.fFile),
   fFile2(ana.fFile2),
   fCurrentRun(ana.fCurrentRun),
@@ -569,8 +572,8 @@ Int_t AliCentralitySelectionTask::SetupRun(AliESDEvent* esd)
   else if ( fRunNo >= 137366 ) fRunNo = 137366;
   // CHANGE HERE FOR RUN RANGES
   
-  TString fileName(Form("$ALICE_ROOT/ANALYSIS/macros/AliCentralityBy1D_%d.root", fRunNo));
-  TString fileName2(Form("$ALICE_ROOT/ANALYSIS/macros/AliCentralityByFunction_%d.root", fRunNo));
+  TString fileName(Form("%s/AliCentralityBy1D_%d.root", fDirName.Data(), fRunNo));
+  TString fileName2(Form("%s/AliCentralityByFunction_%d.root", fDirName.Data(), fRunNo));
   
   AliInfo(Form("Centrality Selection for run %d is initialized with %s", fCurrentRun, fileName.Data()));
   ReadCentralityHistos(fileName.Data());
index 3271420..cea26b4 100644 (file)
@@ -36,12 +36,12 @@ class AliCentralitySelectionTask : public AliAnalysisTaskSE {
   virtual void Terminate(Option_t *option);
 
   virtual void  SetDebugLevel(Int_t level) {fDebug = level;}
+  void SetDirName(const char *n)           {fDirName = n;}
   void SetInput(const char* input)         {fAnalysisInput = input;}
   void SetMCInput()                        {fIsMCInput = kTRUE;}
   
   void ReadCentralityHistos(TString filename);
   void ReadCentralityHistos2(TString filename);
-
  private:
 
   Int_t SetupRun(AliESDEvent* esd);
@@ -49,6 +49,7 @@ class AliCentralitySelectionTask : public AliAnalysisTaskSE {
   Int_t    fDebug;             // Debug flag
   TString  fAnalysisInput;     // "ESD", "AOD"
   Bool_t   fIsMCInput;          // true when input is MC
+  TString  fDirName;            // directory name in which file is being searched
   TFile   *fFile;               // file that holds the centrality vs multiplicity 1d
   TFile   *fFile2;              // file that holds the centrality vs multiplicity 2d  
   Int_t    fCurrentRun;         // current run number
@@ -102,8 +103,7 @@ class AliCentralitySelectionTask : public AliAnalysisTaskSE {
   TH2F *fHOutMultV0MvsTRK;    //control histogram for multiplicity
   TH2F *fHOutMultTRKvsCL1;    //control histogram for multiplicity
 
-  ClassDef(AliCentralitySelectionTask,1); 
-
+  ClassDef(AliCentralitySelectionTask,2); 
 };
 
 #endif