HGCal Test Beam  03a93d6239a951948e06fb3ef8dae4cbdebfad30
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
HGCalTBCellVertices.h
Go to the documentation of this file.
1 #ifndef HGCAL_GEOMETRY_HGCALTBCELLVERTICES_H
2 #define HGCAL_GEOMETRY_HGCALTBCELLVERTICES_H
3 
4 #include "HGCal/Geometry/interface/HGCalTBTopology.h"
5 #include "HGCal/Geometry/interface/HGCalTBCellParameters.h"
6 #include "math.h"
7 #include <vector>
8 
9 /**
10  * \class HGCal/Geometry/interface/HGCalTBCellVertices.h
11  *
12  * \brief This class implements the local coordinate system
13  *
14  * The local coordinate system is a 2D non-hortogonal system. The axes are \b iu and \b iv.
15  * The orientation of the axis is \b iu
16  *
17  * \author Rajdeep Mohan Chatterjee, Shervin Nourbakhsh
18  *
19  */
20 
22 {
23 public:
24 
25  HGCalTBCellVertices(); ///< Constructor from cell \b iu & \b iv, valid sensorSizes are 128 and 256
26 
27  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 \b (x,y)
28 
29  inline std::vector<std::pair<double, double>> GetCellCoordinatesForPlots(int layer, int sensor_iu, int sensor_iv, int iu, int iv, int sensorsize)
30  {
31  return GetCellCoordinates(layer, sensor_iu, sensor_iv, iu, iv, sensorsize, true);
32  }; ///< returns the coordinates of each vertex of cell in the lab frame \b (x,y)
33 
34  std::pair<double, double> GetCellCentreCoordinates(int layer, int sensor_iu, int sensor_iv, int iu, int iv, int sensorsize, bool flipX = false); ///< returns the center of the cell in absolute coordinates: \b (x,y)
35 
36  inline std::pair<double, double> GetCellCentreCoordinatesForPlots(int layer, int sensor_iu, int sensor_iv, int iu, int iv, int sensorsize)
37  {
38  return GetCellCentreCoordinates(layer, sensor_iu, sensor_iv, iu, iv, sensorsize, true);
39  }; ///< returns the center of the cell in absolute coordinates: \b (x,y)
40 
41 
42 // void CellType(int iu, int v, bool ValidFlag);// 1 for full hex, 2 for half hex and 3 for the pentagons(to be implemented later)
43 private:
44  double a = HGCAL_TB_CELL::FULL_CELL_SIDE; // Size in terms of 1 unit of x/y co-ordinates of a cell side which is 0.064 cm
45  double x_a = sqrt(3) / 2; // cosine pi/6
46  double y_a = 1 / 2.; // sine pi/6
47  double vy_a = 3. / 2;
48 
49  std::vector<double> x_co_FullHex, y_co_FullHex; // stores the initial x,y coordinates of a hexagonal cell
50  std::vector<std::pair<double, double>> Cell_co;
51 // Translation in u,v co-ordinates in terms of TB cartesian -x,y.
52  double x0 = 2 * x_a * a; //Translation in Cartesian x for 1 unit of iu
53  double vx0 = x_a * a; // Cartesian x component of translation for 1 unit of iv
54  double vy0 = vy_a * a; // Cartesian y component of translation for 1 unit of iv
55 
56  double Xmax(int iv, double y);// returns the max x value for a cell to be in the given sensor
57 
58  std::pair<double, double> RotateLayer(std::pair<double, double>, double Angle);
59 
60 };
61 
62 //std::ostream& operator<<(std::ostream&,const HGCalTBCellVertices& Cell_U_V);
63 
64 #endif
65 
std::pair< double, double > GetCellCentreCoordinatesForPlots(int layer, int sensor_iu, int sensor_iv, int iu, int iv, int sensorsize)
std::vector< std::pair< double, double > > GetCellCoordinatesForPlots(int layer, int sensor_iu, int sensor_iv, int iu, int iv, int sensorsize)
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)
HGCalTBCellVertices()
Constructor from cell iu &amp; iv, valid sensorSizes are 128 and 256.
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)