ROOT logo
/**************************************************************************
 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 * Author: The ALICE Off-line Project.                                    *
 * Contributors are mentioned in the code where appropriate.              *
 *                                                                        *
 * Permission to use, copy, modify and distribute this software and its   *
 * documentation strictly for non-commercial purposes is hereby granted   *
 * without fee, provided that the above copyright notice appears in all   *
 * copies and that both the copyright notice and this permission notice   *
 * appear in the supporting documentation. The authors make no claims     *
 * about the suitability of this software for any purpose. It is          *
 * provided "as is" without express or implied warranty.                  *
 **************************************************************************/

/* $Id$ */

//
// abstract interface class to AliShuttle
// This class is implemented by AliTestShuttle for testing and
// by AliShuttle for the full setup
//

#include "AliShuttleInterface.h"
#include "AliLog.h"
#include <TClass.h>
#include <TSystem.h>

ClassImp(AliShuttleInterface)

const char* AliShuttleInterface::fkSystemNames[4] = { "DAQ", "DCS", "HLT", "DQM" };

// names of the detectors preprocessors
const char* AliShuttleInterface::fgkDetName[kNDetectors] = {"SPD", "SDD", "SSD", "TPC", "TRD", "TOF",
  "PHS", "CPV", "HMP", "EMC", "MCH", "MTR", "FMD", "ZDC", "PMD", "T00", "V00", "AD0", "GRP", "HLT", "ACO", "TRI"
};

// names of the detectors in OCDB
const char* AliShuttleInterface::fgkOfflineDetName[kNDetectors] = {"ITS", "ITS", "ITS", "TPC", "TRD", "TOF",
  "PHOS", "PHOS", "HMPID", "EMCAL", "MUON", "MUON", "FMD", "ZDC", "PMD", "T0", "VZERO", "AD", "GRP", "HLT", "ACORDE", "TRIGGER"
};

TString AliShuttleInterface::fgkMainCDB("alien://folder=ShuttleCDB");
TString AliShuttleInterface::fgkLocalCDB("local://LocalShuttleCDB");
TString AliShuttleInterface::fgkMainRefStorage("alien://folder=ShuttleReference");
TString AliShuttleInterface::fgkLocalRefStorage("local://LocalReferenceStorage");
TString AliShuttleInterface::fgkMirrorSEs("ALICE::CERN::OCDB");

TString AliShuttleInterface::fgkShuttleTempDir("/tmp");
TString AliShuttleInterface::fgkShuttleLogDir("/tmp/log");

//______________________________________________________________________________________________
const char* AliShuttleInterface::GetOfflineDetName(const char* detName){
  // Return "offline" detector name

  Int_t detPos = GetDetPos(detName);
  if(detPos < 0) {
    AliErrorClass(Form("Unknown detector: %s",detName));
    return 0;
  }

  return fgkOfflineDetName[detPos];
}

//______________________________________________________________________________________________
const char* AliShuttleInterface::GetDetName(UInt_t detPos){
  // Return detector code

  if(detPos >= kNDetectors) {
    AliErrorClass(Form("Parameter out of bound: %d", detPos));
    return 0;
  }

  return fgkDetName[detPos];
}

//______________________________________________________________________________________________
Int_t AliShuttleInterface::GetDetPos(const char* detName){
  // Return detector position in the detector code array

  for(UInt_t iDet=0; iDet < kNDetectors; iDet++){
    if(!strcmp(fgkDetName[iDet], detName)) return iDet;
  }
  return -1;
}
 AliShuttleInterface.cxx:1
 AliShuttleInterface.cxx:2
 AliShuttleInterface.cxx:3
 AliShuttleInterface.cxx:4
 AliShuttleInterface.cxx:5
 AliShuttleInterface.cxx:6
 AliShuttleInterface.cxx:7
 AliShuttleInterface.cxx:8
 AliShuttleInterface.cxx:9
 AliShuttleInterface.cxx:10
 AliShuttleInterface.cxx:11
 AliShuttleInterface.cxx:12
 AliShuttleInterface.cxx:13
 AliShuttleInterface.cxx:14
 AliShuttleInterface.cxx:15
 AliShuttleInterface.cxx:16
 AliShuttleInterface.cxx:17
 AliShuttleInterface.cxx:18
 AliShuttleInterface.cxx:19
 AliShuttleInterface.cxx:20
 AliShuttleInterface.cxx:21
 AliShuttleInterface.cxx:22
 AliShuttleInterface.cxx:23
 AliShuttleInterface.cxx:24
 AliShuttleInterface.cxx:25
 AliShuttleInterface.cxx:26
 AliShuttleInterface.cxx:27
 AliShuttleInterface.cxx:28
 AliShuttleInterface.cxx:29
 AliShuttleInterface.cxx:30
 AliShuttleInterface.cxx:31
 AliShuttleInterface.cxx:32
 AliShuttleInterface.cxx:33
 AliShuttleInterface.cxx:34
 AliShuttleInterface.cxx:35
 AliShuttleInterface.cxx:36
 AliShuttleInterface.cxx:37
 AliShuttleInterface.cxx:38
 AliShuttleInterface.cxx:39
 AliShuttleInterface.cxx:40
 AliShuttleInterface.cxx:41
 AliShuttleInterface.cxx:42
 AliShuttleInterface.cxx:43
 AliShuttleInterface.cxx:44
 AliShuttleInterface.cxx:45
 AliShuttleInterface.cxx:46
 AliShuttleInterface.cxx:47
 AliShuttleInterface.cxx:48
 AliShuttleInterface.cxx:49
 AliShuttleInterface.cxx:50
 AliShuttleInterface.cxx:51
 AliShuttleInterface.cxx:52
 AliShuttleInterface.cxx:53
 AliShuttleInterface.cxx:54
 AliShuttleInterface.cxx:55
 AliShuttleInterface.cxx:56
 AliShuttleInterface.cxx:57
 AliShuttleInterface.cxx:58
 AliShuttleInterface.cxx:59
 AliShuttleInterface.cxx:60
 AliShuttleInterface.cxx:61
 AliShuttleInterface.cxx:62
 AliShuttleInterface.cxx:63
 AliShuttleInterface.cxx:64
 AliShuttleInterface.cxx:65
 AliShuttleInterface.cxx:66
 AliShuttleInterface.cxx:67
 AliShuttleInterface.cxx:68
 AliShuttleInterface.cxx:69
 AliShuttleInterface.cxx:70
 AliShuttleInterface.cxx:71
 AliShuttleInterface.cxx:72
 AliShuttleInterface.cxx:73
 AliShuttleInterface.cxx:74
 AliShuttleInterface.cxx:75
 AliShuttleInterface.cxx:76
 AliShuttleInterface.cxx:77
 AliShuttleInterface.cxx:78
 AliShuttleInterface.cxx:79
 AliShuttleInterface.cxx:80
 AliShuttleInterface.cxx:81
 AliShuttleInterface.cxx:82
 AliShuttleInterface.cxx:83
 AliShuttleInterface.cxx:84
 AliShuttleInterface.cxx:85