TENDER becomes Tender, removing .so
[u/mrichter/AliRoot.git] / OADB / PWGPP / macros / AddPtInvCorr.C
CommitLineData
22105d3b 1// Macro to add 1/pt correction for specific run range to OADB object
2// If both runMin and runMax are negative, the object is added as default (will override old one if any)
3// Contact: ruben.shahoyan@cern.ch
4
5void AddPtInvCorr(
6 int runMin,int runMax,
7 TGraph* corrPtInvGloA, // A side corr. for globals
8 TGraph* corrPtInvGloC, // C side corr. for globals
9 TGraph* corrPtInvTPCA, // A side corr. for TPC tracks
10 TGraph* corrPtInvTPCC, // C side corr. for TPC tracks
11 double corrXiniGlo=-1, // if >0, globals will be re-propagate to vtxTrc starting from this X
12 double corrXiniTPC=-1, // if >0, TPC tracks will be re-propagate to vtxTPC starting from this X
13 const char* fileOADB = "$OADB/PWGPP/data/CorrPTInv.root",
14 const char* objName = "CorrPTInv"
15)
16{
17 //
230b7aff 18 gSystem->Load("libANALYSIS");
19 gSystem->Load("libANALYSISalice");
20 gSystem->Load("libTender");
21 gSystem->Load("libOADB");
22105d3b 22 //
23 //
24 TString fileName = fileOADB;
25 if (fileName.BeginsWith("$OADB")) fileName.ReplaceAll("$OADB",Form("%s/",AliAnalysisManager::GetOADBPath()));
26 gSystem->ExpandPathName(fileName);
27 //
28 Bool_t isDefault = kFALSE;
29 if (runMin<0 && runMax<0) {
30 printf("Run ranges is negative, will add as default object\n");
31 isDefault = kTRUE;
32 }
33 AliOADBTrackFix* corObj = new AliOADBTrackFix(isDefault ? "default" : Form("corrPTInv_%d_%d",runMin,runMax));
34 corObj->SetPtInvCorr(AliOADBTrackFix::kCorModeGlob,0,corrPtInvGloA);
35 corObj->SetPtInvCorr(AliOADBTrackFix::kCorModeGlob,1,corrPtInvGloC);
36 corObj->SetXIniPtInvCorr(AliOADBTrackFix::kCorModeGlob, corrXiniGlo);
37 //
38 corObj->SetPtInvCorr(AliOADBTrackFix::kCorModeTPCInner,0,corrPtInvTPCA);
39 corObj->SetPtInvCorr(AliOADBTrackFix::kCorModeTPCInner,1,corrPtInvTPCC);
40 corObj->SetXIniPtInvCorr(AliOADBTrackFix::kCorModeTPCInner, corrXiniTPC);
41 //
42 AliOADBContainer *oadbCont = new AliOADBContainer(objName);
43 //
44 if (oadbCont->InitFromFile(fileName.Data(),objName)) {
45 printf("New object will be created\n");
46 oadbCont->SetNameTitle(objName, "object for 1/pt correction");
47 }
48 if (isDefault) {
49 oadbCont->CleanDefaultList();
50 oadbCont->AddDefaultObject(corObj);
51 }
52 else oadbCont->AppendObject(corObj, runMin,runMax);
53 //
54 oadbCont->WriteToFile(fileName.Data());
55 //
56}