]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliShuttleInterface.cxx
Backup the current Root directory and not the current file
[u/mrichter/AliRoot.git] / STEER / AliShuttleInterface.cxx
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
18 //
19 // abstract interface class to AliShuttle
20 // This class is implemented by AliTestShuttle for testing and
21 // by AliShuttle for the full setup
22 //
23
24 #include "AliShuttleInterface.h"
25 #include "AliLog.h"
26 #include <TClass.h>
27 #include <TSystem.h>
28
29 ClassImp(AliShuttleInterface)
30
31 const char* AliShuttleInterface::fkSystemNames[3] = { "DAQ", "DCS", "HLT" };
32
33 // names of the detectors preprocessors
34 const char* AliShuttleInterface::fgkDetName[kNDetectors] = {"SPD", "SDD", "SSD", "TPC", "TRD", "TOF",
35        "PHS", "CPV", "HMP", "EMC", "MCH", "MTR", "FMD", "ZDC", "PMD", "T00", "V00", "GRP"};
36
37 // names of the detectors in OCDB
38 const char* AliShuttleInterface::fgkOfflineDetName[kNDetectors] = {"ITS", "ITS", "ITS", "TPC", "TRD", "TOF",
39        "PHOS", "PHOS", "HMPID", "EMCAL", "MUON", "MUON", "FMD", "ZDC", "PMD", "T0", "VZERO", "GRP"};
40
41 //______________________________________________________________________________________________
42 const char* AliShuttleInterface::GetOfflineDetName(const char* detName){
43 // Return "offline" detector name
44
45         Int_t detPos = GetDetPos(detName);
46         if(detPos < 0) {
47                 AliErrorClass(Form("Unknown detector: %s",detName));
48                 return 0;
49         }
50
51         return fgkOfflineDetName[detPos];
52 }
53
54 //______________________________________________________________________________________________
55 const char* AliShuttleInterface::GetDetName(UInt_t detPos){
56 // Return detector code
57
58         if(detPos >= kNDetectors) {
59                 AliErrorClass(Form("Parameter out of bound: %d", detPos));
60                 return 0;
61         }
62
63         return fgkDetName[detPos];
64 }
65
66 //______________________________________________________________________________________________
67 const Int_t AliShuttleInterface::GetDetPos(const char* detName){
68 // Return detector position in the detector code array
69
70         for(UInt_t iDet=0; iDet < kNDetectors; iDet++){
71                 if(!strcmp(fgkDetName[iDet], detName)) return iDet;
72         }
73         return -1;
74 }