Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MicromegasGeometry.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file MicromegasGeometry.cc
1 #include "MicromegasGeometry.h"
2 
3 //__________________________________________________
5  m_detnames_sphenix( { "SCO", "SCI", "NCI", "NCO", "SEI", "NEI", "SWI", "NWI" } )
6 {
7  /*
8  * to convert sphenix coordinates into a x,y 2D histogram,
9  * we transform z(3D) = x(2D)
10  * and x (3D) = y (2D)
11  */
12  {
13  const double tile_x = 0;
14  for( const double& tile_z:{ -84.6, -28.2, 28.2, 84.6 } )
15  { m_tile_centers.push_back( {tile_z, tile_x} ); }
16  }
17 
18  {
19  // neighbor sectors have two modules, separated by 10cm
20  for( const double& tile_x: { -m_tile_width - 2, m_tile_width+2 } )
21  for( const double& tile_z:{ -37.1, 37.1 } )
22  { m_tile_centers.push_back( {tile_z, tile_x} ); }
23  }
24 }
25 
26 //__________________________________________________
28 {
29  const auto center = get_tile_center( index );
30  return
31  {
32  { center.first-m_tile_length/2,center.second-m_tile_width/2 },
33  { center.first-m_tile_length/2,center.second+m_tile_width/2 },
34  { center.first+m_tile_length/2,center.second+m_tile_width/2 },
35  { center.first+m_tile_length/2,center.second-m_tile_width/2 }
36  };
37 }
38 
39 //__________________________________________________
41 {
42  const auto tile_center = get_tile_center( tile_index );
43  switch( segmentation )
44  {
46  {
47  const double& resist_width = m_tile_width;
48  const double resist_length = m_tile_length/m_nresist;
49  const point_t resist_center({ tile_center.first - (m_tile_length - (2*resist_index+1)*resist_length)/2, tile_center.second });
50  return
51  {
52  { resist_center.first-resist_length/2,resist_center.second-resist_width/2 },
53  { resist_center.first-resist_length/2,resist_center.second+resist_width/2 },
54  { resist_center.first+resist_length/2,resist_center.second+resist_width/2 },
55  { resist_center.first+resist_length/2,resist_center.second-resist_width/2 }
56  };
57  }
59  {
60  const double resist_width = m_tile_width/m_nresist;
61  const double& resist_length = m_tile_length;
62  const point_t resist_center({tile_center.first, tile_center.second - (m_tile_width - (2*resist_index+1)*resist_width)/2 });
63  return
64  {
65  { resist_center.first-resist_length/2,resist_center.second-resist_width/2 },
66  { resist_center.first-resist_length/2,resist_center.second+resist_width/2 },
67  { resist_center.first+resist_length/2,resist_center.second+resist_width/2 },
68  { resist_center.first+resist_length/2,resist_center.second-resist_width/2 }
69  };
70  }
71  }
72 
73  // unreached
74  return point_list_t();
75 }