AliPhysics  68dfc25 (68dfc25)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CopyCorr.C
Go to the documentation of this file.
1 Bool_t
3  const char* table,
4  ULong_t tgtRun,
5  UShort_t tgtSys,
6  UShort_t tgtSNN,
7  Short_t tgtFld,
8  ULong_t srcRun,
9  UShort_t srcSys,
10  UShort_t srcSNN,
11  Short_t srcFld,
12  Bool_t mc)
13 {
14  const char* fwd = "${ALICE_PHYSICS}/PWGLF/FORWARD/analysis2";
15  if (!gROOT->GetClass("AliOADBForward"))
16  gROOT->Macro(Form("%s/scripts/LoadLibs.C", fwd));
17 
18  TString tab(table);
19  const char* det = fmd ? "fmd" : "spd";
20  const char* possible[] = { "elossfits",
21  "secondary",
22  "noisegain",
23  "acceptance",
24  "merging",
25  "vertexbias",
26  "doublehit",
27  0 };
28  const char** pTest = possible;
29  while (*pTest) {
30  if (tab.EqualTo(*pTest)) break;
31  pTest++;
32  }
33  if (!(*pTest)) {
34  Warning("CopyCorr", "Unknown table: %s", table);
35  return false;
36  }
37 
38  if (tgtSys < 1) tgtSys = srcSys;
39  if (tgtSNN < 1) tgtSNN = srcSNN;
40  if (tgtFld >= 999) tgtFld = srcFld;
41 
43  db->Open(Form("%s_corrections.root", det), tab, true);
44 
45  if (!db->CopyEntry(tab,
46  srcRun, srcSys, srcSNN, srcFld,
47  tgtRun, tgtSys, tgtSNN, tgtFld,
48  mc, false)) {
49  Error("CopySec",
50  "Failed to copy %s %lu/%hu/%hu/%hd/%s -> %lu/%hu/%hu/%hd/%s",
51  det,
52  srcRun, srcSys, srcSNN, srcFld, (mc ? "MC" : "Real"),
53  tgtRun, tgtSys, tgtSNN, tgtFld, (mc ? "MC" : "Real"));
54  return false;
55  }
56  return true;
57 }
Bool_t CopyCorr(Bool_t fmd, const char *table, ULong_t tgtRun, UShort_t tgtSys, UShort_t tgtSNN, Short_t tgtFld, ULong_t srcRun, UShort_t srcSys, UShort_t srcSNN, Short_t srcFld, Bool_t mc)
Definition: CopyCorr.C:2
Bool_t CopyEntry(const TString &table, ULong_t oldRunNo, UShort_t oldSys, UShort_t oldSNN, Short_t oldField, ULong_t newRunNo, UShort_t newSys, UShort_t newSNN, Short_t newField, Bool_t mc, Bool_t sat)
unsigned long ULong_t
Definition: External.C:38
short Short_t
Definition: External.C:23
const char * fwd
unsigned short UShort_t
Definition: External.C:28
bool Bool_t
Definition: External.C:53
Bool_t Open(const TString &fileName, const TString &tables="*", Bool_t rw=false, Bool_t verb=false, Bool_t fallback=false)