CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
CgemGeomSvc.h
Go to the documentation of this file.
1// length unit is mm
2
3#ifndef CGEMGEOMSVC_H
4#define CGEMGEOMSVC_H
5
6#include <CLHEP/Units/PhysicalConstants.h>
7#include <CLHEP/Geometry/Point3D.h>
8#include <vector>
9#include <iostream>
10#include <string>
11
12#include "GaudiKernel/Algorithm.h"
13#include "GaudiKernel/Property.h"
14#include "GaudiKernel/MsgStream.h"
15
16#include "GaudiKernel/IIncidentListener.h"
17#include "GaudiKernel/Service.h"
18#include "GaudiKernel/IInterface.h"
20#include "GaudiKernel/IDataProviderSvc.h"
21#include "GaudiKernel/IIncidentListener.h"
22
23#include "CLHEP/Vector/ThreeVector.h"
24
25class CgemGeomSvc : public Service, virtual public ICgemGeomSvc, virtual public IIncidentListener{
26
27 public:
28 CgemGeomSvc(const std::string& name, ISvcLocator* pSvcLocator);
29 ~CgemGeomSvc();
30
31 virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvUnknown);
32 virtual StatusCode initialize();
33 virtual StatusCode finalize();
34 void handle(const Incident& inc);
35 bool initGeom();
36
37 void readAlignPar();
38
39 /* Information of Cgem */
40 double getInnerROfCgem() const {return m_R_i_Cgem;}
41 double getOuterROfCgem() const {return m_R_o_Cgem;}
42 double getLengthOfCgem() const {return m_L_Cgem;}
43
44 /* Information of CgemLayer */
45 int getNumberOfCgemLayer() const {return m_N_CgemLayer ;}
46 int getNumberOfCgemFoil() const {return m_N_GemFoil ;}
47 double getThicknessOfCgemLayer(int i) const {return m_T_CgemLayer[i] ;}
48 CgemGeoLayer* getCgemLayer(int i) const {return m_CgemLayer[i];}
49
50 double getThicknessOfGapD(int i) const {return m_T_Gap_D[i] ;}
51 double getThicknessOfCathode(int i) const {return m_T_Cathode[i] ;}
52 double getThicknessOfAnode(int i) const {return m_T_Anode[i] ;}
53
54 CgemGeoReadoutPlane* getReadoutPlane(int iLayer, int iSheet) const;
55 /* information about strip description */
56 bool isXStripDescriptionOn() const {return m_B_strip_x_on; }
57 bool isVStripDescriptionOn() const {return m_B_strip_v_on; }
58
59 void setDensityOfCable(double rho) {m_Rho_Cable = rho;}
60 double getDensityOfCable() const {return m_Rho_Cable;}
61 string getMaterialOfCgemFoil(int i) const {return nmg_Materials[i+1];}
62 string getMaterialOfCathode(int i) const {return nmc_Materials[i+1];}
63 string getMaterialOfAnode(int i) const {return nma_Materials[i+1];}
64
65 /* Information of CGEM/MDC Separator */
66 CgemGeoSeparator* getCgemSeparator() const {return m_CgemSeparator;}
67
68 /* get Alignment pointer */
69 CgemGeoAlign* getAlignPtr() const{ return m_align; }
70
71 /* get the pointer of mid-drift plane */
72 CgemMidDriftPlane* getMidDriftPtr() const{ return m_midDrift; }
73
74 bool isPassive() const { return m_passive; }
75 bool isEffDensityHoles() const {return m_effDensityHoles;}
76 bool isEffDensityStrips() const {return m_effDensityStrips;}
77
78 static const int NLAYER_MAX = 3;
79 static const int NFOIL_MAX = 3;
80 static const int NSHEET_MAX = 2;
81 static const int N_MATERIAL_MAX = 30;
82 static const int NMATERIALS_CATHODE = 14;
83 static const int NMATERIALS_ANODE = 20;
84 static const int NMATERIALS_FOIL = 3;
87 int getNMaterialsFoil() const {return NMATERIALS_FOIL;}
88
89 private:
90 int m_iFile;
91 bool m_debugCout;
92 bool m_testReadoutPlane;
93 /* std::string m_geomFile; */
94 std::string m_alignFile;
95 CgemGeoAlign* m_align;
96 CgemMidDriftPlane* m_midDrift;
97
98 /* passive elements on/off */
99 bool m_passive;
100
101 /* Information of Cgem */
102 double m_R_i_Cgem, m_R_o_Cgem, m_L_Cgem;
103 string nmc_Materials[NMATERIALS_CATHODE+1];
104 string nma_Materials[NMATERIALS_ANODE+1];
105 string nmg_Materials[NMATERIALS_FOIL+1];
106
107 double m_T_Gap_D[NLAYER_MAX] ;
108 double m_T_Cathode[NLAYER_MAX] ;
109 double m_T_Anode[NLAYER_MAX] ;
110
111 /* Information of CgemLayer */
112 int m_N_CgemLayer ;
113 int m_N_GemFoil ;
114 double m_T_CgemLayer[NLAYER_MAX] ;
115 CgemGeoLayer* m_CgemLayer[NLAYER_MAX];
117 CgemGeoSeparator *m_CgemSeparator;
118
119
120 /* Orientation
121 0 = straight
122 1 = reversed */
123 bool m_Orientation;
124 bool m_effDensityHoles;
125 bool m_effDensityStrips;
126
127
128 /* Do we want to use the strip description in the anode? */
129 bool m_B_strip_x_on;
130 bool m_B_strip_v_on;
131 CgemGeoReadoutPlane* m_ReadoutPlane[NLAYER_MAX][NSHEET_MAX];
132 void TestReadoutPlane();
133 /** density of cables
134 taking into account fill factor and weight/volume of HV, LV, signal cables
135 **/
136 double m_Rho_Cable;
137
138};
139
140inline CgemGeoReadoutPlane* CgemGeomSvc::getReadoutPlane(int iLayer, int iSheet) const {
141 if( (iLayer<NLAYER_MAX) && (iSheet<NSHEET_MAX) ) return m_ReadoutPlane[iLayer][iSheet];
142 else return 0;
143}
144
145
146#endif /* CGEMGEOMSVC_H */
int getNumberOfCgemFoil() const
Definition CgemGeomSvc.h:46
static const int NMATERIALS_CATHODE
Definition CgemGeomSvc.h:82
bool isVStripDescriptionOn() const
Definition CgemGeomSvc.h:57
static const int NMATERIALS_ANODE
Definition CgemGeomSvc.h:83
bool isXStripDescriptionOn() const
Definition CgemGeomSvc.h:56
string getMaterialOfAnode(int i) const
Definition CgemGeomSvc.h:63
bool isEffDensityHoles() const
Definition CgemGeomSvc.h:75
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvUnknown)
double getThicknessOfCathode(int i) const
Definition CgemGeomSvc.h:51
double getThicknessOfAnode(int i) const
Definition CgemGeomSvc.h:52
void setDensityOfCable(double rho)
Definition CgemGeomSvc.h:59
double getThicknessOfCgemLayer(int i) const
Definition CgemGeomSvc.h:47
void handle(const Incident &inc)
static const int N_MATERIAL_MAX
Definition CgemGeomSvc.h:81
string getMaterialOfCathode(int i) const
Definition CgemGeomSvc.h:62
int getNMaterialsFoil() const
Definition CgemGeomSvc.h:87
virtual StatusCode finalize()
CgemGeoLayer * getCgemLayer(int i) const
Definition CgemGeomSvc.h:48
double getDensityOfCable() const
Definition CgemGeomSvc.h:60
CgemGeomSvc(const std::string &name, ISvcLocator *pSvcLocator)
double getLengthOfCgem() const
Definition CgemGeomSvc.h:42
static const int NMATERIALS_FOIL
Definition CgemGeomSvc.h:84
int getNumberOfCgemLayer() const
Definition CgemGeomSvc.h:45
bool isPassive() const
Definition CgemGeomSvc.h:74
double getOuterROfCgem() const
Definition CgemGeomSvc.h:41
static const int NLAYER_MAX
Definition CgemGeomSvc.h:78
CgemGeoReadoutPlane * getReadoutPlane(int iLayer, int iSheet) const
double getInnerROfCgem() const
Definition CgemGeomSvc.h:40
CgemGeoSeparator * getCgemSeparator() const
Definition CgemGeomSvc.h:66
virtual StatusCode initialize()
double getThicknessOfGapD(int i) const
Definition CgemGeomSvc.h:50
int getNMaterialsAnode() const
Definition CgemGeomSvc.h:86
static const int NSHEET_MAX
Definition CgemGeomSvc.h:80
string getMaterialOfCgemFoil(int i) const
Definition CgemGeomSvc.h:61
void readAlignPar()
bool isEffDensityStrips() const
Definition CgemGeomSvc.h:76
CgemMidDriftPlane * getMidDriftPtr() const
Definition CgemGeomSvc.h:72
CgemGeoAlign * getAlignPtr() const
Definition CgemGeomSvc.h:69
int getNMaterialsCathode() const
Definition CgemGeomSvc.h:85
static const int NFOIL_MAX
Definition CgemGeomSvc.h:79