AliPhysics  754e963 (754e963)
readOCDB.C
Go to the documentation of this file.
1 #include "readOCDB_Temperature.C"
2 #include "readOCDB_LED.C"
3 
4 Int_t readTemp(Int_t *runs, Int_t nruns=1, const char *pername="unspec")
5 {
6  if (!gGrid)
7  TGrid::Connect("alien://");
8  AliCDBManager* cdb = AliCDBManager::Instance();
9  if (cdb->GetDefaultStorage()==0)
10  cdb->SetDefaultStorage("raw://");
11 
12  Int_t ret = 0;
13 
14  TObjArray arr;
15  arr.SetOwner(1);
16 
17  for (Int_t i=0;i<nruns;++i) {
18  Int_t rn = runs[i];
19  cout << "*** Working on " << i+1 << "/" << nruns << " with run number " << rn << " ***" << endl;
20  TInfo *ti = readOCDB_Temperature(rn,0);
21  if (!ti)
22  continue;
23  ti->Print();
24  arr.Add(ti);
25  ++ret;
26  }
27 
28  TFile *outf = TFile::Open("tempinfo.root","update");
29  arr.Write(Form("temperatures_%s",pername),TObject::kSingleKey);
30  outf->ls();
31  outf->Close();
32  delete outf;
33  Double_t frac = 100.*ret/nruns;
34  cout << "Finished temperature objects with " << frac << " percent!" << endl;
35  return ret;
36 }
37 
38 Int_t readLed(Int_t *runs, Int_t nruns=1, const char *pername="unspec")
39 {
40  if (!gGrid)
41  TGrid::Connect("alien://");
42  AliCDBManager* cdb = AliCDBManager::Instance();
43  if (cdb->GetDefaultStorage()==0)
44  cdb->SetDefaultStorage("raw://");
45 
46  Int_t ret = 0;
47 
48  TObjArray arr;
49  arr.SetOwner(1);
50 
51  for (Int_t i=0;i<nruns;++i) {
52  Int_t rn = runs[i];
53  cout << "*** Working on " << i+1 << "/" << nruns << " with run number " << rn << " ***" << endl;
54  LInfo *ti = readOCDB_LED(rn,0);
55  if (!ti)
56  continue;
57  ti->Print();
58  arr.Add(ti);
59  ++ret;
60  }
61 
62  TFile *outf = TFile::Open("ledinfo.root","update");
63  arr.Write(Form("led_%s",pername),TObject::kSingleKey);
64  outf->ls();
65  outf->Close();
66  delete outf;
67  Double_t frac = 100.*ret/nruns;
68  cout << "Finished LED objects with " << frac << " percent!" << endl;
69  return ret;
70 }
71 
72 
73 void read_LHC16f(Bool_t loc=0, Bool_t test=0)
74 {
75  Int_t runs[] = {253961, 253958, 253957, 253956, 253951, 253834, 253826, 253825, 253820, 253819, 253813, 253757, 253756, 253755, 253753, 253751, 253682, 253681, 253680, 253660, 253659, 253658, 253614};
76  Int_t nruns = sizeof(runs)/sizeof(Int_t);
77  if (test)
78  nruns=3;
79 
80  if (loc) {
81  AliCDBManager* cdb = AliCDBManager::Instance();
82  cdb->SetDefaultStorage("local:///opt/alice/OCDB/2016/");
83  }
84 
85  readTemp(runs,nruns,"lhc16f");
86  readLed(runs,nruns,"lhc16f");
87 }
88 
89 void read_LHC16g(Bool_t loc=0, Bool_t test=0)
90 {
91  Int_t runs[] = {254124, 254126, 254128, 254147, 254148, 254149, 254174, 254196, 254199, 254204, 254205, 254293, 254302, 254303, 254304, 254330, 254331, 254332};
92 
93  Int_t nruns = sizeof(runs)/sizeof(Int_t);
94  if (test)
95  nruns=3;
96 
97  if (loc) {
98  AliCDBManager* cdb = AliCDBManager::Instance();
99  cdb->SetDefaultStorage("local:///opt/alice/OCDB/2016/");
100  }
101 
102  readTemp(runs,nruns,"lhc16g");
103  readLed(runs,nruns,"lhc16g");
104 }
105 
107 {
108  Int_t runs[] = {254381, 254394, 254395, 254396, 254422, 254476, 254479, 254529, 254564, 254568, 254576, 254577, 254578, 254581, 254586, 254589, 254604, 254606, 254607, 254608, 254621, 254629, 254630, 254632, 254640, 254644, 254646, 254648, 254649, 254651, 254652, 254653, 254654, 254670, 254691, 254701, 254704, 255009, 255010, 255011, 255245, 255246, 255248, 255249, 255251, 255252, 255253, 255255, 255256, 255275, 255276, 255350, 255351, 255352, 255415, 255418, 255419, 255420, 255421, 255440, 255456, 255463, 255465, 255466, 255467, 255469};
109 
110  Int_t nruns = sizeof(runs)/sizeof(Int_t);
111  if (test)
112  nruns=3;
113 
114  if (loc) {
115  AliCDBManager* cdb = AliCDBManager::Instance();
116  cdb->SetDefaultStorage("local:///opt/alice/OCDB/2016/");
117  }
118 
119  readTemp(runs,nruns,"lhc16h");
120  readLed(runs,nruns,"lhc16h");
121 }
122 
124 {
125  Int_t runs[] = {255515, 255533, 255534, 255535, 255537, 255538, 255539, 255540, 255541, 255542, 255543, 255577, 255582, 255583, 255591, 255592, 255614, 255615, 255616, 255617, 255618, 255642, 255648, 255649, 255650};
126 
127  Int_t nruns = sizeof(runs)/sizeof(Int_t);
128  if (test)
129  nruns=3;
130 
131  if (loc) {
132  AliCDBManager* cdb = AliCDBManager::Instance();
133  cdb->SetDefaultStorage("local:///opt/alice/OCDB/2016/");
134  }
135 
136  readTemp(runs,nruns,"lhc16i");
137  readLed(runs,nruns,"lhc16i");
138 }
139 
141 {
142  Int_t runs[] = {256146, 256147, 256148, 256149, 256156, 256157, 256207, 256210, 256223, 256225, 256227, 256231, 256281, 256282, 256283, 256284, 256289, 256290, 256292, 256295, 256297, 256298, 256299, 256302, 256307, 256309, 256311, 256356, 256357, 256361, 256362, 256363, 256364, 256365, 256366, 256367, 256371, 256372, 256373, 256415, 256417, 256418, 256420};
143  Int_t nruns = sizeof(runs)/sizeof(Int_t);
144  if (test)
145  nruns=3;
146 
147  if (loc) {
148  AliCDBManager* cdb = AliCDBManager::Instance();
149  cdb->SetDefaultStorage("local:///opt/alice/OCDB/2016/");
150  }
151 
152  readTemp(runs,nruns,"lhc16j");
153  readLed(runs,nruns,"lhc16j");
154 }
155 
157 {
158  Int_t runs[] = {256504, 256506, 256510, 256512, 256514, 256552, 256554, 256556, 256560, 256561, 256562, 256564, 256565, 256567, 256589, 256591, 256592, 256619, 256620, 256653, 256658, 256676, 256677, 256681, 256684, 256691, 256692, 256694, 256695, 256697, 256782, 256797, 256879, 256911, 256913, 256924, 256926, 256941, 256942, 256944, 257011, 257012, 257021, 257026, 257028, 257071, 257075, 257077, 257078, 257079, 257080, 257082, 257083, 257084, 257092, 257100, 257136, 257137, 257138, 257139, 257140, 257141, 257142, 257144, 257145, 257190, 257204, 257206, 257209, 257224, 257260, 257318, 257320, 257322, 257364, 257381, 257382, 257433, 257457, 257474, 257487, 257490, 257491, 257492, 257530, 257531, 257537, 257539, 257540, 257541, 257560, 257561, 257562, 257563, 257564, 257565, 257566, 257587, 257590, 257594, 257605, 257606, 257630, 257635, 257642, 257682, 257684, 257687, 257688, 257689, 257691, 257692, 257694, 257697, 257724, 257725, 257733, 257734, 257735, 257737, 257754, 257765, 257773, 257797, 257798, 257799, 257800, 257803, 257804, 257850, 257853, 257855, 257892, 257893, 257908, 257912, 257936, 257937, 257939, 257957, 257958, 257960, 257963, 257971, 257979, 258012, 258014, 258017, 258019, 258039, 258041, 258042, 258045, 258046, 258048, 258049, 258059, 258060, 258062, 258063, 258107, 258108, 258109, 258112, 258113, 258114, 258117, 258178, 258197, 258198, 258202, 258203, 258204, 258256, 258257, 258258, 258259, 258270, 258271, 258272, 258273, 258274, 258276, 258278, 258279, 258280, 258299, 258301, 258302, 258303, 258306, 258307, 258336, 258359, 258387, 258388, 258393, 258426, 258454, 258456, 258477, 258485, 258498, 258499, 258537, 258545, 258546, 258551, 258560, 258567, 258569, 258571, 258572, 258574};
159 
160  Int_t nruns = sizeof(runs)/sizeof(Int_t);
161  if (test)
162  nruns=3;
163 
164  if (loc) {
165  AliCDBManager* cdb = AliCDBManager::Instance();
166  cdb->SetDefaultStorage("local:///opt/alice/OCDB/2016/");
167  }
168 
169  readTemp(runs,nruns,"lhc16k");
170  readLed(runs,nruns,"lhc16k");
171 }
172 
174 {
175  Int_t runs[] = {258883, 258884, 258885, 258886, 258889, 258890, 258919, 258920, 258921, 258923, 258926, 258931, 258962, 258964, 258998, 259000, 259086, 259088, 259090, 259091, 259095, 259096, 259099, 259117, 259118, 259140, 259141, 259164, 259204, 259257, 259263, 259269, 259270, 259271, 259272, 259273, 259274, 259302, 259305, 259307, 259334, 259336, 259339, 259340, 259341, 259342, 259378, 259379, 259381, 259382, 259388, 259389, 259394, 259395, 259396, 259469, 259470, 259471, 259473, 259477, 259546, 259559, 259560, 259561, 259563, 259606, 259608, 259609, 259649, 259650, 259668, 259697, 259703, 259704, 259711, 259747, 259748, 259750, 259751, 259752, 259756, 259781, 259788, 259792, 259822, 259841, 259842, 259860, 259866, 259867, 259868, 259888, 259954, 259961, 259979, 260010, 260011, 260014, 260187};
176 
177  Int_t nruns = sizeof(runs)/sizeof(Int_t);
178  if (test)
179  nruns=3;
180 
181  if (loc) {
182  AliCDBManager* cdb = AliCDBManager::Instance();
183  cdb->SetDefaultStorage("local:///opt/alice/OCDB/2016/");
184  }
185 
186  readTemp(runs,nruns,"lhc16l");
187  readLed(runs,nruns,"lhc16l");
188 }
189 
191 {
192  Int_t runs[] = {262395, 262396, 262397, 262398, 262399, 262418, 262419, 262422, 262423, 262424, 262425, 262426, 262427, 262428, 262429, 262430, 262450, 262451, 262492, 262528, 262532, 262533, 262563, 262567, 262568, 262569, 262570, 262571, 262572, 262574, 262583, 262593, 262594, 262624, 262628, 262632, 262635, 262679, 262682, 262683, 262686, 262705, 262706, 262708, 262712, 262713, 262716, 262717, 262719, 262723, 262727, 262728, 262734, 262760, 262768, 262776, 262777, 262778, 262841, 262844, 262849, 262853, 262858, 263331, 263332, 263487, 263496, 263529, 263647, 263648, 263652, 263653, 263654, 263657, 263662, 263663, 263682, 263689, 263690, 263691, 263737, 263738, 263739, 263741, 263743, 263744, 263784, 263785, 263786, 263787, 263789, 263790, 263792, 263793, 263803, 263813, 263814, 263823, 263824, 263829, 263830, 263861, 263863, 263866, 263905, 263916, 263917, 263922, 263923, 263977, 263978, 263979, 263981, 263984, 263985, 264033, 264035};
193  Int_t nruns = sizeof(runs)/sizeof(Int_t);
194  if (test)
195  nruns=3;
196 
197  if (loc) {
198  AliCDBManager* cdb = AliCDBManager::Instance();
199  cdb->SetDefaultStorage("local:///opt/alice/OCDB/2016/");
200  }
201 
202  readTemp(runs,nruns,"lhc16o");
203  readLed(runs,nruns,"lhc16o");
204 }
205 
207 {
208  Int_t runs[] = {264076, 264078, 264082, 264085, 264086, 264109, 264110, 264129, 264133, 264134, 264137, 264138, 264139, 264164, 264168, 264188, 264190, 264197, 264198, 264232, 264233, 264235, 264238, 264259, 264260, 264261, 264262, 264264, 264265, 264266, 264267, 264277, 264279, 264281, 264305, 264306, 264312, 264336, 264345, 264346, 264347};
209 
210  Int_t nruns = sizeof(runs)/sizeof(Int_t);
211  if (test)
212  nruns=3;
213 
214  if (loc) {
215  AliCDBManager* cdb = AliCDBManager::Instance();
216  cdb->SetDefaultStorage("local:///opt/alice/OCDB/2016/");
217  }
218 
219  readTemp(runs,nruns,"lhc16p");
220  readLed(runs,nruns,"lhc16p");
221 }
222 
224 {
225  Int_t runs[] = {282008,282016,282021,282025,282026,282027,282030,282031,282050,282051,282078,282098,282099,282118,282119,282120,282122,282123,282125,282126,282127,282146,282147,282189,282206,282224,282227,282229,282230,282247,282302,282303,282304,282305,282306,282307,282309,282312,282313,282314,282340,282341,282342,282343};
226 
227  Int_t nruns = sizeof(runs)/sizeof(Int_t);
228  if (test)
229  nruns=3;
230 
231  if (loc) {
232  AliCDBManager* cdb = AliCDBManager::Instance();
233  cdb->SetDefaultStorage("local:///opt/alice/OCDB/2017/");
234  }
235 
236  readTemp(runs,nruns,"lhc17p");
237  readLed(runs,nruns,"lhc17p");
238 }
239 
241 {
242  Int_t runs[] =
243  {284891, 284900, 284946, 285007, 285008, 285009, 285010, 285011, 285012, 285013, 285014, 285015, 285064, 285065, 285066, 285106, 285107, 285108, 285125, 285127, 285165, 285200, 285202, 285203, 285222, 285224, 285286, 285287, 285289, 285290, 285291, 285327, 285328, 285347, 285364, 285365, 285396, 285447};
244 
245  Int_t nruns = sizeof(runs)/sizeof(Int_t);
246  if (test)
247  nruns=3;
248 
249  if (loc) {
250  AliCDBManager* cdb = AliCDBManager::Instance();
251  cdb->SetDefaultStorage("local:///opt/alice/OCDB/2018/");
252  }
253 
254  readTemp(runs,nruns,"lhc18b");
255  readLed(runs,nruns,"lhc18b");
256 }
257 
259 {
260  Int_t runs[] =
261  {285466,285471,285481,285486,285496,285497,285515,285516,285545,285550,285557,285575,285576,285577,285578,285599,285601,285602,285603,285639,285640,285641,285642,285643,285659,285662,285663,285664,285666,285697,285698,285722,285751,285752,285753,285754,285755,285777,285778,285781,285804,285810,285811,285812,285830,285851,285869,285893,285917,285946,285957,285958};
262 
263  Int_t nruns = sizeof(runs)/sizeof(Int_t);
264  if (test)
265  nruns=3;
266 
267  if (loc) {
268  AliCDBManager* cdb = AliCDBManager::Instance();
269  cdb->SetDefaultStorage("local:///opt/alice/OCDB/2018/");
270  }
271 
272  readTemp(runs,nruns,"lhc18c");
273  readLed(runs,nruns,"lhc18c");
274 }
275 
277 {
278  Int_t runs[] = {285978,285979,285980,286014,286018,286025,286026,286027,286030,286064,286124,286127,286129,286130,286154,286157,286159,286198,286201,286202,286203,286229,286230,286231,286254,286255,286256,286257,286258,286261,286263,286282,286284,286287,286288,286289,286308,286309,286310,286311,286312,286313,286314,286336,286337,286340,286341,286345,286348,286349,286350};
279 
280  Int_t nruns = sizeof(runs)/sizeof(Int_t);
281  if (test)
282  nruns=3;
283 
284  if (loc) {
285  AliCDBManager* cdb = AliCDBManager::Instance();
286  cdb->SetDefaultStorage("local:///opt/alice/OCDB/2018/");
287  }
288 
289  readTemp(runs,nruns,"lhc18d");
290  readLed(runs,nruns,"lhc18d");
291 }
292 
294 {
295  Int_t runs[] = {286380, 286426, 286428, 286454, 286455, 286482, 286501, 286502, 286508, 286509, 286511, 286566, 286567, 286568, 286569, 286591, 286592, 286653, 286661, 286695, 286731, 286799, 286801, 286846, 286848, 286850, 286852, 286874, 286876, 286907, 286908, 286910, 286911, 286930, 286931, 286932, 286936, 286937};
296 
297  Int_t nruns = sizeof(runs)/sizeof(Int_t);
298  if (test)
299  nruns=3;
300 
301  if (loc) {
302  AliCDBManager* cdb = AliCDBManager::Instance();
303  cdb->SetDefaultStorage("local:///opt/alice/OCDB/2018/");
304  }
305 
306  readTemp(runs,nruns,"lhc18e");
307  readLed(runs,nruns,"lhc18e");
308 }
309 
310 
311 void read_all(Bool_t loc=0, Bool_t test=0)
312 {
313  read_LHC16f(loc,test);
314  read_LHC16g(loc,test);
315  read_LHC16h(loc,test);
316  read_LHC16i(loc,test);
317  read_LHC16j(loc,test);
318  read_LHC16k(loc,test);
319  read_LHC16l(loc,test);
320  read_LHC16o(loc,test);
321  read_LHC16p(loc,test);
322  read_LHC17p(loc,test);
323  read_LHC18b(loc,test);
324  read_LHC18c(loc,test);
325  read_LHC18d(loc,test);
326  read_LHC18e(loc,test);
327 }
328 
329 void readOCDB(Bool_t loc=0, Int_t runno=286154)
330 {
331  AliCDBManager* cdb = AliCDBManager::Instance();
332  if (loc)
333  cdb->SetDefaultStorage("local:///opt/alice/OCDB/test/");
334 
335  LInfo *li = readOCDB_LED(runno, 0);
336  li->Compute();
337  //li->Print();
338  cout << "fraction good strips ";
339  for (Int_t i=0;i<20;++i)
340  cout << li->FracStrips(i) << " ";
341  cout << endl;
342  cout << "fraction good towers ";
343  for (Int_t i=0;i<20;++i)
344  cout << li->FracLeds(i) << " ";
345  cout << endl;
346 }
void read_LHC16k(Bool_t loc=0, Bool_t test=0)
Definition: readOCDB.C:156
double Double_t
Definition: External.C:58
Double_t FracLeds(Int_t sm, Int_t gain=1) const
Definition: LInfo.cxx:199
Definition: TInfo.h:10
void readOCDB(Bool_t loc=0, Int_t runno=286154)
Definition: readOCDB.C:329
void read_LHC16i(Bool_t loc=0, Bool_t test=0)
Definition: readOCDB.C:123
void Print(Option_t *option="") const
Definition: LInfo.cxx:247
void read_LHC18c(Bool_t loc=0, Bool_t test=0)
Definition: readOCDB.C:258
Int_t readTemp(Int_t *runs, Int_t nruns=1, const char *pername="unspec")
Definition: readOCDB.C:4
void read_LHC16h(Bool_t loc=0, Bool_t test=0)
Definition: readOCDB.C:106
void read_LHC16g(Bool_t loc=0, Bool_t test=0)
Definition: readOCDB.C:89
Int_t readLed(Int_t *runs, Int_t nruns=1, const char *pername="unspec")
Definition: readOCDB.C:38
void read_LHC16p(Bool_t loc=0, Bool_t test=0)
Definition: readOCDB.C:206
void read_LHC18b(Bool_t loc=0, Bool_t test=0)
Definition: readOCDB.C:240
Definition: LInfo.h:13
void read_LHC16l(Bool_t loc=0, Bool_t test=0)
Definition: readOCDB.C:173
int Int_t
Definition: External.C:63
void read_LHC18d(Bool_t loc=0, Bool_t test=0)
Definition: readOCDB.C:276
void Compute()
Definition: LInfo.cxx:11
Double_t FracStrips(Int_t sm, Int_t gain=1) const
Definition: LInfo.cxx:226
LInfo * readOCDB_LED(Int_t runNb=286350, Bool_t debug=1)
Definition: readOCDB_LED.C:33
TInfo * readOCDB_Temperature(Int_t runNb=286350, Bool_t debug=1)
void read_LHC18e(Bool_t loc=0, Bool_t test=0)
Definition: readOCDB.C:293
void read_LHC16f(Bool_t loc=0, Bool_t test=0)
Definition: readOCDB.C:73
void Print(Option_t *option="") const
Definition: TInfo.cxx:66
void read_all(Bool_t loc=0, Bool_t test=0)
Definition: readOCDB.C:311
void read_LHC16o(Bool_t loc=0, Bool_t test=0)
Definition: readOCDB.C:190
void test(int runnumber=195345)
void read_LHC17p(Bool_t loc=0, Bool_t test=0)
Definition: readOCDB.C:223
bool Bool_t
Definition: External.C:53
void read_LHC16j(Bool_t loc=0, Bool_t test=0)
Definition: readOCDB.C:140