Added PWGLF directory and added constants for the
authorhansena <hansena@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 14 Feb 2012 10:58:31 +0000 (10:58 +0000)
committerhansena <hansena@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 14 Feb 2012 10:58:31 +0000 (10:58 +0000)
FMD event plane.  Also make sure this directory is
properly installed.

OADB/CMakelibOADB.pkg
OADB/PWGLF/FORWARD/FMDEVENTPLANE/data/fmdEPoadb.root [new file with mode: 0644]
OADB/PWGLF/FORWARD/FMDEVENTPLANE/macros/UpdateEventplaneOADB.C [new file with mode: 0644]

index c8e249b..87c94bb 100644 (file)
@@ -15,6 +15,6 @@ set ( EXPORT ${HDRS})
 set ( EINCLUDE ANALYSIS  STEER/STEERBase)
 
 # Install data to destination 
-install (DIRECTORY COMMON PWGPP PWG2 PWG3 PWG4 
+install (DIRECTORY COMMON PWGPP PWG2 PWG3 PWG4 PWGLF
          DESTINATION OADB 
         PATTERN ".svn" EXCLUDE)
diff --git a/OADB/PWGLF/FORWARD/FMDEVENTPLANE/data/fmdEPoadb.root b/OADB/PWGLF/FORWARD/FMDEVENTPLANE/data/fmdEPoadb.root
new file mode 100644 (file)
index 0000000..03aad41
Binary files /dev/null and b/OADB/PWGLF/FORWARD/FMDEVENTPLANE/data/fmdEPoadb.root differ
diff --git a/OADB/PWGLF/FORWARD/FMDEVENTPLANE/macros/UpdateEventplaneOADB.C b/OADB/PWGLF/FORWARD/FMDEVENTPLANE/macros/UpdateEventplaneOADB.C
new file mode 100644 (file)
index 0000000..f27ce9f
--- /dev/null
@@ -0,0 +1,42 @@
+void UpdateEventplaneOADB(TString oadbname, const char* updatename, Int_t runBegin = 0, Int_t runEnd = 0)
+{
+
+  Bool_t newcont = kFALSE;
+  
+  if (!runBegin || !runEnd) newcont = kTRUE;
+  
+  TFile* oadb = 0; 
+  if (oadbname.Length() > 0.) oadb = TFile::Open(oadbname, "READ");
+  TFile* in   = TFile::Open(updatename);
+
+  AliOADBContainer* cont = 0;
+  if (oadb) cont = (AliOADBContainer*)oadb->Get("FMDphidist");
+  if (!cont) {
+    if (newcont) cont = new AliOADBContainer("FMDphidist");
+    else         Fatal("Something is wrong. There is no container, but you supplied a runrange...\n");
+  }
+
+  TList* list   = (TList*)in->Get("FMDEventplaneSums");
+  TList* eplist = (TList*)list->FindObject("fmdEventplaneFinder");
+  TH1D*  hist   = (TH1D*) eplist->FindObject("hPhiDist");
+
+  if (!newcont) {
+    hist->SetName(Form("%d-%d", runBegin, runEnd));
+    cont->AppendObject(hist, runBegin, runEnd);
+  }
+  else {
+    hist->SetName("Default");
+    cont->AddDefaultObject(hist);
+  }
+
+  TFile* out = TFile::Open("new_fmdEPoadb.root", "RECREATE");
+  out->Close();
+
+  cont->WriteToFile("new_fmdEPoadb.root");
+
+  Printf("Wrote new OADB object to file new_%s, please check that everything is OK and replace the old file", oadbname);
+
+  out = TFile::Open("new_fmdEPoadb.root");
+  new TBrowser();
+
+}