96 if (!forced && !mStrips.empty())
100 TString stripName, pathTOF =
"/cave_1/TOF400_0";
101 gGeoManager->cd(pathTOF);
102 Double_t* X0Y0Z0 =
new Double_t[3];
103 X0Y0Z0[0] = X0Y0Z0[1] = X0Y0Z0[2] = 0.;
104 Double_t *local =
new Double_t[3], master[3], dX, dY, dZ;
106 Int_t volumeUID, detectorID, stripID;
107 Int_t nDetectors = 0, nStrips = 0;
109 TObjArray* array = gGeoManager->GetCurrentVolume()->GetNodes();
110 TIterator* it1 = array->MakeIterator();
112 TGeoNode *detectorNode, *stripNode;
113 while ((detectorNode = (TGeoNode*)it1->Next()))
115 TString PATH1 = pathTOF +
"/" + detectorNode->GetName();
116 detectorID = detectorNode->GetNumber();
117 TString detectorNodeName = (TString)detectorNode->GetName();
118 if (!detectorNodeName.Contains(
"Detector"))
123 TIterator* it2 = detectorNode->GetNodes()->MakeIterator();
124 while ((stripNode = (TGeoNode*)it2->Next()))
126 stripName = stripNode->GetName();
127 if (!stripName.Contains(
"StripActiveGas"))
130 TString PATH2 = PATH1 +
"/" + stripName;
131 stripID = stripNode->GetNumber();
136 gGeoManager->cd(PATH2);
138 TGeoMatrix* matrix = gGeoManager->GetCurrentMatrix();
139 matrix->LocalToMaster(X0Y0Z0, master);
141 TGeoBBox* box = (TGeoBBox*)gGeoManager->GetCurrentNode()->GetVolume()->GetShape();
150 LStrip1 stripData(volumeUID, 0, 0, detectorID, stripID);
151 stripData.
center.SetXYZ(master[0], master[1], master[2]);
157 matrix->LocalToMaster(local, master);
158 stripData.
A.SetXYZ(master[0], master[1], master[2]);
163 matrix->LocalToMaster(local, master);
164 stripData.
B.SetXYZ(master[0], master[1], master[2]);
169 matrix->LocalToMaster(local, master);
170 stripData.
C.SetXYZ(master[0], master[1], master[2]);
175 matrix->LocalToMaster(local, master);
176 stripData.
D.SetXYZ(master[0], master[1], master[2]);
181 bool IsUniqueUID = mStrips.insert(make_pair(volumeUID, stripData)).second;
189 LOG(info) <<
"[BmnTof400HitProducer::ParseTGeoManager] detectors = " << nDetectors <<
", strips= " << nStrips
200 if (!forced && !mStrips.empty())
204 TString stripName, gasName, pathTOF =
"/cave_1/tof700_0";
205 gGeoManager->cd(pathTOF);
206 Double_t* X0Y0Z0 =
new Double_t[3];
207 X0Y0Z0[0] = X0Y0Z0[1] = X0Y0Z0[2] = 0.;
208 Double_t *local =
new Double_t[3], master[3], dX, dY, dZ;
210 Int_t volumeUID, detectorID, stripID;
211 Int_t nDetectors = 0, nStrips = 0;
213 TObjArray* array = gGeoManager->GetCurrentVolume()->GetNodes();
214 TIterator* it1 = array->MakeIterator();
216 TGeoNode *detectorNode, *detectorNodeGas, *stripNode;
217 while ((detectorNode = (TGeoNode*)it1->Next()))
219 TString PATH1 = pathTOF +
"/" + detectorNode->GetName();
220 detectorID = detectorNode->GetNumber();
221 TString detectorNodeName = detectorNode->GetName();
222 if (!detectorNodeName.Contains(
"Chamber"))
227 TIterator* it2 = detectorNode->GetNodes()->MakeIterator();
228 while ((detectorNodeGas = (TGeoNode*)it2->Next()))
230 gasName = detectorNodeGas->GetName();
231 if (!gasName.Contains(
"Gas"))
233 TString PATHG = PATH1 +
"/" + gasName;
234 TObjArray* Nodes = detectorNodeGas->GetNodes();
235 TIterator* it3 = Nodes->MakeIterator();
237 while ((stripNode = (TGeoNode*)it3->Next())) {
239 stripName = stripNode->GetName();
240 if (!stripName.Contains(
"ActiveGasStrip"))
243 TString PATH2 = PATHG +
"/" + stripName;
244 stripID = stripNode->GetNumber();
249 gGeoManager->cd(PATH2);
251 TGeoMatrix* matrix = gGeoManager->GetCurrentMatrix();
252 matrix->LocalToMaster(X0Y0Z0, master);
254 TGeoBBox* box = (TGeoBBox*)gGeoManager->GetCurrentNode()->GetVolume()->GetShape();
262 LStrip1 stripData(volumeUID, 0, 0, detectorID, stripID);
265 stripData.
center.SetXYZ(master[0], master[1], master[2]);
271 matrix->LocalToMaster(local, master);
272 stripData.
A.SetXYZ(master[0], master[1], master[2]);
277 matrix->LocalToMaster(local, master);
278 stripData.
B.SetXYZ(master[0], master[1], master[2]);
283 matrix->LocalToMaster(local, master);
284 stripData.
C.SetXYZ(master[0], master[1], master[2]);
289 matrix->LocalToMaster(local, master);
290 stripData.
D.SetXYZ(master[0], master[1], master[2]);
297 bool IsUniqueUID = mStrips.insert(make_pair(volumeUID, stripData)).second;
306 LOG(info) <<
"[BmnTof700HitProducer::ParseTGeoManager] detectors = " << nDetectors <<
", strips= " << nStrips
461 Double_t value, min1 = 1.e+10, min2 = 1.e+10;
463 if ((*
this) == strip)
482 value =
fabs((*p1 - strip.
A).Mag());
483 min1 = (value < min1) ? value : min1;
484 value =
fabs((*p1 - strip.
B).Mag());
485 min1 = (value < min1) ? value : min1;
486 value =
fabs((*p1 - strip.
C).Mag());
487 min1 = (value < min1) ? value : min1;
488 value =
fabs((*p1 - strip.
D).Mag());
489 min1 = (value < min1) ? value : min1;
491 value =
fabs((*p2 - strip.
A).Mag());
492 min2 = (value < min2) ? value : min2;
493 value =
fabs((*p2 - strip.
B).Mag());
494 min2 = (value < min2) ? value : min2;
495 value =
fabs((*p2 - strip.
C).Mag());
496 min2 = (value < min2) ? value : min2;
497 value =
fabs((*p2 - strip.
D).Mag());
498 min2 = (value < min2) ? value : min2;
505 Double_t value, min1 = 1.e+10, min2 = 1.e+10;
507 if ((*
this) == strip)
526 value =
fabs((*p1 - strip.
A).Mag());
527 min1 = (value < min1) ? value : min1;
528 value =
fabs((*p1 - strip.
B).Mag());
529 min1 = (value < min1) ? value : min1;
530 value =
fabs((*p1 - strip.
C).Mag());
531 min1 = (value < min1) ? value : min1;
532 value =
fabs((*p1 - strip.
D).Mag());
533 min1 = (value < min1) ? value : min1;
535 value =
fabs((*p2 - strip.
A).Mag());
536 min2 = (value < min2) ? value : min2;
537 value =
fabs((*p2 - strip.
B).Mag());
538 min2 = (value < min2) ? value : min2;
539 value =
fabs((*p2 - strip.
C).Mag());
540 min2 = (value < min2) ? value : min2;
541 value =
fabs((*p2 - strip.
D).Mag());
542 min2 = (value < min2) ? value : min2;