]>
Commit | Line | Data |
---|---|---|
dee1d5f1 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, 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 | ||
5f91c9e8 | 16 | // $Id$ |
f023e45b | 17 | // $MpId: AliMpFiles.cxx,v 1.12 2006/05/23 13:09:54 ivana Exp $ |
dee1d5f1 | 18 | // Category: basic |
3d1463c8 | 19 | |
20 | //----------------------------------------------------------------------------- | |
5f91c9e8 | 21 | // Class AliMpFiles |
22 | // ---------------- | |
23 | // Class for generating file names and paths. | |
24 | // The input files: | |
25 | // zones.dat, zones_special.dat - sector description | |
26 | // motif*.dat - motif description (generated from Exceed) | |
27 | // padPos*.dat - pad positions in motif | |
28 | // | |
dbe945cc | 29 | // Included in AliRoot: 2003/05/02 |
5f91c9e8 | 30 | // Authors: David Guez, Ivana Hrivnacova; IPN Orsay |
3d1463c8 | 31 | //----------------------------------------------------------------------------- |
5f91c9e8 | 32 | |
5f91c9e8 | 33 | #include "AliMpFiles.h" |
2c605e66 | 34 | |
7f54909e | 35 | #include "AliLog.h" |
2c605e66 | 36 | |
37 | #include <TClass.h> | |
38 | #include <Riostream.h> | |
39 | ||
40 | #include <stdlib.h> | |
5f91c9e8 | 41 | |
13985652 | 42 | /// \cond CLASSIMP |
43 | ClassImp(AliMpFiles) | |
44 | /// \endcond | |
7f54909e | 45 | |
13985652 | 46 | // |
f023e45b | 47 | // static |
48 | ||
5f91c9e8 | 49 | // static data members |
50 | ||
be2a6782 | 51 | const TString AliMpFiles::fgkDataDir = "/data"; |
52 | const TString AliMpFiles::fgkStationDir = "/station"; | |
53 | const TString AliMpFiles::fgkBendingDir = "/bending_plane/"; | |
54 | const TString AliMpFiles::fgkNonBendingDir = "/non-bending_plane/"; | |
0025a53e | 55 | const TString AliMpFiles::fgkDENames = "denames"; |
5f91c9e8 | 56 | const TString AliMpFiles::fgkSector = "zones"; |
57 | const TString AliMpFiles::fgkSectorSpecial = "zones_special"; | |
be2a6782 | 58 | const TString AliMpFiles::fgkSectorSpecial2 = "zones_special_outer"; |
5f91c9e8 | 59 | const TString AliMpFiles::fgkMotifPrefix = "motif"; |
60 | const TString AliMpFiles::fgkMotifSpecialPrefix ="motifSpecial"; | |
67f410f1 | 61 | const TString AliMpFiles::fgkManuToSerialDir ="manu_serial/"; |
ec5079b1 | 62 | const TString AliMpFiles::fgkManuToSerial ="_manu"; |
5f91c9e8 | 63 | const TString AliMpFiles::fgkPadPosPrefix = "padPos"; |
64 | const TString AliMpFiles::fgkDataExt = ".dat"; | |
7f54909e | 65 | const TString AliMpFiles::fgkBergToGCFileName = "/bergToGC"; |
40c8e44b | 66 | const TString AliMpFiles::fgkTriggerLocalBoards = "RegionalCrate"; |
67 | const TString AliMpFiles::fgkTriggerGlobalBoards = "GlobalCrate"; | |
4df2ac68 | 68 | const TString AliMpFiles::fgkBusPatchFileName = "DetElemIdToBusPatch"; |
0b121e9e | 69 | const TString AliMpFiles::fgkBusPatchLengthFileName = "BusPatchLength"; |
5f91c9e8 | 70 | //______________________________________________________________________________ |
dee1d5f1 | 71 | AliMpFiles::~AliMpFiles() |
72 | { | |
73 | /// Destructor | |
5f91c9e8 | 74 | } |
75 | ||
5f91c9e8 | 76 | // |
77 | // private methods | |
78 | // | |
79 | ||
7f54909e | 80 | //______________________________________________________________________________ |
d9100e8b | 81 | TString AliMpFiles::GetTop() |
7f54909e | 82 | { |
490da820 | 83 | /// Return top path to mapping data defined either via MINSTALL |
84 | /// or ALICE_ROOT environment variable. \n | |
85 | /// If both variables are defined, MINSTALL is used. | |
86 | ||
d9100e8b | 87 | TString top = getenv("MINSTALL"); |
527e050d | 88 | if ( ! top.IsNull() ) return top; |
89 | ||
d9100e8b | 90 | TString ntop = getenv("ALICE_ROOT"); |
527e050d | 91 | if ( ntop.IsNull() ) { |
92 | AliErrorClassStream() << "Cannot find path to mapping data." << endl; | |
93 | return ntop; | |
94 | } | |
95 | ntop += "/MUON/mapping"; | |
96 | return ntop; | |
7f54909e | 97 | } |
98 | ||
5f91c9e8 | 99 | //______________________________________________________________________________ |
cddd101e | 100 | TString AliMpFiles::PlaneDataDir(AliMp::StationType station, |
101 | AliMp::PlaneType plane) | |
5f91c9e8 | 102 | { |
dee1d5f1 | 103 | /// Returns path to data files with sector description |
104 | /// for a specified plane. | |
5f91c9e8 | 105 | |
dee1d5f1 | 106 | switch (station) { |
cddd101e | 107 | case AliMp::kStation1: |
108 | case AliMp::kStation2: | |
dee1d5f1 | 109 | switch (plane) { |
cddd101e | 110 | case AliMp::kBendingPlane: |
d9100e8b | 111 | return GetTop() + fgkDataDir + StationDataDir(station) + fgkBendingDir; |
dee1d5f1 | 112 | ;; |
cddd101e | 113 | case AliMp::kNonBendingPlane: |
d9100e8b | 114 | return GetTop() + fgkDataDir + StationDataDir(station) + fgkNonBendingDir; |
dee1d5f1 | 115 | ;; |
116 | } | |
117 | break; | |
cddd101e | 118 | case AliMp::kStation345: |
119 | case AliMp::kStationTrigger: | |
d9100e8b | 120 | return GetTop() + fgkDataDir + StationDataDir(station) + "/"; |
7f54909e | 121 | break; |
122 | default: | |
cddd101e | 123 | AliFatalClass("Incomplete switch on AliMp::PlaneType"); |
dee1d5f1 | 124 | break; |
125 | } | |
5f91c9e8 | 126 | return TString(); |
127 | } | |
128 | ||
be2a6782 | 129 | //______________________________________________________________________________ |
cddd101e | 130 | TString AliMpFiles::StationDataDir(AliMp::StationType station) |
be2a6782 | 131 | { |
dee1d5f1 | 132 | /// Returns the station directory name for the specified station number. |
be2a6782 | 133 | |
134 | TString stationDataDir(fgkStationDir); | |
135 | switch (station) { | |
cddd101e | 136 | case AliMp::kStation1: |
0025a53e | 137 | stationDataDir += "1/"; |
dee1d5f1 | 138 | break; |
139 | ;; | |
cddd101e | 140 | case AliMp::kStation2: |
0025a53e | 141 | stationDataDir += "2/"; |
dee1d5f1 | 142 | break; |
143 | ;; | |
cddd101e | 144 | case AliMp::kStation345: |
dee1d5f1 | 145 | stationDataDir += "345/"; |
146 | break; | |
147 | ;; | |
cddd101e | 148 | case AliMp::kStationTrigger: |
7f54909e | 149 | stationDataDir += "Trigger/"; |
150 | break; | |
151 | ;; | |
152 | default: | |
153 | stationDataDir += "Invalid/"; | |
154 | break; | |
be2a6782 | 155 | } |
156 | return stationDataDir; | |
157 | } | |
158 | ||
5f91c9e8 | 159 | // |
160 | // public methods | |
161 | // | |
162 | ||
4df2ac68 | 163 | //______________________________________________________________________________ |
164 | TString AliMpFiles::BusPatchFilePath() | |
165 | { | |
166 | /// Return path to data file with bus patch mapping. | |
167 | ||
d9100e8b | 168 | return GetTop() + fgkDataDir + "/" + fgkBusPatchFileName + fgkDataExt; |
4df2ac68 | 169 | } |
170 | ||
0b121e9e | 171 | //______________________________________________________________________________ |
172 | TString AliMpFiles::BusPatchLengthFilePath() | |
173 | { | |
174 | /// Return path to data file with bus patch mapping. | |
175 | ||
176 | return GetTop() + fgkDataDir + "/" + fgkBusPatchLengthFileName + fgkDataExt; | |
177 | } | |
178 | ||
0025a53e | 179 | //______________________________________________________________________________ |
cddd101e | 180 | TString AliMpFiles::DENamesFilePath(AliMp::StationType station) |
0025a53e | 181 | { |
182 | /// Return path to data file with DE names for given station. | |
183 | ||
d9100e8b | 184 | return GetTop() + fgkDataDir + StationDataDir(station) + fgkDENames + fgkDataExt; |
0025a53e | 185 | } |
186 | ||
4df2ac68 | 187 | //______________________________________________________________________________ |
188 | TString AliMpFiles::LocalTriggerBoardMapping() | |
189 | { | |
f023e45b | 190 | /// Return path to data file with local trigger board mapping. |
490da820 | 191 | |
cddd101e | 192 | return GetTop() + fgkDataDir + StationDataDir(AliMp::kStationTrigger) |
f023e45b | 193 | + fgkTriggerLocalBoards + fgkDataExt;; |
4df2ac68 | 194 | } |
195 | ||
40c8e44b | 196 | //______________________________________________________________________________ |
197 | TString AliMpFiles::GlobalTriggerBoardMapping() | |
198 | { | |
199 | /// Return path to data file with local trigger board mapping. | |
200 | ||
201 | return GetTop() + fgkDataDir + StationDataDir(AliMp::kStationTrigger) | |
202 | + fgkTriggerGlobalBoards + fgkDataExt;; | |
203 | } | |
204 | ||
dee1d5f1 | 205 | //_____________________________________________________________________________ |
cddd101e | 206 | TString AliMpFiles::SlatFilePath(AliMp::StationType stationType, |
7f54909e | 207 | const char* slatType, |
cddd101e | 208 | AliMp::PlaneType plane) |
dee1d5f1 | 209 | { |
210 | /// \todo add .. | |
211 | ||
7f54909e | 212 | return TString(PlaneDataDir(stationType,plane) + slatType + "." + |
cddd101e | 213 | ( plane == AliMp::kNonBendingPlane ? "NonBending":"Bending" ) + ".slat"); |
dee1d5f1 | 214 | } |
215 | ||
216 | //_____________________________________________________________________________ | |
cddd101e | 217 | TString AliMpFiles::SlatPCBFilePath(AliMp::StationType stationType, |
7f54909e | 218 | const char* pcbType) |
dee1d5f1 | 219 | { |
220 | /// Get the full path for a given PCB (only relevant to stations 3, | |
7f54909e | 221 | /// 4, 5 and trigger). The bending parameter below is of no use in this case, but |
dee1d5f1 | 222 | /// we use it to re-use the PlaneDataDir() method untouched. |
223 | ||
cddd101e | 224 | return TString(PlaneDataDir(stationType,AliMp::kNonBendingPlane) + pcbType + |
7f54909e | 225 | ".pcb"); |
dee1d5f1 | 226 | } |
227 | ||
5f91c9e8 | 228 | //______________________________________________________________________________ |
cddd101e | 229 | TString AliMpFiles::SectorFilePath(AliMp::StationType station, |
230 | AliMp::PlaneType plane) | |
5f91c9e8 | 231 | { |
dee1d5f1 | 232 | /// Return path to data file with sector description. |
5f91c9e8 | 233 | |
be2a6782 | 234 | return TString(PlaneDataDir(station, plane) + fgkSector + fgkDataExt); |
235 | } | |
236 | ||
237 | //______________________________________________________________________________ | |
cddd101e | 238 | TString AliMpFiles::SectorSpecialFilePath(AliMp::StationType station, |
239 | AliMp::PlaneType plane) | |
be2a6782 | 240 | { |
dee1d5f1 | 241 | /// Return path to data file with sector special description (irregular motifs). |
be2a6782 | 242 | |
243 | return TString(PlaneDataDir(station, plane) + fgkSectorSpecial + fgkDataExt); | |
5f91c9e8 | 244 | } |
245 | ||
246 | //______________________________________________________________________________ | |
cddd101e | 247 | TString AliMpFiles::SectorSpecialFilePath2(AliMp::StationType station, |
248 | AliMp::PlaneType plane) | |
5f91c9e8 | 249 | { |
dee1d5f1 | 250 | /// Returns path to data file with sector special description (irregular motifs). |
5f91c9e8 | 251 | |
be2a6782 | 252 | return TString(PlaneDataDir(station, plane) + fgkSectorSpecial2 + fgkDataExt); |
5f91c9e8 | 253 | } |
82915841 | 254 | |
255 | //______________________________________________________________________________ | |
256 | TString AliMpFiles::MotifFileName(const TString& motifTypeID) | |
257 | { | |
258 | /// Returns name of data file for a given motif type. | |
259 | ||
260 | return TString(fgkMotifPrefix + motifTypeID + fgkDataExt); | |
261 | } | |
262 | ||
5f91c9e8 | 263 | //______________________________________________________________________________ |
cddd101e | 264 | TString AliMpFiles::MotifFilePath(AliMp::StationType station, |
265 | AliMp::PlaneType plane, | |
7f54909e | 266 | const TString& motifTypeID) |
5f91c9e8 | 267 | { |
dee1d5f1 | 268 | /// Returns path to data file for a given motif type. |
5f91c9e8 | 269 | |
82915841 | 270 | return TString(PlaneDataDir(station, plane) + MotifFileName(motifTypeID)); |
5f91c9e8 | 271 | } |
82915841 | 272 | |
273 | //______________________________________________________________________________ | |
274 | TString AliMpFiles::PadPosFileName(const TString& motifTypeID) | |
275 | { | |
276 | /// Returns name of data file with pad positions for a given motif type. | |
277 | ||
278 | return TString(fgkPadPosPrefix + motifTypeID + fgkDataExt); | |
279 | } | |
280 | ||
5f91c9e8 | 281 | //______________________________________________________________________________ |
cddd101e | 282 | TString AliMpFiles::PadPosFilePath(AliMp::StationType station, |
283 | AliMp::PlaneType plane, | |
7f54909e | 284 | const TString& motifTypeID) |
5f91c9e8 | 285 | { |
dee1d5f1 | 286 | /// Returns path to data file with pad positions for a given motif type. |
5f91c9e8 | 287 | |
82915841 | 288 | return TString(PlaneDataDir(station, plane) + PadPosFileName(motifTypeID)); |
289 | } | |
290 | ||
291 | //______________________________________________________________________________ | |
292 | TString AliMpFiles::MotifSpecialFileName(const TString& motifID) | |
293 | { | |
294 | /// Returns name of data file with pad dimensions for a given motif ID. | |
295 | ||
296 | return TString(fgkMotifSpecialPrefix + motifID + fgkDataExt); | |
297 | ||
5f91c9e8 | 298 | } |
299 | ||
300 | //______________________________________________________________________________ | |
cddd101e | 301 | TString AliMpFiles::MotifSpecialFilePath(AliMp::StationType station, |
302 | AliMp::PlaneType plane, | |
7f54909e | 303 | const TString& motifID) |
5f91c9e8 | 304 | { |
dee1d5f1 | 305 | /// Returns path to data file with pad dimensions for a given motif ID. |
5f91c9e8 | 306 | |
82915841 | 307 | return TString(PlaneDataDir(station, plane) + MotifSpecialFileName(motifID)); |
5f91c9e8 | 308 | } |
309 | ||
310 | //______________________________________________________________________________ | |
cddd101e | 311 | TString AliMpFiles::BergToGCFilePath(AliMp::StationType station) |
5f91c9e8 | 312 | { |
dee1d5f1 | 313 | /// Returns the path of the file which describes the correspondance between |
314 | /// the berg number and the gassiplex channel. | |
5f91c9e8 | 315 | |
d9100e8b | 316 | return GetTop() + fgkDataDir + StationDataDir(station) |
be2a6782 | 317 | + fgkBergToGCFileName + fgkDataExt; |
5f91c9e8 | 318 | } |
7f54909e | 319 | |
ec5079b1 | 320 | //______________________________________________________________________________ |
cddd101e | 321 | TString AliMpFiles::ManuToSerialPath(const TString& deName, AliMp::StationType station) |
ec5079b1 | 322 | { |
323 | /// Returns the path of the file for the manu id to their serial number | |
324 | ||
67f410f1 | 325 | return GetTop() + fgkDataDir + StationDataDir(station) |
326 | + fgkManuToSerialDir + deName + fgkManuToSerial + fgkDataExt; | |
ec5079b1 | 327 | } |
328 | ||
329 | ||
7f54909e | 330 | //______________________________________________________________________________ |
331 | void | |
332 | AliMpFiles::SetTopPath(const TString& topPath) | |
333 | { | |
71a2d3aa | 334 | /// Set top file path |
335 | ||
d9100e8b | 336 | GetTop() = topPath; |
7f54909e | 337 | } |
338 |