-
Notifications
You must be signed in to change notification settings - Fork 28
/
parameter_merger.C
65 lines (43 loc) · 1.92 KB
/
parameter_merger.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
void parameter_merger() {
// ---------------------- Parameter Version List ------------------
// Put here last parameter version for each detector at the end of the list
std::vector<TString> califaCalParList{"califa/califacalibparams_v1.par","califa/califacalibparams_v2.par" };
std::vector<TString> califaMapParList{"califa/califamappingparams_v1.par"};
std::vector<TString> califaGeoParList{"califa/califageoparams_v1.par"};
// -------------------- Setting Parameters --------------------
R3BCalifaCrystalCalPar *califaCalPar;
R3BCalifaMappingPar *califaMapPar;
R3BTGeoPar *califaGeoPar;
FairParAsciiFileIo *inputAscii = new FairParAsciiFileIo();
FairRuntimeDb *rtdb = FairRuntimeDb::instance();
// ------------------- Setting Outputs ----------------------------
// Here Run Id's do not matter. We only need versions of each parameter
Bool_t kParameterMerged = kFALSE;
FairParRootFileIo *parOut = new FairParRootFileIo(kParameterMerged);
parOut->open("workshop_expParams.root", "RECREATE");
rtdb->setOutput(parOut);
rtdb->addRun(1);
for (Int_t k = 0; k < califaCalParList.size(); k++) {
califaCalPar =
(R3BCalifaCrystalCalPar *)rtdb->getContainer("califaCrystalCalPar");
inputAscii->open(califaCalParList.at(k), "in");
rtdb->setFirstInput(inputAscii);
rtdb->initContainers(k + 1);
rtdb->saveOutput();
}
for (Int_t k = 0; k < califaMapParList.size(); k++) {
califaMapPar =
(R3BCalifaMappingPar *)rtdb->getContainer("califaMappingPar");
inputAscii->open(califaMapParList.at(k), "in");
rtdb->setFirstInput(inputAscii);
rtdb->initContainers(k + 1);
rtdb->saveOutput();
}
for (Int_t k = 0; k < califaGeoParList.size(); k++) {
califaGeoPar = (R3BTGeoPar *)rtdb->getContainer("CalifaGeoPar");
inputAscii->open(califaGeoParList.at(k), "in");
rtdb->setFirstInput(inputAscii);
rtdb->initContainers(k + 1);
rtdb->saveOutput();
}
}