12#include "Framework/Configure/Parameters.h"
29 std::vector<double> ecal_sens_layers_z = {
30 7.850, 13.300, 26.400, 33.500, 47.950, 56.550, 72.250,
31 81.350, 97.050, 106.150, 121.850, 130.950, 146.650, 155.750,
32 171.450, 180.550, 196.250, 205.350, 221.050, 230.150, 245.850,
33 254.950, 270.650, 279.750, 298.950, 311.550, 330.750, 343.350,
34 362.550, 375.150, 394.350, 406.950, 426.150, 438.750};
36 params.addParameter(
"layerZPositions", ecal_sens_layers_z);
37 params.addParameter(
"ecalFrontZ", 220.);
38 params.addParameter(
"moduleMinR", 85.0);
39 params.addParameter(
"nCellRHeight", 35.3);
40 params.addParameter(
"gap", 1.5);
41 params.addParameter(
"cornersSideUp",
false);
42 params.addParameter(
"layer_shift_x", 0.);
43 params.addParameter(
"layer_shift_y", 0.);
44 params.addParameter(
"layer_shift_odd",
false);
45 params.addParameter(
"layer_shift_odd_bilayer",
false);
46 params.addParameter(
"verbose", 1);
53 auto poly_map = geometry.getCellPolyMap();
55 TCanvas* c =
new TCanvas(
"c",
"c", 900, 900);
56 c->SetMargin(0.15, 0.05, 0.1, 0.1);
57 gStyle->SetOptStat(0);
59 "Local Cell ID to Local Cell Position Map;"
60 "P Position Relative to Module [mm];"
61 "Q Position Relative to Module [mm]");
62 poly_map->GetXaxis()->SetTickLength(0.);
63 poly_map->GetYaxis()->SetTickLength(0.);
64 poly_map->Draw(
"TEXT");
66 double hex_corner_radius = 85.0 * (2 / sqrt(3));
67 std::vector<std::pair<double, double> > hex_corners = {
68 std::make_pair(+1. * hex_corner_radius, 0.),
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 * cos(M_PI / 3),
72 +1. * hex_corner_radius * sin(M_PI / 3)),
73 std::make_pair(-1. * hex_corner_radius, 0.),
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 * cos(M_PI / 3),
77 -1. * hex_corner_radius * sin(M_PI / 3)),
78 std::make_pair(+1. * hex_corner_radius, 0.)};
79 TLine module_hex_border{0., 0., 0., 0.};
80 module_hex_border.SetLineColorAlpha(kRed, 0.5);
81 module_hex_border.SetLineWidth(2);
82 for (
int i = 1; i < hex_corners.size(); i++) {
83 module_hex_border.DrawLine(
84 hex_corners.at(i - 1).first, hex_corners.at(i - 1).second,
85 hex_corners.at(i).first, hex_corners.at(i).second);
89 c->SaveAs(
"Cell_ID_Cell_Position_Map.pdf");
92 "Local Cell U,V to Local Cell Position Map;X Position Relative to Module "
93 "[mm];Y Position Relative to Module [mm]");
94 poly_map->GetXaxis()->SetTickLength(0.);
95 poly_map->GetYaxis()->SetTickLength(0.);
96 poly_map->SetMaximum(1000);
97 poly_map->SetMinimum(500);
98 poly_map->Draw(
"hist");
100 for (
int icell = 0; icell < 432; icell++) {
102 std::pair<double, double> pt = geometry.getPositionInModule(icell);
104 std::pair<unsigned int, unsigned int> uv =
id.getCellUV();
105 sprintf(text,
"(%d,%d)", uv.first, uv.second);
106 TText* tt =
new TText(pt.first, pt.second, text);
107 tt->SetTextAlign(22);
108 tt->SetTextSize(0.012);
113 c->SaveAs(
"Cell_UV_Cell_Position_Map.pdf");
118 "Trigger Cell Summing Map;"
119 "P Position Relative to Module [mm];"
120 "Q Position Relative to Module [mm]");
121 poly_map->GetXaxis()->SetTickLength(0.);
122 poly_map->GetYaxis()->SetTickLength(0.);
123 poly_map->SetMaximum(4);
124 poly_map->SetMinimum(0);
126 for (
int icell = 0; icell < 432; icell++) {
130 std::cout <<
id <<
"->" << tid << std::endl;
198 poly_map->SetBinContent(icell + 1, ival);
201 poly_map->Draw(
"COL");
203 for (
int tcell = 0; tcell < 48; tcell++) {
205 std::pair<double, double> pt = trig_g.localPosition(tid);
208 sprintf(text,
"(%d)", tcell);
209 TText* tt =
new TText(pt.first, pt.second, text);
210 tt->SetTextAlign(22);
211 tt->SetTextSize(0.012);
216 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.