StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StDetectorName.cxx
1 /***************************************************************************
2  *
3  * $Id: StDetectorName.cxx,v 2.3 2019/02/11 18:49:59 ullrich Exp $
4  *
5  * Author: unknown
6  ***************************************************************************
7  *
8  * Description:
9  *
10  ***************************************************************************
11  *
12  * $Log: StDetectorName.cxx,v $
13  * Revision 2.3 2019/02/11 18:49:59 ullrich
14  * Added EToF.
15  *
16  * Revision 2.2 2015/05/13 17:06:13 ullrich
17  * Added hooks and interfaces to Sst detector (part of HFT).
18  *
19  **************************************************************************/
20 #include "StDetectorName.h"
21 #include <map>
22 
23 const char* DetectorName(int id) {
24 
25  static bool init = true;
26  static std::map<int, const char *> DetectorNames;
27 
28  if (init) {
29  DetectorNames[kUnknownId ] = "Unknown";
30  DetectorNames[kTpcId ] = "Tpc";
31  DetectorNames[kSvtId ] = "Svt";
32  DetectorNames[kRichId ] = "Rich";
33  DetectorNames[kFtpcWestId ] = "FtpcWest";
34  DetectorNames[kFtpcEastId ] = "FtpcEast";
35  DetectorNames[kTofId ] = "Tof";
36  DetectorNames[kBTofId ] = "Tof";
37  DetectorNames[kETofId ] = "ETof";
38  DetectorNames[kCtbId ] = "Ctb";
39  DetectorNames[kSsdId ] = "Ssd";
40  DetectorNames[kSstId ] = "Sst";
41  DetectorNames[kBarrelEmcTowerId ] = "BarrelEmcTower";
42  DetectorNames[kBarrelEmcPreShowerId] = "BarrelEmcPreShower";
43  DetectorNames[kBarrelSmdEtaStripId ] = "BarrelSmdEtaStrip";
44  DetectorNames[kBarrelSmdPhiStripId ] = "BarrelSmdPhiStrip";
45  DetectorNames[kEndcapEmcTowerId ] = "EndcapEmcTower";
46  DetectorNames[kEndcapEmcPreShowerId] = "EndcapEmcPreShower";
47  DetectorNames[kEndcapSmdUStripId ] = "EndcapSmdUStrip";
48  DetectorNames[kEndcapSmdVStripId ] = "EndcapSmdVStrip";
49  DetectorNames[kZdcWestId ] = "ZdcWest";
50  DetectorNames[kZdcEastId ] = "ZdcEast";
51  DetectorNames[kMwpcWestId ] = "MwpcWest";
52  DetectorNames[kMwpcEastId ] = "MwpcEast";
53  DetectorNames[kTpcSsdId ] = "TpcSsd";
54  DetectorNames[kTpcSvtId ] = "TpcSvt";
55  DetectorNames[kTpcSsdSvtId] = "TpcSsdSvt";
56  DetectorNames[kSsdSvtId ] = "SsdSvt";
57  DetectorNames[kPhmdCpvId ] = "PhmdCpv";
58  DetectorNames[kPhmdId ] = "Phmd";
59  DetectorNames[kPxlId ] = "Pxl";
60  DetectorNames[kIstId ] = "Ist";
61  DetectorNames[kFstId ] = "Fst";
62  DetectorNames[kFgtId ] = "Fgt";
63  DetectorNames[kEtrId ] = "Etr";
64  DetectorNames[kFpdWestId ] = "FpdWest";
65  DetectorNames[kFpdEastId ] = "FpdEast";
66  DetectorNames[kFmsId ] = "Fms";
67  DetectorNames[kRpsId ] = "Rps";
68  DetectorNames[kMtdId ] = "Mtd";
69  DetectorNames[kRHICfId ] = "RHICf";
70  }
71 
72  if (id < kMaxDetectorId)
73  return DetectorNames[id];
74  else
75  return DetectorNames[kUnknownId];
76 }