CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
EventDisplay/BesVisLib/BesVisLib-00-06-08/BesVisLib/EmcROOTGeo.h
Go to the documentation of this file.
1//$id$
2/*
3 * 2004/11/29 Zhengyun You Peking University
4 * Emc Geometry General for EventDisplay
5 *
6 * 2004/12/11 Zhengyun You Peking University
7 * named from EmcGeo to EmcROOTGeo
8 * inherit from class SubDetectorROOTGeo
9 *
10 * 2005/04/04 Zhengyun You Peking University
11 * Emc End geometry added
12 */
13
14#ifndef Emc_ROOT_GEO_H
15#define Emc_ROOT_GEO_H
16
17#include <TGeoVolume.h>
18#include <TGeoNode.h>
19#include <TGeoPhysicalNode.h>
20
21#include "SubDetectorROOTGeo.h"
22#include "Emc2DCrystal.h"
23
24/**
25 * Class EmcGeo contains all of the objects necessary to describe the
26 * emc geometry.
27 *
28 * @author Zhengyun You \URL{mailto:[email protected]}
29 *
30 */
31
32class EmcROOTGeo : public SubDetectorROOTGeo
33{
34 public:
35
36 /// Constructor.
38
39 /// Destructor.
41
42 /// Initialize ROOTGeo from GDML.
43 void InitFromGDML( const char *gdmlFile, const char *setupName );
44
45 /// Initialize ROOTGeo from TGeoVolume logicalEmc.
46 void InitFromROOT( TGeoVolume *vol );
47
48 /// Initialize 2D Geometry
49 void Init2DGeometry();
50
51 /// Set the pointers to theirs nodes;
52 void SetNode();
53
54 /// Set default visual attributes;
56
57 /// Set default visual attributes;
59
60 /// Set all visible;
62
63 /// Set quater visible;
65
66 /// Set half visible;
67 void SetHalfVisible();
68
69 /// Set noend visible;
70 void SetNoEndVisible();
71
72 /// Set the pointers to the physical nodes;
74
75 /// Set default physical node attributes;
76 void SetPhysicalDefaultVis(); //Long Peixun's update: Remove annotation
77
78 /// Set Detecor (what is detector depends on you)
79 void SetDetector();
80
81 /// Set all physicalNodes corresponding to digiCol;
82 void SetHits();
83
84 //Long Peixun's update: clear all hits
85 void ClearHits();
86
87 /// Set Emc detector visibility;
88 void SetVisEmcDetector();
89
90 /// Set Emc hits visibility;
91 void SetVisEmcHits();
92
93 /// Get number of part;
94 int GetPartNb();
95
96 /// Get number of theta on part;
97 int GetThetaNb(int part);
98
99 /// Get number of phi on part;
100 int GetPhiNb(int part, int theta);
101
102 /// Set Emc volume, while initializing from ROOT;
103 void SetVolumeEmc(TGeoVolume *vol) { m_Emc = vol; }
104
105 /// Get Emc volume;
106 TGeoVolume *GetVolumeEmc() { return m_Emc; }
107
108 /// Get part volume;
109 TGeoVolume *GetVolumePart( int part );
110
111 /// Get phi volume;
112 TGeoVolume *GetVolumePhi( int part, int phi );
113
114 /// Get theta volume;
115 TGeoVolume *GetVolumeTheta( int part, int phi, int theta );
116
117 /// Get crystal volume;
118 TGeoVolume *GetVolumeCrystal( int part, int phi, int theta );
119
120 /// Get part node;
121 TGeoNode *GetPart( int part );
122
123 /// Get phi node;
124 TGeoNode *GetPhi( int part, int phi );
125
126 /// Get theta node;
127 TGeoNode *GetTheta( int part, int phi, int theta );
128
129 /// Get theta2 node;
130 TGeoNode *GetTheta2( int part, int phi, int theta );
131
132 /// Get crystal one;
133 TGeoNode *GetCrystal( int part, int phi, int theta );
134
135 /// Get crystal2 one;
136 TGeoNode *GetCrystal2( int part, int phi, int theta );
137
138 /// Get crystal physical node; all part,phi,theta has a physicalNode
139 TGeoPhysicalNode *GetPhysicalCrystal( int part, int phi, int theta);
140
141 /// Get crystal physical node2; EC nb 5,6,14,15,16 in any sector has two physicalNode
142 TGeoPhysicalNode *GetPhysicalCrystal2( int part, int phi, int theta);
143
144 /// Whether this id is combined of two nodes
145 bool HasTwoNodes( int part, int phi, int theta );
146
147 /// Compute theta, phi from sector, nb
148 void ComputeThetaPhi( int id, int sector, int nb, int &CryNumberTheta, int &CryNumberPhi);
149
150 /// Compute copyNb, copyNb 5,6,14,15,16 corresponding to two volume
151 int ComputeEndCopyNb(int num);
152
153 /// Get Emc2DCrystal;
154 Emc2DCrystal *Get2DCrystal( Int_t part, Int_t phi, Int_t theta );
155
156 /// Get part no of a crystal physcial node
157 Int_t GetPart(TGeoPhysicalNode* phyNode);
158
159 /// Draw function
160 void Draw(Option_t *option);
161
162 /// Draw 2D hits
163 void DrawHits(Option_t *option);
164
165 /// Align a physical node, change its position and shape
166 void Align(TGeoPhysicalNode *phyNode, TGeoMatrix *newmat=0, TGeoShape *newshape=0, Bool_t check=kFALSE);
167
168 /// Restore the physical node to original shape
169 void RestorePhyNode(TGeoPhysicalNode *phyNode, TGeoNode *node);
170
171 private:
172 static const int m_kPart = 3;
173 static const int m_kPhiBr = 120;
174 static const int m_kThetaBr = 44;
175
176 int m_kPhiEc;
177 int m_kThetaEc;
178 int m_kSectorEc;
179 int m_kNbEc;
180 int m_kRealNbEc;
181
182 int m_EmcColor;
183 int m_partColor;
184 int m_phiColor;
185 int m_thetaColor;
186 int m_brCrystalColor;
187 int m_ecCrystalColor;
188
189 static const int EMC_TIME_FACTOR = 1;
190 static const int EMC_CHARGE_FACTOR = 1000;
191
192 TGeoVolume *m_Emc;
193 TGeoNode *m_NodePart[m_kPart];
194 TGeoNode *m_NodePhi[m_kPart][m_kPhiBr];
195 TGeoNode *m_NodeTheta[m_kPart][m_kPhiBr][m_kThetaBr]; // m_kPhiBr > m_kPhiEc, m_kThetaBr > m_kThetaEc
196 TGeoNode *m_NodeTheta2[m_kPart][m_kPhiBr][m_kThetaBr]; // contains theta phi has tow nodes
197 TGeoPhysicalNode *m_PhysicalCrystal[m_kPart][m_kPhiBr][m_kThetaBr];
198 TGeoPhysicalNode *m_PhysicalCrystal2[m_kPart][m_kPhiBr][m_kThetaBr];
199
200 TObjArray *m_PhyNodeOrgArray;
201
202 // Volume refer to logicalVolume, only refer to the one exists.
203 // Node refer to physicalVolume, each real theta has a corresponding physical volume, althought they may be the same one.
204 // PhysicalNode gives the path combined by physical volume, it's unique for each real theta.
205
206 const TObjArray *m_EmcDigiCol;
207
208 // 2D
209 Emc2DCrystal *m_Emc2DCrystal[m_kPart][m_kPhiBr][m_kThetaBr];
210
211};
212
213#endif /* Emc_ROOT_GEO_H */
TGeoVolume * GetVolumeCrystal(int part, int phi, int theta)
Get crystal volume;.
int ComputeEndCopyNb(int num)
Compute copyNb, copyNb 5,6,14,15,16 corresponding to two volume.
void SetVisEmcDetector()
Set Emc detector visibility;.
TGeoNode * GetCrystal(int part, int phi, int theta)
Get crystal one;.
TGeoVolume * GetVolumeTheta(int part, int phi, int theta)
Get theta volume;.
TGeoNode * GetTheta(int part, int phi, int theta)
Get theta node;.
int GetPartNb()
Get number of part;.
void SetPhysicalDefaultVis()
Set default physical node attributes;.
TGeoVolume * GetVolumePart(int part)
Get part volume;.
TGeoNode * GetCrystal2(int part, int phi, int theta)
Get crystal2 one;.
void Align(TGeoPhysicalNode *phyNode, TGeoMatrix *newmat=0, TGeoShape *newshape=0, Bool_t check=kFALSE)
Align a physical node, change its position and shape.
void ComputeThetaPhi(int id, int sector, int nb, int &CryNumberTheta, int &CryNumberPhi)
Compute theta, phi from sector, nb.
TGeoNode * GetPart(int part)
Get part node;.
~EmcROOTGeo()
Destructor.
Emc2DCrystal * Get2DCrystal(Int_t part, Int_t phi, Int_t theta)
Get Emc2DCrystal;.
TGeoPhysicalNode * GetPhysicalCrystal2(int part, int phi, int theta)
Get crystal physical node2; EC nb 5,6,14,15,16 in any sector has two physicalNode.
int GetPhiNb(int part)
Get number of phi on part;.
void InitFromROOT(TGeoVolume *vol)
Initialize ROOTGeo from TGeoVolume logicalEmc.
void SetAllVisible()
Set all visible;.
TGeoVolume * GetVolumePhi(int part, int phi)
Get phi volume;
void InitFromGDML(const char *gdmlFile, const char *setupName)
Initialize ROOTGeo from GDML.
EmcROOTGeo()
Constructor.
void SetPhysicalNode()
Set the pointers to the physical nodes;.
void SetVolumeAppendInVis()
Set default visual attributes;.
void SetNode()
Set the pointers to theirs nodes;.
int GetThetaNb(int part)
Get number of theta on part;.
bool HasTwoNodes(int part, int phi, int theta)
Whether this id is combined of two nodes.
TGeoNode * GetPhi(int part, int phi)
Get phi node;.
void RestorePhyNode(TGeoPhysicalNode *phyNode, TGeoNode *node)
Restore the physical node to original shape.
TGeoPhysicalNode * GetPhysicalCrystal(int part, int phi, int theta)
Get crystal physical node; all part,phi,theta has a physicalNode.
TGeoNode * GetTheta2(int part, int phi, int theta)
Get theta2 node;.
void SetDetector()
Set Detecor (what is detector depends on you)
void SetVolumeEmc(TGeoVolume *vol)
Set Emc volume, while initializing from ROOT;.
void SetVolumeDefaultVis()
Set default visual attributes;.
void SetQuarterVisible()
Set quater visible;.
void SetHits()
Set all physicalNodes corresponding to digiCol;.
int num[96]
Definition: ranlxd.c:373
c1_1 Draw()