macro to create calibration data in CDB
[u/mrichter/AliRoot.git] / VZERO / DBStorageCalib.C
CommitLineData
98fa8bae 1
2void DBStorageCalib(){
3
4AliCDBManager *man = AliCDBManager::Instance();
5
6AliCDBStorage *storLoc;
7man->SetDefaultStorage("local://$ALICE_ROOT");
8
9// Setting gain and pedestal values :
10
11AliVZEROCalibData *calibda = new AliVZEROCalibData("Calib");
12
13Float_t GainFactors[128] =
14{ 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0,
15 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0,
16 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0,
17 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0,
18 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0,
19 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0,
20 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0,
21 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0,
22 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0,
23 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0,
24 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0,
25 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0,
26 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0, 50.0 };
27
28calibda->SetGain(GainFactors);
29
30Float_t Pedestals[128] =
31{ 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0,
32 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0,
33 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0,
34 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0,
35 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0,
36 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0,
37 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0,
38 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0,
39 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0,
40 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0,
41 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0,
42 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0,
43 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0, 16.0 };
44
45calibda->SetPedestal(Pedestals);
46
47Float_t Sigmas[128] =
48{ 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0,
49 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0,
50 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0,
51 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0,
52 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0,
53 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0,
54 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0,
55 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0,
56 3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
85
86// Creation of the object VZERO Calibration as a MetaData
87
88TObjString str("VZERO Calibration"); // object that will be stored
89
90AliCDBMetaData *md= new AliCDBMetaData(); // metaData describing the object
91
92AliCDBId id("VZERO/Calib/Data",0,9999999);
93
94md->SetObjectClassName("VZERO calibration parameters");
95md->SetResponsible("Brigitte Cheynis");
96md->SetBeamPeriod(0);
97md->SetAliRootVersion("July2006");
98md->SetComment("Prototype");
99md->PrintMetaData();
100
101storLoc = man->GetDefaultStorage();
102storLoc->Put(calibda, id, md);
103
104storLoc->Delete();
105delete md;
106
107}