BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EventDisplay/BesVisLib/include/BesVisLib/MdcROOTGeo.h
Go to the documentation of this file.
1//$id$
2/*
3 * 2004/11/29 Zhengyun You Peking University
4 * Tof Geometry General for EventDisplay
5 *
6 * 2004/12/9 Zhengyun You Peking University
7 * named from TofGeo to MdcROOTGeo
8 * inherit from class SubDetectorROOTGeo
9 */
10
11#ifndef Mdc_ROOT_GEO_H
12#define Mdc_ROOT_GEO_H
13
14#include <map>
15
16#include <TGeoNode.h>
17#include <TGeoPhysicalNode.h>
18#include <TGeoVolume.h>
19
20#include "Mdc2DWire.h"
21#include "SubDetectorROOTGeo.h"
22
23/**
24 * Class MdcGeo contains all of the objects necessary to describe the
25 * mdc geometry.
26 *
27 * @author Zhengyun You \URL{mailto:youzy@hep.pku.cn}
28 *
29 */
30
31class MdcROOTGeo : public SubDetectorROOTGeo {
32public:
33 /// Constructor.
34 // Long Peixun's update: Add CGEM flag
35 MdcROOTGeo( Bool_t cgem_flag = 0 );
36
37 /// Destructor.
39
40 /// Initialize ROOTGeo from GDML.
41 void InitFromGDML( const char* gdmlFile, const char* setupName );
42
43 /// Initialize ROOTGeo from TGeoVolume logicalMdc.
44 void InitFromROOT( TGeoVolume* vol );
45
46 /// Initialize 2D Geometry
47 void Init2DGeometry();
48
49 /// Set the pointers to theirs nodes;
50 void SetNode();
51
52 /// Correct some axial layer id to copyNo;
53 int CorrectReplica( int layer, int replica );
54
55 /// Set default visual attributes;
57
58 /// Set all visible;
60
61 /// Set quater visible;
63
64 /// Set half visible;
65 void SetHalfVisible();
66
67 /// Set the pointers to the physical nodes;
69
70 /// Set default physical node attributes;
71 void SetPhysicalDefaultVis(); // Long Peixun' update: Remove annotation
72
73 /// Draw Detecor (what is detector depends on you)
74 void SetDetector();
75
76 /// Set all physicalNodes corresponding to digiCol;
77 void SetHits();
78 void SetTFire( Bool_t input );
79 void SetQFire( Bool_t input );
80 // void SetTOverflow(Bool_t input);
81 void SetQNotOverflow( Bool_t input );
82 void SetColorfulWire( Bool_t input );
83 void SetMdcTimeSubEvTime( Bool_t input );
84
85 /// Set Mdc default detector visibility;
86 void SetVisMdcDetector();
87
88 /// Set Mdc hits visibility;
89 void SetVisMdcHits();
90
91 /// Get number of segments;
92 int GetSegmentNb() { return m_kSegment; }
93
94 /// Get number of layers;
95 int GetLayerNb() { return m_kLayer; }
96
97 /// Get number of replicas on each layer;
98 int GetReplicaNb( int layer ) { return m_kReplica[layer]; }
99
100 /// Set Mdc volume, while initializing from ROOT;
101 void SetVolumeMdc( TGeoVolume* vol ) { m_Mdc = vol; }
102
103 /// Get Mdc volume;
104 TGeoVolume* GetVolumeMdc() { return m_Mdc; }
105
106 /// Get segment volume;
107 TGeoVolume* GetVolumeSegment( int segment );
108
109 /// Get layer volume;
110 TGeoVolume* GetVolumeLayer( int layer );
111
112 /// Get replica volume;
113 TGeoVolume* GetVolumeReplica( int layer );
114
115 /// Get segment node;
116 TGeoNode* GetSegment( int segment, int no );
117
118 /// Get layer node;
119 TGeoNode* GetLayer( int layer );
120
121 /// Get replica node;
122 TGeoNode* GetReplica( int layer, int replica );
123
124 /// Get segment physical node;
125 TGeoPhysicalNode* GetPhysicalSegment( int segment );
126
127 /// Get replica physical node;
128 TGeoPhysicalNode* GetPhysicalReplica( int layer, int replica );
129
130 /// Get Mdc2DWire;
131 Mdc2DWire* Get2DWire( Int_t layer, Int_t replica );
132
133 /// Trans trueLayer to simuLayer (0~42)->(0~49)
134 Int_t GetSimuLayer( Int_t trueLayer );
135
136 /// Judge whether the digiCol contains (layer, wire)
137 Bool_t IsHit( Int_t layer, Int_t wire );
138
139 /// Draw function
140 void Draw( Option_t* option );
141
142 /// Draw 2D hits
143 void DrawHits( Option_t* option );
144
145private:
146 static const int m_kSegment = 66;
147 static const int m_kStereoLayerIn = 8;
148 static const int m_kAxialLayerIn = 12;
149 static const int m_kStereoLayerOut = 16;
150 static const int m_kAxialLayerOut = 7;
151 static const int m_kLayer = 50;
152 static const int m_kTrueLayer = 43; // m_kLayer-m_kAxialLayerOut
153 static const int m_kReplicaMax = 288;
154 static const int m_kReplica[m_kLayer];
155 static const int m_kStereoDir[m_kTrueLayer];
156 static const int m_kCorrectLayer = 10;
157 static const int m_kiCorrectLayer[m_kCorrectLayer];
158 static const int m_kiCorrectReplica[m_kCorrectLayer];
159
160 // huangsh
161 static const int m_kSegmentNodeOffset = 891;
162 static const int m_kSegmentBr = 2; // Segment 1 or 2 is special
163
164 Bool_t k_TFire;
165 Bool_t k_QFire;
166 // Bool_t k_TOverflow;
167 Bool_t k_QNotOverflow;
168 Bool_t k_ColorfulWire;
169 Bool_t k_MdcTimeSubEvTime;
170
171 // Long Peixun's update: Add CGEM flags
172 int m_StartLayer; // 0 - No CGEM; 8 - Contains CGEM
173
174 static const int MDC_TIME_FACTOR = 100000;
175 static const int MDC_CHARGE_FACTOR = 1000000;
176
177 int m_MdcColor;
178 int m_segmentColor;
179 int m_hypeColor;
180 int m_tubeColor;
181 int m_twistedTubsColor;
182 int m_replicaColor;
183
184 std::map<int, int> m_CorrectMap;
185 typedef std::map<int, int> intMap;
186
187 TGeoVolume* m_Mdc;
188 TGeoNode* m_NodeLayer[m_kLayer];
189 TGeoNode* m_NodeReplica[m_kLayer][m_kReplicaMax];
190 TGeoPhysicalNode* m_PhysicalSegment[m_kSegment * 2];
191 TGeoPhysicalNode* m_PhysicalReplica[m_kLayer][m_kReplicaMax];
192
193 const TObjArray* m_MdcDigiCol;
194
195 // 2D XY
196 BesCircle2D* m_MdcXY;
197 BesCircle2D* m_MdcXYSuper[4];
198 Mdc2DWire* m_Mdc2DWire[m_kTrueLayer][m_kReplicaMax];
199
200 // 2D ZR
201 BesPolygon2D* m_MdcZR[2];
202};
203
204#endif /* Mdc_ROOT_GEO_H */
legend Draw()
TGeoNode * GetSegment(int segment, int no)
Get segment node;.
int CorrectReplica(int layer, int replica)
Correct some axial layer id to copyNo;.
void SetVolumeDefaultVis()
Set default visual attributes;.
TGeoVolume * GetVolumeLayer(int layer)
Get layer volume;.
TGeoPhysicalNode * GetPhysicalSegment(int segment)
Get segment physical node;.
int GetReplicaNb(int layer)
Get number of replicas on each layer;.
void SetQuarterVisible()
Set quater visible;.
void SetNode()
Set the pointers to theirs nodes;.
~MdcROOTGeo()
Destructor.
TGeoNode * GetLayer(int layer)
Get layer node;.
void DrawHits(Option_t *option)
Draw 2D hits.
void InitFromROOT(TGeoVolume *vol)
Initialize ROOTGeo from TGeoVolume logicalMdc.
void Init2DGeometry()
Initialize 2D Geometry.
TGeoNode * GetReplica(int layer, int replica)
Get replica node;.
TGeoVolume * GetVolumeReplica(int layer)
Get replica volume;.
TGeoVolume * GetVolumeSegment(int segment)
Get segment volume;.
void SetVisMdcHits()
Set Mdc hits visibility;.
void SetVisMdcDetector()
Set Mdc default detector visibility;.
Int_t GetSimuLayer(Int_t trueLayer)
Trans trueLayer to simuLayer (0~42)->(0~49).
Mdc2DWire * Get2DWire(Int_t layer, Int_t replica)
Get Mdc2DWire;.
void SetVolumeMdc(TGeoVolume *vol)
Set Mdc volume, while initializing from ROOT;.
void SetHalfVisible()
Set half visible;.
TGeoPhysicalNode * GetPhysicalReplica(int layer, int replica)
Get replica physical node;.
void SetPhysicalDefaultVis()
Set default physical node attributes;.
void SetPhysicalNode()
Set the pointers to the physical nodes;.
void SetAllVisible()
Set all visible;.
TGeoVolume * GetVolumeMdc()
Get Mdc volume;.
Bool_t IsHit(Int_t layer, Int_t wire)
Judge whether the digiCol contains (layer, wire).
void SetDetector()
Draw Detecor (what is detector depends on you).
void InitFromGDML(const char *gdmlFile, const char *setupName)
Initialize ROOTGeo from GDML.
void SetHits()
Set all physicalNodes corresponding to digiCol;.