99 std::cout << std::endl;
103 if (!fgeoName.EndsWith(
".geo.root")) {
104 LOG(info) << GetName() <<
": geometry file is " << fgeoName;
105 LOG(fatal) << GetName() <<
": only ROOT geometry files are supported!";
108 LOG(info) << GetName() <<
": Constructing geometry from " << fgeoName;
109 ConstructRootGeometry();
113 LOG(info) << GetName() <<
": Constructing geometry...";
116 TGeoManager* geoMan = gGeoManager;
120 TGeoElement* targElem = NULL;
122 targElem = geoMan->GetElementTable()->GetElement(
fZ);
124 LOG(fatal) << GetName() <<
": Unknown element " <<
fZ;
130 targElem = geoMan->GetElementTable()->FindElement(
fMaterial.Data());
132 LOG(fatal) << GetName() <<
": Unknown element " <<
fMaterial;
137 LOG(fatal) << GetName() <<
": Target material not specified!";
140 LOG(info) << GetName() <<
": Use material " <<
fMaterial <<
", z = " <<
fZ;
145 LOG(fatal) << GetName() <<
": No standard density for element " <<
fMaterial
146 <<
" available: density must be set explicitly.";
149 LOG(info) << GetName() <<
": Density " <<
fDensity;
152 TGeoMaterial* targMat =
new TGeoMaterial(
"targetMaterial", targElem,
fDensity);
153 if (fair::Logger::Logging(
"DEBUG")) targMat->Print();
155 TGeoMedium* targMedium =
new TGeoMedium(
"targetMedium", 9999, targMat);
156 targMedium->SetParam(0, 1.);
157 targMedium->SetParam(1, 1.);
158 targMedium->SetParam(2, 20.);
159 targMedium->SetParam(6, 0.001);
164 LOG(fatal) << GetName() <<
": No mother node found at target position!";
167 LOG(info) << GetName() <<
": Mother node is " << motherNode->GetName();
174 TGeoHMatrix r1 = geoMan->GetCurrentMatrix()->Inverse();
176 TGeoRotation* target_rotation =
new TGeoRotation();
177 target_rotation->RotateY(
fRotY * TMath::RadToDeg());
178 TGeoHMatrix* targetMatrix =
new TGeoHMatrix(
"targetToGlobal");
179 *targetMatrix = r1 * r2 * *target_rotation;
182 TGeoVolume* target = geoMan->MakeTube(
"target", targMedium, 0.,
fDiameter / 2.,
fThickness / 2.);
183 motherNode->GetVolume()->AddNode(target, 0, targetMatrix);
187 LOG(debug) << GetName() <<
": Test node is " << testNode->GetName();
188 TGeoHMatrix* testMatrix = geoMan->GetCurrentMatrix();
189 if (fair::Logger::Logging(
"DEBUG")) testMatrix->Print();
191 std::cout << std::endl;