1 #ifndef Validation_MuonGEMHits_GEMBaseValidation_h
2 #define Validation_MuonGEMHits_GEMBaseValidation_h
30 const char* name_prfix,
31 const char* title_prefix);
36 const char* name_prfix,
37 const char* title_prefix);
42 const char* name_prefix,
43 const char* title_prefix);
48 const char* name_prefix,
49 const char* title_prefix);
55 const char* name_prfix,
56 const char* title_prefix);
66 const char* x_title =
"",
67 const char* y_title =
"Entries");
80 const char* x_title =
"",
81 const char* y_title =
"");
100 const char* name_prefix,
101 const char* title_prefix) {
107 Int_t station_id = std::get<1>(
key);
112 TString
name = TString::Format(
"%s_occ_zr%s", name_prefix, name_suffix.Data());
113 TString
title = TString::Format(
"%s ZR Occupancy :%s;|Z| #[cm];R [cm]", title_prefix, title_suffix.Data());
117 UInt_t nbins_start = 2 * (station_id - 1);
122 UInt_t range_start = 4 * (station_id - 1);
130 return booker.
book2D(
name,
title, nbinsx, xlow, xup, nbinsy, ylow, yup);
133 template <
typename T>
136 const char* name_prefix,
137 const char* title_prefix) {
140 TString
name = TString::Format(
"%s_occ_xy%s", name_prefix, name_suffix.Data());
141 TString
title = TString::Format(
"%s XY Occupancy :%s;X [cm];Y [cm]", title_prefix, title_suffix.Data());
145 template <
typename T>
148 const char* name_prefix,
149 const char* title_prefix) {
152 TString
name = TString::Format(
"%s_occ_polar%s", name_prefix, name_suffix.Data());
153 TString
title = TString::Format(
"%s Polar Occupancy :%s", title_prefix, title_suffix.Data());
160 template <
typename T>
164 const char* name_prefix,
165 const char* title_prefix) {
169 TString
name = TString::Format(
"%s_occ_det%s", name_prefix, name_suffix.Data());
170 TString
title = TString::Format(
"%s Occupancy for detector component :%s", title_prefix, title_suffix.Data());
172 std::vector<const GEMSuperChamber*> superchambers =
station->superChambers();
174 Int_t num_superchambers = superchambers.size();
175 Int_t num_chambers = 0;
177 if (num_superchambers > 0) {
178 num_chambers = superchambers.front()->nChambers();
179 if (num_chambers > 0)
180 nbinsy = superchambers.front()->chambers().front()->nEtaPartitions();
182 Int_t nbinsx = num_superchambers * num_chambers;
188 auto hist =
new TH2F(
name,
title, nbinsx, 1 - 0.5, nbinsx + 0.5, nbinsy, 1 - 0.5, nbinsy + 0.5);
189 hist->GetXaxis()->SetTitle(
"Chamber-Layer");
190 hist->GetYaxis()->SetTitle(
"Eta Partition");
192 TAxis* x_axis =
hist->GetXaxis();
193 for (Int_t chamber_id = 1; chamber_id <= num_superchambers; chamber_id++) {
194 for (Int_t layer_id = 1; layer_id <= num_chambers; layer_id++) {
196 TString
label = TString::Format(
"C%dL%d", chamber_id, layer_id);
201 TAxis* y_axis =
hist->GetYaxis();
202 for (Int_t
bin = 1;
bin <= nbinsy;
bin++) {
203 y_axis->SetBinLabel(
bin, TString::Itoa(
bin, 10));
209 template <
typename T>
218 const char* y_title) {
221 TString hist_name = TString::Format(
"%s%s",
name, name_suffix.Data());
222 TString hist_title = TString::Format(
"%s :%s;%s;%s",
title, title_suffix.Data(), x_title, y_title);
223 return booker.
book1D(hist_name, hist_title, nbinsx, xlow, xup);
226 template <
typename T>
238 const char* y_title) {
241 TString hist_name = TString::Format(
"%s%s",
name, name_suffix.Data());
242 TString hist_title = TString::Format(
"%s :%s;%s;%s",
title, title_suffix.Data(), x_title, y_title);
243 return booker.
book2D(hist_name, hist_title, nbinsx, xlow, xup, nbinsy, ylow, yup);
246 #endif // Validation_MuonGEMHits_GEMBaseValidation_h