HARPO  5.1.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HarpoDet.cxx
Go to the documentation of this file.
1 //
2 // File HarpoDet.cxx
3 //
11 #include "HarpoDet.h"
12 
13 
14 #include <iostream>
15 #include <cassert>
16 #include <cstring>
17 
18 
19 
20 ClassImp(HarpoDet)
21 
22 static const char *HarpoDetDescription[] = {
23  "Plane X DCC",
24  "Plane Y DCC",
25  "Grid Summ",
26  "Temperature and Pression",
27  "Simulation"
28 };
29 
30 static const char *HarpoDetName[] = {
31  "xDcc.",
32  "yDcc.",
33  "pmm2.",
34  "tp.",
35  "sim."
36 };
37 
38 HarpoDet::HarpoDet(ULong_t det)
39 {
40  if (det < gkNDetectors) {
41  detIdx = static_cast<HarpoDetType>(det);
42  detName = HarpoDetName[det];
43  detDescription = HarpoDetDescription[det];
44  } else {
45  detIdx = NODET;
46  detName = "N/A";
47  detDescription = "N/A";
48  }
49 }
50 
52 {
53  detName = NULL;
54 }
55 
57 {
58  // if (detName != NULL) delete detName;
59 }
60 
61 const char * HarpoDet::DetName(ULong_t ndet) const
62 {
63  if (ndet < gkNDetectors) {
64  return HarpoDetName[ndet];
65  } else {
66  return "N/A";
67  }
68 }
69 
70 const char * HarpoDet::DetDescription(ULong_t ndet) const
71 {
72  if (ndet < gkNDetectors) {
73  return HarpoDetDescription[ndet];
74  } else {
75  return "N/A";
76  }
77 }
78 
80 {
81  std::cout << "---Detector Id : " << detIdx << std::endl;
82  std::cout << " Name : " << detName << std::endl;
83 }
Definition: HarpoDet.h:17
const char * detDescription
Definition: HarpoDet.h:48
static const char * HarpoDetName[]
Definition: HarpoDet.cxx:30
Base class for all Harpo Detectors.
Definition: HarpoDet.h:27
virtual ~HarpoDet()
Definition: HarpoDet.cxx:56
HarpoDet()
Definition: HarpoDet.cxx:51
virtual void print()
Definition: HarpoDet.cxx:79
const char * DetDescription(ULong_t ndet) const
Definition: HarpoDet.cxx:70
const char * detName
Definition: HarpoDet.h:47
const char * DetName(ULong_t ndet) const
Definition: HarpoDet.cxx:61
HarpoDetType
Definition: HarpoDet.h:16
HarpoDetType detIdx
Definition: HarpoDet.h:46
const ULong_t gkNDetectors
Definition: HarpoDet.h:14