AliRoot Core  3abf5b4 (3abf5b4)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMpFiles.cxx
Go to the documentation of this file.
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 
16 // $Id$
17 // $MpId: AliMpFiles.cxx,v 1.12 2006/05/23 13:09:54 ivana Exp $
18 // Category: basic
19 
20 //-----------------------------------------------------------------------------
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 //
29 // Included in AliRoot: 2003/05/02
30 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
31 //-----------------------------------------------------------------------------
32 
33 #include "AliMpFiles.h"
34 
35 #include "AliLog.h"
36 
37 #include <TClass.h>
38 #include <Riostream.h>
39 
40 #include <stdlib.h>
41 
42 using std::endl;
46 
47 //
48 // static private methods
49 //
50 
51 //______________________________________________________________________________
52 const TString& AliMpFiles::GetDataDir()
53 {
55  static const TString kDataDir = "/data";
56  return kDataDir;
57 }
58 
59 //______________________________________________________________________________
60 const TString& AliMpFiles::GetDataRunDir()
61 {
63  static const TString kDataRunDir = "/data_run";
64  return kDataRunDir;
65 }
66 
67 //______________________________________________________________________________
68 const TString& AliMpFiles::GetStationDir()
69 {
71  static const TString kStationDir = "/station";
72  return kStationDir;
73 }
74 
75 //______________________________________________________________________________
76 const TString& AliMpFiles::GetBendingDir()
77 {
79  static const TString kBendingDir = "bending_plane/";
80  return kBendingDir;
81 }
82 
83 //______________________________________________________________________________
85 {
87  static const TString kNonBendingDir = "non-bending_plane/";
88  return kNonBendingDir;
89 }
90 
91 //______________________________________________________________________________
92 const TString& AliMpFiles::GetDENames()
93 {
95  static const TString kDENames = "denames";
96  return kDENames;
97 }
98 
99 //______________________________________________________________________________
100 const TString& AliMpFiles::GetSector()
101 {
103  static const TString kSector = "zones";
104  return kSector;
105 }
106 
107 //______________________________________________________________________________
109 {
111  static const TString kSectorSpecial = "zones_special";
112  return kSectorSpecial;
113 }
114 
115 //______________________________________________________________________________
117 {
119  static const TString kSectorSpecial2 = "zones_special_outer";
120  return kSectorSpecial2;
121 }
122 
123 //______________________________________________________________________________
124 const TString& AliMpFiles::GetMotifPrefix()
125 {
127  static const TString kMotifPrefix = "motif";
128  return kMotifPrefix;
129 }
130 
131 
132 //______________________________________________________________________________
134 {
136  static const TString kMotifSpecialPrefix ="motifSpecial";
137  return kMotifSpecialPrefix;
138 }
139 
140 //______________________________________________________________________________
142 {
144  static const TString kManuToSerial ="_manu";
145  return kManuToSerial;
146 }
147 
148 //______________________________________________________________________________
150 {
152  static const TString kPadPosPrefix = "padPos";
153  return kPadPosPrefix;
154 }
155 
156 //______________________________________________________________________________
157 const TString& AliMpFiles::GetDataExt()
158 {
160  static const TString kDataExt = ".dat";
161  return kDataExt;
162 }
163 
164 //______________________________________________________________________________
166 {
168  static const TString kBergToGCFileName = "bergToGC";
169  return kBergToGCFileName;
170 }
171 
172 //______________________________________________________________________________
174 {
176  static const TString kTriggerLocalBoards = "RegionalCrate";
177  return kTriggerLocalBoards;
178 }
179 
180 //______________________________________________________________________________
182 {
184  static const TString kTriggerGlobalBoards = "GlobalCrate";
185  return kTriggerGlobalBoards;
186 }
187 
188 //______________________________________________________________________________
190 {
192  static const TString kBusPatchFileName = "DetElemIdToBusPatch";
193  return kBusPatchFileName;
194 }
195 
196 //______________________________________________________________________________
198 {
200  static const TString kBusPatchInfoFileName = "BusPatchInfo";
201  return kBusPatchInfoFileName;
202 }
203 
204 //______________________________________________________________________________
206 {
208  static const TString kBusPatchSpecialFileName = "BusPatchSpecial";
209  return kBusPatchSpecialFileName;
210 }
211 
212 //______________________________________________________________________________
214 {
216  static const TString kSerialToBinFileName = "ManuSerialToBin";
217  return kSerialToBinFileName;
218 }
219 
220 //
221 // static public methods
222 //
223 
224 //______________________________________________________________________________
226  AliMq::Station12Type station12Type,
227  AliMp::PlaneType plane)
228 {
231 
232  switch (station) {
233  case AliMp::kStation12:
234  switch (plane) {
236  return GetTop() + GetDataDir() + StationDataDir(station, station12Type) + GetBendingDir();
237  ;;
239  return GetTop() + GetDataDir() + StationDataDir(station, station12Type) + GetNonBendingDir();
240  ;;
241  }
242  break;
243  case AliMp::kStation345:
245  return GetTop() + GetDataDir() + StationDataDir(station, AliMq::kNotSt12);
246  break;
247  default:
248  AliFatalClass("Incomplete switch on AliMp::PlaneType");
249  break;
250  }
251  return TString();
252 }
253 
254 //______________________________________________________________________________
256  AliMq::Station12Type station12Type)
257 {
259 
260  TString stationDataDir(GetStationDir());
261  switch (station) {
262  case AliMp::kStation12:
263  switch (station12Type) {
264  case AliMq::kStation1:
265  stationDataDir += "1/";
266  break;
267  ;;
268  case AliMq::kStation2:
269  stationDataDir += "2/";
270  break;
271  ;;
272  case AliMq::kNotSt12:
273  AliFatalClass("Incorrect switch on AliMq::Station12Type");
274  break;
275  }
276  break;
277  ;;
278  case AliMp::kStation345:
279  stationDataDir += "345/";
280  break;
281  ;;
283  stationDataDir += "Trigger/";
284  break;
285  ;;
286  default:
287  stationDataDir += "Invalid/";
288  break;
289  }
290  return stationDataDir;
291 }
292 
293 //______________________________________________________________________________
295 {
297 
298  return GetTop() + GetDataDir() + "/" + GetBusPatchFileName() + GetDataExt();
299 }
300 
301 //______________________________________________________________________________
303 {
305 
306  return GetTop() + GetDataDir() + "/" + GetBusPatchInfoFileName() + GetDataExt();
307 }
308 
309 //______________________________________________________________________________
311 {
313 
314  return GetTop() + GetDataDir() + "/" + GetBusPatchSpecialFileName() + GetDataExt();
315 }
316 
317 //______________________________________________________________________________
319 {
321 
322  return GetTop() + GetDataDir() + "/" + GetSerialToBinFileName() + GetDataExt();
323 }
324 
325 
326 //______________________________________________________________________________
328  AliMq::Station12Type station12Type)
329 {
331 
332  return GetTop() + GetDataDir() + StationDataDir(station, station12Type)
333  + GetDENames() + GetDataExt();
334 }
335 
336 //______________________________________________________________________________
338 {
340 
341  return GetTop() + GetDataDir()
344 }
345 
346 //______________________________________________________________________________
348 {
350 
351  return GetTop() + GetDataDir()
354 }
355 
356 //_____________________________________________________________________________
358  const char* slatType,
359  AliMp::PlaneType plane)
360 {
362 
363  return TString(PlaneDataDir(stationType, AliMq::kNotSt12, plane)
364  + slatType + "." +
365  ( plane == AliMp::kNonBendingPlane ? "NonBending":"Bending" ) + ".slat");
366 }
367 
368 //_____________________________________________________________________________
370  const char* pcbType)
371 {
375 
376  return TString(PlaneDataDir(stationType, AliMq::kNotSt12, AliMp::kNonBendingPlane)
377  + pcbType + ".pcb");
378 }
379 
380 //______________________________________________________________________________
382  AliMp::PlaneType plane)
383 {
385 
386  return TString(PlaneDataDir(AliMp::kStation12, station12Type, plane)
387  + GetSector() + GetDataExt());
388 }
389 
390 //______________________________________________________________________________
392  AliMp::PlaneType plane)
393 {
395 
396  return TString(PlaneDataDir(AliMp::kStation12, station12Type, plane)
397  + GetSectorSpecial() + GetDataExt());
398 }
399 
400 //______________________________________________________________________________
402  AliMp::PlaneType plane)
403 {
405 
406  return TString(PlaneDataDir(AliMp::kStation12, station12Type, plane)
407  + GetSectorSpecial2() + GetDataExt());
408 }
409 
410 //______________________________________________________________________________
411 TString AliMpFiles::MotifFileName(const TString& motifTypeID)
412 {
414 
415  return TString(GetMotifPrefix() + motifTypeID + GetDataExt());
416 }
417 
418 //______________________________________________________________________________
420  AliMq::Station12Type station12Type,
421  AliMp::PlaneType plane,
422  const TString& motifTypeID)
423 {
425 
426  return TString(PlaneDataDir(station, station12Type, plane)
427  + MotifFileName(motifTypeID));
428 }
429 
430 //______________________________________________________________________________
431 TString AliMpFiles::PadPosFileName(const TString& motifTypeID)
432 {
434 
435  return TString(GetPadPosPrefix() + motifTypeID + GetDataExt());
436 }
437 
438 //______________________________________________________________________________
440  AliMq::Station12Type station12Type,
441  AliMp::PlaneType plane,
442  const TString& motifTypeID)
443 {
445 
446  return TString(PlaneDataDir(station, station12Type, plane)
447  + PadPosFileName(motifTypeID));
448 }
449 
450 //______________________________________________________________________________
451 TString AliMpFiles::MotifSpecialFileName(const TString& motifID)
452 {
454 
455  return TString(GetMotifSpecialPrefix() + motifID + GetDataExt());
456 
457 }
458 
459 //______________________________________________________________________________
461  AliMq::Station12Type station12Type,
462  AliMp::PlaneType plane,
463  const TString& motifID)
464 {
466 
467  return TString(PlaneDataDir(station, station12Type, plane)
468  + MotifSpecialFileName(motifID));
469 }
470 
471 //______________________________________________________________________________
473  AliMq::Station12Type station12Type)
474 {
477 
478  return GetTop() + GetDataDir() + StationDataDir(station, station12Type)
480 }
481 
482 //______________________________________________________________________________
483 TString AliMpFiles::ManuToSerialPath(const TString& deName,
484  AliMp::StationType station,
485  AliMq::Station12Type station12Type)
486 {
488 
489  return GetTop() + GetDataRunDir() + StationDataDir(station, station12Type)
490  + deName + GetManuToSerial() + GetDataExt();
491 }
492 
493 
494 //______________________________________________________________________________
495 void
496 AliMpFiles::SetTopPath(const TString& topPath)
497 {
499 
500  GetTop() = topPath;
501 }
502 
503 //______________________________________________________________________________
505 {
509 
510  TString top = getenv("MINSTALL");
511  if ( ! top.IsNull() ) return top;
512 
513  TString ntop = getenv("ALICE_ROOT");
514  if ( ntop.IsNull() ) {
515  AliErrorClassStream() << "Cannot find path to mapping data." << endl;
516  return ntop;
517  }
518  ntop += "/MUON/mapping";
519  return ntop;
520 }
521 
522 //
523 // ctors, dtor
524 //
525 
526 //______________________________________________________________________________
528 {
530 }
531 
static const TString & GetDataExt()
Definition: AliMpFiles.cxx:157
static const TString & GetTriggerLocalBoards()
Definition: AliMpFiles.cxx:173
static const TString & GetBusPatchSpecialFileName()
Definition: AliMpFiles.cxx:205
station 1,2 (quadrants)
Class for generating file names and paths.
Definition: AliMpFiles.h:29
static const TString & GetSerialToBinFileName()
Definition: AliMpFiles.cxx:213
static TString SectorSpecialFilePath2(AliMq::Station12Type station, AliMp::PlaneType plane)
Definition: AliMpFiles.cxx:401
static const TString & GetMotifPrefix()
Definition: AliMpFiles.cxx:124
virtual ~AliMpFiles()
Definition: AliMpFiles.cxx:527
static TString SectorFilePath(AliMq::Station12Type station, AliMp::PlaneType plane)
Definition: AliMpFiles.cxx:381
static TString PadPosFilePath(AliMp::StationType station, AliMq::Station12Type station12Type, AliMp::PlaneType plane, const TString &motifTypeID)
Definition: AliMpFiles.cxx:439
static const TString & GetDataRunDir()
Definition: AliMpFiles.cxx:60
station 3,4,5 (slats)
static const TString & GetTriggerGlobalBoards()
Definition: AliMpFiles.cxx:181
static const TString & GetMotifSpecialPrefix()
Definition: AliMpFiles.cxx:133
static const TString & GetStationDir()
Definition: AliMpFiles.cxx:68
static TString ManuToSerialPath(const TString &deName, AliMp::StationType station, AliMq::Station12Type station12Type)
Definition: AliMpFiles.cxx:483
static const TString & GetBusPatchInfoFileName()
Definition: AliMpFiles.cxx:197
static TString MotifFilePath(AliMp::StationType station, AliMq::Station12Type station12Type, AliMp::PlaneType plane, const TString &motifTypeID)
Definition: AliMpFiles.cxx:419
static const TString & GetManuToSerial()
Definition: AliMpFiles.cxx:141
static const TString & GetSectorSpecial()
Definition: AliMpFiles.cxx:108
static TString BusPatchSpecialFilePath()
Definition: AliMpFiles.cxx:310
static const TString & GetDataDir()
Definition: AliMpFiles.cxx:52
static const TString & GetSectorSpecial2()
Definition: AliMpFiles.cxx:116
static TString MotifSpecialFileName(const TString &motifID)
Definition: AliMpFiles.cxx:451
static const TString & GetBusPatchFileName()
Definition: AliMpFiles.cxx:189
static TString StationDataDir(AliMp::StationType station, AliMq::Station12Type station12Type)
Definition: AliMpFiles.cxx:255
static const TString & GetNonBendingDir()
Definition: AliMpFiles.cxx:84
static TString LocalTriggerBoardMapping()
Definition: AliMpFiles.cxx:337
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
static const TString & GetSector()
Definition: AliMpFiles.cxx:100
static TString SlatPCBFilePath(AliMp::StationType stationType, const char *pcbType)
Definition: AliMpFiles.cxx:369
static TString MotifSpecialFilePath(AliMp::StationType station, AliMq::Station12Type station12Type, AliMp::PlaneType plane, const TString &motifID)
Definition: AliMpFiles.cxx:460
static TString GetTop()
Definition: AliMpFiles.cxx:504
non-bending plane
static void SetTopPath(const TString &topPath)
Definition: AliMpFiles.cxx:496
static TString BusPatchInfoFilePath()
Definition: AliMpFiles.cxx:302
static TString SectorSpecialFilePath(AliMq::Station12Type station, AliMp::PlaneType plane)
Definition: AliMpFiles.cxx:391
static TString SerialToBinFilePath()
Definition: AliMpFiles.cxx:318
bending plane
value for all non sector stations
static const TString & GetBergToGCFileName()
Definition: AliMpFiles.cxx:165
static TString PlaneDataDir(AliMp::StationType station, AliMq::Station12Type station12Type, AliMp::PlaneType plane)
Definition: AliMpFiles.cxx:225
trigger stations (slats)
static TString GlobalTriggerBoardMapping()
Definition: AliMpFiles.cxx:347
static TString BergToGCFilePath(AliMp::StationType station, AliMq::Station12Type station12Type)
Definition: AliMpFiles.cxx:472
static const TString & GetPadPosPrefix()
Definition: AliMpFiles.cxx:149
static const TString & GetDENames()
Definition: AliMpFiles.cxx:92
static TString SlatFilePath(AliMp::StationType stationType, const char *slatType, AliMp::PlaneType plane)
Definition: AliMpFiles.cxx:357
static TString DENamesFilePath(AliMp::StationType stationType, AliMq::Station12Type station12Type)
Definition: AliMpFiles.cxx:327
static const TString & GetBendingDir()
Definition: AliMpFiles.cxx:76
static TString MotifFileName(const TString &motifTypeID)
Definition: AliMpFiles.cxx:411
static TString BusPatchFilePath()
Definition: AliMpFiles.cxx:294
static TString PadPosFileName(const TString &motifTypeID)
Definition: AliMpFiles.cxx:431