34 for (
int part = 0; part < m_kPart; part++) {
35 for (
int phi = 0; phi < m_kPhiBr; phi++) {
36 for (
int theta = 0; theta < m_kThetaBr; theta++) {
37 m_NodeTheta[part][phi][theta] = 0;
38 m_PhysicalCrystal[part][phi][theta] = 0;
43 string GdmlManagementPath = getenv(
"GDMLMANAGEMENTROOT");
44 if (GdmlManagementPath ==
"") cout <<
"EmcROOTGeo::GdmlManagementPath not set!" << endl;
45 string GdmlFile = GdmlManagementPath + string(
"/dat/Emc.gdml");
46 cout <<
"Construct Emc from GdmlFile " << GdmlFile << endl;
70 if(!m_Emc) std::cout <<
"m_Emc = 0" << std::endl;
71 else cout<<
"Find logicalEMC!"<<endl;
73 for (
int part = 0; part < m_kPart; part++) {
76 int nPhi = (part == 1 ? m_kPhiBr : m_kPhiEc);
78 for (
int phi = 0; phi <
nPhi; phi++) {
80 int nTheta = (part == 1 ? 219 : m_kThetaEc);
81 TGeoNode *nodePhi =
GetPhi(part,phi);
84 for (
int theta = 0; theta < nTheta; theta++) {
85 string name = nodePhi->GetDaughter(theta)->GetName();
88 if(name.find(
"BSCCasing",0)==7) {
89 strthe = name.substr(16,2);
90 }
else if(name.find(
"EndCasing",0)==7) {
91 strthe = name.substr(19,2);
94 istringstream thetaBuf(strthe);
98 m_NodeTheta[part][phi][nthe] = nodePhi->GetDaughter(theta);
114 int brCrystalColor = 4;
115 int ecCrystalColor = 7;
117 m_Emc->SetLineColor(emcColor);
118 m_Emc->SetVisibility(0);
120 for (
int part = 0; part < m_kPart-1; part++) {
122 int nPhi = (part == 1 ? m_kPhiBr : m_kPhiEc);
123 for (
int phi = 0; phi <
nPhi; phi++) {
128 for (
int theta = 0; theta < m_kThetaBr; theta++) {
135 else if (part == 0) {
136 int iPhi[4] = {0,6,8,7};
137 for (
int i = 0; i < 4; i++) {
139 int nTheta = (part == 1 ? m_kThetaBr : m_kThetaEc);
140 for (
int theta = 0; theta < nTheta; theta++) {
150 for (
int part = 0; part < m_kPart; part++) {
151 GetPart(part)->SetVisibility(0);
152 int nPhi = (part == 1 ? m_kPhiBr : m_kPhiEc);
153 for (
int phi = 0; phi <
nPhi; phi++) {
154 GetPhi(part, phi)->SetVisibility(0);
155 int nTheta = (part == 1 ? m_kThetaBr : m_kThetaEc);
156 for (
int theta = 0; theta < nTheta; theta++) {
157 GetTheta(part, phi, theta)->SetVisibility(0);
158 GetCrystal(part, phi, theta)->SetVisibility(0);
193 for (
int part = 0; part < m_kPart; part++) {
194 GetPart(part)->SetVisibility(0);
195 int nPhi = (part == 1 ? m_kPhiBr : m_kPhiEc);
196 for (
int phi = 0; phi <
nPhi; phi++) {
197 GetPhi(part, phi)->SetVisibility(0);
198 int nTheta = (part == 1 ? m_kThetaBr : m_kThetaEc);
199 for (
int theta = 0; theta < nTheta; theta++) {
200 GetTheta(part, phi, theta)->SetVisibility(0);
201 GetCrystal(part, phi, theta)->SetVisibility(1);
233 for (
int part = 0; part < m_kPart; part++) {
234 GetPart(part)->SetVisibility(0);
235 int nPhi = (part == 1 ? m_kPhiBr : m_kPhiEc);
236 for (
int phi = 0; phi <
nPhi; phi++) {
237 GetPhi(part, phi)->SetVisibility(0);
238 int nTheta = (part == 1 ? m_kThetaBr : m_kThetaEc);
239 for (
int theta = 0; theta < nTheta; theta++) {
240 GetTheta(part, phi, theta)->SetVisibility(0);
241 if ( (part == 1 && (phi >= 0 && phi <
nPhi/4)) ||
243 GetCrystal(part, phi, theta)->SetVisibility(1);
246 GetCrystal(part, phi, theta)->SetVisibility(0);
260 if (gGeoManager == 0) std::cout <<
"Create gGeoManager first" << std::endl;
261 else cout<<
"gGeoManager success!"<<endl;
264 if(!volEmc) std::cout <<
"logicalEMC not found !" << std::endl;
269 TGeoIdentity *identity =
new TGeoIdentity();
271 TGeoMaterial *mat =
new TGeoMaterial(
"VOID",0,0,0);
272 TGeoMedium *med =
new TGeoMedium(
"MED",1,mat);
273 TGeoVolume *m_Bes = gGeoManager->MakeBox(
"volBes", med,
274 0.5*m_BesR, 0.5*m_BesR, 0.5*m_BesZ);
275 gGeoManager->SetTopVolume(m_Bes);
276 m_Bes->AddNode(volEmc, 0, identity);
280 gGeoManager->SetDrawExtraPaths();
281 gGeoManager->CloseGeometry();
282 gGeoManager->SetNsegments(20);
285 TGeoNode *
bes = gGeoManager->GetTopNode();
286 TGeoNode *emc =
bes->GetDaughter(0);
288 for (
int part = 0; part < m_kPart; part++) {
289 TGeoNode *nodePart =
GetPart(part);
290 int nPhi = (part == 1 ? m_kPhiBr : m_kPhiEc);
291 for (
int phi = 0; phi <
nPhi; phi++) {
292 TGeoNode *nodePhi =
GetPhi(part, phi);
293 int nTheta = (part == 1 ? m_kThetaBr : m_kThetaEc);
294 for (
int theta = 0; theta < nTheta; theta++) {
296 TGeoNode *nodeTheta =
GetTheta(part, phi, theta);
297 TGeoNode *nodeCrystal =
GetCrystal(part, phi, theta);
298 TString strPath = TString(
"/") +
bes->GetName() +
299 TString(
"/") + emc->GetName() +
300 TString(
"/") + nodePart->GetName() +
301 TString(
"/") + nodePhi->GetName() +
302 TString(
"/") + nodeTheta->GetName() +
303 TString(
"/") + nodeCrystal->GetName();
304 m_PhysicalCrystal[part][phi][theta] = gGeoManager->MakePhysicalNode(strPath);