BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
InstallArea/include/BesVisLib/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.
37
38 /// Destructor.
40
41 /// Initialize ROOTGeo from GDML.
42 void InitFromGDML( const char *gdmlFile, const char *setupName );
43
44 /// Initialize ROOTGeo from TGeoVolume logicalMdc.
45 void InitFromROOT( TGeoVolume *vol );
46
47 /// Initialize 2D Geometry
49
50 /// Set the pointers to theirs nodes;
51 void SetNode();
52
53 /// Correct some axial layer id to copyNo;
54 int CorrectReplica(int layer, int replica);
55
56 /// Set default visual attributes;
58
59 /// Set all visible;
61
62 /// Set quater visible;
64
65 /// Set half visible;
67
68 /// Set the pointers to the physical nodes;
70
71 /// Set default physical node attributes;
72 //void SetPhysicalDefaultVis();
73
74 /// Draw Detecor (what is detector depends on you)
76
77 /// Set all physicalNodes corresponding to digiCol;
78 void SetHits();
79 void SetTFire(Bool_t input);
80 void SetQFire(Bool_t input);
81 //void SetTOverflow(Bool_t input);
82 void SetQNotOverflow(Bool_t input);
83 void SetColorfulWire(Bool_t input);
84 void SetMdcTimeSubEvTime(Bool_t input);
85
86 /// Set Mdc default detector visibility;
88
89 /// Set Mdc hits visibility;
91
92 /// Get number of segments;
93 int GetSegmentNb() { return m_kSegment; }
94
95 /// Get number of layers;
96 int GetLayerNb() { return m_kLayer; }
97
98 /// Get number of replicas on each layer;
99 int GetReplicaNb(int layer) { return m_kReplica[layer]; }
100
101 /// Set Mdc volume, while initializing from ROOT;
102 void SetVolumeMdc(TGeoVolume *vol) { m_Mdc = vol; }
103
104 /// Get Mdc volume;
105 TGeoVolume *GetVolumeMdc() { return m_Mdc; }
106
107 /// Get segment volume;
108 TGeoVolume *GetVolumeSegment( int segment );
109
110 /// Get layer volume;
111 TGeoVolume *GetVolumeLayer( int layer );
112
113 /// Get replica volume;
114 TGeoVolume *GetVolumeReplica( int layer );
115
116 /// Get segment node;
117 TGeoNode *GetSegment( int segment, int no );
118
119 /// Get layer node;
120 TGeoNode *GetLayer( int layer );
121
122 /// Get replica node;
123 TGeoNode *GetReplica( int layer, int replica );
124
125 /// Get segment physical node;
126 TGeoPhysicalNode *GetPhysicalSegment( int segment );
127
128 /// Get replica physical node;
129 TGeoPhysicalNode *GetPhysicalReplica( int layer, int replica );
130
131 /// Get Mdc2DWire;
132 Mdc2DWire *Get2DWire( Int_t layer, Int_t replica );
133
134 /// Trans trueLayer to simuLayer (0~42)->(0~49)
135 Int_t GetSimuLayer(Int_t trueLayer);
136
137 /// Judge whether the digiCol contains (layer, wire)
138 Bool_t IsHit(Int_t layer, Int_t wire);
139
140 /// Draw function
141 void Draw(Option_t *option);
142
143 /// Draw 2D hits
144 void DrawHits(Option_t *option);
145
146 private:
147
148 static const int m_kSegment = 66;
149 static const int m_kStereoLayerIn = 8;
150 static const int m_kAxialLayerIn = 12;
151 static const int m_kStereoLayerOut = 16;
152 static const int m_kAxialLayerOut = 7;
153 static const int m_kLayer = 50;
154 static const int m_kTrueLayer = 43; // m_kLayer-m_kAxialLayerOut
155 static const int m_kReplicaMax = 288;
156 static const int m_kReplica[m_kLayer];
157 static const int m_kStereoDir[m_kTrueLayer];
158 static const int m_kCorrectLayer = 10;
159 static const int m_kiCorrectLayer[m_kCorrectLayer];
160 static const int m_kiCorrectReplica[m_kCorrectLayer];
161 Bool_t k_TFire;
162 Bool_t k_QFire;
163 //Bool_t k_TOverflow;
164 Bool_t k_QNotOverflow;
165 Bool_t k_ColorfulWire;
166 Bool_t k_MdcTimeSubEvTime;
167
168 static const int MDC_TIME_FACTOR = 100000;
169 static const int MDC_CHARGE_FACTOR = 1000000;
170
171 int m_MdcColor;
172 int m_segmentColor;
173 int m_hypeColor;
174 int m_tubeColor;
175 int m_twistedTubsColor;
176 int m_replicaColor;
177
178 std::map<int ,int> m_CorrectMap;
179 typedef std::map<int, int> intMap;
180
181 TGeoVolume *m_Mdc;
182 TGeoNode *m_NodeLayer[m_kLayer];
183 TGeoNode *m_NodeReplica[m_kLayer][m_kReplicaMax];
184 TGeoPhysicalNode *m_PhysicalSegment[m_kSegment*2];
185 TGeoPhysicalNode *m_PhysicalReplica[m_kLayer][m_kReplicaMax];
186
187 const TObjArray *m_MdcDigiCol;
188
189 // 2D
190 BesCircle2D *m_MdcXY;
191 BesCircle2D *m_MdcXYSuper[4];
192 Mdc2DWire *m_Mdc2DWire[m_kTrueLayer][m_kReplicaMax];
193
194 BesPolygon2D *m_MdcZR[2];
195};
196
197#endif /* Mdc_ROOT_GEO_H */
TGeoNode * GetSegment(int segment, int no)
Get segment node;.
void SetTFire(Bool_t input)
int GetSegmentNb()
Get number of segments;.
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;.
void SetMdcTimeSubEvTime(Bool_t input)
~MdcROOTGeo()
Destructor.
MdcROOTGeo()
Constructor.
TGeoNode * GetLayer(int layer)
Get layer node;
void SetQFire(Bool_t input)
void SetQNotOverflow(Bool_t input)
void DrawHits(Option_t *option)
Draw 2D hits.
void SetColorfulWire(Bool_t input)
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 Draw(Option_t *option)
Draw function.
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 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()
Set default physical node attributes;.
void InitFromGDML(const char *gdmlFile, const char *setupName)
Initialize ROOTGeo from GDML.
void SetHits()
Set all physicalNodes corresponding to digiCol;.