00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef Emc_ROOT_GEO_H
00015 #define Emc_ROOT_GEO_H
00016
00017 #include <TGeoVolume.h>
00018 #include <TGeoNode.h>
00019 #include <TGeoPhysicalNode.h>
00020
00021 #include "SubDetectorROOTGeo.h"
00022 #include "Emc2DCrystal.h"
00023
00032 class EmcROOTGeo : public SubDetectorROOTGeo
00033 {
00034 public:
00035
00037 EmcROOTGeo();
00038
00040 ~EmcROOTGeo();
00041
00043 void InitFromGDML( const char *gdmlFile, const char *setupName );
00044
00046 void InitFromROOT( TGeoVolume *vol );
00047
00049 void Init2DGeometry();
00050
00052 void SetNode();
00053
00055 void SetVolumeAppendInVis();
00056
00058 void SetVolumeDefaultVis();
00059
00061 void SetAllVisible();
00062
00064 void SetQuarterVisible();
00065
00067 void SetHalfVisible();
00068
00070 void SetNoEndVisible();
00071
00073 void SetPhysicalNode();
00074
00076
00077
00079 void SetDetector();
00080
00082 void SetHits();
00083
00085 void SetVisEmcDetector();
00086
00088 void SetVisEmcHits();
00089
00091 int GetPartNb();
00092
00094 int GetThetaNb(int part);
00095
00097 int GetPhiNb(int part, int theta);
00098
00100 void SetVolumeEmc(TGeoVolume *vol) { m_Emc = vol; }
00101
00103 TGeoVolume *GetVolumeEmc() { return m_Emc; }
00104
00106 TGeoVolume *GetVolumePart( int part );
00107
00109 TGeoVolume *GetVolumePhi( int part, int phi );
00110
00112 TGeoVolume *GetVolumeTheta( int part, int phi, int theta );
00113
00115 TGeoVolume *GetVolumeCrystal( int part, int phi, int theta );
00116
00118 TGeoNode *GetPart( int part );
00119
00121 TGeoNode *GetPhi( int part, int phi );
00122
00124 TGeoNode *GetTheta( int part, int phi, int theta );
00125
00127 TGeoNode *GetTheta2( int part, int phi, int theta );
00128
00130 TGeoNode *GetCrystal( int part, int phi, int theta );
00131
00133 TGeoNode *GetCrystal2( int part, int phi, int theta );
00134
00136 TGeoPhysicalNode *GetPhysicalCrystal( int part, int phi, int theta);
00137
00139 TGeoPhysicalNode *GetPhysicalCrystal2( int part, int phi, int theta);
00140
00142 bool HasTwoNodes( int part, int phi, int theta );
00143
00145 void ComputeThetaPhi( int id, int sector, int nb, int &CryNumberTheta, int &CryNumberPhi);
00146
00148 int ComputeEndCopyNb(int num);
00149
00151 Emc2DCrystal *Get2DCrystal( Int_t part, Int_t phi, Int_t theta );
00152
00154 Int_t GetPart(TGeoPhysicalNode* phyNode);
00155
00157 void Draw(Option_t *option);
00158
00160 void DrawHits(Option_t *option);
00161
00163 void Align(TGeoPhysicalNode *phyNode, TGeoMatrix *newmat=0, TGeoShape *newshape=0, Bool_t check=kFALSE);
00164
00166 void RestorePhyNode(TGeoPhysicalNode *phyNode, TGeoNode *node);
00167
00168 private:
00169 static const int m_kPart = 3;
00170 static const int m_kPhiBr = 120;
00171 static const int m_kThetaBr = 44;
00172
00173 int m_kPhiEc;
00174 int m_kThetaEc;
00175 int m_kSectorEc;
00176 int m_kNbEc;
00177 int m_kRealNbEc;
00178
00179 int m_EmcColor;
00180 int m_partColor;
00181 int m_phiColor;
00182 int m_thetaColor;
00183 int m_brCrystalColor;
00184 int m_ecCrystalColor;
00185
00186 static const int EMC_TIME_FACTOR = 1;
00187 static const int EMC_CHARGE_FACTOR = 1000;
00188
00189 TGeoVolume *m_Emc;
00190 TGeoNode *m_NodePart[m_kPart];
00191 TGeoNode *m_NodePhi[m_kPart][m_kPhiBr];
00192 TGeoNode *m_NodeTheta[m_kPart][m_kPhiBr][m_kThetaBr];
00193 TGeoNode *m_NodeTheta2[m_kPart][m_kPhiBr][m_kThetaBr];
00194 TGeoPhysicalNode *m_PhysicalCrystal[m_kPart][m_kPhiBr][m_kThetaBr];
00195 TGeoPhysicalNode *m_PhysicalCrystal2[m_kPart][m_kPhiBr][m_kThetaBr];
00196
00197 TObjArray *m_PhyNodeOrgArray;
00198
00199
00200
00201
00202
00203 const TObjArray *m_EmcDigiCol;
00204
00205
00206 Emc2DCrystal *m_Emc2DCrystal[m_kPart][m_kPhiBr][m_kThetaBr];
00207
00208 };
00209
00210 #endif