]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/InspectITSRecoParam.C
#100372: Request to port code to allow for event selection from ZDC timing info at...
[u/mrichter/AliRoot.git] / ITS / InspectITSRecoParam.C
1 #if !defined(__CINT__) || defined(__MAKECINT__)
2 #include "Riostream.h"
3 #include "TGrid.h"
4 #include "TString.h"
5 #include "AliCDBManager.h"
6 #include "AliITSRecoParam.h"
7 #include "AliCDBPath.h"
8 #include "AliCDBEntry.h"
9 #endif
10 AliITSRecoParam* InspectITSRecoParam(Int_t nrun=167713,TString selec="HighMult", Bool_t local=kFALSE ){
11   // this macro retrieves one of the 3 recoparam objects stored in the OCDB:
12   // according to the selection string selec:  HighMult - LowMult - Cosmic
13   // if local is true, then the OCDB in $ALICE_ROOT is used
14   AliCDBManager * man = AliCDBManager::Instance();
15   if(local){
16     man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
17   }
18   else{
19     TGrid::Connect("alien://");
20     man->SetDefaultStorage("alien://folder=/alice/data/2011/OCDB");
21   }
22   man->SetRun(nrun);
23   AliCDBPath path("ITS","Calib","RecoParam");
24   AliCDBEntry *entry=AliCDBManager::Instance()->Get(path.GetPath());
25   TObjArray *arr = dynamic_cast<TObjArray*>(entry->GetObject());
26   if(!arr){
27     cout<<"No valid TObjArray\n";
28     return NULL;
29   }
30   Int_t elem=0;
31   if(selec.Contains("Cosmic")){
32     elem = 0;
33   }
34   else if (selec.Contains("LowMult")){
35     elem = 1;
36   }
37   else if (selec.Contains("HighMult")){
38     elem = 2;
39   }
40   else {
41     cout<<"Invalid choice "<<selec<<endl;
42     return NULL;
43   }
44   AliITSRecoParam* rp = (AliITSRecoParam*)arr->At(elem);
45   rp->PrintParameters();
46   return rp;
47 }