10#include "Framework/Configure/Parameters.h"
27 std::vector<double> ecal_sens_layers_z = {
28 7.850, 13.300, 26.400, 33.500, 47.950, 56.550, 72.250,
29 81.350, 97.050, 106.150, 121.850, 130.950, 146.650, 155.750,
30 171.450, 180.550, 196.250, 205.350, 221.050, 230.150, 245.850,
31 254.950, 270.650, 279.750, 298.950, 311.550, 330.750, 343.350,
32 362.550, 375.150, 394.350, 406.950, 426.150, 438.750};
34 params.addParameter(
"layer_z_positions", ecal_sens_layers_z);
35 params.addParameter(
"ecal_front_z", 220.);
36 params.addParameter(
"module_min_r", 85.0);
37 params.addParameter(
"n_cell_r_height", 35.3);
38 params.addParameter(
"gap", 1.5);
39 params.addParameter(
"corners_side_up",
false);
40 params.addParameter(
"layer_shift_x", 0.);
41 params.addParameter(
"layer_shift_y", 0.);
42 params.addParameter(
"layer_shift_odd",
false);
43 params.addParameter(
"layer_shift_odd_bilayer",
false);
44 params.addParameter(
"verbose", 1);
51 auto poly_map = geometry.getCellPolyMap();
53 TCanvas* c =
new TCanvas(
"c",
"c", 900, 900);
54 c->SetMargin(0.15, 0.05, 0.1, 0.1);
55 gStyle->SetOptStat(0);
57 "Local Cell ID to Local Cell Position Map;"
58 "P Position Relative to Module [mm];"
59 "Q Position Relative to Module [mm]");
60 poly_map->GetXaxis()->SetTickLength(0.);
61 poly_map->GetYaxis()->SetTickLength(0.);
62 poly_map->Draw(
"TEXT");
64 double hex_corner_radius = 85.0 * (2 / sqrt(3));
65 std::vector<std::pair<double, double> > hex_corners = {
66 std::make_pair(+1. * hex_corner_radius, 0.),
67 std::make_pair(+1. * hex_corner_radius * cos(M_PI / 3),
68 +1. * hex_corner_radius * sin(M_PI / 3)),
69 std::make_pair(-1. * hex_corner_radius * cos(M_PI / 3),
70 +1. * hex_corner_radius * sin(M_PI / 3)),
71 std::make_pair(-1. * hex_corner_radius, 0.),
72 std::make_pair(-1. * hex_corner_radius * cos(M_PI / 3),
73 -1. * hex_corner_radius * sin(M_PI / 3)),
74 std::make_pair(+1. * hex_corner_radius * cos(M_PI / 3),
75 -1. * hex_corner_radius * sin(M_PI / 3)),
76 std::make_pair(+1. * hex_corner_radius, 0.)};
77 TLine module_hex_border{0., 0., 0., 0.};
78 module_hex_border.SetLineColorAlpha(kRed, 0.5);
79 module_hex_border.SetLineWidth(2);
80 for (
int i = 1; i < hex_corners.size(); i++) {
81 module_hex_border.DrawLine(
82 hex_corners.at(i - 1).first, hex_corners.at(i - 1).second,
83 hex_corners.at(i).first, hex_corners.at(i).second);
87 c->SaveAs(
"Cell_ID_Cell_Position_Map.pdf");
90 "Local Cell U,V to Local Cell Position Map;X Position Relative to Module "
91 "[mm];Y Position Relative to Module [mm]");
92 poly_map->GetXaxis()->SetTickLength(0.);
93 poly_map->GetYaxis()->SetTickLength(0.);
94 poly_map->SetMaximum(1000);
95 poly_map->SetMinimum(500);
96 poly_map->Draw(
"hist");
98 for (
int icell = 0; icell < 432; icell++) {
100 std::pair<double, double> pt = geometry.getPositionInModule(icell);
102 std::pair<unsigned int, unsigned int> uv =
id.getCellUV();
103 sprintf(text,
"(%d,%d)", uv.first, uv.second);
104 TText* tt =
new TText(pt.first, pt.second, text);
105 tt->SetTextAlign(22);
106 tt->SetTextSize(0.012);
111 c->SaveAs(
"Cell_UV_Cell_Position_Map.pdf");
116 "Trigger Cell Summing Map;"
117 "P Position Relative to Module [mm];"
118 "Q Position Relative to Module [mm]");
119 poly_map->GetXaxis()->SetTickLength(0.);
120 poly_map->GetYaxis()->SetTickLength(0.);
121 poly_map->SetMaximum(4);
122 poly_map->SetMinimum(0);
124 for (
int icell = 0; icell < 432; icell++) {
128 std::cout <<
id <<
"->" << tid << std::endl;
196 poly_map->SetBinContent(icell + 1, ival);
199 poly_map->Draw(
"COL");
201 for (
int tcell = 0; tcell < 48; tcell++) {
203 std::pair<double, double> pt = trig_g.localPosition(tid);
206 sprintf(text,
"(%d)", tcell);
207 TText* tt =
new TText(pt.first, pt.second, text);
208 tt->SetTextAlign(22);
209 tt->SetTextSize(0.012);
214 c->SaveAs(
"TriggerCell_Position_Map.pdf");
Class that translates raw positions of ECal module hits into cells in a hexagonal readout.
Class that defines an ECal detector ID with a cell number.
Class that defines the relationship between precision cells and trigger cells and provides geometry i...
Class that defines an ECal trigger cell detector ID.
defines the relationship between precision cells and trigger cells and provides geometry information ...
Class encapsulating parameters for configuring a processor.
Translation between real-space positions and cell IDs within the ECal.
Extension of DetectorID providing access to ECal layers and cell numbers in a hex grid.
Extension of DetectorID providing access to ECal trigger cell information.
int triggercell() const
Get the value of the trigger cell field from the ID.