HGCal Test Beam  03a93d6239a951948e06fb3ef8dae4cbdebfad30
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
HGCalTBTopology.cc
Go to the documentation of this file.
1 #include "HGCal/Geometry/interface/HGCalTBTopology.h"
2 #include "HGCal/Geometry/interface/HGCalTBCellParameters.h"
3 #include "math.h"
4 #include <stdlib.h>
5 #define PI 3.14159265
6 
7 bool HGCalTBTopology::iu_iv_valid(int layer, int sensor_iu, int sensor_iv, int iu, int iv, int sensorSize) const
8 {
9  int aiv = abs(iv);
10  int iuc = (iv < 0) ? (-iu) : (iu);
11  if(layer <= 28 && sensor_iu == 0 && sensor_iv == 0) {
12  if(sensorSize == 128) {
13  if (iv == 0) return (iu >= -5 && iu <= 5);
14  else if (aiv == 1) return (iuc >= -6 && iuc <= 5);
15  else if (aiv == 2) return (iuc >= -6 && iuc <= 4);
16  else if (aiv == 3) return (iuc >= -7 && iuc <= 4);
17  else if (aiv == 4) return (iuc >= -7 && iuc <= 3);
18  else if (aiv == 5) return (iuc >= -6 && iuc <= 1);
19  else if (aiv == 6) return (iuc >= -5 && iuc <= -1);
20  else if (aiv == 7) return (iuc == -3 || iuc == -4);
21  else return false;
22  } else return false;
23  } else return false;
24 }
25 
26 double HGCalTBTopology::Cell_Area(int cell_type) const
27 {
28  double a = HGCAL_TB_CELL::FULL_CELL_SIDE;
29  double b = HGCAL_TB_CELL::CALIB_PAD_SIDE;
30  double mouse_bite = HGCAL_TB_CELL::MOUSE_BITE_SIDE;
31 
32  double area_full_hex = 0.5 * 3 * sqrt(3) * pow(a, 2);
33  double area_calib_pad = 0.5 * 3 * sqrt(3) * pow(b, 2);
34  double area_half_hex = area_full_hex / 2;
35  double area_mouse_bite = area_half_hex - (0.5 * pow((a - mouse_bite), 2) / tan(PI / 6));
36  double area_outer_calib_pad = area_full_hex - area_calib_pad;
37  double area_merged_cell = area_full_hex + area_half_hex;
38 
39  if (cell_type == 0) return area_full_hex;
40  else if (cell_type == 1) return area_calib_pad;
41  else if (cell_type == 2) return area_half_hex;
42  else if (cell_type == 3) return area_mouse_bite;
43  else if (cell_type == 4) return area_outer_calib_pad;
44  else if (cell_type == 5) return area_merged_cell;
45  else return -1.; //signifies an invalid cell type
46 }
47 
#define PI
bool iu_iv_valid(int layer, int sensor_iu, int sensor_iv, int iu, int iv, int sensorSize) const
double Cell_Area(int cell_type) const