-
Notifications
You must be signed in to change notification settings - Fork 494
Expand file tree
/
Copy pathCreateModuleConfig.C
More file actions
132 lines (122 loc) · 4.07 KB
/
CreateModuleConfig.C
File metadata and controls
132 lines (122 loc) · 4.07 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#if !defined(__CLING__) || defined(__ROOTCLING__)
#include "FairLogger.h"
#include "CCDB/CcdbApi.h"
#include "ZDCBase/ModuleConfig.h"
#include "ZDCBase/Constants.h"
#include <string>
#include <TFile.h>
#include <map>
#endif
using namespace o2::zdc;
using namespace std;
void CreateModuleConfig(long tmin = 0, long tmax = -1,
std::string ccdbHost = "http://ccdb-test.cern.ch:8080")
{
ModuleConfig conf;
int modID;
//-------------------------------------------
{
modID = 0;
auto& module = conf.modules[modID];
module.id = modID;
module.setChannel(0, IdZNAC, 0, true, true, -5, 6, 4, 12);
module.setChannel(1, IdZNASum, 1, false, false);
module.setChannel(2, IdZNA1, 2, true, false);
module.setChannel(3, IdZNA2, 3, true, false);
//
}
//-------------------------------------------
{
modID = 1;
auto& module = conf.modules[modID];
module.id = modID;
module.setChannel(0, IdZNAC, 4, false, true, -5, 6, 4, 12);
module.setChannel(1, IdZNASum, 5, true, false);
module.setChannel(2, IdZNA1, 6, true, false);
module.setChannel(3, IdZNA2, 7, true, false);
//
}
//-------------------------------------------
{
modID = 2;
auto& module = conf.modules[modID];
module.id = modID;
module.setChannel(0, IdZNCC, 8, true, true, -5, 6, 4, 12);
module.setChannel(1, IdZNCSum, 9, false, false);
module.setChannel(2, IdZNC1, 10, true, false);
module.setChannel(3, IdZNC2, 11, true, false);
//
}
//-------------------------------------------
{
modID = 3;
auto& module = conf.modules[modID];
module.id = modID;
module.setChannel(0, IdZNCC, 12, false, true, -5, 6, 4, 12);
module.setChannel(1, IdZNCSum, 13, true, false);
module.setChannel(2, IdZNC3, 14, true, false);
module.setChannel(3, IdZNC4, 15, true, false);
//
}
//-------------------------------------------
{
modID = 4;
auto& module = conf.modules[modID];
module.id = modID;
module.setChannel(0, IdZPAC, 16, true, true, -5, 6, 4, 12);
module.setChannel(1, IdZEM1, 16, true, true, -5, 6, 4, 12);
module.setChannel(2, IdZPA1, 17, true, false);
module.setChannel(3, IdZPA2, 17, true, false);
//
}
//-------------------------------------------
{
modID = 5;
auto& module = conf.modules[modID];
module.id = modID;
module.setChannel(0, IdZPAC, 18, false, true, -5, 6, 4, 12);
module.setChannel(1, IdZPASum, 18, true, false);
module.setChannel(2, IdZPA1, 19, true, false);
module.setChannel(3, IdZPA2, 19, true, false);
//
}
//-------------------------------------------
{
modID = 6;
auto& module = conf.modules[modID];
module.id = modID;
module.setChannel(0, IdZPCC, 16, true, true, -5, 6, 4, 12);
module.setChannel(1, IdZEM2, 16, true, true, -5, 6, 4, 12);
module.setChannel(2, IdZPC1, 17, true, false);
module.setChannel(3, IdZPC2, 17, true, false);
//
}
//-------------------------------------------
{
modID = 7;
auto& module = conf.modules[modID];
module.id = modID;
module.setChannel(0, IdZPCC, 18, false, true, -5, 6, 4, 12);
module.setChannel(1, IdZPCSum, 18, true, false);
module.setChannel(2, IdZPC3, 19, true, false);
module.setChannel(3, IdZPC4, 19, true, false);
//
}
conf.check();
conf.print();
o2::ccdb::CcdbApi api;
map<string, string> metadata; // can be empty
api.init(ccdbHost.c_str()); // or http://localhost:8080 for a local installation
// store abitrary user object in strongly typed manner
api.storeAsTFileAny(&conf, CCDBPathConfigModule, metadata, tmin, tmax);
// return conf;
}