CbmRoot
CbmTrdUtils.h
Go to the documentation of this file.
1 #ifndef CBMTRDUTILS_H
2 #define CBMTRDUTILS_H 1
3 
4 #include <RtypesCore.h> // for Int_t, Double_t, Bool_t
5 #include <TString.h> // for TString
6 
7 #include <map> // for map
8 #include <vector> // for vector
9 
10 class CbmTrdParModDigi;
11 class CbmTrdParSetDigi;
12 class TH1;
13 class TH2;
14 class TH3;
15 class TLegend;
16 class TPolyLine;
17 class TProfile;
18 
19 class CbmTrdUtils {
20 public:
21  CbmTrdUtils();
22  virtual ~CbmTrdUtils();
23  void InitColorVector(Bool_t logScale, Double_t min, Double_t max);
24  Int_t GetColorCode(Double_t value);
25  void Statusbar(Int_t i, Int_t n);
26  Int_t GetModuleType(Int_t moduleAddress,
27  CbmTrdParModDigi* fModuleInfo,
28  CbmTrdParSetDigi* fDigiPar);
29  void NiceLegend(TLegend* l);
30  void NiceTProfile(TProfile* h,
31  Int_t color,
32  Int_t mStyle,
33  Int_t mSize,
34  TString xTitle,
35  TString yTitle);
36  void NiceTH3(TH3* h,
37  Int_t color,
38  Int_t mStyle,
39  Int_t mSize,
40  TString xTitle,
41  TString yTitle,
42  TString zTitle);
43  void NiceTH2(TH2* h,
44  Int_t color,
45  Int_t mStyle,
46  Int_t mSize,
47  TString xTitle,
48  TString yTitle,
49  TString zTitle);
50  void NiceTH1(TH1* h,
51  Int_t color,
52  Int_t mStyle,
53  Int_t mSize,
54  TString xTitle,
55  TString yTitle);
56  void CreateLayerView(std::map<Int_t /*moduleAddress*/, TH1*>& Map,
57  CbmTrdParModDigi* fModuleInfo,
58  CbmTrdParSetDigi* fDigiPar,
59  const TString folder,
60  const TString pics,
61  const TString zAxisTitle,
62  const Double_t fmax,
63  const Double_t fmin,
64  const Bool_t logScale);
65  TPolyLine* CreateTriangularPad(Int_t column,
66  Int_t row,
67  Double_t value,
68  Double_t min_range,
69  Double_t max_range,
70  Bool_t logScale);
71  TPolyLine* CreateRectangularPad(Int_t column,
72  Int_t row,
73  Double_t value,
74  Double_t min_range,
75  Double_t max_range,
76  Bool_t logScale);
77  static TString GetGeantName(Int_t GeantId) {
78  if (GeantId == 1)
79  return (TString) "#gamma";
80  else if (GeantId == 2)
81  return (TString) "e^{+}";
82  else if (GeantId == 3)
83  return (TString) "e^{-}";
84  else if (GeantId == 4)
85  return (TString) "#nu_{(e;#mu;#tau)}";
86  else if (GeantId == 5)
87  return (TString) "#mu^{+}";
88  else if (GeantId == 6)
89  return (TString) "#mu^{-}";
90  else if (GeantId == 7)
91  return (TString) "#pi^{0}";
92  else if (GeantId == 8)
93  return (TString) "#pi^{+}";
94  else if (GeantId == 9)
95  return (TString) "#pi^{-}";
96  else if (GeantId == 10)
97  return (TString) "K^{0}_{L}";
98  else if (GeantId == 11)
99  return (TString) "K^{+}";
100  else if (GeantId == 12)
101  return (TString) "K^{-}";
102  else if (GeantId == 13)
103  return (TString) "n";
104  else if (GeantId == 14)
105  return (TString) "p";
106  else if (GeantId == 15)
107  return (TString) "#bar{p}";
108  else if (GeantId == 16)
109  return (TString) "K^{0}_{S}";
110  else if (GeantId == 17)
111  return (TString) "#eta";
112  else if (GeantId == 18)
113  return (TString) "#Lambda";
114  else if (GeantId == 19)
115  return (TString) "#Sigma^{+}";
116  else if (GeantId == 20)
117  return (TString) "#Sigma^{0}";
118  else if (GeantId == 21)
119  return (TString) "#Sigma^{-}";
120  else if (GeantId == 22)
121  return (TString) "#Xi^{0}";
122  else if (GeantId == 23)
123  return (TString) "#Xi^{-}";
124  else if (GeantId == 24)
125  return (TString) "#Omega^{-}";
126  else if (GeantId == 25)
127  return (TString) "#bar{n}";
128  else if (GeantId == 26)
129  return (TString) "#bar{#Lambda}";
130  else if (GeantId == 27)
131  return (TString) "#bar{#Sigma}^{-}";
132  else if (GeantId == 28)
133  return (TString) "#bar{#Sigma}^{0}";
134  else if (GeantId == 29)
135  return (TString) "#bar{#Sigma}^{+}";
136  else if (GeantId == 30)
137  return (TString) "#bar{#Xi}^{0}";
138  else if (GeantId == 31)
139  return (TString) "#bar{#Xi}^{+}";
140  else if (GeantId == 32)
141  return (TString) "#bar{#Omega}^{+}";
142  else if (GeantId == 33)
143  return (TString) "#tau^{+}";
144  else if (GeantId == 34)
145  return (TString) "#tau^{-}";
146  else if (GeantId == 35)
147  return (TString) "D^{+}";
148  else if (GeantId == 36)
149  return (TString) "D^{-}";
150  else if (GeantId == 37)
151  return (TString) "D^{0}";
152  else if (GeantId == 38)
153  return (TString) "#bar{D}^{+}";
154  else if (GeantId == 39)
155  return (TString) "D_{S}^{+}";
156  else if (GeantId == 40)
157  return (TString) "#bar{D_{S}}^{-}";
158  else if (GeantId == 41)
159  return (TString) "#Lambda_{C}^{+}";
160  else if (GeantId == 42)
161  return (TString) "W^{+}";
162  else if (GeantId == 43)
163  return (TString) "W^{-}";
164  else if (GeantId == 44)
165  return (TString) "Z^{0}";
166  else if (GeantId == 45)
167  return (TString) "d";
168  else if (GeantId == 46)
169  return (TString) "t";
170  else if (GeantId == 47)
171  return (TString) "He";
172  else if (GeantId == 48)
173  return (TString) "#gamma_{RICH}";
174  else if (GeantId == 49)
175  return (TString) "Primary";
176  else
177  return (TString) "not known";
178  };
179  static Int_t PdgToGeant(Int_t PdgCode);
180 
181 private:
182  std::vector<Int_t> fColors;
183  std::vector<Double_t> fZLevel;
184 };
185 #endif
CbmTrdUtils::PdgToGeant
static Int_t PdgToGeant(Int_t PdgCode)
Definition: CbmTrdUtils.cxx:236
CbmTrdUtils::NiceTH2
void NiceTH2(TH2 *h, Int_t color, Int_t mStyle, Int_t mSize, TString xTitle, TString yTitle, TString zTitle)
Definition: CbmTrdUtils.cxx:153
CbmTrdUtils
Definition: CbmTrdUtils.h:19
CbmTrdUtils::NiceTH3
void NiceTH3(TH3 *h, Int_t color, Int_t mStyle, Int_t mSize, TString xTitle, TString yTitle, TString zTitle)
Definition: CbmTrdUtils.cxx:179
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmTrdUtils::~CbmTrdUtils
virtual ~CbmTrdUtils()
Definition: CbmTrdUtils.cxx:36
CbmTrdUtils::fColors
std::vector< Int_t > fColors
Definition: CbmTrdUtils.h:182
min
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: L1/vectors/P4_F32vec4.h:33
CbmTrdUtils::CreateRectangularPad
TPolyLine * CreateRectangularPad(Int_t column, Int_t row, Double_t value, Double_t min_range, Double_t max_range, Bool_t logScale)
Definition: CbmTrdUtils.cxx:101
h
Data class with information on a STS local track.
CbmTrdUtils::CbmTrdUtils
CbmTrdUtils()
Definition: CbmTrdUtils.cxx:35
CbmTrdParModDigi
Definition of chamber gain conversion for one TRD module.
Definition: CbmTrdParModDigi.h:14
CbmTrdUtils::InitColorVector
void InitColorVector(Bool_t logScale, Double_t min, Double_t max)
Definition: CbmTrdUtils.cxx:38
CbmTrdUtils::NiceTH1
void NiceTH1(TH1 *h, Int_t color, Int_t mStyle, Int_t mSize, TString xTitle, TString yTitle)
Definition: CbmTrdUtils.cxx:129
CbmTrdUtils::fZLevel
std::vector< Double_t > fZLevel
Definition: CbmTrdUtils.h:183
CbmTrdParSetDigi
Definition: CbmTrdParSetDigi.h:15
CbmTrdUtils::NiceLegend
void NiceLegend(TLegend *l)
Definition: CbmTrdUtils.cxx:229
CbmTrdUtils::NiceTProfile
void NiceTProfile(TProfile *h, Int_t color, Int_t mStyle, Int_t mSize, TString xTitle, TString yTitle)
Definition: CbmTrdUtils.cxx:205
max
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: L1/vectors/P4_F32vec4.h:36
CbmTrdUtils::Statusbar
void Statusbar(Int_t i, Int_t n)
Definition: CbmTrdUtils.cxx:291
CbmTrdUtils::CreateLayerView
void CreateLayerView(std::map< Int_t, TH1 * > &Map, CbmTrdParModDigi *fModuleInfo, CbmTrdParSetDigi *fDigiPar, const TString folder, const TString pics, const TString zAxisTitle, const Double_t fmax, const Double_t fmin, const Bool_t logScale)
Definition: CbmTrdUtils.cxx:375
CbmTrdUtils::GetColorCode
Int_t GetColorCode(Double_t value)
Definition: CbmTrdUtils.cxx:54
CbmTrdUtils::GetGeantName
static TString GetGeantName(Int_t GeantId)
Definition: CbmTrdUtils.h:77
CbmTrdUtils::GetModuleType
Int_t GetModuleType(Int_t moduleAddress, CbmTrdParModDigi *fModuleInfo, CbmTrdParSetDigi *fDigiPar)
Definition: CbmTrdUtils.cxx:300
CbmTrdUtils::CreateTriangularPad
TPolyLine * CreateTriangularPad(Int_t column, Int_t row, Double_t value, Double_t min_range, Double_t max_range, Bool_t logScale)
Definition: CbmTrdUtils.cxx:66