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