105 for (UInt_t iLad = 0; iLad <
fLadders.size(); iLad++) {
124 TGeoPhysicalNode* sensorNode = sensor->
GetPnode();
126 Double_t local[3] = {0., 0., 0.};
128 sensorNode->GetMatrix()->LocalToMaster(local, global);
139 TGeoBBox* sBox =
dynamic_cast<TGeoBBox*
>(sensorNode->GetShape());
140 if (!sBox) LOG(fatal) << GetName() <<
": sensor shape is not a box!";
141 Double_t sD = 2. * sBox->GetDZ();
199 TGeoBBox* box =
dynamic_cast<TGeoBBox*
>(
fNode->GetShape());
200 if (!box) LOG(fatal) << GetName() <<
": shape is not box! ";
201 Double_t local[3] = {0., 0., 0.};
203 fNode->GetMatrix()->LocalToMaster(local, global);
204 fXmin = global[0] - box->GetDX();
205 fXmax = global[0] + box->GetDX();
206 fYmin = global[1] - box->GetDY();
207 fYmax = global[1] + box->GetDY();
215 TGeoVolumeAssembly* statVol =
new TGeoVolumeAssembly(
"myStation");
216 for (UInt_t iLadder = 0; iLadder <
fLadders.size(); iLadder++) {
217 TGeoVolume* ladVol =
fLadders.at(iLadder)->GetPnode()->GetVolume();
218 TGeoHMatrix* ladMat =
fLadders.at(iLadder)->GetPnode()->GetMatrix();
219 statVol->AddNode(ladVol, iLadder, ladMat);
221 statVol->GetShape()->ComputeBBox();
222 TGeoBBox* statShape =
dynamic_cast<TGeoBBox*
>(statVol->GetShape());
223 const Double_t* origin = statShape->GetOrigin();
224 fXmin = origin[0] - statShape->GetDX();
225 fXmax = origin[0] + statShape->GetDX();
226 fYmin = origin[1] - statShape->GetDY();
227 fYmax = origin[1] + statShape->GetDY();
236 if (
fDiffSensorD) LOG(warn) << GetName() <<
": Different values for sensor thickness!";
243 Double_t unitLocal[3] = {1., 0., 0.};
244 Double_t unitGlobal[3];
245 sensorNode->GetMatrix()->LocalToMaster(unitLocal, unitGlobal);
247 Double_t* translation = sensorNode->GetMatrix()->GetTranslation();
248 unitGlobal[0] -= translation[0];
249 unitGlobal[1] -= translation[1];
250 unitGlobal[2] -= translation[2];
252 fSensorRot = atan2(unitGlobal[1], unitGlobal[0]);