LDMX Software
EcalGeometry.cxx
2
3#include <cmath>
4#include <iomanip>
5#include <iostream>
6#include <tuple>
7
8#include "Framework/Exception/Exception.h"
9#include "TGraph.h"
10#include "TList.h"
11
12namespace ldmx {
13
14static double distance(const std::pair<double, double>& p1,
15 const std::pair<double, double>& p2) {
16 return sqrt((p1.first - p2.first) * (p1.first - p2.first) +
17 (p1.second - p2.second) * (p1.second - p2.second));
18}
19
20[[maybe_unused]] static double distance(
21 const std::tuple<double, double, double>& p1,
22 const std::tuple<double, double, double>& p2) {
23 return sqrt((std::get<0>(p1) - std::get<0>(p2)) *
24 (std::get<0>(p1) - std::get<0>(p2)) +
25 (std::get<1>(p1) - std::get<1>(p2)) *
26 (std::get<1>(p1) - std::get<1>(p2)) +
27 (std::get<2>(p1) - std::get<2>(p2)) *
28 (std::get<2>(p1) - std::get<2>(p2)));
29}
30
34static void rotate(double& p, double& q) {
35 double tmp{p};
36 p = -q;
37 q = tmp;
38}
39
43static void unrotate(double& p, double& q) {
44 double tmp{p};
45 p = q;
46 q = -tmp;
47}
48
50 : framework::ConditionsObject(EcalGeometry::CONDITIONS_OBJECT_NAME) {
51 layer_z_positions_ = ps.get<std::vector<double>>("layer_z_positions");
52 ecal_front_z_ = ps.get<double>("ecal_front_z");
53 module_r_min_ = ps.get<double>("module_min_r");
54 gap_ = ps.get<double>("gap");
55 n_cell_r_height_ = ps.get<double>("n_cell_r_height");
56 corners_side_up_ = ps.get<bool>("corners_side_up");
57 layer_shift_x_ = ps.get<double>("layer_shift_x");
58 layer_shift_y_ = ps.get<double>("layer_shift_y");
59 layer_shift_odd_ = ps.get<bool>("layer_shift_odd");
60 layer_shift_odd_bilayer_ = ps.get<bool>("layer_shift_odd_bilayer");
61 ecal_center_x_ = ps.get<double>("ecal_center_x", 0.);
62 ecal_center_y_ = ps.get<double>("ecal_center_y", 0.);
63 flip_y_ = ps.get<bool>("flip_y", false);
64 flip_x_ = ps.get<bool>("flip_x", false);
65 si_thickness_ = ps.get<double>("si_thickness");
66
68 EXCEPTION_RAISE("BadConf",
69 "Cannot shift both odd sensitive layers and odd bilayers");
70 }
71
72 module_r_max_ = module_r_min_ * (2 / sqrt(3));
74 cell_r_min_ = (sqrt(3.) / 2.) * cell_r_max_;
75
76 ldmx_log(debug) << "Building module map with gap " << std::setprecision(2)
77 << gap_ << ", nCellRHeight " << n_cell_r_height_
78 << ", min/max radii of cell " << cell_r_min_ << " / "
79 << cell_r_max_ << ", and module " << module_r_min_ << " / "
81
87
88 ldmx_log(trace) << "Geometry fully constructed";
89}
90
91EcalID EcalGeometry::getID(double x, double y, double z, bool fallible) const {
92 int layer_id{-1};
93 for (const auto& [lid, layer_xyz] : layer_pos_xy_) {
94 // check if the z coordinate is within the layer thickness
95 if (std::abs(std::get<2>(layer_xyz) - z) < si_thickness_) {
96 layer_id = lid;
97 break;
98 }
99 }
100 if (layer_id < 0) {
101 if (fallible) {
102 return ldmx::EcalID(0);
103 } else {
104 EXCEPTION_RAISE("BadConf", "z = " + std::to_string(z) +
105 " mm is not within any"
106 " of the configured layers.");
107 }
108 }
109 return getID(x, y, layer_id, fallible);
110}
111
112EcalID EcalGeometry::getID(double x, double y, int layer_id,
113 bool fallible) const {
114 // now assume we know the layer
115 // shift to center of layer
116 // and convert to flower coordinates
117 double p{x - std::get<0>(layer_pos_xy_.at(layer_id))},
118 q{y - std::get<1>(layer_pos_xy_.at(layer_id))};
119 if (flip_x_) p = -p;
120 if (flip_y_) q = -q;
121
122 // deduce module ID
123 // there are only 7 modules so we just loop through them
124 // all and pick out the module ID that we are inside of
125
126 int module_id{-1};
127 for (auto const& [mid, module_xy] : module_pos_xy_) {
128 double probe_x{p - module_xy.first}, probe_y{q - module_xy.second};
129 if (corners_side_up_) rotate(probe_x, probe_y);
130 if (isInside(probe_x / module_r_max_, probe_y / module_r_max_)) {
131 module_id = mid;
132 break;
133 }
134 }
135
136 if (module_id < 0) {
137 if (fallible) {
138 return ldmx::EcalID(0);
139 } else {
140 EXCEPTION_RAISE(
141 "BadConf",
142 TString::Format(
143 "Coordinates relative to layer (p,q) = (%.2f, %.2f) mm "
144 "derived from world coordinates (%.2f, %.2f) mm with layer = %d "
145 "are not inside any module.",
146 p, q, x, y, layer_id)
147 .Data());
148 }
149 }
150
151 return getID(x, y, layer_id, module_id);
152}
153
154EcalID EcalGeometry::getID(double x, double y, int layer_id, int module_id,
155 bool fallible) const {
156 // now assume we know the layer and module
157 // shift to center of layer and then center of module
158 double p{(flip_x_ ? -1. : 1.) *
159 (x - std::get<0>(layer_pos_xy_.at(layer_id))) -
160 module_pos_xy_.at(module_id).first},
161 q{(flip_y_ ? -1. : 1.) * (y - std::get<1>(layer_pos_xy_.at(layer_id))) -
162 module_pos_xy_.at(module_id).second};
163
164 // need to rotate
165 if (corners_side_up_) rotate(p, q);
166
167 // deduce cell ID
168 int cell_id = cell_id_in_module_.FindBin(p, q) - 1;
169
170 if (cell_id < 0) {
171 if (fallible) {
172 return ldmx::EcalID(0);
173 } else {
174 EXCEPTION_RAISE(
175 "BadConf",
176 TString::Format(
177 "Relative cell coordinates (%.2f, %.2f) mm "
178 "derived from world coordinates (%.2f, %.2f) mm with layer = %d "
179 "and module = %d are outside module hexagon",
180 p, q, x, y, layer_id, module_id)
181 .Data());
182 }
183 }
184
185 return EcalID(layer_id, module_id, cell_id);
186}
187
188std::tuple<double, double, double> EcalGeometry::getPosition(EcalID id) const {
189 return cell_global_pos_.at(id);
190}
191
192std::pair<double, double> EcalGeometry::getPositionInModule(int cell_id) const {
193 auto pq = cell_pos_in_module_.at(cell_id);
194
195 // going from (p,q) to (x,y) is a unrotate
196 if (corners_side_up_) unrotate(pq.first, pq.second);
197
198 return pq;
199}
200
202 ldmx_log(debug) << "Building layer map with " << layer_z_positions_.size()
203 << " layers";
205 if (layer_shift_odd_) {
206 ldmx_log(debug) << "Shifting odd layers by (x,y) = (" << layer_shift_x_
207 << ", " << layer_shift_y_ << ") mm";
208 } else {
209 ldmx_log(debug) << "Shifting odd bilayers by (x,y) = (" << layer_shift_x_
210 << ", " << layer_shift_y_ << ") mm";
211 }
212 }
213
214 for (std::size_t i_layer{0}; i_layer < layer_z_positions_.size(); ++i_layer) {
215 // default is centered on z-axis
216 double x{ecal_center_x_}, y{ecal_center_y_},
217 z{ecal_front_z_ + layer_z_positions_.at(i_layer)};
218 const double shift_x{flip_x_ ? -layer_shift_x_ : layer_shift_x_};
219 const double shift_y{flip_y_ ? -layer_shift_y_ : layer_shift_y_};
220 if (layer_shift_odd_ and (i_layer % 2 == 1)) {
221 x += shift_x;
222 y += shift_y;
223 } else if (layer_shift_odd_bilayer_ and ((i_layer / 2) % 2 == 1)) {
224 x += shift_x;
225 y += shift_y;
226 }
227 ldmx_log(trace) << " Layer " << i_layer << " has center at (" << x
228 << ", " << y << ", " << z << ") mm";
229
230 layer_pos_xy_[i_layer] = std::make_tuple(x, y, z);
231 }
232}
233
235 static const double c_pi = 3.14159265358979323846;
236
237 // the center module (module_id == 0) has always been (and will always be?)
238 // centered with respect to the layer position
239 module_pos_xy_[0] = std::pair<double, double>(0., 0.);
240
241 // for flat-side-up designs (v12 and earlier), the modules are numbered 1 on
242 // positive y-axis and then counter-clockwise until 6
243 //
244 // for corner-side-up designes (v13 and later), the modules are numbered 1 on
245 // positive x-axis and then counter-clockwise until 6.
246 for (unsigned id = 1; id < 7; id++) {
247 // flat-side-up
248 double x = (2. * module_r_min_ + gap_) * sin((id - 1) * (c_pi / 3.));
249 double y = (2. * module_r_min_ + gap_) * cos((id - 1) * (c_pi / 3.));
250 if (corners_side_up_) {
251 // re-calculating to make sure centers match GDML
252 x = (2. * module_r_min_ + gap_) * cos((id - 1) * (c_pi / 3.));
253 y = -(2. * module_r_min_ + gap_) * sin((id - 1) * (c_pi / 3.));
254 }
255 module_pos_xy_[id] = std::pair<double, double>(x, y);
256 ldmx_log(trace) << " Module " << id << " is centered at (x,y) = " << "("
257 << x << ", " << y << ") mm";
258 }
259}
260
281 TH2Poly grid_map;
282
283 // make hexagonal grid [boundary is rectangle] larger than the module
284 double grid_min_p = 0., grid_min_q = 0.; // start at the origin
285 int num_p_cells = 0, num_q_cells = 0;
286
287 // first x-cell is only a half
288 grid_min_p -= cell_r_min_;
289 num_p_cells++;
290 while (grid_min_p > -1 * module_r_max_) {
291 // decrement x by cell center-to-flat diameter
292 grid_min_p -= 2 * cell_r_min_;
293 num_p_cells++;
294 }
295 while (grid_min_q > -1 * module_r_min_) {
296 // decrement y by cell center-to-corner radius
297 // alternate between a full corner-to-corner diameter
298 // and a side of a cell (center-to-corner radius)
299 if (num_q_cells % 2 == 0)
300 grid_min_q -= 1 * cell_r_max_;
301 else
302 grid_min_q -= 2 * cell_r_max_;
303 num_q_cells++;
304 }
305 // only counted one half of the cells
306 num_p_cells *= 2;
307 num_q_cells *= 2;
308
309 grid_map.Honeycomb(grid_min_p, grid_min_q, cell_r_max_, num_p_cells,
310 num_q_cells);
311
312 ldmx_log(trace) << std::setprecision(2)
313 << "Building buildCellMap with cell rmin: " << cell_r_min_
314 << " cell rmax: " << cell_r_max_ << " (gridMinP,gridMinQ) = ("
315 << grid_min_p << "," << grid_min_q << ")"
316 << " (numPCells,numQCells) = (" << num_p_cells << ","
317 << num_q_cells << ")";
318
319 // copy cells lying within module boundaries to a module grid
320 TListIter next(grid_map.GetBins()); // a TH2Poly is a TList of TH2PolyBin
321 TH2PolyBin* poly_bin = 0;
322 TGraph* poly = 0; // a polygon returned by TH2Poly is a TGraph
323 // cells_in_module_ IDs go from 0 to N-1, not equal to original grid cell ID
324 int cell_id = 0;
325 while ((poly_bin = (TH2PolyBin*)next())) {
326 // these bins are coming from the honeycomb
327 // grid so we assume that they are regular
328 // hexagons i.e. has 6 vertices
329 poly = (TGraph*)poly_bin->GetPolygon();
330
331 // decide whether to copy polygon to new map.
332 // use all vertices in case of cut-off edge polygons.
333 int num_vertices_inside = 0;
334 double vertex_p[6], vertex_q[6]; // vertices of the cell
335 bool isinside[6]; // which vertices are inside
336 ldmx_log(trace) << " Cell vertices";
337 for (unsigned i = 0; i < 6; i++) {
338 poly->GetPoint(i, vertex_p[i], vertex_q[i]);
339 ldmx_log(trace) << " vtx # " << i;
340 ldmx_log(trace) << " vtx p,q " << vertex_p[i] << " " << vertex_q[i];
341
342 isinside[i] =
343 isInside(vertex_p[i] / module_r_max_, vertex_q[i] / module_r_max_);
344 if (isinside[i]) num_vertices_inside++;
345 }
346
347 if (num_vertices_inside > 1) {
348 // Include this cell if more than one of its vertices is inside the module
349 // hexagon
350 double actual_p[8], actual_q[8];
351 int num_vertices{0};
352 if (num_vertices_inside < 6) {
353 // This cell is stradling the edge of the module
354 // and is NOT cleanly cut by module edge
355
356 ldmx_log(trace) << " Polygon " << cell_id
357 << " has vertices poking out of module hexagon.";
358
359 // loop through vertices
360 for (int i = 0; i < 6; i++) {
361 int up = i == 5 ? 0 : i + 1;
362 int dn = i == 0 ? 5 : i - 1;
363 if (isinside[i] and (not isinside[up] or not isinside[dn])) {
364 // this vertex is inside the module hexagon and is adjacent to a
365 // vertex outside
366 // ==> project this vertex onto the nearest edge of the module
367 // hexagon
368
369 // determine which side of hexagon we should project onto
370 double edge_origin_p, edge_origin_q;
371 double edge_dest_p, edge_dest_q;
372 if (vertex_p[i] < -module_r_max_ / 2.) {
373 // sloped edge on negative-x side
374 edge_origin_p = -1. * module_r_max_;
375 edge_origin_q = 0.;
376 edge_dest_p = -0.5 * module_r_max_;
377 edge_dest_q = module_r_min_;
378 } else if (vertex_p[i] > module_r_max_ / 2.) {
379 // sloped edge on positive-x side
380 edge_origin_p = 0.5 * module_r_max_;
381 edge_origin_q = module_r_min_;
382 edge_dest_p = module_r_max_;
383 edge_dest_q = 0.;
384 } else {
385 // flat edge at top
386 edge_origin_p = 0.5 * module_r_max_;
387 edge_origin_q = module_r_min_;
388 edge_dest_p = -0.5 * module_r_max_;
389 edge_dest_q = module_r_min_;
390 }
391 // flip to bottom half if below x-axis
392 if (vertex_q[i] < 0) {
393 edge_dest_q *= -1;
394 edge_origin_q *= -1;
395 }
396
397 // get edge slope vector
398 double edge_slope_p = edge_dest_p - edge_origin_p;
399 double edge_slope_q = edge_dest_q - edge_origin_q;
400
401 ldmx_log(trace)
402 << "Vertex " << i
403 << " is inside and adjacent to a vertex outside the module.";
404 ldmx_log(trace) << "Working on edge with slope (" << edge_slope_p
405 << "," << edge_slope_q << ")" << " and origin ("
406 << edge_origin_p << "," << edge_origin_q << ")";
407
408 // project vertices adjacent to the vertex outside the module onto
409 // the module edge
410 double projection_factor =
411 ((vertex_p[i] - edge_origin_p) * edge_slope_p +
412 (vertex_q[i] - edge_origin_q) * edge_slope_q) /
413 (edge_slope_p * edge_slope_p + edge_slope_q * edge_slope_q);
414
415 double proj_p = edge_origin_p + projection_factor * edge_slope_p;
416 double proj_q = edge_origin_q + projection_factor * edge_slope_q;
417
418 if (not isinside[up]) {
419 // the next point is outside
420 actual_p[num_vertices] = vertex_p[i];
421 actual_q[num_vertices] = vertex_q[i];
422 actual_p[num_vertices + 1] = proj_p;
423 actual_q[num_vertices + 1] = proj_q;
424 } else {
425 // the previous point was outside
426 actual_p[num_vertices] = proj_p;
427 actual_q[num_vertices] = proj_q;
428 actual_p[num_vertices + 1] = vertex_p[i];
429 actual_q[num_vertices + 1] = vertex_q[i];
430 }
431 num_vertices += 2;
432
433 ldmx_log(trace) << "New Vertex " << i << " : (" << vertex_p[i]
434 << "," << vertex_q[i] << ")";
435
436 } else {
437 actual_p[num_vertices] = vertex_p[i];
438 actual_q[num_vertices] = vertex_q[i];
439 num_vertices++;
440 } // should we project or not
441 } // loop through vertices
442 } else {
443 // all 6 inside, just copy the vertices over
444 num_vertices = 6;
445 for (int i = 0; i < 6; i++) {
446 actual_p[i] = vertex_p[i];
447 actual_q[i] = vertex_q[i];
448 }
449 } // if numVerticesInside is less than 5
450
451 // TH2Poly needs to have its own copy of the polygon TGraph
452 // otherwise, we get a seg fault when EcalGeometry is destructed
453 // because the polygon that was copied over from gridMap is deleted at
454 // the end of this function
455 cell_id_in_module_.AddBin(num_vertices, actual_p, actual_q);
456
460 double p = (poly_bin->GetXMax() + poly_bin->GetXMin()) / 2.;
461 double q = (poly_bin->GetYMax() + poly_bin->GetYMin()) / 2.;
462
463 ldmx_log(trace) << " Copying poly with ID " << poly_bin->GetBinNumber()
464 << " and (p,q) (" << std::setprecision(2) << p << "," << q
465 << ")";
466 // save cell location as center of ENTIRE hexagon
467 cell_pos_in_module_[cell_id] = std::pair<double, double>(p, q);
468 ++cell_id; // incrememnt cell ID
469 } // if num vertices inside is > 1
470 } // loop over larger grid spanning module hexagon
471 return;
472}
473
475 ldmx_log(trace) << "Building cellModule position map";
477 for (auto const& [module_id, module_xy] : module_pos_xy_) {
478 for (auto const& [cell_id, cell_pq] : cell_pos_in_module_) {
479 double cell_x{cell_pq.first}, cell_y{cell_pq.second};
480 // convert from (p,q) to (x,y) space
481 // when the corners are not up, x = p and y = q
482 // so no transformation needs to be done
483 if (corners_side_up_) unrotate(cell_x, cell_y);
484
485 // calculate cell's pq relative to entire layer center
486 auto cell_rel_to_layer =
487 std::make_pair(module_xy.first + cell_x, module_xy.second + cell_y);
488
489 // now add the layer-center values to get the global position
490 // of the cell
491 cell_pos_in_layer_[EcalID(0, module_id, cell_id)] = cell_rel_to_layer;
492 }
493 }
494
496 for (auto const& [layer_id, layer_xyz] : layer_pos_xy_) {
497 for (auto const& [flat_id, rel_to_layer] : cell_pos_in_layer_) {
498 // now add the layer-center values to get the global position
499 // of the cell
500 cell_global_pos_[EcalID(layer_id, flat_id.module(), flat_id.cell())] =
501 std::make_tuple((flip_x_ ? -1. : 1.) * rel_to_layer.first +
502 std::get<0>(layer_xyz),
503 (flip_y_ ? -1. : 1.) * rel_to_layer.second +
504 std::get<1>(layer_xyz),
505 std::get<2>(layer_xyz));
506 }
507 }
508
509 ldmx_log(trace) << "Cell module map contains " << cell_global_pos_.size()
510 << " entries. ";
511 return;
512}
513
528 ldmx_log(trace) << "Building Nearest and Next-Nearest Neighbor maps";
529
530 nn_map_.clear();
531 nnn_map_.clear();
532 for (auto const& [center_id, center_xyz] : cell_pos_in_layer_) {
533 for (auto const& [probe_id, probe_xyz] : cell_pos_in_layer_) {
535 double dist = distance(probe_xyz, center_xyz);
536 if (dist > 1 * cell_r_min_ && dist <= 3. * cell_r_min_) {
537 nn_map_[center_id].push_back(probe_id);
538 } else if (dist > 3. * cell_r_min_ && dist <= 4.5 * cell_r_min_) {
539 nnn_map_[center_id].push_back(probe_id);
540 }
541 }
542 // Keeping this commented out until the SimIDs string method is implemented
543 // ldmx_log(debug) << " Found " << nn_map_[center_id].size() << " NN and "
544 // << nnn_map_[center_id].size() << " NNN for cell " << center_id;
545 }
546 return;
547}
548
550 // https://math.stackexchange.com/questions/1210572/find-the-distance-to-the-edge-of-a-hexagon
551 std::pair<double, double> cell_location = cell_pos_in_module_.at(id.cell());
552 double x = fabs(cell_location.first); // bring to first quadrant
553 double y = fabs(cell_location.second);
554 double r = sqrt(x * x + y * y);
555 double theta = (r > 1E-3) ? fabs(std::atan(y / x)) : 0;
556 if (x < module_r_max_ / 2.)
557 return (module_r_min_ -
558 y); // closest line is straight vertical to top edge
559 double dist =
560 sqrt(3.) * module_r_max_ / (std::sin(theta) + sqrt(3.) * std::cos(theta));
561 return dist;
562}
563
564bool EcalGeometry::isInside(double normX, double normY) const {
565 ldmx_log(trace) << std::fixed << std::setprecision(2)
566 << "Checking if normXY=(" << normX << "," << normY
567 << ") is inside.";
568 normX = fabs(normX), normY = fabs(normY);
569 double xvec = -1, yvec = -1. / sqrt(3);
570 double xref = 0.5, yref = sqrt(3) / 2.;
571 if ((normX > 1.) || (normY > yref)) {
572 ldmx_log(trace) << "They are outside quadrant.";
573 return false;
574 }
575 double dot_prod = (xvec * (normX - xref) + yvec * (normY - yref));
576 ldmx_log(trace) << std::fixed << std::setprecision(2)
577 << "They are inside quadrant. Dot product (>0 is inside): "
578 << dot_prod;
579 return (dot_prod > 0.);
580}
581
582} // namespace ldmx
Class that translates raw positions of ECal module hits into cells in a hexagonal readout.
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:26
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
Definition Parameters.h:75
Translation between real-space positions and cell IDs within the ECal.
std::map< EcalID, std::tuple< double, double, double > > cell_global_pos_
Position of cell centers relative to world geometry.
std::map< EcalID, std::vector< EcalID > > nnn_map_
Map of cell ID to neighbors of neighbor cells.
EcalID getID(double x, double y, double z, bool fallible=false) const
Get a cell's ID number from its position.
std::tuple< double, double, double > getPosition(EcalID id) const
Get a cell's position from its ID number.
void buildCellModuleMap()
Constructs the positions of all the cells in a layer relative to the ecal center.
double layer_shift_y_
shift of layers in the y-direction [mm]
double distanceToEdge(EcalID id) const
Distance to module edge, and whether cell is on edge of module.
std::pair< double, double > getPositionInModule(int cell_id) const
Get a cell's position within a module.
double ecal_center_x_
World x of the layer centers [mm].
std::map< int, std::pair< double, double > > module_pos_xy_
Postion of module centers relative to the center of the layer in world coordinates.
void buildCellMap()
Constructs the flat-bottomed hexagonal grid (cellID) of corner-down hexagonal cells.
bool layer_shift_odd_
shift odd layers
double module_r_max_
Center-to-Corner Radius of module hexagon [mm].
double cell_r_min_
Center-to-Flat Radius of cell hexagon [mm].
std::map< int, std::tuple< double, double, double > > layer_pos_xy_
Position of layer centers in world coordinates (uses layer ID as key)
double n_cell_r_height_
Number of cell center-to-corner radii (one side of the cell) from the bottom to the top of the module...
std::map< int, std::pair< double, double > > cell_pos_in_module_
Position of cell centers relative to center of module in p,q space.
double layer_shift_x_
shift of layers in the x-direction [mm]
bool flip_x_
ECal x axis points along world -x, e.g. rotated about y by 180 deg.
void buildModuleMap()
Constructs the positions of the seven modules (moduleID) relative to the ecal center.
std::map< EcalID, std::pair< double, double > > cell_pos_in_layer_
Position of cell centers relative to center of layer in world coordinates.
std::map< EcalID, std::vector< EcalID > > nn_map_
Map of cell ID to neighboring cells.
std::vector< double > layer_z_positions_
The layer Z postions are with respect to the front of the ECal [mm].
bool isInside(double normX, double normY) const
Determines if point (x,y), already normed to max hexagon radius, lies within a hexagon.
double si_thickness_
Thickness of the Si sensitive layer [mm].
bool layer_shift_odd_bilayer_
shift odd bi layers
double ecal_center_y_
World y of the layer centers [mm].
void buildLayerMap()
Constructs the positions of the layers in world coordinates.
EcalGeometry(const framework::config::Parameters &ps)
Class constructor, for use only by the provider.
double cell_r_max_
Center-to-Corner Radius of cell hexagon [mm].
bool flip_y_
ECal y axis points along world -y, e.g. rotated about x by 180 deg.
double ecal_front_z_
Front of ECal relative to world geometry [mm].
double gap_
Gap between module flat sides [mm].
double module_r_min_
Center-to-Flat Radius of module hexagon [mm].
TH2Poly cell_id_in_module_
Honeycomb Binning from ROOT.
void buildNeighborMaps()
Construts NNMap and NNNMap.
bool corners_side_up_
indicator of geometry orientation if true, flower shape's corners side (ie: side with two modules) is...
Extension of DetectorID providing access to ECal layers and cell numbers in a hex grid.
Definition EcalID.h:20
All classes in the ldmx-sw project use this namespace.