ATLAS Offline Software
TrackingVolumeHelper.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // TrackingVolumeHelper.cxx, (c) ATLAS Detector software
8 
9 // Trk include
15 #include "TrkSurfaces/Surface.h"
18 #include "TrkSurfaces/DiscBounds.h"
23 #include "TrkGeometry/DiscLayer.h"
29 // Amg
31 
32 #include <memory>
33 #include <stdexcept>
34 
35 namespace {
36  template <class Obj>
37  std::vector<Obj*> toRawVec(const std::vector<std::shared_ptr<Obj>>& in) {
38 
39  std::vector<Obj*> out{};
40  out.reserve(in.size());
41  for (const std::shared_ptr<Obj>& obj : in) {
42  out.emplace_back(obj.get());
43  }
44  return out;
45  }
46 }
47 
48 namespace Trk {
49 // constructor
50 TrackingVolumeHelper::TrackingVolumeHelper(const std::string& t, const std::string& n, const IInterface* p)
51 : AthAlgTool(t,n,p),
53  declareInterface<ITrackingVolumeHelper>(this);
54 }
55 // destructor
57 
58 
59 // the interface methods
61 
62  ATH_MSG_DEBUG( "initialize() " );
63  ATH_CHECK(m_layerArrayCreator.retrieve());
65  return StatusCode::SUCCESS;
66 }
67 
68 
71  BoundarySurfaceFace firstFace,
72  TrackingVolume& secondVol,
73  BoundarySurfaceFace secondFace,
74  bool buildBoundaryLayer) const
75 {
76  TrackingVolumeManipulator::glueVolumes( firstVol, firstFace, secondVol, secondFace );
77 
78  // ----------------------------------------------------------------------------------------
79  // create a MaterialLayer as a boundary
80  if (buildBoundaryLayer){
81  auto& bSurfacesFirst = firstVol.boundarySurfaces();
82  auto& bSurfacesSecond = secondVol.boundarySurfaces();
83  // get the boundary surfaces
84  Surface& firstFaceSurface = bSurfacesFirst[firstFace]->surfaceRepresentation();
85  Surface& secondFaceSurface = bSurfacesSecond[secondFace]->surfaceRepresentation();
86  // dynamic_cast to the right type
87  std::unique_ptr<LayerMaterialProperties> lmps = layerMaterialProperties(firstFaceSurface);
88  // LayerMaterialProperties will be cloned in MaterialLayer
89 
90  // set the layer to the two surfaces
91  if (lmps){
92  std::shared_ptr<Layer> mLayer = std::make_shared<MaterialLayer>(firstFaceSurface, *lmps);
93  ATH_MSG_VERBOSE( "Set MaterialLayer to the BoundarySurface of first volume." );
94  firstFaceSurface.setMaterialLayer(mLayer);
95  ATH_MSG_VERBOSE("Set MaterialLayer to the BoundarySurface of second volume.");
96  secondFaceSurface.setMaterialLayer(mLayer);
97  }
98  }
99 }
100 
103  BoundarySurfaceFace firstFace,
104  const std::vector<TrackingVolume*>& secondVolumes,
105  BoundarySurfaceFace secondFace,
106  bool buildBoundaryLayer,
107  bool boundaryFaceExchange) const
108 {
109 
110  if (msgLvl(MSG::VERBOSE)) {
111  ATH_MSG_VERBOSE( "Glue Volume '" << firstVol.volumeName() << "' to " << secondVolumes.size() << " volume(s): " );
112  for (const auto & volIter : secondVolumes)
113  ATH_MSG_VERBOSE( " -> " << (volIter)->volumeName() );
114  }
115  // prepare the material layer if needed
116  std::shared_ptr<Layer> mLayer{};
117  // ----------------------------------------------------------------------------------------
118  // create a MaterialLayer as a boundary
119  if (buildBoundaryLayer){
120  // the first face surface
121  Surface& firstFaceSurface = firstVol.boundarySurfaces()[firstFace]->surfaceRepresentation();
122  std::unique_ptr<LayerMaterialProperties> lmps = layerMaterialProperties(firstFaceSurface);
123  // LayerMaterialProperties are cloned by MaterialLayer
124 
125  // the material layer is ready - it can be assigned
126  mLayer = std::make_unique<MaterialLayer>(firstFaceSurface, *lmps);
127  ATH_MSG_VERBOSE( "Set MaterialLayer to the BoundarySurface of first volume (may be shared with second volume)." );
128  firstFaceSurface.setMaterialLayer(mLayer);
129  }
130  // if only one volume was given in the vector call the standard one-to-one glueing
131  // 1-to-1 case
132  if (secondVolumes.size() == 1) {
133  // self call for one-on-one
134  glueTrackingVolumes(firstVol, firstFace, *(secondVolumes[0]), secondFace);
135  } else {
136  // create the navigation bin array
137  BinnedArray<TrackingVolume>* navArray = nullptr;
138  // create the Array - either r-binned or z-binned
139  if (firstFace == negativeFaceXY || firstFace == positiveFaceXY )
140  navArray = m_trackingVolumeArrayCreator->cylinderVolumesArrayInR(secondVolumes, true);
141  else
142  navArray = m_trackingVolumeArrayCreator->cylinderVolumesArrayInZ(secondVolumes, true);
143 
144  // set the volume array to the first boundary surface - this must always happen
145  if (firstFace != tubeInnerCover)
146  setOutsideTrackingVolumeArray( firstVol, firstFace, navArray );
147  else
148  setInsideTrackingVolumeArray( firstVol, firstFace, navArray );
149  // the navigation arrays are completed now - check if the boundary face should be exchanged
150  // [1] the boundary face exchange ----------------------------------------------------------------------------------------
151  if (boundaryFaceExchange){
152  // creating only one boundary surface
153  ATH_MSG_VERBOSE("Creating a joint boundary surface for 1-to-n glueing case.");
154  // get the dimension of boundary surface of the first volume
155  SharedObject<BoundarySurface<TrackingVolume> > bSurface = firstVol.boundarySurfaces()[firstFace];
156  // replace the boundary surface
157  for ( const auto & volIter: secondVolumes )
158  setBoundarySurface(*volIter, bSurface, secondFace);
159  } else {
160  // [2] the traditional way, keeping two boundary surfaces
161  // now set the face to the volume array -------------------------------------------------------------------------------
162  for ( const auto & volIter: secondVolumes ) {
163  // the secondGlueFace
164  BoundarySurfaceFace secondGlueFace = secondFace;
165  if (secondFace == tubeOuterCover) {
166  //check for cylinder case
167  const CylinderVolumeBounds* currentVolBounds = dynamic_cast<const CylinderVolumeBounds*>(&((volIter)->volumeBounds()));
168  // protection : there may be a cylinder within the tube vector
169  if (currentVolBounds && currentVolBounds->innerRadius() < 10e-3)
170  secondGlueFace = cylinderCover;
171  setOutsideTrackingVolume(*volIter, secondGlueFace, (&(firstVol)));
172  } // for all surfaces except the tunbeInnerCover outside of the surface is identical to outside of the volume
173  else if (secondGlueFace != tubeInnerCover)
174  setOutsideTrackingVolume(*volIter, secondGlueFace, (&(firstVol)));
175  else
176  setInsideTrackingVolume(*volIter, secondGlueFace, (&(firstVol)));
177  // if existing, set the material Layer
178  // get the second face surface and set the new MaterialLayer
179  Surface& secondFaceSurface = volIter->boundarySurfaces()[secondFace]->surfaceRepresentation();
180  secondFaceSurface.setMaterialLayer(mLayer);
181  }
182  }
183  } // 1-to-n case
184 }
185 
186 
188 void TrackingVolumeHelper::glueTrackingVolumes(const std::vector<TrackingVolume*>& firstVolumes,
189  BoundarySurfaceFace firstFace,
190  const std::vector<TrackingVolume*>& secondVolumes,
191  BoundarySurfaceFace secondFace,
192  bool buildBoundaryLayer,
193  bool boundaryFaceExchange) const
194 {
195 
196 
197  BinnedArray<TrackingVolume>* navArrayOne = nullptr;
198  BinnedArray<TrackingVolume>* navArrayTwo = nullptr;
199 
200  std::unique_ptr<Surface> mLayerSurface;
201  std::shared_ptr<Layer> mLayer;
202 
203  ATH_MSG_VERBOSE("Glue configuration firstFace | secondFace = " << firstFace << " | " << secondFace );
204 
205  // create the Arrays - assuming cylindrical TrackingVolumes
206  if (firstFace < 2 && secondFace < 2 ) {
207  ATH_MSG_VERBOSE( "The glueing is done along z axis" );
208  navArrayOne = m_trackingVolumeArrayCreator->cylinderVolumesArrayInR(firstVolumes, true);
209  navArrayTwo = m_trackingVolumeArrayCreator->cylinderVolumesArrayInR(secondVolumes, true);
210  // build a disc to separate the two
211  if (buildBoundaryLayer || boundaryFaceExchange){
212  double rmin = 10e10; double rmax = 0; double boundaryz = 0.; double centerzOne = 0.;
213  for (const auto & volIter : firstVolumes ){
214  const CylinderVolumeBounds* cb = dynamic_cast<const CylinderVolumeBounds*>(&(volIter->volumeBounds()));
215  if (cb) {
216  takeSmaller(rmin,cb->innerRadius());
217  takeBigger(rmax,cb->outerRadius());
218  // get the z of the surface
219  boundaryz = volIter->boundarySurfaces()[firstFace]->surfaceRepresentation().center().z();
220  }
221  centerzOne = volIter->center().z();
222  }
223  if (buildBoundaryLayer){
224  Amg::Transform3D mLayerTransform =
225  Amg::Transform3D(Amg::Translation3D(0., 0., boundaryz));
226  // layer surface
227  mLayerSurface = std::make_unique<DiscSurface>(mLayerTransform, rmin, rmax);
228  // create a MaterialLayer
229  std::unique_ptr<LayerMaterialProperties> lmps = layerMaterialProperties(*mLayerSurface);
230  // MaterialLayer clones the LayerMaterialPropteries.
231 
232  if (lmps) {
233  mLayer = std::make_unique<MaterialLayer>(std::move(mLayerSurface), *lmps);
234  }
235  }
236  if (boundaryFaceExchange){
237  // creating only one boundary surface
238  ATH_MSG_VERBOSE("Creating a joint boundary surface for n-to-n glueing case.");
239  // check if the seconf volumes have a bigger z value or a smaller one
240  double centerzTwo = secondVolumes[secondVolumes.size()-1]->center().z();
241  // thi sboundary surface is having a z-axix along the global z-axis
242  Amg::Transform3D boundaryTransform = Amg::getTranslateZ3D(boundaryz);
243  // disc surfaces
244  DiscSurface dSurface(boundaryTransform, rmin, rmax);
245  // swap if needed
246  if (centerzTwo < centerzOne){
247  std::swap(navArrayTwo, navArrayOne);
248  }
249  // create the new boudnary surface which spans over the entire volume border
250  SharedObject< BinnedArray<TrackingVolume> > navArrayInside(navArrayOne);
251  SharedObject< BinnedArray<TrackingVolume> > navArrayOutside(navArrayTwo);
252  BoundaryDiscSurface<TrackingVolume>* boundarySurface = new BoundaryDiscSurface<TrackingVolume>(navArrayInside,navArrayOutside,dSurface);
253  SharedObject<BoundarySurface<TrackingVolume> > sharedBoundarySurface(boundarySurface);
254  // attach the material layer to the shared boundary if existing
255  if (mLayer) {
256  ATH_MSG_VERBOSE( "Set MaterialLayer to the BoundarySurface of volume from second array." );
257  boundarySurface->surfaceRepresentation().setMaterialLayer(mLayer);
258  }
259  // set the boundary surface to the volumes of both sides
260  for (const auto & volIter : firstVolumes){
261  ATH_MSG_VERBOSE(" -> first array : setting a newly created boundary surface to " << volIter->volumeName());
262  setBoundarySurface(*volIter,sharedBoundarySurface,firstFace);
263  }
264  for (const auto & volIter : secondVolumes){
265  ATH_MSG_VERBOSE(" -> second array : setting a newly created boundary surface to " << volIter->volumeName());
266  setBoundarySurface(*volIter,sharedBoundarySurface,secondFace);
267  }
268  // we are done here
269  return;
270  }
271  }
272  } else {
273  ATH_MSG_VERBOSE( "The glueing is done along the radius." );
274  navArrayOne = m_trackingVolumeArrayCreator->cylinderVolumesArrayInZ(firstVolumes, true);
275  navArrayTwo = m_trackingVolumeArrayCreator->cylinderVolumesArrayInZ(secondVolumes, true);
276  // check if the boundary layer was configured to be built
277  if (buildBoundaryLayer || boundaryFaceExchange){
278  // build a cylinder to separate the two
279  double zmin = 10e10; double zmax = -10e10; double boundaryr = 0.; double volumerOne = 0.; double volumerTwo = 10e10;
280  for (const auto & volIter : firstVolumes ){
281  const CylinderVolumeBounds* cb = dynamic_cast<const CylinderVolumeBounds*>(&(volIter->volumeBounds()));
282  if (cb) {
283  takeSmaller(zmin,volIter->center().z()-cb->halflengthZ());
284  takeBigger(zmax,volIter->center().z()+cb->halflengthZ());
285  // get the z of the surface
286  boundaryr = volIter->boundarySurfaces()[firstFace]->surfaceRepresentation().bounds().r();
287  // get the volume radius
288  volumerOne = cb->outerRadius();
289  }
290  }
291  // check if boundary layer should be built
292  if (buildBoundaryLayer){
293  std::unique_ptr<Amg::Transform3D> mLayerTransform =
294  ((zmin + zmax) * (zmin + zmax) < 10e-4)
295  ? nullptr
296  : std::make_unique < Amg::Transform3D>();
297 
298  if (mLayerTransform) (*mLayerTransform) = Amg::Translation3D(0.,0.,0.5*(zmin+zmax));
299  mLayerSurface.reset( mLayerTransform ? new CylinderSurface(*mLayerTransform,boundaryr,0.5*(zmax-zmin)) :
300  new CylinderSurface(boundaryr,0.5*(zmax-zmin)) );
301  // create a MaterialLayer
302  std::unique_ptr<LayerMaterialProperties> lmps = layerMaterialProperties(*mLayerSurface);
303  // LayerMaterialProperties will be cloned in MaterialLayer
304  if (lmps) mLayer = std::make_unique<MaterialLayer>(
305  std::shared_ptr<Surface>(std::move(mLayerSurface)),
306  *lmps );
307  }
308  // check if boundary face should be exchanged
309  if (boundaryFaceExchange) {
310  // creating only one boundary surface
311  ATH_MSG_VERBOSE("Creating a joint boundary surface for n-to-n glueing case.");
312  // the boundary transform can be 0 for cylinder surfaces
313  std::unique_ptr<Amg::Transform3D> boundaryTransform =
314  ((zmin + zmax) * (zmin + zmax) < 10e-4)
315  ? nullptr
316  : std::make_unique<Amg::Transform3D>();
317 
318  if (boundaryTransform) (*boundaryTransform) = Amg::getTranslateZ3D(0.5*(zmin+zmax));
319  // create the cylinder surface for the shared boundary
320  CylinderSurface cSurface = boundaryTransform ? CylinderSurface(*boundaryTransform,boundaryr,0.5*(zmax-zmin)) :
321  CylinderSurface(boundaryr,0.5*(zmax-zmin));
322  // get the volume outer radius of the sconf volumes
323  const CylinderVolumeBounds* cbTwo = dynamic_cast<const CylinderVolumeBounds*>(&(secondVolumes[secondVolumes.size()-1]->volumeBounds()));
324  if (cbTwo){
325  volumerTwo = cbTwo->outerRadius();
326  }
327  // swap if needed
328  if (volumerTwo < volumerOne){
329  BinnedArray<TrackingVolume>* navArraySwap = navArrayOne;
330  navArrayTwo = navArrayOne;
331  navArrayOne = navArraySwap;
332  }
333  // create the new boudnary surface which spans over the entire volume border
334  SharedObject< BinnedArray<TrackingVolume> > navArrayInside(navArrayOne);
335  SharedObject< BinnedArray<TrackingVolume> > navArrayOutside(navArrayTwo);
336  BoundaryCylinderSurface<TrackingVolume>* boundarySurface = new BoundaryCylinderSurface<TrackingVolume>(navArrayInside,navArrayOutside,cSurface);
337  SharedObject<BoundarySurface<TrackingVolume> > sharedBoundarySurface(boundarySurface);
338  // attach the material layer to the shared boundary if existing
339  if (mLayer) {
340  ATH_MSG_VERBOSE("Set MaterialLayer to the BoundarySurface of volume from second array.");
341  // assume that now the mlayer onwership goes over to the TrackingVolume
342  boundarySurface->surfaceRepresentation().setMaterialLayer(mLayer);
343  }
344  // set the boundary surface to the volumes of both sides
345  for (const auto & volIter : firstVolumes){
346  ATH_MSG_VERBOSE(" -> first array : setting a newly created boundary surface to " << volIter->volumeName());
347  setBoundarySurface(*volIter,sharedBoundarySurface,firstFace);
348  }
349  for (const auto & volIter : secondVolumes){
350  ATH_MSG_VERBOSE(" -> second array : setting a newly created boundary surface to " << volIter->volumeName());
351  setBoundarySurface(*volIter,sharedBoundarySurface,secondFace);
352  }
353  // we are done here
354  return;
355 
356  }
357  } // build either boundary layer or exchange the face
358  } // radial glueing
359 
360 
361  // create the boundary faces - not creating a joint one
362  ATH_MSG_VERBOSE("Leaving individual boundary surfaces for n-to-n glueing case.");
363 
364  // assign the navigation arrays
365  SharedObject< BinnedArray< TrackingVolume> > navArrayOneShared(navArrayOne);
366  SharedObject< BinnedArray< TrackingVolume> > navArrayTwoShared(navArrayTwo);
367 
368  // (a) to the first set of volumes
369  for (const auto & tVolIter: firstVolumes) {
370  // take care of the orientation of the normal vector
371  if (firstFace != tubeInnerCover) {
372  setOutsideTrackingVolumeArray(*tVolIter,firstFace,navArrayTwoShared);
373  ATH_MSG_VERBOSE( "Set outsideTrackingVolumeArray at face " << firstFace << " to " << (*tVolIter).volumeName() );
374  } else {
375  setInsideTrackingVolumeArray(*tVolIter,firstFace,navArrayTwoShared);
376  ATH_MSG_VERBOSE( "Set insideTrackingVolumeArray at face " << firstFace << " to " << (*tVolIter).volumeName() );
377  }
378  // set the boundary layer if it exists
379  if (mLayer) {
380  ATH_MSG_VERBOSE( "Set MaterialLayer to the BoundarySurface of volume from first array." );
381  Surface& firstFaceSurface = tVolIter->boundarySurfaces()[firstFace]->surfaceRepresentation();
382  // assume that now the mlayer onwership goes over to the TrackingVolume
383  //cppcheck-suppress ignoredReturnValue
384  firstFaceSurface.setMaterialLayer(mLayer);
385  }
386 
387  }
388  // (b) to the second set of volumes
389  for (const auto & tVolIter : secondVolumes) {
390  // take care of the orientation of the normal vector
391  if (secondFace != tubeInnerCover) {
392  ATH_MSG_VERBOSE( "Set outsideTrackingVolumeArray at face " << secondFace << " to " << (*tVolIter).volumeName() );
393  setOutsideTrackingVolumeArray(*tVolIter,secondFace,navArrayOneShared);
394  } else {
395  ATH_MSG_VERBOSE( "Set insideTrackingVolumeArray at face " << secondFace << " to " << (*tVolIter).volumeName() );
396  setInsideTrackingVolumeArray(*tVolIter,secondFace,navArrayOneShared);
397  }
398  if (mLayer) {
399  ATH_MSG_VERBOSE( "Set MaterialLayer to the BoundarySurface of volume from second array." );
400  Surface& secondFaceSurface = tVolIter->boundarySurfaces()[secondFace]->surfaceRepresentation();
401  // assume that now the mlayer onwership goes over to the TrackingVolume
402  //cppcheck-suppress ignoredReturnValue
403  secondFaceSurface.setMaterialLayer(mLayer);
404  }
405  }
406  // coverity will report a bug here for mLayer running out of scope, but the memory management is done later in the TrackingVolume
407 }
408 
410  TrackingVolume& firstVol,
411  BoundarySurfaceFace firstFace,
412  TrackingVolume& secondVol,
413  BoundarySurfaceFace secondFace, std::string name) const
414 {
415  TrackingVolume* enclosingVolume = nullptr;
416 
417  const auto *cyl1 = dynamic_cast<const CylinderVolumeBounds*> (&(firstVol.volumeBounds()));
418  const auto *cyl2 = dynamic_cast<const CylinderVolumeBounds*> (&(secondVol.volumeBounds()));
419 
420  if (!cyl1 || !cyl2) {
421  ATH_MSG_ERROR( "TrackingVolumeHelper::glueTrackingVolumeArrays: input volumes not cylinders, return 0" );
422  return enclosingVolume;
423  }
424  if (cyl1->halfPhiSector()!= M_PI || cyl2->halfPhiSector()!= M_PI ) {
425  ATH_MSG_ERROR( "TrackingVolumeHelper::glueTrackingVolumeArrays: not coded for cylinder Phi sectors yet, return 0" );
426  return enclosingVolume;
427  }
428 
429  // if the swap is required
430  BoundarySurfaceFace firstFaceCorr = firstFace;
431  BoundarySurfaceFace secondFaceCorr = secondFace;
432 
433 
434  // build volume envelope
435  std::vector<TrackingVolume*> vols;
436  CylinderVolumeBounds* envBounds = nullptr;
437  Amg::Transform3D* envTransf = nullptr;
438  BinnedArray<TrackingVolume>* subVols = nullptr;
439  vols.push_back(&firstVol);
440  vols.push_back(&secondVol);
441  std::vector<TrackingVolume*> envGlueNegXY;
442  std::vector<TrackingVolume*> envGluePosXY;
443  std::vector<TrackingVolume*> envGlueOuter;
444  std::vector<TrackingVolume*> envGlueInner;
445 
446  if (firstFace==positiveFaceXY) {
447  envBounds = new CylinderVolumeBounds(cyl1->innerRadius(),
448  cyl1->outerRadius(),
449  cyl1->halflengthZ()+cyl2->halflengthZ());
450  envTransf = new Amg::Transform3D;
451  (*envTransf) = Amg::Translation3D(firstVol.center().x(),
452  firstVol.center().y(),
453  firstVol.center().z()+cyl2->halflengthZ());
454  subVols = m_trackingVolumeArrayCreator->cylinderVolumesArrayInZ(vols,false);
455  envGlueNegXY.push_back(&firstVol);
456  envGluePosXY.push_back(&secondVol);
457  envGlueOuter = vols;
458  envGlueInner = vols;
459  } else if (firstFace==negativeFaceXY) {
460  envBounds = new CylinderVolumeBounds(cyl1->innerRadius(),
461  cyl1->outerRadius(),
462  cyl1->halflengthZ()+cyl2->halflengthZ());
463  envTransf = new Amg::Transform3D;
464  (*envTransf) = Amg::Translation3D(firstVol.center().x(),
465  firstVol.center().y(),
466  firstVol.center().z()-cyl2->halflengthZ());
467  envGlueNegXY.push_back(&secondVol);
468  envGluePosXY.push_back(&firstVol);
469  // revert vols
470  vols.clear();
471  vols.push_back(&secondVol);
472  vols.push_back(&firstVol);
473  // --- account for the swapping
474  firstFaceCorr = secondFace;
475  secondFaceCorr = firstFace;
476  //
477  subVols = m_trackingVolumeArrayCreator->cylinderVolumesArrayInZ(vols,false);
478  envGlueOuter = vols;
479  envGlueInner = vols;
480  } else if (firstFace==tubeInnerCover) {
481  if (secondFace==tubeOuterCover){
482  envBounds = new CylinderVolumeBounds(cyl2->innerRadius(),
483  cyl1->outerRadius(),
484  cyl1->halflengthZ());
485  } else {
486  envBounds = new CylinderVolumeBounds(cyl1->outerRadius(),
487  cyl1->halflengthZ());
488  }
489  envTransf = firstVol.transform().isApprox(Amg::Transform3D::Identity()) ? nullptr : new Amg::Transform3D;
490  if (envTransf)
491  (*envTransf) = Amg::Translation3D(firstVol.center());
492  // revert vols
493  vols.clear();
494  vols.push_back(&secondVol);
495  vols.push_back(&firstVol);
496  // account for the swapping
497  firstFaceCorr = secondFace;
498  secondFaceCorr = firstFace;
499  //
500  subVols = m_trackingVolumeArrayCreator->cylinderVolumesArrayInR(vols,false);
501  envGlueNegXY = vols;
502  envGluePosXY = vols;
503  envGlueOuter.push_back(&firstVol);
504  envGlueInner.push_back(&secondVol);
505  } else {
506  envBounds = new CylinderVolumeBounds(cyl1->innerRadius(),
507  cyl2->outerRadius(),
508  cyl1->halflengthZ());
509  envTransf = firstVol.transform().isApprox(Amg::Transform3D::Identity()) ? nullptr : new Amg::Transform3D;
510  if (envTransf)
511  (*envTransf) = Amg::Translation3D(firstVol.center());
512  subVols = m_trackingVolumeArrayCreator->cylinderVolumesArrayInR(vols,false);
513  envGlueNegXY = vols;
514  envGluePosXY = vols;
515  envGlueOuter.push_back(&secondVol);
516  envGlueInner.push_back(&firstVol);
517  // account for the swapping
518  firstFaceCorr = secondFace;
519  secondFaceCorr = firstFace;
520  }
521 
522  // create the enveloping volume
523  enclosingVolume = new TrackingVolume(envTransf,
524  envBounds,
525  firstVol,
526  nullptr,subVols,
527  name);
528 
529  // ENVELOPE GLUE DESCRIPTION -----------------------------------------------------------------
530  // glue descriptors ---- they jump to the first one
531  GlueVolumesDescriptor& glueDescr = enclosingVolume->glueVolumesDescriptor();
532 
533  // for the outside volumes, could be done in a loop as well, but will only save 4 lines
534  std::vector<TrackingVolume*> glueNegXY;
535  std::vector<TrackingVolume*> gluePosXY;
536  std::vector<TrackingVolume*> glueInner;
537  std::vector<TrackingVolume*> glueOuter;
538  fillGlueVolumes(vols,envGlueNegXY,negativeFaceXY,glueNegXY);
539  fillGlueVolumes(vols,envGluePosXY,positiveFaceXY,gluePosXY);
540  fillGlueVolumes(vols,envGlueInner,tubeInnerCover,glueInner);
541  fillGlueVolumes(vols,envGlueOuter,tubeOuterCover,glueOuter);
542  // set them to the envelopGlueDescriptor
543  glueDescr.registerGlueVolumes(negativeFaceXY, glueNegXY);
544  glueDescr.registerGlueVolumes(positiveFaceXY, gluePosXY);
545  glueDescr.registerGlueVolumes(tubeInnerCover, glueInner);
546  glueDescr.registerGlueVolumes(tubeOuterCover, glueOuter);
547  glueDescr.registerGlueVolumes(cylinderCover, glueOuter);
548 
549  // INTERNAL GLUEING ---------------------------------------------------------------------------
550  glueTrackingVolumes(vols,firstFaceCorr,secondFaceCorr);
551 
552  return enclosingVolume;
553 }
554 
555 std::unique_ptr<TrackingVolume> TrackingVolumeHelper::glueTrackingVolumeArrays(std::shared_ptr<TrackingVolume> firstVol,
556  BoundarySurfaceFace firstFace,
557  std::shared_ptr<TrackingVolume> secondVol,
558  BoundarySurfaceFace secondFace,
559  const std::string& name) const {
560  std::unique_ptr<TrackingVolume> enclosingVolume{};
561 
562  const auto *cyl1 = dynamic_cast<const CylinderVolumeBounds*>(&(firstVol->volumeBounds()));
563  const auto *cyl2 = dynamic_cast<const CylinderVolumeBounds*>(&(secondVol->volumeBounds()));
564 
565  if (!cyl1 || !cyl2) {
566  ATH_MSG_ERROR( "TrackingVolumeHelper::glueTrackingVolumeArrays: input volumes not cylinders, return 0" );
567  return enclosingVolume;
568  }
569  if (cyl1->halfPhiSector()!= M_PI || cyl2->halfPhiSector()!= M_PI ) {
570  ATH_MSG_ERROR( "TrackingVolumeHelper::glueTrackingVolumeArrays: not coded for cylinder Phi sectors yet, return 0" );
571  return enclosingVolume;
572  }
573 
574  // if the swap is required
575  BoundarySurfaceFace firstFaceCorr = firstFace;
576  BoundarySurfaceFace secondFaceCorr = secondFace;
577 
578 
579  // build volume envelope
580  std::vector<std::shared_ptr<TrackingVolume>> vols;
581  std::unique_ptr<CylinderVolumeBounds> envBounds{};
582  std::unique_ptr<Amg::Transform3D> envTransf{};
583  std::unique_ptr<BinnedArray<TrackingVolume>> subVols{};
584  vols.push_back(firstVol);
585  vols.push_back(secondVol);
586  std::vector<std::shared_ptr<TrackingVolume>> envGlueNegXY{}, envGluePosXY{}, envGlueOuter, envGlueInner{};
587 
588  if (firstFace==positiveFaceXY) {
589  envBounds = std::make_unique<CylinderVolumeBounds>(cyl1->innerRadius(),
590  cyl1->outerRadius(),
591  cyl1->halflengthZ() + cyl2->halflengthZ());
592 
593  const Amg::Vector3D center{firstVol->center()};
594  envTransf = std::make_unique<Amg::Transform3D>(Amg::getTranslate3D(center.x(),
595  center.y(),
596  center.z() + cyl2->halflengthZ()));
597 
598  subVols = m_trackingVolumeArrayCreator->cylinderVolumesArrayInZ(vols, false);
599  envGlueNegXY.push_back(firstVol);
600  envGluePosXY.push_back(secondVol);
601  envGlueOuter = vols;
602  envGlueInner = vols;
603  } else if (firstFace==negativeFaceXY) {
604  envBounds = std::make_unique<CylinderVolumeBounds>(cyl1->innerRadius(),
605  cyl1->outerRadius(),
606  cyl1->halflengthZ()+cyl2->halflengthZ());
607  const Amg::Vector3D center{firstVol->center()};
608  envTransf = std::make_unique<Amg::Transform3D>(Amg::getTranslate3D(center.x(),
609  center.y(),
610  center.z() - cyl2->halflengthZ()));
611  envGlueNegXY.push_back(secondVol);
612  envGluePosXY.push_back(firstVol);
613  // revert vols
614  vols.clear();
615  vols.push_back(secondVol);
616  vols.push_back(firstVol);
617  // --- account for the swapping
618  firstFaceCorr = secondFace;
619  secondFaceCorr = firstFace;
620  //
621  subVols = m_trackingVolumeArrayCreator->cylinderVolumesArrayInZ(vols,false);
622  envGlueOuter = vols;
623  envGlueInner = vols;
624  } else if (firstFace==tubeInnerCover) {
625  if (secondFace==tubeOuterCover){
626  envBounds = std::make_unique<CylinderVolumeBounds>(cyl2->innerRadius(),
627  cyl1->outerRadius(),
628  cyl1->halflengthZ());
629  } else {
630  envBounds = std::make_unique<CylinderVolumeBounds>(cyl1->outerRadius(),
631  cyl1->halflengthZ());
632  }
633  if (!firstVol->transform().isApprox(Amg::Transform3D::Identity())) {
634  envTransf = std::make_unique<Amg::Transform3D>(Amg::getTranslate3D(firstVol->center()));
635  }
636  // revert vols
637  vols.clear();
638  vols.push_back(secondVol);
639  vols.push_back(firstVol);
640  // account for the swapping
641  firstFaceCorr = secondFace;
642  secondFaceCorr = firstFace;
643  //
644  subVols = m_trackingVolumeArrayCreator->cylinderVolumesArrayInR(vols,false);
645  envGlueNegXY = vols;
646  envGluePosXY = vols;
647  envGlueOuter.push_back(firstVol);
648  envGlueInner.push_back(secondVol);
649  } else {
650  envBounds = std::make_unique<CylinderVolumeBounds>(cyl1->innerRadius(),
651  cyl2->outerRadius(),
652  cyl1->halflengthZ());
653  if(!firstVol->transform().isApprox(Amg::Transform3D::Identity())){
654  envTransf = std::make_unique<Amg::Transform3D>(Amg::getTranslate3D(firstVol->center()));
655  }
656  subVols = m_trackingVolumeArrayCreator->cylinderVolumesArrayInR(vols, false);
657  envGlueNegXY = vols;
658  envGluePosXY = vols;
659  envGlueOuter.push_back(secondVol);
660  envGlueInner.push_back(firstVol);
661  // account for the swapping
662  firstFaceCorr = secondFace;
663  secondFaceCorr = firstFace;
664  }
665 
666  // create the enveloping volume
667  enclosingVolume = std::make_unique<TrackingVolume>(envTransf.release(),
668  envBounds.release(),
669  *firstVol,
670  nullptr, subVols.release(), name);
671 
672  // ENVELOPE GLUE DESCRIPTION -----------------------------------------------------------------
673  // glue descriptors ---- they jump to the first one
674  GlueVolumesDescriptor& glueDescr = enclosingVolume->glueVolumesDescriptor();
675 
676  // for the outside volumes, could be done in a loop as well, but will only save 4 lines
677  std::vector<TrackingVolume*> glueNegXY{}, gluePosXY{}, glueInner{},glueOuter{};
678  fillGlueVolumes(vols, envGlueNegXY, negativeFaceXY,glueNegXY);
679  fillGlueVolumes(vols, envGluePosXY, positiveFaceXY,gluePosXY);
680  fillGlueVolumes(vols, envGlueInner, tubeInnerCover,glueInner);
681  fillGlueVolumes(vols, envGlueOuter, tubeOuterCover,glueOuter);
682  // set them to the envelopGlueDescriptor
683  glueDescr.registerGlueVolumes(negativeFaceXY, glueNegXY);
684  glueDescr.registerGlueVolumes(positiveFaceXY, gluePosXY);
685  glueDescr.registerGlueVolumes(tubeInnerCover, glueInner);
686  glueDescr.registerGlueVolumes(tubeOuterCover, glueOuter);
687  glueDescr.registerGlueVolumes(cylinderCover, glueOuter);
688 
689  // INTERNAL GLUEING ---------------------------------------------------------------------------
690  glueTrackingVolumes(vols, firstFaceCorr, secondFaceCorr);
691 
692  return enclosingVolume;
693 }
694 
695 
696 
697 void TrackingVolumeHelper::fillGlueVolumes(const std::vector<std::shared_ptr<TrackingVolume>>& topLevelVolumes,
698  const std::vector<std::shared_ptr<TrackingVolume>>& envelopeFaceVolumes,
699  BoundarySurfaceFace glueFace,
700  std::vector<TrackingVolume*>& glueVols){
701  std::vector<std::shared_ptr<TrackingVolume>> sharedTops{}, sharedFaces{};
702  return fillGlueVolumes(::toRawVec(topLevelVolumes),
703  ::toRawVec(envelopeFaceVolumes),
704  glueFace, glueVols);
705 
706 }
707 void TrackingVolumeHelper::fillGlueVolumes(const std::vector<TrackingVolume*>& topLevelVolumes,
708  const std::vector<TrackingVolume*>& envelopeFaceVolumes,
709  BoundarySurfaceFace glueFace,
710  std::vector<TrackingVolume*>& glueVols) {
711  // loop over the topLevel Volumes
712  auto refVolIter = topLevelVolumes.begin();
713  for ( ; refVolIter != topLevelVolumes.end(); ++refVolIter ) {
714  // loop over the faceVolumes
715  for (auto *envelopeFaceVolume : envelopeFaceVolumes){
716  // check whether this volume was assigned to on this face
717  if (envelopeFaceVolume==(*refVolIter)) {
718  // get the GlueVolumesDescriptor
719  GlueVolumesDescriptor& glueVolDescriptor = (*refVolIter)->glueVolumesDescriptor();
720  // if the size of glue volumes is 0 -> the referenceVolume is at navigation level
721  if ( (glueVolDescriptor.glueVolumes(glueFace)).empty()) {
722  glueVols.push_back(*refVolIter);
723  } else {
724  // fill all the sub-volumes described by the glueVolumeDescriptor
725  for (auto *isubNavVol : glueVolDescriptor.glueVolumes(glueFace))
726  glueVols.push_back( isubNavVol );
727  }
728  }
729  }// loop over envelopeFaceVolumes
730  } // loop over reference Volumes
731 }
732 
733 
735 void TrackingVolumeHelper::glueTrackingVolumes(const std::vector<std::shared_ptr<TrackingVolume>>& glueVols,
736  BoundarySurfaceFace firstFace,
737  BoundarySurfaceFace secondFace) const {
738  glueTrackingVolumes(::toRawVec(glueVols), firstFace, secondFace);
739 
740 }
741 void TrackingVolumeHelper::glueTrackingVolumes(const std::vector<TrackingVolume*>& glueVols,
742  BoundarySurfaceFace firstFace,
743  BoundarySurfaceFace secondFace) const {
744 
745  if (glueVols.size()<2) {
746  ATH_MSG_VERBOSE( "Nothing to do in glueVolumes() " );
747  return;
748  }
749 
750 
751  ATH_MSG_VERBOSE( " glueTrackingVolumes() called with boundary faces " << static_cast<int>(firstFace)
752  << " and " << static_cast<int>(secondFace) << "." );
753 
754  // the iterators through the volumes
755  std::vector<TrackingVolume*>::const_iterator firstVol = glueVols.begin();
756  std::vector<TrackingVolume*>::const_iterator secondVol = firstVol + 1;
757  for ( ; secondVol != glueVols.end(); ++firstVol, ++secondVol) {
758 
759  if (msgLvl(MSG::VERBOSE))
760  ATH_MSG_VERBOSE( "Processing '" << (*firstVol)->volumeName() << "' and '" << (*secondVol)->volumeName() << "'." );
761 
762  // get the glue volume descriptors to see that we have all subvolumes
763  GlueVolumesDescriptor& glueDescr1 = (*firstVol)->glueVolumesDescriptor();
764  GlueVolumesDescriptor& glueDescr2 = (*secondVol)->glueVolumesDescriptor();
765 
766  // glue volumes at navigation level
767  std::vector<TrackingVolume*> glueVols1{}, glueVols2{};
768  glueVols1 = glueDescr1.glueVolumes(firstFace);
769  glueVols2 = glueDescr2.glueVolumes(secondFace);
770 
771  // trivial cases
772  // (glue one to the other)
773  if (glueVols1.empty() && glueVols2.empty()) {
774  glueTrackingVolumes(**firstVol,firstFace,**secondVol,secondFace);
775  continue;
776  // (glue one to many)
777  } else if (glueVols1.empty() && !glueVols2.empty()) {
778  glueVols1.push_back(*firstVol);
779  // (glue the other one to many)
780  } else if (!glueVols1.empty() && glueVols2.empty()) {
781  glueVols2.push_back(*secondVol);
782  }
783 
784  // non-trivial case :: array against array
785  // in Z : assume 2dim R/Phi
786  if (firstFace==negativeFaceXY || firstFace==positiveFaceXY ) {
787  // turn both vectors into R/Phi 2dim binnedArrays; assume equidistant binning in Phi
788  SharedObject<BinnedArray<TrackingVolume>> sgv1{m_trackingVolumeArrayCreator->cylinderVolumesArrayInPhiR(glueVols1,true)};
789  SharedObject<BinnedArray<TrackingVolume>> sgv2{m_trackingVolumeArrayCreator->cylinderVolumesArrayInPhiR(glueVols2,true)};
790 
791  // array vs. array in Z
792  if (glueVols2.size()>1)
793  for (auto & vol : glueVols1) setOutsideTrackingVolumeArray( *vol, firstFace, sgv2 );
794  else
795  for (auto & vol : glueVols1) setOutsideTrackingVolume( *vol, firstFace, glueVols2[0] );
796 
797  if (glueVols1.size()>1)
798  for (auto & vol : glueVols2) setOutsideTrackingVolumeArray( *vol, secondFace, sgv1 );
799  else
800  for (auto & vol : glueVols2) setOutsideTrackingVolume( *vol, secondFace, glueVols1[0] );
801 
802 
803  } else {
804  // turn both vectors into Z/Phi 2dim binnedArrays; assume equidistant binning in Phi
805  SharedObject<BinnedArray<TrackingVolume>> sgv1{m_trackingVolumeArrayCreator->cylinderVolumesArrayInPhiZ(glueVols1,true)};
806  SharedObject<BinnedArray<TrackingVolume>> sgv2{m_trackingVolumeArrayCreator->cylinderVolumesArrayInPhiZ(glueVols2,true)};
807 
808  // the glue cases -----------------------------------------------------------------------------------
809  // handle the tube with care !
810  // first vol
811  for (auto & vol : glueVols1) {
812  // set the array as the outside array of the firstVol
813  if (firstFace != tubeInnerCover) {
814  if (glueVols2.size()>1)
815  setOutsideTrackingVolumeArray( *vol, firstFace, sgv2 );
816  else
817  setOutsideTrackingVolume( *vol, firstFace, glueVols2[0] );
818  } else {
819  if (glueVols2.size()>1){
820  setInsideTrackingVolumeArray( *vol, firstFace, sgv2 );
821  setOutsideTrackingVolume( *vol, firstFace, vol );
822  } else {
823  setInsideTrackingVolume( *vol, firstFace, glueVols2[0] );
824  setOutsideTrackingVolume( *vol, firstFace, vol );
825  }
826  }
827  }
828  // second
829  for (auto & vol : glueVols2) {
830  // set the array as the outside array of the secondVol
831  if (secondFace != tubeInnerCover)
832  setOutsideTrackingVolumeArray( *vol, secondFace, sgv1 );
833  else {
834  setInsideTrackingVolumeArray( *vol, secondFace, sgv1 );
835  setOutsideTrackingVolume( *vol, secondFace, vol );
836  }
837  }
838  }
839  }
840 }
841 
842 std::unique_ptr<LayerMaterialProperties>
844 
845  std::unique_ptr<LayerMaterialProperties> layerMaterial{};
846 
847  if (boundarySurface.type() == SurfaceType::Cylinder){
848  const CylinderBounds* cb = dynamic_cast<const CylinderBounds*>(&boundarySurface.bounds());
849  if (!cb) throw std::logic_error("Not CylinderBounds");
850  // --------------- material estimation ----------------------------------------------------------------
851  // -- material with 1D binning
852  double hz = cb->halflengthZ();
853  double r = cb->r();
854  BinUtility layerBinUtilityZ(m_barrelLayerBinsZ, -hz, hz, open, binZ);
855  if (m_barrelLayerBinsPhi==1){
856  layerMaterial = std::make_unique<BinnedLayerMaterial>(layerBinUtilityZ);
857  } else { // -- material with 2D binning
858  BinUtility layerBinUtilityRPhiZ(m_barrelLayerBinsPhi, -r*M_PI, r*M_PI, closed,binRPhi);
859  layerBinUtilityRPhiZ += layerBinUtilityZ;
860  layerMaterial = std::make_unique<BinnedLayerMaterial>(layerBinUtilityRPhiZ);
861  }
862  // --------------- material estimation ----------------------------------------------------------------
863  }
864  if (boundarySurface.type() == SurfaceType::Disc){
865  // --------------- material estimation ----------------------------------------------------------------
866  const DiscBounds* db = dynamic_cast<const DiscBounds*>(&boundarySurface.bounds());
867  if (!db) throw std::logic_error("Not DiscBounds");
868  double rMin = db->rMin();
869  double rMax = db->rMax();
870  BinUtility layerBinUtilityR(m_endcapLayerBinsR,rMin,rMax,open, binR);
871  // -- material with 1D binning
872  if (m_endcapLayerBinsPhi==1){
873  layerMaterial = std::make_unique<BinnedLayerMaterial>(layerBinUtilityR);
874  } else { // -- material with 2D binning
875  BinUtility layerBinUtilityPhi(m_endcapLayerBinsPhi,-M_PI,M_PI,closed,binPhi);
876  layerBinUtilityR += layerBinUtilityPhi;
877  layerMaterial = std::make_unique<BinnedLayerMaterial>(layerBinUtilityR);
878  }
879  // --------------- material estimation ----------------------------------------------------------------
880  }
881  // return what you have
882  return layerMaterial;
883 }
884 
885 
886 
889  BoundarySurfaceFace face,
890  TrackingVolume* insidevol) const {
891  TrackingVolumeManipulator::setInsideVolume( tvol, face, insidevol );
892 }
893 
894 
897  BoundarySurfaceFace face,
898  BinnedArray<TrackingVolume>* insidevolarray) const {
899  TrackingVolumeManipulator::setInsideVolumeArray(tvol,face,insidevolarray);
900 }
901 
902 
905  BoundarySurfaceFace face,
906  SharedObject<BinnedArray<TrackingVolume> > insidevolarray) const {
907  TrackingVolumeManipulator::setInsideVolumeArray(tvol,face,insidevolarray);
908 }
909 
910 
913  BoundarySurfaceFace face,
914  TrackingVolume* outsidevol) const {
915  ATH_MSG_VERBOSE( " -> Glue '" << outsidevol->volumeName() << "' at face " << face << " to '" << tvol.volumeName() << "'.");
916  TrackingVolumeManipulator::setOutsideVolume( tvol, face, outsidevol );
917 }
918 
919 
922  BoundarySurfaceFace face,
923  BinnedArray<TrackingVolume>* outsidevolarray) const {
924  unsigned int numVols = outsidevolarray->arrayObjects().size() ;
925  ATH_MSG_VERBOSE( " -> Glue " << numVols << " volumes at face " << face << " to '" << tvol.volumeName() );
926  TrackingVolumeManipulator::setOutsideVolumeArray( tvol, face, outsidevolarray );
927 }
928 
929 
932  BoundarySurfaceFace face,
933  SharedObject<BinnedArray<TrackingVolume> > outsidevolarray) const {
934  unsigned int numVols = outsidevolarray.get()->arrayObjects().size() ;
935  ATH_MSG_VERBOSE( " -> Glue " << numVols << " volumes at face " << face << " to '" << tvol.volumeName() );
936  TrackingVolumeManipulator::setOutsideVolumeArray( tvol, face, outsidevolarray );
937 }
938 }
Trk::TrackingVolumeManipulator
Definition: TrackingVolumeManipulator.h:32
beamspotman.r
def r
Definition: beamspotman.py:676
Trk::TrackingVolume::glueVolumesDescriptor
GlueVolumesDescriptor & glueVolumesDescriptor()
Definition: TrackingVolume.cxx:1205
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
DiscBounds.h
Surface.h
Trk::binZ
@ binZ
Definition: BinningType.h:49
PixelAthClusterMonAlgCfg.zmin
zmin
Definition: PixelAthClusterMonAlgCfg.py:176
Trk::TrackingVolumeHelper::setOutsideTrackingVolumeArray
void setOutsideTrackingVolumeArray(TrackingVolume &tvol, BoundarySurfaceFace face, BinnedArray< TrackingVolume > *outsidevolarray) const override
protected method to set outside VolumeArray of a BoundarySurface: input:
Definition: TrackingVolumeHelper.cxx:921
Trk::TrackingVolume::boundarySurfaces
std::vector< SharedObject< BoundarySurface< TrackingVolume > > > & boundarySurfaces()
Method to return the BoundarySurfaces.
Definition: TrackingVolume.cxx:982
BinnedArray.h
CaloCondBlobAlgs_fillNoiseFromASCII.db
db
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:43
Trk::TrackingVolumeHelper::m_barrelLayerBinsPhi
Gaudi::Property< int > m_barrelLayerBinsPhi
material bins in Phi
Definition: TrackingVolumeHelper.h:247
Trk::BoundaryDiscSurface::surfaceRepresentation
virtual const Surface & surfaceRepresentation() const override final
The Surface Representation of this.
Amg::getTranslateZ3D
Amg::Transform3D getTranslateZ3D(const double Z)
: Returns a shift transformation along the z-axis
Definition: GeoPrimitivesHelpers.h:285
Trk::TrackingVolumeHelper::m_barrelLayerBinsZ
Gaudi::Property< int > m_barrelLayerBinsZ
material bins in Z
Definition: TrackingVolumeHelper.h:246
BinUtility.h
Trk::TrackingVolumeHelper::setOutsideTrackingVolume
void setOutsideTrackingVolume(TrackingVolume &tvol, BoundarySurfaceFace face, TrackingVolume *outsidevol) const override
protected method to set outside Volume of a BoundarySurface: input:
Definition: TrackingVolumeHelper.cxx:912
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
DiscLayer.h
M_PI
#define M_PI
Definition: ActiveFraction.h:11
Trk::closed
@ closed
Definition: BinningType.h:41
VolumeBounds.h
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
HomogeneousLayerMaterial.h
Trk::positiveFaceXY
@ positiveFaceXY
Definition: BoundarySurfaceFace.h:33
Trk::TrackingVolumeHelper::m_layerArrayCreator
PublicToolHandle< ILayerArrayCreator > m_layerArrayCreator
A Tool for coherent LayerArray creation.
Definition: TrackingVolumeHelper.h:241
Trk::TrackingVolumeManipulator::setOutsideVolume
static void setOutsideVolume(TrackingVolume &tvol, BoundarySurfaceFace face, TrackingVolume *outsidevol)
protected method to set outside Volume of a BoundarySurface: input:
Definition: TrackingVolumeManipulator.cxx:82
Trk::DiscSurface
Definition: DiscSurface.h:54
Trk::TrackingVolumeHelper::m_endcapLayerBinsPhi
Gaudi::Property< int > m_endcapLayerBinsPhi
material bins in Phi
Definition: TrackingVolumeHelper.h:249
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Trk::TrackingVolumeHelper::fillGlueVolumes
static void fillGlueVolumes(const std::vector< TrackingVolume * > &topLevelVolumes, const std::vector< TrackingVolume * > &envelopeFaceVolumes, BoundarySurfaceFace glueFace, std::vector< Trk::TrackingVolume * > &glueVols)
Private method - it takes the full vector of given volumes to create the supervolume,...
Definition: TrackingVolumeHelper.cxx:707
ITrackingVolumeArrayCreator.h
Trk::TrackingVolumeManipulator::setInsideVolumeArray
static void setInsideVolumeArray(TrackingVolume &tvol, BoundarySurfaceFace face, BinnedArray< TrackingVolume > *insidevolarray)
protected method to set inside VolumeArray of a BoundarySurface: input:
Definition: TrackingVolumeManipulator.cxx:61
Trk::BoundarySurfaceFace
BoundarySurfaceFace
Definition: BoundarySurfaceFace.h:31
Trk::TrackingVolumeManipulator::setOutsideVolumeArray
static void setOutsideVolumeArray(TrackingVolume &tvol, BoundarySurfaceFace face, BinnedArray< TrackingVolume > *outsidevolarray)
protected method to set outside VolumeArray of a BoundarySurface: input:
Definition: TrackingVolumeManipulator.cxx:91
ILayerArrayCreator.h
Trk::TrackingVolumeHelper::glueTrackingVolumeArrays
Trk::TrackingVolume * glueTrackingVolumeArrays(TrackingVolume &firstVol, BoundarySurfaceFace firstFace, TrackingVolume &secondVol, BoundarySurfaceFace secondFace, std::string name) const override
Method to glue two VolumeArrays together (at navigation level)
Definition: TrackingVolumeHelper.cxx:409
takeBigger
#define takeBigger(current, test)
Definition: RobustTrackingGeometryBuilderImpl.h:44
Trk::Surface::setMaterialLayer
void setMaterialLayer(std::shared_ptr< Layer > mlay)
set material layer
CylinderVolumeBounds.h
Trk::BoundaryDiscSurface
Definition: BoundaryDiscSurface.h:40
Trk::TrackingVolumeHelper::setInsideTrackingVolumeArray
void setInsideTrackingVolumeArray(TrackingVolume &tvol, BoundarySurfaceFace face, BinnedArray< TrackingVolume > *insidevolarray) const override
protected method to set inside VolumeArray of a BoundarySurface: input:
Definition: TrackingVolumeHelper.cxx:896
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Trk::TrackingVolumeHelper::setInsideTrackingVolume
void setInsideTrackingVolume(TrackingVolume &tvol, BoundarySurfaceFace face, TrackingVolume *insidevol) const override
protected method to set inside Volume of a BoundarySurface: input:
Definition: TrackingVolumeHelper.cxx:888
TrackingVolumeHelper.h
beamspotman.n
n
Definition: beamspotman.py:731
Trk::GlueVolumesDescriptor::registerGlueVolumes
void registerGlueVolumes(BoundarySurfaceFace, std::vector< TrackingVolume * > &)
register the volumes
Definition: GlueVolumesDescriptor.cxx:28
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Trk::CylinderSurface
Definition: CylinderSurface.h:55
Trk::CylinderBounds
Definition: CylinderBounds.h:46
Trk::TrackingVolumeHelper::~TrackingVolumeHelper
virtual ~TrackingVolumeHelper()
Destructor.
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
CylinderSurface.h
Trk::CylinderVolumeBounds::halflengthZ
double halflengthZ() const
This method returns the halflengthZ.
Definition: CylinderVolumeBounds.h:207
PixelAthClusterMonAlgCfg.zmax
zmax
Definition: PixelAthClusterMonAlgCfg.py:176
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Trk::negativeFaceXY
@ negativeFaceXY
Definition: BoundarySurfaceFace.h:32
CylinderLayer.h
Trk::Volume::center
const Amg::Vector3D & center() const
returns the center of the volume
Definition: Volume.h:86
BinnedLayerMaterial.h
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
Trk::BinUtility
Definition: BinUtility.h:39
Trk::CylinderVolumeBounds
Definition: CylinderVolumeBounds.h:70
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::TrackingVolume::volumeName
const std::string & volumeName() const
Returns the VolumeName - for debug reason, might be depreciated later.
GlueVolumesDescriptor.h
Trk::GlueVolumesDescriptor::glueVolumes
const std::vector< TrackingVolume * > & glueVolumes(BoundarySurfaceFace)
retrieve them again
Definition: GlueVolumesDescriptor.cxx:40
Trk::Surface::bounds
virtual const SurfaceBounds & bounds() const =0
Surface Bounds method.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
Trk::CylinderVolumeBounds::outerRadius
double outerRadius() const
This method returns the outer radius.
Definition: CylinderVolumeBounds.h:191
Trk::BinnedArray::arrayObjects
virtual BinnedArraySpan< T *const > arrayObjects()=0
Return all objects of the Array non-const we can still modify the T.
Trk::BoundaryCylinderSurface::surfaceRepresentation
virtual const Surface & surfaceRepresentation() const override final
The Surface Representation of this.
MaterialLayer.h
takeSmaller
#define takeSmaller(current, test)
Definition: RobustTrackingGeometryBuilderImpl.h:43
Trk::Volume::transform
const Amg::Transform3D & transform() const
Return methods for geometry transform.
Definition: Volume.h:81
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::GlueVolumesDescriptor
Definition: GlueVolumesDescriptor.h:40
Trk::BoundaryCylinderSurface
Definition: BoundaryCylinderSurface.h:37
Trk::TrackingVolumeManipulator::setInsideVolume
static void setInsideVolume(TrackingVolume &tvol, BoundarySurfaceFace face, TrackingVolume *insidevol)
protected method to set inside Volume of a BoundarySurface: input:
Definition: TrackingVolumeManipulator.cxx:52
Trk::open
@ open
Definition: BinningType.h:40
Trk::TrackingVolumeHelper::layerMaterialProperties
std::unique_ptr< Trk::LayerMaterialProperties > layerMaterialProperties(const Trk::Surface &sf) const
< helper method to construct barrel material
Definition: TrackingVolumeHelper.cxx:843
CylinderBounds.h
Trk::binR
@ binR
Definition: BinningType.h:50
TrackingVolume.h
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
Trk::SharedObject
std::shared_ptr< T > SharedObject
Definition: SharedObject.h:24
Trk::binRPhi
@ binRPhi
Definition: BinningType.h:52
Trk::CylinderVolumeBounds::innerRadius
double innerRadius() const
This method returns the inner radius.
Definition: CylinderVolumeBounds.h:187
Trk::TrackingVolumeManipulator::setBoundarySurface
static void setBoundarySurface(TrackingVolume &tvol, SharedObject< BoundarySurface< TrackingVolume >> bsurf, BoundarySurfaceFace face)
protected method to set the boundary surface of a tracking volume
Definition: TrackingVolumeManipulator.cxx:43
GeoPrimitivesHelpers.h
Trk::TrackingVolumeManipulator::glueVolumes
void glueVolumes(TrackingVolume &firstVol, BoundarySurfaceFace firstFace, TrackingVolume &secondVol, BoundarySurfaceFace secondFace) const
protected method to glue two Volumes together input:
Definition: TrackingVolumeManipulator.cxx:17
Trk::TrackingVolumeHelper::TrackingVolumeHelper
TrackingVolumeHelper(const std::string &, const std::string &, const IInterface *)
Constructor.
Definition: TrackingVolumeHelper.cxx:50
Amg::Translation3D
Eigen::Translation< double, 3 > Translation3D
Definition: GeoPrimitives.h:44
Trk::Volume::volumeBounds
const VolumeBounds & volumeBounds() const
returns the volumeBounds()
Definition: Volume.h:97
Trk::SurfaceType::Disc
@ Disc
Trk::cylinderCover
@ cylinderCover
Definition: BoundarySurfaceFace.h:38
Trk::SurfaceType::Cylinder
@ Cylinder
Trk::tubeOuterCover
@ tubeOuterCover
Definition: BoundarySurfaceFace.h:40
Trk::TrackingVolumeHelper::m_endcapLayerBinsR
Gaudi::Property< int > m_endcapLayerBinsR
material bins in R
Definition: TrackingVolumeHelper.h:248
Trk::TrackingVolumeHelper::initialize
StatusCode initialize() override
AlgTool initialize method.
Definition: TrackingVolumeHelper.cxx:60
Trk::tubeInnerCover
@ tubeInnerCover
Definition: BoundarySurfaceFace.h:39
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
fitman.hz
def hz
Definition: fitman.py:516
Trk::BinnedArray
Definition: BinnedArray.h:38
AthAlgTool
Definition: AthAlgTool.h:26
Trk::TrackingVolumeHelper::glueTrackingVolumes
void glueTrackingVolumes(TrackingVolume &firstVol, BoundarySurfaceFace firstFace, TrackingVolume &secondVol, BoundarySurfaceFace secondFace, bool buildBoundaryLayer=false) const override
Method to glue two Volumes together input:
Definition: TrackingVolumeHelper.cxx:70
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
python.PyAthena.obj
obj
Definition: PyAthena.py:135
Trk::TrackingVolume
Definition: TrackingVolume.h:121
Trk::TrackingVolumeHelper::m_trackingVolumeArrayCreator
ToolHandle< ITrackingVolumeArrayCreator > m_trackingVolumeArrayCreator
Helper Tool to create TrackingVolume.
Definition: TrackingVolumeHelper.h:243
Trk::Surface::type
constexpr virtual SurfaceType type() const =0
Returns the Surface type to avoid dynamic casts.
LayerMaterialProperties.h
Trk::DiscBounds
Definition: DiscBounds.h:44
Trk::CylinderBounds::halflengthZ
double halflengthZ() const
This method returns the halflengthZ.
Amg::getTranslate3D
Amg::Transform3D getTranslate3D(const double X, const double Y, const double Z)
: Returns a shift transformation along an arbitrary axis
Definition: GeoPrimitivesHelpers.h:289
Trk::CylinderBounds::r
virtual double r() const override final
This method returns the radius.
Trk::binPhi
@ binPhi
Definition: BinningType.h:51