StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StBbcGeom.h
1 #ifndef _StBbcGeom
2 #define _StBbcGeom
3 
4 //#include "Rtypes.h"
5 #include "TVector3.h"
6 
7 /*************************************
8  * \author Mike Lisa
9  * \date 1 Mar 2018
10  *
11  * \description:
12  * class defining geometrical aspects of the inner BBC
13  * (position of tile center, tile corners, etc.)
14  *
15  * The BBC is a holy nightmare because one PMT connects
16  * to *either* one or two disjoint tiles. Also, the
17  * PMT number is the same as the tile number sometimes,
18  * but not all the time. Plus the numbering starts
19  * at zero sometimes and not other times.
20  *
21  * In this class, we are only talking about tiles
22  * and tile geometry. Another class will give you the
23  * map from PMT number to tile(s).
24  *
25  *
26  * Because some users will use the sign of the tileId
27  * to denote east/west, and some will use an explicit
28  * integer, we provide overloaded functions, to allow both.
29  *
30  ******************************************/
31 
32 
33 
34 class StBbcGeom{
35  private:
36 
37  TVector3 mEastTileCenter[18];
38  TVector3 mWestTileCenter[18];
39  double mX[6]; // x-coordinates of hexagonal tile corners, if tile center is at (0,0)
40  double mY[6]; // y-coordinates of hexagonal tile corners, if tile center is at (0,0)
41  unsigned short mPMT[18]; // phototube number corresponding to a given inner BBC tile. Same for east and west BBCs
42 
43  unsigned short mNtilesOfPmt[16]; // how many tiles correspond to the phototube? (either 1 or 2)
44  unsigned short mTileNumbersOfPmt[16][2]; // WHICH tiles correspond to the phototube?
45 
46 
47 // mEastNumberOfOverlappingEpdTiles[BB-1] gives the number of EPD tiles that have any overlap with BBC tile BB
48  static short mEastNumberOfOverlappingEpdTiles[18];
49 // mEastEpdTilesWhichOverlap[BB-1][i] gives the EPD tile id of the jth EPD tile that overlaps BBC inner tile BB
50  static short mEastEpdTilesWhichOverlap[18][10];
51 
52 // mWestNumberOfOverlappingEpdTiles[BB-1] gives the number of EPD tiles that have any overlap with BBC tile BB
53  static short mWestNumberOfOverlappingEpdTiles[18];
54 // mWestEpdTilesWhichOverlap[BB-1][i] gives the EPD tile id of the jth EPD tile that overlaps BBC inner tile BB
55  static short mWestEpdTilesWhichOverlap[18][10];
56 
57 
58 
59 
60 
61  void InitializeGeometry();
62 
63  public:
64  StBbcGeom();
65  ~StBbcGeom();
66 
67  //------------------------------------------------------
68 
71  TVector3 TileCenter(short tileId);
72 
76  TVector3 TileCenter(unsigned short absValueTileNumber, short eastwest);
77 
78  //------------------------------------------------------
79 
83  void GetCorners(short tileId, double* x, double* y);
84 
89  void GetCorners(unsigned short absValueTileNumber, short eastwest, double* x, double* y);
90 
91  //------------------------------------------------------
92 
97  void GetOverlappingEpdTiles(short tileId,
98  int* nOverlappingEpdTiles, short* EpdTileIDs);
99 
100 
106  void GetOverlappingEpdTiles(unsigned short absValueTileNumber, short eastwest,
107  int* nOverlappingEpdTiles, short* EpdTileIDs);
108 
109  //------------------------------------------------------
110 
117  bool IsInTile(short tileId, double x, double y);
118 
126  bool IsInTile(unsigned short absValueTileNumber, short eastwest, double x, double y);
127 
128 
132  unsigned short PmtOfTile(unsigned short tileNumber);
133 
142  void GetTilesOfPmt(unsigned short pmtNumber, unsigned short* nTiles, unsigned short* tileNumbers);
143 
144  ClassDef(StBbcGeom,0)
145 };
146 
147 
148 inline unsigned short StBbcGeom::PmtOfTile(unsigned short tile){return mPMT[tile-1];}
149 
150 #endif
bool IsInTile(short tileId, double x, double y)
Definition: StBbcGeom.cxx:147
void GetOverlappingEpdTiles(short tileId, int *nOverlappingEpdTiles, short *EpdTileIDs)
Definition: StBbcGeom.cxx:161
void GetTilesOfPmt(unsigned short pmtNumber, unsigned short *nTiles, unsigned short *tileNumbers)
Definition: StBbcGeom.cxx:97
unsigned short PmtOfTile(unsigned short tileNumber)
Definition: StBbcGeom.h:148
TVector3 TileCenter(short tileId)
Definition: StBbcGeom.cxx:107
void GetCorners(short tileId, double *x, double *y)
Definition: StBbcGeom.cxx:121