00001 //$id$ 00002 /* 00003 * 2004/11/29 Zhengyun You Peking University 00004 * Tof Geometry General for EventDisplay 00005 * 00006 * 2004/12/9 Zhengyun You Peking University 00007 * named from TofGeo to MdcROOTGeo 00008 * inherit from class SubDetectorROOTGeo 00009 */ 00010 00011 #ifndef Mdc_ROOT_GEO_H 00012 #define Mdc_ROOT_GEO_H 00013 00014 #include <map> 00015 00016 #include <TGeoVolume.h> 00017 #include <TGeoNode.h> 00018 #include <TGeoPhysicalNode.h> 00019 00020 #include "SubDetectorROOTGeo.h" 00021 #include "Mdc2DWire.h" 00022 00031 class MdcROOTGeo : public SubDetectorROOTGeo 00032 { 00033 public: 00034 00036 MdcROOTGeo(); 00037 00039 ~MdcROOTGeo(); 00040 00042 void InitFromGDML( const char *gdmlFile, const char *setupName ); 00043 00045 void InitFromROOT( TGeoVolume *vol ); 00046 00048 void Init2DGeometry(); 00049 00051 void SetNode(); 00052 00054 int CorrectReplica(int layer, int replica); 00055 00057 void SetVolumeDefaultVis(); 00058 00060 void SetAllVisible(); 00061 00063 void SetQuarterVisible(); 00064 00066 void SetHalfVisible(); 00067 00069 void SetPhysicalNode(); 00070 00072 //void SetPhysicalDefaultVis(); 00073 00075 void SetDetector(); 00076 00078 void SetHits(); 00079 void SetTFire(Bool_t input); 00080 void SetQFire(Bool_t input); 00081 //void SetTOverflow(Bool_t input); 00082 void SetQNotOverflow(Bool_t input); 00083 void SetColorfulWire(Bool_t input); 00084 void SetMdcTimeSubEvTime(Bool_t input); 00085 00087 void SetVisMdcDetector(); 00088 00090 void SetVisMdcHits(); 00091 00093 int GetSegmentNb() { return m_kSegment; } 00094 00096 int GetLayerNb() { return m_kLayer; } 00097 00099 int GetReplicaNb(int layer) { return m_kReplica[layer]; } 00100 00102 void SetVolumeMdc(TGeoVolume *vol) { m_Mdc = vol; } 00103 00105 TGeoVolume *GetVolumeMdc() { return m_Mdc; } 00106 00108 TGeoVolume *GetVolumeSegment( int segment ); 00109 00111 TGeoVolume *GetVolumeLayer( int layer ); 00112 00114 TGeoVolume *GetVolumeReplica( int layer ); 00115 00117 TGeoNode *GetSegment( int segment, int no ); 00118 00120 TGeoNode *GetLayer( int layer ); 00121 00123 TGeoNode *GetReplica( int layer, int replica ); 00124 00126 TGeoPhysicalNode *GetPhysicalSegment( int segment ); 00127 00129 TGeoPhysicalNode *GetPhysicalReplica( int layer, int replica ); 00130 00132 Mdc2DWire *Get2DWire( Int_t layer, Int_t replica ); 00133 00135 Int_t GetSimuLayer(Int_t trueLayer); 00136 00138 Bool_t IsHit(Int_t layer, Int_t wire); 00139 00141 void Draw(Option_t *option); 00142 00144 void DrawHits(Option_t *option); 00145 00146 private: 00147 00148 static const int m_kSegment = 66; 00149 static const int m_kStereoLayerIn = 8; 00150 static const int m_kAxialLayerIn = 12; 00151 static const int m_kStereoLayerOut = 16; 00152 static const int m_kAxialLayerOut = 7; 00153 static const int m_kLayer = 50; 00154 static const int m_kTrueLayer = 43; // m_kLayer-m_kAxialLayerOut 00155 static const int m_kReplicaMax = 288; 00156 static const int m_kReplica[m_kLayer]; 00157 static const int m_kStereoDir[m_kTrueLayer]; 00158 static const int m_kCorrectLayer = 10; 00159 static const int m_kiCorrectLayer[m_kCorrectLayer]; 00160 static const int m_kiCorrectReplica[m_kCorrectLayer]; 00161 Bool_t k_TFire; 00162 Bool_t k_QFire; 00163 //Bool_t k_TOverflow; 00164 Bool_t k_QNotOverflow; 00165 Bool_t k_ColorfulWire; 00166 Bool_t k_MdcTimeSubEvTime; 00167 00168 static const int MDC_TIME_FACTOR = 100000; 00169 static const int MDC_CHARGE_FACTOR = 1000000; 00170 00171 int m_MdcColor; 00172 int m_segmentColor; 00173 int m_hypeColor; 00174 int m_tubeColor; 00175 int m_twistedTubsColor; 00176 int m_replicaColor; 00177 00178 std::map<int ,int> m_CorrectMap; 00179 typedef std::map<int, int> intMap; 00180 00181 TGeoVolume *m_Mdc; 00182 TGeoNode *m_NodeLayer[m_kLayer]; 00183 TGeoNode *m_NodeReplica[m_kLayer][m_kReplicaMax]; 00184 TGeoPhysicalNode *m_PhysicalSegment[m_kSegment*2]; 00185 TGeoPhysicalNode *m_PhysicalReplica[m_kLayer][m_kReplicaMax]; 00186 00187 const TObjArray *m_MdcDigiCol; 00188 00189 // 2D 00190 BesCircle2D *m_MdcXY; 00191 BesCircle2D *m_MdcXYSuper[4]; 00192 Mdc2DWire *m_Mdc2DWire[m_kTrueLayer][m_kReplicaMax]; 00193 00194 BesPolygon2D *m_MdcZR[2]; 00195 }; 00196 00197 #endif /* Mdc_ROOT_GEO_H */