1 #include "HGCal/Geometry/interface/HGCalTBCellVertices.h"
7 #define TEST_BEAM_LAYER_ROTATION -PI/2
16 double x1[] = {0., x_a * a, x_a * a, 0., -x_a * a, -x_a * a};
17 double y1[] = {a, y_a * a, -y_a * a, -a, -y_a * a, y_a * a};
18 for(
int iii = 0; iii < 6; iii++) {
19 x_co_FullHex.push_back(x1[iii]);
20 y_co_FullHex.push_back(y1[iii]);
28 bool ValidFlag =
Top.
iu_iv_valid(layer, sensor_iu, sensor_iv, iu, iv, sensorsize);
29 double vertex_x_tmp = 0., vertex_y_tmp = 0.;
32 for(
int iii = 0; iii < 6; iii++) {
33 vertex_x_tmp = x_co_FullHex[iii] + iu * x0 + iv * vx0;
34 vertex_y_tmp = y_co_FullHex[iii] + iv * vy0;
36 if(fabs(vertex_x_tmp) <= Xmax(iv, fabs(vertex_y_tmp)) +
delta) {
39 Cell_co.push_back(point);
44 Cell_co.push_back(std::make_pair(-123456, -123456));
53 double centre_x_tmp = 0., centre_y_tmp = 0.;
54 bool ValidFlag =
Top.
iu_iv_valid(layer, sensor_iu, sensor_iv, iu, iv, sensorsize);
56 centre_x_tmp = iu * x0 + iv * vx0;
57 centre_y_tmp = iv * vy0;
61 }
else return std::make_pair(-123456, -123456);
65 double HGCalTBCellVertices::Xmax(
int iv,
double y)
67 if(fabs(iv) <= 3)
return 11 * x_a * a;
68 else return (11 * a - y) / (1 / (2 * x_a));
71 std::pair<double, double> HGCalTBCellVertices::RotateLayer(std::pair<double, double> Vertex,
double Angle)
73 double X_new = (Vertex.first) * cos(Angle) - (Vertex.second) * sin(Angle);
74 double Y_new = (Vertex.first) * sin(Angle) - (Vertex.second) * cos(Angle);
75 return std::make_pair(-X_new, Y_new);
std::pair< double, double > GetCellCentreCoordinates(int layer, int sensor_iu, int sensor_iv, int iu, int iv, int sensorsize, bool flipX=false)
returns the coordinates of each vertex of cell in the lab frame (x,y)
bool iu_iv_valid(int layer, int sensor_iu, int sensor_iv, int iu, int iv, int sensorSize) const
HGCalTBCellVertices()
Constructor from cell iu & iv, valid sensorSizes are 128 and 256.
#define TEST_BEAM_LAYER_ROTATION
std::vector< std::pair< double, double > > GetCellCoordinates(int layer, int sensor_iu, int sensor_iv, int iu, int iv, int sensorsize, bool flipX=false)
returns the coordinates of each vertex of cell in the lab frame (x,y)