macro to fetch the AliITSRecoPAram object from the OCDB
authormasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 13 Nov 2011 16:25:48 +0000 (16:25 +0000)
committermasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 13 Nov 2011 16:25:48 +0000 (16:25 +0000)
ITS/InspectITSRecoParam.C [new file with mode: 0644]

diff --git a/ITS/InspectITSRecoParam.C b/ITS/InspectITSRecoParam.C
new file mode 100644 (file)
index 0000000..2f0d972
--- /dev/null
@@ -0,0 +1,47 @@
+#if !defined(__CINT__) || defined(__MAKECINT__)
+#include "Riostream.h"
+#include "TGrid.h"
+#include "TString.h"
+#include "AliCDBManager.h"
+#include "AliITSRecoParam.h"
+#include "AliCDBPath.h"
+#include "AliCDBEntry.h"
+#endif
+AliITSRecoParam* InspectITSRecoParam(Int_t nrun=167713,TString selec="HighMult", Bool_t local=kFALSE ){
+  // this macro retrieves one of the 3 recoparam objects stored in the OCDB:
+  // according to the selection string selec:  HighMult - LowMult - Cosmic
+  // if local is true, then the OCDB in $ALICE_ROOT is used
+  AliCDBManager * man = AliCDBManager::Instance();
+  if(local){
+    man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+  }
+  else{
+    TGrid::Connect("alien://");
+    man->SetDefaultStorage("alien://folder=/alice/data/2011/OCDB");
+  }
+  man->SetRun(nrun);
+  AliCDBPath path("ITS","Calib","RecoParam");
+  AliCDBEntry *entry=AliCDBManager::Instance()->Get(path.GetPath());
+  TObjArray *arr = dynamic_cast<TObjArray*>(entry->GetObject());
+  if(!arr){
+    cout<<"No valid TObjArray\n";
+    return NULL;
+  }
+  Int_t elem=0;
+  if(selec.Contains("Cosmic")){
+    elem = 0;
+  }
+  else if (selec.Contains("LowMult")){
+    elem = 1;
+  }
+  else if (selec.Contains("HighMult")){
+    elem = 2;
+  }
+  else {
+    cout<<"Invalid choice "<<selec<<endl;
+    return NULL;
+  }
+  AliITSRecoParam* rp = (AliITSRecoParam*)arr->At(elem);
+  rp->PrintParameters();
+  return rp;
+}