]>
Commit | Line | Data |
---|---|---|
dc6dc1ff | 1 | void CreateDDLinfoCDB() |
2 | { | |
3 | ||
4 | AliCDBManager* man = AliCDBManager::Instance(); | |
5 | man->SetDefaultStorage("local://$ALICE_ROOT/OCDB"); | |
6 | // man->SetDefaultStorage("local:///Users/basanta/ALISOFT/PMD/VarInit/OCDB"); | |
7 | AliPMDddlinfoData *mapda = new AliPMDddlinfoData(); | |
8 | ||
9 | Int_t ddlno; | |
10 | Int_t modno, totmod; | |
11 | Int_t serialmodno[12]; | |
12 | // Int_t moduleDDL[6] = {12,12,0,0,12,12}; | |
13 | ||
14 | ifstream infile; | |
15 | infile.open("PMD_ddl_info.dat"); // ascii file | |
16 | if(!infile) AliError("Could not open the DDL info file"); | |
17 | ||
18 | ||
19 | for(Int_t iddl = 0; iddl < 6; iddl++) | |
20 | { | |
21 | infile >> ddlno >> totmod; | |
22 | ||
23 | mapda->SetNoOfModulePerDdl(iddl,totmod); | |
24 | ||
25 | //printf("%d %d\n", ddlno, totmod); | |
26 | if(totmod == 0) continue; | |
27 | ||
28 | for(Int_t imod = 0; imod < 12; imod++) | |
29 | { | |
30 | infile >> modno; | |
31 | serialmodno[imod] = modno; | |
32 | //printf("%d \n", modno); | |
33 | } | |
34 | ||
35 | mapda->SetModuleNoPerDdl(iddl,serialmodno); | |
36 | } | |
37 | ||
38 | infile.close(); | |
39 | ||
40 | infile.open("PMD_removed_chains.dat"); // ascii file | |
41 | if(!infile) AliError("Could not open the DDL info file"); | |
42 | ||
43 | Int_t det, smn; | |
44 | Int_t rows1, rowe1, cols1, cole1; | |
45 | Int_t rows2, rowe2, cols2, cole2; | |
46 | ||
47 | Int_t srowa[2][24]; | |
48 | Int_t erowa[2][24]; | |
49 | Int_t scola[2][24]; | |
50 | Int_t ecola[2][24]; | |
51 | Int_t srowb[2][24]; | |
52 | Int_t erowb[2][24]; | |
53 | Int_t scolb[2][24]; | |
54 | Int_t ecolb[2][24]; | |
55 | ||
56 | ||
57 | for(Int_t idet = 0; idet < 2; idet++) | |
58 | { | |
59 | for(Int_t ismn = 0; ismn < 24; ismn++) | |
60 | { | |
61 | infile >> det >> smn >> rows1 >> rowe1 >> cols1 >> cole1 | |
62 | >> rows2 >> rowe2 >> cols2 >> cole2; | |
63 | ||
64 | srowa[idet][ismn] = rows1; | |
65 | erowa[idet][ismn] = rowe1; | |
66 | scola[idet][ismn] = cols1; | |
67 | ecola[idet][ismn] = cole1; | |
68 | srowb[idet][ismn] = rows2; | |
69 | erowb[idet][ismn] = rowe2; | |
70 | scolb[idet][ismn] = cols2; | |
71 | ecolb[idet][ismn] = cole2; | |
72 | ||
73 | } | |
74 | } | |
75 | ||
76 | mapda->SetStartRowA(srowa); | |
77 | mapda->SetStartRowB(srowb); | |
78 | mapda->SetStartColA(scola); | |
79 | mapda->SetStartColB(scolb); | |
80 | mapda->SetEndRowA(erowa); | |
81 | mapda->SetEndRowB(erowb); | |
82 | mapda->SetEndColA(ecola); | |
83 | mapda->SetEndColB(ecolb); | |
84 | ||
85 | ||
86 | AliCDBMetaData *md= new AliCDBMetaData(); | |
87 | md->SetResponsible("Basanta Nandi"); | |
88 | md->SetComment("DDL info for PMD"); | |
89 | ||
90 | AliCDBId id("PMD/Calib/Ddlinfo",0,AliCDBRunRange::Infinity()); | |
91 | ||
92 | man->GetDefaultStorage()->Put(mapda,id, md); | |
93 | ||
94 | } |