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