]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSDDLModuleMapSDD.cxx
Added February 2008 DDL maps (F. Prino)
[u/mrichter/AliRoot.git] / ITS / AliITSDDLModuleMapSDD.cxx
1 /**************************************************************************
2  * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /* $Id: $ */
17
18 ///////////////////////////////////////////////////////////////////
19 //                                                               //
20 // Implementation of the class for SDD DDL mapping in the OCDB   //
21 // Origin: F.Prino, Torino, prino@to.infn.it                     //
22 //                                                               //
23 ///////////////////////////////////////////////////////////////////
24
25 #include "AliITSDDLModuleMapSDD.h"
26
27 ClassImp(AliITSDDLModuleMapSDD)
28
29
30 //______________________________________________________________________
31 AliITSDDLModuleMapSDD::AliITSDDLModuleMapSDD():TObject(){
32   // default constructor
33   SetDefaultMap();
34 }
35 //______________________________________________________________________
36 AliITSDDLModuleMapSDD::AliITSDDLModuleMapSDD(Char_t *ddlmapfile):TObject(){
37   // constructor used to read DDL map  from text file
38   ReadDDLModuleMap(ddlmapfile);
39 }
40 //______________________________________________________________________
41 void AliITSDDLModuleMapSDD::SetDefaultMap(){
42   // Fill DDL map according to the default connection scheme
43   Int_t defaultmap[kDDLsNumber][kModulesPerDDL] = 
44     {
45  
46       {240,241,242,246,247,248,252,253,254,258,259,260},
47       {264,265,266,270,271,272,276,277,278,282,283,284},
48       {288,289,290,294,295,296,300,301,302,306,307,308},
49       {312,313,314,318,319,320,-1,-1,-1,-1,-1,-1},
50       {243,244,245,249,250,251,255,256,257,261,262,263},
51       {267,268,269,273,274,275,279,280,281,285,286,287},
52       {291,292,293,297,298,299,303,304,305,309,310,311},
53       {315,316,317,321,322,323,-1,-1,-1,-1,-1,-1},
54       {324,325,326,327,332,333,334,335,340,341,342,343},
55       {348,349,350,351,356,357,358,359,364,365,366,367},
56       {372,373,374,375,380,381,382,383,388,389,390,391},
57       {396,397,398,399,404,405,406,407,412,413,414,415},
58       {420,421,422,423,428,429,430,431,436,437,438,439},
59       {444,445,446,447,452,453,454,455,460,461,462,463},
60       {468,469,470,471,476,477,478,479,484,485,486,487},
61       {492,493,494,495,-1,-1,-1,-1,-1,-1,-1,-1},
62       {328,329,330,331,336,337,338,339,344,345,346,347},
63       {352,353,354,355,360,361,362,363,368,369,370,371},
64       {376,377,378,379,384,385,386,387,392,393,394,395},
65       {400,401,402,403,408,409,410,411,416,417,418,419},
66       {424,425,426,427,432,433,434,435,440,441,442,443},
67       {448,449,450,451,456,457,458,459,464,465,466,467},
68       {472,473,474,475,480,481,482,483,488,489,490,491},
69       {496,497,498,499,-1,-1,-1,-1,-1,-1,-1,-1}
70     };
71
72   for(Int_t iddl=0;iddl<kDDLsNumber;iddl++){
73     for(Int_t ichan=0; ichan<kModulesPerDDL; ichan++){
74       fDDLModuleMap[iddl][ichan]=defaultmap[iddl][ichan];
75     }
76   }
77 }
78
79 //______________________________________________________________________
80 void AliITSDDLModuleMapSDD::SetDec07part1Map(){
81   // Fill DDL map according to dec07 cosmic run connections (run<14435)
82   Int_t dec07part1map[kDDLsNumber][kModulesPerDDL] = 
83     {
84       {328,329,330,331,336,337,338,339,344,345,346,347}, //Crate TOP
85       {352,353,354,355,-1,-1,-1,-1,-1,-1,-1,-1},
86       {376,377,378,379,384,385,386,387,408,409,410,411},
87       {400,401,402,403,392,393,394,395,416,417,418,419},
88       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
89       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
90       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
91       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
92     
93       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},   //Crate MED
94       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
95       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
96       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
97       {368,369,370,371,360,361,362,363,-1,-1,-1,-1},
98       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
99       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
100       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
101     
102       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},   //Crate BOT
103       {240,241,242,246,247,248,-1,-1,-1,-1,-1,-1},
104       {-1,-1,-1,-1,-1,-1,264,265,266,270,271,272},
105       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
106       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
107       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
108       {267,268,269,273,274,275,-1,-1,-1,-1,-1,-1},
109       {243,244,245,249,250,251,255,256,257,261,262,263}
110     };
111   for(Int_t iddl=0;iddl<kDDLsNumber;iddl++){
112     for(Int_t ichan=0; ichan<kModulesPerDDL; ichan++){
113       fDDLModuleMap[iddl][ichan]=dec07part1map[iddl][ichan];
114     }
115   }
116 }
117
118
119 //______________________________________________________________________
120 void AliITSDDLModuleMapSDD::SetDec07part2Map(){
121   // Fill DDL map according to dec07 cosmic run connection (run>14435)
122   Int_t dec07part2map[kDDLsNumber][kModulesPerDDL] = 
123     {
124       {328,329,330,331,336,337,338,339,344,345,346,347}, //Crate TOP
125       {352,353,354,355,360,361,362,363,368,369,370,371},
126       {376,377,378,379,384,385,386,387,408,409,410,411},
127       {400,401,402,403,392,393,394,395,416,417,418,419},
128       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
129       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
130       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
131       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
132       
133       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},   //Crate MED
134       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
135       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
136       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
137       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
138       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
139       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
140       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
141       
142       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},   //Crate BOT
143       {240,241,242,246,247,248,-1,-1,-1,-1,-1,-1},
144       {-1,-1,-1,-1,-1,-1,264,265,266,270,271,272},
145       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
146       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
147       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
148       {267,268,269,273,274,275,-1,-1,-1,-1,-1,-1},
149       {243,244,245,249,250,251,255,256,257,261,262,263}
150     };
151   for(Int_t iddl=0;iddl<kDDLsNumber;iddl++){
152     for(Int_t ichan=0; ichan<kModulesPerDDL; ichan++){
153       fDDLModuleMap[iddl][ichan]=dec07part2map[iddl][ichan];
154     }
155   }
156 }
157
158 //______________________________________________________________________
159 void AliITSDDLModuleMapSDD::SetFeb08Map(){
160   // Fill DDL map according to feb08 cosmic run connection 
161   Int_t feb08map[kDDLsNumber][kModulesPerDDL] = 
162     {
163       {328,329,330,331,336,337,338,339,344,345,346,347}, //Crate TOP
164       {352,353,354,355,360,361,362,363,368,369,370,371},
165       {376,377,378,379,384,385,386,387,392,393,394,395},
166       {400,401,402,403,408,409,410,411,416,417,418,419},
167       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
168       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
169       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
170       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
171       
172       {324,325,326,327,332,333,334,335,340,341,342,343},   //Crate MED
173       {348,349,350,351,356,357,358,359,364,365,366,367},
174       {372,373,374,375,380,381,382,383,388,389,390,391},
175       {396,397,398,399,404,405,406,407,412,413,414,415},
176       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
177       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
178       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
179       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
180       
181       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},   //Crate BOT
182       {240,241,242,246,247,248,-1,-1,-1,-1,-1,-1},
183       {252,253,254,-1,-1,-1,264,265,266,270,271,272},
184       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
185       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
186       {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
187       {273,274,275,267,268,269,-1,-1,-1,-1,-1,-1},
188       {243,244,245,249,250,251,255,256,257,261,262,263}
189     };
190   for(Int_t iddl=0;iddl<kDDLsNumber;iddl++){
191     for(Int_t ichan=0; ichan<kModulesPerDDL; ichan++){
192       fDDLModuleMap[iddl][ichan]=feb08map[iddl][ichan];
193     }
194   }
195 }
196
197 //______________________________________________________________________
198 void AliITSDDLModuleMapSDD::SetDDLMap(AliITSDDLModuleMapSDD* ddlmap){
199 // Fill DDL map
200   for(Int_t iddl=0;iddl<kDDLsNumber;iddl++){
201     for(Int_t ichan=0; ichan<kModulesPerDDL; ichan++){
202       fDDLModuleMap[iddl][ichan]=ddlmap->GetModuleNumber(iddl,ichan);
203     }
204   }
205 }
206 //______________________________________________________________________
207 void AliITSDDLModuleMapSDD::ReadDDLModuleMap(Char_t *ddlmapfile){
208   // Fill DDL map from ASCCI data file
209   FILE *fil;
210   fil=fopen(ddlmapfile,"r");  
211   Int_t mod;
212   for(Int_t iddl=0;iddl<kDDLsNumber;iddl++){
213     for(Int_t ichan=0; ichan<kModulesPerDDL; ichan++){
214       fscanf(fil,"%d",&mod);
215       fDDLModuleMap[iddl][ichan]=mod;
216     }
217   }
218   fclose(fil);
219 }
220
221 //______________________________________________________________________
222 void AliITSDDLModuleMapSDD::PrintDDLMap() const {
223   // printout DDL map
224   for(Int_t iddl=0;iddl<kDDLsNumber;iddl++){
225     for(Int_t ichan=0; ichan<kModulesPerDDL; ichan++){
226       printf("%d  ",fDDLModuleMap[iddl][ichan]);
227     }
228     printf("\n");
229   }
230 }