|
ATLAS Offline Software
|
#include <StagedTrackingGeometryBuilderImpl.h>
|
| StagedTrackingGeometryBuilderImpl (const std::string &, const std::string &, const IInterface *) |
| Constructor. More...
|
|
virtual | ~StagedTrackingGeometryBuilderImpl ()=default |
| Destructor. More...
|
|
virtual StatusCode | initialize () override |
| AlgTool initialize method. More...
|
|
virtual StatusCode | finalize () override |
| AlgTool finalize method. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
std::unique_ptr< Trk::TrackingGeometry > | trackingGeometryImpl (std::vector< InDet::LayerSetup > &layerSetups, double maximumLayerExtendZ, double maximumLayerRadius, double envelopeVolumeHalfZ, double envelopeVolumeRadius) const |
|
void | estimateLayerDimensions (const std::vector< Trk::Layer * > &layers, double &rMin, double &rMax, double &zMin, double &zMax) const |
| Private helper method to estimate the layer dimensions. More...
|
|
Trk::TrackingVolume * | createTrackingVolume (const std::vector< Trk::Layer * > &layers, double innerRadius, double &outerRadius, double zMin, double zMax, const std::string &volumeName, Trk::BinningType btype, bool doAdjustOuterRadius=true) const |
| Private helper method, creates a TrackingVolume - and checks if configured - for Ring Layout. More...
|
|
Trk::TrackingVolume * | packVolumeTriple (const std::vector< Trk::TrackingVolume * > &negVolumes, const std::vector< Trk::TrackingVolume * > ¢ralVolumes, const std::vector< Trk::TrackingVolume * > &posVolumes, const std::string &baseName="UndefinedVolume") const |
| Private helper method, creates and packs a triple containing of NegEndcap-Barrel-PosEndcap volumes. More...
|
|
LayerSetup | estimateLayerSetup (const std::string &idName, size_t ils, const std::vector< Trk::Layer * > &negLayers, const std::vector< Trk::Layer * > ¢ralLayers, const std::vector< Trk::Layer * > &posLayers, double maxR, double maxZ) const |
| Private helper method, estimates the overal dimensions. More...
|
|
bool | setupFitsCache (LayerSetup &layerSetup, std::vector< InDet::LayerSetup > &layerSetupCache) const |
| Private helper method to check if a sector is compatible with the cache. More...
|
|
Trk::TrackingVolume * | createFlushVolume (std::vector< InDet::LayerSetup > &layerSetupCache, double innerRadius, double &outerRadius, double extendZ) const |
| Private helper method to flush the cache into the id volumes - return volume is the one to be provided. More...
|
|
Trk::TrackingVolume * | packVolumeTriple (LayerSetup &layerSetup, double rMin, double &rMax, double zMin, double zPosCentral) const |
| Private helper method, creates and packs a triple containing of NegEndcap-Barrel-PosEndcap layers. More...
|
|
bool | ringLayout (const std::vector< Trk::Layer * > &layers, std::vector< double > &rmins, std::vector< double > &rmaxs) const |
| Private helper method for detection of Ring layout. More...
|
|
void | checkForInsert (std::vector< double > &radii, double radius) const |
| helper method needed for the Ring layout More...
|
|
void | checkForInsert (double rmin, double rmax, std::vector< std::pair< double, double >> &radii) const |
|
std::vector< Trk::Layer * > | checkZoverlap (std::vector< Trk::Layer * > &lays) const |
| Private helper method for merging of rings with z-overlap. More...
|
|
Trk::Layer * | mergeDiscLayers (std::vector< Trk::Layer * > &dlays) const |
|
void | renounceArray (SG::VarHandleKeyArray &handlesArray) |
| remove all handles from I/O resolution More...
|
|
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > | renounce (T &h) |
|
void | extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps) |
| Add StoreName to extra input/output deps as needed. More...
|
|
void | glueVolumes (TrackingVolume &firstVol, BoundarySurfaceFace firstFace, TrackingVolume &secondVol, BoundarySurfaceFace secondFace) const |
| protected method to glue two Volumes together input: More...
|
|
|
static void | setBoundarySurface (TrackingVolume &tvol, SharedObject< BoundarySurface< TrackingVolume >> bsurf, BoundarySurfaceFace face) |
| protected method to set the boundary surface of a tracking volume More...
|
|
static void | setInsideVolume (TrackingVolume &tvol, BoundarySurfaceFace face, TrackingVolume *insidevol) |
| protected method to set inside Volume of a BoundarySurface: input: More...
|
|
static void | setInsideVolumeArray (TrackingVolume &tvol, BoundarySurfaceFace face, BinnedArray< TrackingVolume > *insidevolarray) |
| protected method to set inside VolumeArray of a BoundarySurface: input: More...
|
|
static void | setInsideVolumeArray (TrackingVolume &tvol, BoundarySurfaceFace face, const SharedObject< BinnedArray< TrackingVolume >> &insidevolarray) |
| protected method to set inside VolumeArray of a BoundarySurface: input: More...
|
|
static void | setOutsideVolume (TrackingVolume &tvol, BoundarySurfaceFace face, TrackingVolume *outsidevol) |
| protected method to set outside Volume of a BoundarySurface: input: More...
|
|
static void | setOutsideVolumeArray (TrackingVolume &tvol, BoundarySurfaceFace face, BinnedArray< TrackingVolume > *outsidevolarray) |
| protected method to set outside VolumeArray of a BoundarySurface: input: More...
|
|
static void | setOutsideVolumeArray (TrackingVolume &tvol, BoundarySurfaceFace face, const SharedObject< BinnedArray< TrackingVolume >> &outsidevolarray) |
| protected method to set outside VolumeArray of a BoundarySurface: input: More...
|
|
static void | confineVolume (TrackingVolume &tvol, TrackingVolume *outsidevol) |
| protected method to confine (dense) volumes: input: More...
|
|
New Geometry builder that adapts to different layer setups
Only a few parameters are not automated:
- m_outwardsFraction: this defines how much you orient yourself on the next bigger layer if you wrap an outer volume around an inner 0.5 would lead to a boundary fully in bewteen
- at the outer boundary, 0. at the inner boundary
- Author
- Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch
Definition at line 121 of file StagedTrackingGeometryBuilderImpl.h.
◆ StoreGateSvc_t
◆ StagedTrackingGeometryBuilderImpl()
InDet::StagedTrackingGeometryBuilderImpl::StagedTrackingGeometryBuilderImpl |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~StagedTrackingGeometryBuilderImpl()
virtual InDet::StagedTrackingGeometryBuilderImpl::~StagedTrackingGeometryBuilderImpl |
( |
| ) |
|
|
virtualdefault |
◆ checkForInsert() [1/2]
void InDet::StagedTrackingGeometryBuilderImpl::checkForInsert |
( |
double |
rmin, |
|
|
double |
rmax, |
|
|
std::vector< std::pair< double, double >> & |
radii |
|
) |
| const |
|
inlineprotected |
Definition at line 307 of file StagedTrackingGeometryBuilderImpl.h.
311 if (!radii.size()) radii.push_back(std::pair<double,double>(rmin,rmax));
314 while (
ir != radii.size() && rmin > radii[
ir].second )
ir++;
316 if (
ir==radii.size()) radii.push_back(std::pair<double,double>(rmin,rmax));
318 else if (rmax<radii[
ir].
first) radii.insert(radii.begin()+
ir,std::pair<double,double>(rmin,rmax));
322 if (rmin<radii[
ir].
first) radii[
ir].first=rmin;
324 unsigned int imerge =
ir;
325 while (imerge<radii.size()-1 && rmax>radii[imerge+1].first) imerge++;
326 radii[
ir].second = rmax > radii[imerge].second ? rmax : radii[imerge].second;
327 if (imerge>
ir) radii.erase(radii.begin()+
ir+1,radii.begin()+imerge);
◆ checkForInsert() [2/2]
void InDet::StagedTrackingGeometryBuilderImpl::checkForInsert |
( |
std::vector< double > & |
radii, |
|
|
double |
radius |
|
) |
| const |
|
inlineprotected |
◆ checkZoverlap()
std::vector< Trk::Layer * > InDet::StagedTrackingGeometryBuilderImpl::checkZoverlap |
( |
std::vector< Trk::Layer * > & |
lays | ) |
const |
|
protected |
Private helper method for merging of rings with z-overlap.
Definition at line 743 of file StagedTrackingGeometryBuilderImpl.cxx.
748 std::map < float , std::vector<Trk::Layer*> > locationAndLayers;
754 for (
auto *lay : lays) {
755 float zpos= lay->surfaceRepresentation().center().z();
756 float thick = 0.5*lay->thickness();
758 bool foundZoverlap =
false;
759 for (
auto& singlePosLayer : locationAndLayers) {
760 if (abs(zpos - singlePosLayer.first) < thick) {
761 singlePosLayer.second.push_back(lay);
762 foundZoverlap =
true;
769 if (not foundZoverlap) {
770 locationAndLayers[zpos] = std::vector<Trk::Layer*>();
771 locationAndLayers[zpos].push_back(lay);
778 if (lays.size()>locationAndLayers.size()) {
779 std::vector<Trk::Layer*> mergedDiscLayers;
780 for (
auto& singlePosLayer : locationAndLayers) {
782 if (nd) mergedDiscLayers.push_back(nd);
784 ATH_MSG_WARNING(
"radial merge of rings failed, return the input layer set");
788 return mergedDiscLayers;
◆ confineVolume()
protected method to confine (dense) volumes: input:
- the volume that holdes the BoundarySurfaces (embedded)
- the volume to be set as outside volume
Definition at line 112 of file TrackingVolumeManipulator.cxx.
116 const auto& bounds = tvol.boundarySurfaces();
117 for (
const auto &
bound : bounds) {
118 if (
bound->outsideVolume() ==
nullptr) {
119 bound->setOutsideVolume(outsideVol);
121 if (
bound->insideVolume() ==
nullptr) {
122 bound->setInsideVolume(outsideVol);
◆ createFlushVolume()
Trk::TrackingVolume * InDet::StagedTrackingGeometryBuilderImpl::createFlushVolume |
( |
std::vector< InDet::LayerSetup > & |
layerSetupCache, |
|
|
double |
innerRadius, |
|
|
double & |
outerRadius, |
|
|
double |
extendZ |
|
) |
| const |
|
protected |
Private helper method to flush the cache into the id volumes - return volume is the one to be provided.
Definition at line 649 of file StagedTrackingGeometryBuilderImpl.cxx.
658 if (layerSetupCache.size() == 1 ){
659 ATH_MSG_VERBOSE(
" -> single sector setup - synchronising from inner (" << innerRadius <<
") to outer (" << outerRadius <<
") radius.");
660 ATH_MSG_VERBOSE(
" -> setup identification : " << layerSetupCache[0].identification );
662 flushVolume = layerSetupCache[0].buildEndcap ?
664 innerRadius, outerRadius,
665 extendZ,layerSetupCache[0].zSector) :
668 innerRadius,outerRadius,
670 layerSetupCache[0].identification,
674 ATH_MSG_VERBOSE(
" -> setup with " << layerSetupCache.size() <<
" entries - synchronising from inner (" << innerRadius <<
") to outer (" << outerRadius <<
") radius.");
676 std::vector<Trk::TrackingVolume*> negVolumes;
677 std::vector<Trk::TrackingVolume*> centralVolumes;
678 std::vector<Trk::TrackingVolume*> posVolumes;
679 std::string combinedName;
680 for (
size_t ilS = 0; ilS < layerSetupCache.size(); ++ilS){
682 double irE = ilS ? 0.5*(layerSetupCache[ilS].minRadiusEndcap+layerSetupCache[ilS-1].maxRadiusEndcap) : innerRadius;
683 double irC = ilS ? 0.5*(layerSetupCache[ilS].minRadiusCenter+layerSetupCache[ilS-1].maxRadiusCenter) : innerRadius;
685 double orE = ((ilS+1)==layerSetupCache.size()) ? outerRadius : 0.5*(layerSetupCache[ilS+1].minRadiusEndcap+layerSetupCache[ilS].maxRadiusEndcap);
686 double orC = ((ilS+1)==layerSetupCache.size()) ? outerRadius : 0.5*(layerSetupCache[ilS+1].minRadiusCenter+layerSetupCache[ilS].maxRadiusCenter);
688 if(ilS==layerSetupCache.size()-1) {
690 ATH_MSG_VERBOSE(
" --> adjust volumes to same extends: orE=" << orE <<
" orC=" << orC);
691 if(orE>orC) orC=orE;
else orE=orC;
695 layerSetupCache[ilS].negativeLayers,
699 -layerSetupCache[ilS].zSector,
700 layerSetupCache[ilS].identification +
"::NegativeEndcap",
705 layerSetupCache[ilS].centralLayers,
709 -layerSetupCache[ilS].zSector,
710 layerSetupCache[ilS].zSector,
711 layerSetupCache[ilS].identification +
"::Barrel",
714 layerSetupCache[ilS].positiveLayers,
717 layerSetupCache[ilS].zSector,
719 layerSetupCache[ilS].identification +
"::PositiveEndcap",
727 negVolumes.push_back(nVolume);
728 centralVolumes.push_back(cVolume);
729 posVolumes.push_back(pVolume);
731 combinedName +=
"_"+layerSetupCache[ilS].identification;
734 flushVolume =
packVolumeTriple(negVolumes,centralVolumes,posVolumes,combinedName);
737 layerSetupCache.clear();
◆ createTrackingVolume()
Trk::TrackingVolume * InDet::StagedTrackingGeometryBuilderImpl::createTrackingVolume |
( |
const std::vector< Trk::Layer * > & |
layers, |
|
|
double |
innerRadius, |
|
|
double & |
outerRadius, |
|
|
double |
zMin, |
|
|
double |
zMax, |
|
|
const std::string & |
volumeName, |
|
|
Trk::BinningType |
btype, |
|
|
bool |
doAdjustOuterRadius = true |
|
) |
| const |
|
protected |
Private helper method, creates a TrackingVolume - and checks if configured - for Ring Layout.
- in case a ring layout is given, it creates the corresponding sub-volumes and updates the radius
Definition at line 285 of file StagedTrackingGeometryBuilderImpl.cxx.
297 std::vector<double> ringRmins;
298 std::vector<double> ringRmaxa;
300 ATH_MSG_INFO(
"Ring layout is present for volume '" << volumeName <<
"' dealing with it.");
302 std::vector<Trk::TrackingVolume* > ringVolumes;
303 std::vector<Trk::TrackingVolume* > const_ringVolumes;
306 std::vector< std::vector<Trk::Layer*> > groupedDiscs(ringRmins.size(), std::vector<Trk::Layer*>() );
308 for (
auto *ring :
layers){
310 const Trk::Surface& ringSurface = ring->surfaceRepresentation();
314 double rMax = ringBounds->
rMax();
317 for (
auto& rm : ringRmaxa){
323 if (dring) groupedDiscs[rPos].push_back(dring);
327 std::vector< std::vector<Trk::Layer*> > mergedLayers;
328 std::vector< float > mergedRmax;
329 std::vector< std::vector< int > >
merge;
330 std::vector<int> laySet(1,0);
merge.push_back(laySet);
331 double rCurr = ringRmaxa[0];
332 mergedRmax.push_back(rCurr);
333 for (
int idset = 1; idset <
int(groupedDiscs.size()); idset++){
335 merge.back().push_back(idset);
336 if (ringRmaxa[idset]>mergedRmax.back()) mergedRmax.back()=ringRmaxa[idset];
338 merge.emplace_back(1,idset);
339 mergedRmax.push_back(ringRmaxa[idset]);
341 rCurr = ringRmaxa[idset];
343 for (
const auto& layset :
merge ) {
344 std::vector<Trk::Layer*> ringSet;
345 for (
const auto& lay : layset ) {
346 for (
auto *ring : groupedDiscs[lay]) {
347 float zPos = ring->surfaceRepresentation().center().z();
348 if (ringSet.empty() || zPos>ringSet.back()->surfaceRepresentation().center().z()) ringSet.push_back(ring);
351 while (lit!=ringSet.end() && zPos>(*lit)->surfaceRepresentation().center().z()) ++lit;
352 ringSet.insert(lit,ring);
360 for (
int idset = 0; idset <
int(mergedLayers.size()); idset++){
364 if(idset==
int(mergedLayers.size())-1 && !doAdjustOuterRadius) crmax = outerRadius;
366 std::string ringVolumeName = volumeName+
"Ring"+
std::to_string(idset);
377 ringVolumes.push_back(ringVolume);
378 const_ringVolumes.push_back(ringVolume);
383 ATH_MSG_INFO(
" -> adjusting the outer radius to the last ring at " << outerRadius );
384 ATH_MSG_INFO(
" -> created " << ringVolumes.size() <<
" ring volumes for Volume '" << volumeName <<
"'.");
386 if (ringVolumes.size()==1)
387 return ringVolumes.at(0);
397 innerRadius,outerRadius,
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ estimateLayerDimensions()
void InDet::StagedTrackingGeometryBuilderImpl::estimateLayerDimensions |
( |
const std::vector< Trk::Layer * > & |
layers, |
|
|
double & |
rMin, |
|
|
double & |
rMax, |
|
|
double & |
zMin, |
|
|
double & |
zMax |
|
) |
| const |
|
protected |
◆ estimateLayerSetup()
Private helper method, estimates the overal dimensions.
Definition at line 541 of file StagedTrackingGeometryBuilderImpl.cxx.
551 double cenMinR = 10e10;
553 double cenMinZ = 10e10;
555 double posMinR = 10e10;
557 double posMinZ = 10e10;
564 if (posMaxZ > maxZ) {
565 ATH_MSG_WARNING(
"Estimated z extended of central sector bigger than maximal z extened. Resetting - may lose layers though.");
567 }
else if (posMaxZ > maxZ) {
568 ATH_MSG_WARNING(
"Estimated z extended of endcap sector bigger than maximal z extened. Resetting - may lose layers though.");
572 if (cenMaxR > maxR) {
573 ATH_MSG_WARNING(
"Estimated r extended of central sector bigger than maximal r extened. Resetting - may lose layers though.");
576 if (posMaxR > maxR) {
577 ATH_MSG_WARNING(
"Estimated r extended of endcap sector bigger than maximal r extened. Resetting - may lose layers though.");
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ finalize()
StatusCode InDet::StagedTrackingGeometryBuilderImpl::finalize |
( |
| ) |
|
|
overridevirtual |
◆ glueVolumes()
protected method to glue two Volumes together input:
- first TrackingVolume that keeps boundary surface
- face of the BoundarySurface to be kept
- second volume that gets glued to the first volume
- face of the BoundarySurface to be shared
Definition at line 17 of file TrackingVolumeManipulator.cxx.
28 return glueVolumes(secondVol, secondFace, firstVol, firstFace);
◆ initialize()
StatusCode InDet::StagedTrackingGeometryBuilderImpl::initialize |
( |
| ) |
|
|
overridevirtual |
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ mergeDiscLayers()
Trk::Layer * InDet::StagedTrackingGeometryBuilderImpl::mergeDiscLayers |
( |
std::vector< Trk::Layer * > & |
dlays | ) |
const |
|
protected |
Definition at line 795 of file StagedTrackingGeometryBuilderImpl.cxx.
798 if (inputDiscs.size()==1)
799 return inputDiscs.at(0);
802 std::pair<float,float> zb(1.e5,-1.e5);
804 std::vector< std::pair<float,float> > rbounds;
805 std::vector<size_t> discOrder;
807 for (
const auto * lay : inputDiscs ) {
808 zb.first = fmin( zb.first, lay->surfaceRepresentation().center().z()-0.5*lay->thickness());
809 zb.second = fmax( zb.second, lay->surfaceRepresentation().center().z()+0.5*lay->thickness());
815 float r =
db->rMin();
816 if (rbounds.empty() ||
r>rbounds.back().first) {
817 rbounds.emplace_back(
r,
db->rMax());
818 discOrder.push_back(
id);
820 int ir=rbounds.size()-1;
825 auto rboundsInsertionPt(rbounds.begin());
826 std::advance(rboundsInsertionPt,
ir+1);
827 rbounds.insert(rboundsInsertionPt,std::pair<float,float> (
r,
db->rMax()));
828 auto discOrderInsertionPt(discOrder.begin());
829 std::advance(discOrderInsertionPt,
ir+1);
830 discOrder.insert(discOrderInsertionPt,
id);
835 std::vector<float> rsteps;
836 std::vector<Trk::Surface*> surfs;
837 std::vector<Trk::BinUtility*>* binUtils=
new std::vector<Trk::BinUtility*>();
838 rsteps.push_back(rbounds[0].
first);
839 for (
unsigned int id=0;
id<discOrder.size();
id++) {
840 unsigned int index=discOrder[
id];
848 if (
id+1<discOrder.size()) rsteps.push_back( 0.5*(rbounds[
id].
second+rbounds[
id+1].
first));
850 surfs.insert(surfs.end(),ringSurf.begin(),ringSurf.end());
854 rsteps.push_back(rbounds.back().second);
856 std::vector< std::pair< Trk::SharedObject<Trk::Surface>,
Amg::Vector3D > > surfaces;
857 for (
auto *
sf : surfs ) {
859 std::pair< Trk::SharedObject<Trk::Surface>,
Amg::Vector3D > surfaceOrder(sharedSurface,
sf->center());
860 surfaces.push_back(surfaceOrder);
866 auto mergeBA = std::make_unique<Trk::BinnedArray1D1D<Trk::Surface>>(
872 std::vector<Trk::BinUtility*>* clonedBinUtils =
new std::vector<Trk::BinUtility*>();
873 for (
auto *bu : *binUtils) clonedBinUtils->push_back(bu->clone());
874 auto olDescriptor = std::make_unique<InDet::DiscOverlapDescriptor>(mergeBA.get(),clonedBinUtils,
true);
877 double disc_thickness = std::fabs(zb.second-zb.first);
878 double disc_pos = (zb.first+zb.second)*0.5;
890 *(inputDiscs[0]->layerMaterialProperties()),
892 std::move(olDescriptor));
895 for (
const auto *
sf : layerSurfaces) {
897 const std::vector<const Trk::Surface*>& allSurfacesVector = detElement->
surfaces();
898 for (
const auto *subsf : allSurfacesVector){
903 for (
const auto *disc : inputDiscs) {
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ packVolumeTriple() [1/2]
Private helper method, creates and packs a triple containing of NegEndcap-Barrel-PosEndcap volumes.
Definition at line 404 of file StagedTrackingGeometryBuilderImpl.cxx.
410 ATH_MSG_VERBOSE(
'\t' <<
'\t'<<
"Pack provided Volumes from '" << baseName <<
"' triple into a container volume. " );
412 unsigned int negVolSize = negVolumes.size();
413 unsigned int cenVolSize = centralVolumes.size();
414 unsigned int posVolSize = posVolumes.size();
419 std::string volumeBase =
m_namespace+
"Containers::"+baseName;
424 volumeBase+
"::NegativeSector",
427 (negVolSize ? negVolumes[0] :
nullptr);
431 volumeBase+
"::CentralSector",
434 (cenVolSize ? centralVolumes[0] :
nullptr) ;
439 volumeBase+
"::PositiveSector",
442 (posVolSize ? posVolumes[0] :
nullptr);
444 if (!negativeVolume && !positiveVolume){
445 ATH_MSG_DEBUG(
"No negative/positive sector given - no packing needed, returning central container!" );
446 return centralVolume;
449 std::vector<Trk::TrackingVolume*> tripleVolumes;
450 if (negativeVolume) tripleVolumes.push_back(negativeVolume);
451 if (centralVolume) tripleVolumes.push_back(centralVolume);
452 if (positiveVolume) tripleVolumes.push_back(positiveVolume);
460 return tripleContainer;
◆ packVolumeTriple() [2/2]
Trk::TrackingVolume * InDet::StagedTrackingGeometryBuilderImpl::packVolumeTriple |
( |
InDet::LayerSetup & |
layerSetup, |
|
|
double |
rMin, |
|
|
double & |
rMax, |
|
|
double |
zMin, |
|
|
double |
zPosCentral |
|
) |
| const |
|
protected |
Private helper method, creates and packs a triple containing of NegEndcap-Barrel-PosEndcap layers.
- in case of a ring layout the subvolumes are created and the rMax is adapted
Definition at line 465 of file StagedTrackingGeometryBuilderImpl.cxx.
484 volumeBase +
"::NegativeEndcap",
496 volumeBase +
"::Barrel",
505 volumeBase +
"::PositiveEndcap",
511 '\t' <<
'\t' <<
"Volumes have been created, now pack them into a triple.");
518 std::vector<Trk::TrackingVolume*> tripleVolumes;
519 tripleVolumes.push_back(negativeVolume);
520 tripleVolumes.push_back(centralVolume);
521 tripleVolumes.push_back(positiveVolume);
532 ATH_MSG_VERBOSE(
'\t' <<
'\t' <<
"Created container volume with bounds: "
535 return tripleContainer;
◆ renounce()
◆ renounceArray()
◆ ringLayout()
bool InDet::StagedTrackingGeometryBuilderImpl::ringLayout |
( |
const std::vector< Trk::Layer * > & |
layers, |
|
|
std::vector< double > & |
rmins, |
|
|
std::vector< double > & |
rmaxs |
|
) |
| const |
|
protected |
Private helper method for detection of Ring layout.
Definition at line 237 of file StagedTrackingGeometryBuilderImpl.cxx.
239 std::vector<std::pair<double,double>> radii;
241 for (
auto *
const ring :
layers) {
243 const Trk::Surface& ringSurface = ring->surfaceRepresentation();
247 double zpos = ringSurface.
center().z();
248 double rMin = ringBounds->
rMin();
249 double rMax = ringBounds->
rMax();
252 ATH_MSG_DEBUG(
" -> Ring at z-position " << zpos <<
" - with rMin/rMax = " << rMin <<
"/" << rMax );
257 std::vector<std::pair<double,double>> tmpradii;
259 for (
auto& rs: radii) {
261 for (
auto& tmprs: tmpradii) {
262 if ((rs.first<tmprs.second and rs.second>tmprs.first) ) {
263 tmprs.first =
std::min(tmprs.first ,rs.first );
264 tmprs.second =
std::max(tmprs.second,rs.second);
270 tmpradii.push_back(rs);
274 rmins.clear(); rmaxs.clear();
275 for (
auto&
r: tmpradii) {
276 rmins.push_back(
r.first);
277 rmaxs.push_back(
r.second);
281 return (rmins.size() > 1 );
◆ setBoundarySurface()
protected method to set the boundary surface of a tracking volume
Definition at line 43 of file TrackingVolumeManipulator.cxx.
48 (tvol.m_boundarySurfaces)[face] = std::move(bsurf);
◆ setInsideVolume()
protected method to set inside Volume of a BoundarySurface: input:
- the volume that holdes the BoundarySurface
- the face type of the boundary to be set
- the volume to be set as inside volume
Definition at line 52 of file TrackingVolumeManipulator.cxx.
◆ setInsideVolumeArray() [1/2]
protected method to set inside VolumeArray of a BoundarySurface: input:
- ithe volume that holdes the BoundarySurface
- the face type of the boundary to be set
- the volume array to be set as inside volume array
Definition at line 61 of file TrackingVolumeManipulator.cxx.
◆ setInsideVolumeArray() [2/2]
protected method to set inside VolumeArray of a BoundarySurface: input:
- ithe volume that holdes the BoundarySurface
- the face type of the boundary to be set
- the volume array to be set as inside volume array
◆ setOutsideVolume()
protected method to set outside Volume of a BoundarySurface: input:
- the volume that holdes the BoundarySurface
- the face type of the boundary to be set
- the volume to be set as outside volume
Definition at line 82 of file TrackingVolumeManipulator.cxx.
◆ setOutsideVolumeArray() [1/2]
protected method to set outside VolumeArray of a BoundarySurface: input:
- the volume that holdes the BoundarySurface
- the face type of the boundary to be set
- the volume array to be set as outside volume array
Definition at line 91 of file TrackingVolumeManipulator.cxx.
◆ setOutsideVolumeArray() [2/2]
protected method to set outside VolumeArray of a BoundarySurface: input:
- the volume that holdes the BoundarySurface
- the face type of the boundary to be set
- the volume array to be set as outside volume array
◆ setupFitsCache()
bool InDet::StagedTrackingGeometryBuilderImpl::setupFitsCache |
( |
LayerSetup & |
layerSetup, |
|
|
std::vector< InDet::LayerSetup > & |
layerSetupCache |
|
) |
| const |
|
protected |
Private helper method to check if a sector is compatible with the cache.
Definition at line 601 of file StagedTrackingGeometryBuilderImpl.cxx.
606 double maxCenterCacheZ = 0.;
608 double minEndcapCacheZ = 10e10;
610 bool fullSectorSetup =
false;
612 for (
const auto& lCacheSetup : layerSetupCache){
613 takeBigger(maxCenterCacheZ, lCacheSetup.zExtendCenter);
614 takeSmaller(minEndcapCacheZ, lCacheSetup.minZextendEndcap);
616 fullSectorSetup = lCacheSetup.buildEndcap ? true : fullSectorSetup;
620 if (!fullSectorSetup) {
621 ATH_MSG_VERBOSE(
" -> only central sector being built, flush the cache ... ");
625 if (minEndcapCacheZ < layerSetup.zExtendCenter){
626 ATH_MSG_VERBOSE(
" -> cache endcap extend reaches into new central sector, flush the cache ... ");
630 if (maxCenterCacheZ < layerSetup.minZextendEndcap ) {
631 ATH_MSG_VERBOSE(
" -> sector fully fits into cache! Add it and start synchronising ...");
633 double newCenterMaxZ = maxCenterCacheZ > layerSetup.zExtendCenter ? maxCenterCacheZ : layerSetup.zExtendCenter;
634 double newEndcapMinZ = minEndcapCacheZ < layerSetup.minZextendEndcap ? minEndcapCacheZ : layerSetup.minZextendEndcap;
635 double newSectorZ = 0.5*(newCenterMaxZ+newEndcapMinZ);
637 for (
auto& lCacheSetup : layerSetupCache)
638 lCacheSetup.zSector = newSectorZ;
639 layerSetup.zSector = newSectorZ;
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ trackingGeometryImpl()
std::unique_ptr< Trk::TrackingGeometry > InDet::StagedTrackingGeometryBuilderImpl::trackingGeometryImpl |
( |
std::vector< InDet::LayerSetup > & |
layerSetups, |
|
|
double |
maximumLayerExtendZ, |
|
|
double |
maximumLayerRadius, |
|
|
double |
envelopeVolumeHalfZ, |
|
|
double |
envelopeVolumeRadius |
|
) |
| const |
|
protected |
Definition at line 69 of file StagedTrackingGeometryBuilderImpl.cxx.
78 std::vector<Trk::TrackingVolume*> idVolumes;
80 std::vector<InDet::LayerSetup> layerSetupCache;
83 double lastFlushRadius = 0.;
88 "[ STEP 2 ] : Looping through the layer setups and flush them into the "
89 "ID detector volume vector.");
90 for (
auto& lSetup : layerSetups) {
93 << lSetup.identification
94 <<
"' ] being processed, current cache size is "
95 << layerSetupCache.size());
97 " -> estimated dimensions for this layer setup are");
99 << lSetup.minRadiusCenter <<
" / "
100 << lSetup.maxRadiusCenter <<
" / "
101 << lSetup.zExtendCenter);
105 if (layerSetupCache.empty() ||
setupFitsCache(lSetup, layerSetupCache)) {
107 " -> cache is empty or new sector fits cache setup - add "
108 "this one to the cache.");
112 " -> new sector does not fit the current cache specs -> "
113 "flushing the cache.");
117 (layerSetupCache[layerSetupCache.size() - 1].rMax + lSetup.rMin);
120 layerSetupCache, lastFlushRadius, flushRadius, maximumLayerExtendZ);
122 idVolumes.push_back(fVolume);
124 lastFlushRadius = flushRadius;
127 layerSetupCache.push_back(lSetup);
131 if (!layerSetupCache.empty()) {
133 "[ STEP 3 ] : Flush the remaining cache into the ID detector volume "
136 double flushRadius = 0.5 * (maximumLayerRadius + envelopeVolumeRadius);
138 layerSetupCache, lastFlushRadius, flushRadius, maximumLayerExtendZ);
140 idVolumes.push_back(fVolume);
141 lastFlushRadius = flushRadius;
144 ATH_MSG_DEBUG(
"[ STEP 4 ] : Create the ID detector volumes");
149 -maximumLayerExtendZ, maximumLayerExtendZ, 1,
true,
151 idVolumes.push_back(centralEnclosure);
153 std::string volumeName =
m_namespace +
"Detectors::Container";
162 -envelopeVolumeHalfZ, -maximumLayerExtendZ, 1,
false,
169 maximumLayerExtendZ, envelopeVolumeHalfZ, 1,
false,
172 std::vector<Trk::TrackingVolume*> enclosedVolumes;
173 enclosedVolumes.push_back(negativeEnclosure);
174 enclosedVolumes.push_back(idContainer);
175 enclosedVolumes.push_back(positiveEnclosure);
184 auto trackingGeometry =
185 std::make_unique<Trk::TrackingGeometry>(enclosedDetector);
191 return trackingGeometry;
◆ updateVHKA()
◆ m_buildBoundaryLayers
BooleanProperty InDet::StagedTrackingGeometryBuilderImpl::m_buildBoundaryLayers |
|
protected |
◆ m_checkForRingLayout
BooleanProperty InDet::StagedTrackingGeometryBuilderImpl::m_checkForRingLayout |
|
protected |
◆ m_colorCodesConfig
IntegerArrayProperty InDet::StagedTrackingGeometryBuilderImpl::m_colorCodesConfig |
|
protected |
◆ m_detStore
◆ m_enclosingCylinderRadius
DoubleArrayProperty InDet::StagedTrackingGeometryBuilderImpl::m_enclosingCylinderRadius |
|
protected |
◆ m_enclosingDiscPositionZ
DoubleArrayProperty InDet::StagedTrackingGeometryBuilderImpl::m_enclosingDiscPositionZ |
|
protected |
◆ m_enclosingEnvelopeSvc
◆ m_evtStore
◆ m_exitVolume
StringProperty InDet::StagedTrackingGeometryBuilderImpl::m_exitVolume |
|
protected |
◆ m_indexStaticLayers
BooleanProperty InDet::StagedTrackingGeometryBuilderImpl::m_indexStaticLayers |
|
protected |
◆ m_layerArrayCreator
◆ m_layerBinningTypeCenter
IntegerArrayProperty InDet::StagedTrackingGeometryBuilderImpl::m_layerBinningTypeCenter |
|
protected |
◆ m_layerBinningTypeEndcap
IntegerArrayProperty InDet::StagedTrackingGeometryBuilderImpl::m_layerBinningTypeEndcap |
|
protected |
◆ m_layerEnvelopeCover
DoubleProperty InDet::StagedTrackingGeometryBuilderImpl::m_layerEnvelopeCover |
|
protected |
◆ m_materialProperties
◆ m_namespace
StringProperty InDet::StagedTrackingGeometryBuilderImpl::m_namespace |
|
protected |
◆ m_removeHGTD
BooleanProperty InDet::StagedTrackingGeometryBuilderImpl::m_removeHGTD {this, "RemoveHGTD", false} |
|
protected |
◆ m_replaceJointBoundaries
BooleanProperty InDet::StagedTrackingGeometryBuilderImpl::m_replaceJointBoundaries |
|
protected |
◆ m_ringTolerance
DoubleProperty InDet::StagedTrackingGeometryBuilderImpl::m_ringTolerance |
|
protected |
◆ m_trackingVolumeCreator
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_zMinHGTD
FloatProperty InDet::StagedTrackingGeometryBuilderImpl::m_zMinHGTD {this, "ZminHGTD", 3420.f} |
|
protected |
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
IntegerArrayProperty m_layerBinningTypeCenter
binning type for the provided layers
ServiceHandle< IEnvelopeDefSvc > m_enclosingEnvelopeSvc
the service to provide the ID envelope size
Trk::TrackingVolume * createTrackingVolume(const std::vector< Trk::Layer * > &layers, double innerRadius, double &outerRadius, double zMin, double zMax, const std::string &volumeName, Trk::BinningType btype, bool doAdjustOuterRadius=true) const
Private helper method, creates a TrackingVolume - and checks if configured - for Ring Layout.
virtual const BinUtility * binUtility() const =0
Return the BinUtility.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
const std::vector< const Trk::Surface * > & surfaces() const
Returns the full list of surfaces associated to this detector element.
virtual const CylinderSurface & surfaceRepresentation() const override final
Transforms the layer into a Surface representation for extrapolation.
Trk::TrackingVolume * packVolumeTriple(const std::vector< Trk::TrackingVolume * > &negVolumes, const std::vector< Trk::TrackingVolume * > ¢ralVolumes, const std::vector< Trk::TrackingVolume * > &posVolumes, const std::string &baseName="UndefinedVolume") const
Private helper method, creates and packs a triple containing of NegEndcap-Barrel-PosEndcap volumes.
PublicToolHandle< Trk::ILayerArrayCreator > m_layerArrayCreator
Helper Tool to create BinnedArrays.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
virtual const CylinderBounds & bounds() const override final
This method returns the CylinderBounds by reference (NoBounds is not possible for cylinder)
static void setOutsideVolume(TrackingVolume &tvol, BoundarySurfaceFace face, TrackingVolume *outsidevol)
protected method to set outside Volume of a BoundarySurface: input:
T * set(std::unique_ptr< T > elt) const
Atomically set the element.
#define ATH_MSG_VERBOSE(x)
const Amg::Vector3D & center() const
Returns the center position of the Surface.
static void setInsideVolumeArray(TrackingVolume &tvol, BoundarySurfaceFace face, BinnedArray< TrackingVolume > *insidevolarray)
protected method to set inside VolumeArray of a BoundarySurface: input:
void registerColorCode(unsigned int icolor)
Register the color code.
double rMax() const
This method returns outer radius.
static void setOutsideVolumeArray(TrackingVolume &tvol, BoundarySurfaceFace face, BinnedArray< TrackingVolume > *outsidevolarray)
protected method to set outside VolumeArray of a BoundarySurface: input:
virtual void setOwner(IDataHandleHolder *o)=0
#define takeBigger(current, test)
DoubleProperty m_ringTolerance
the ring tolerance
double rMin() const
This method returns inner radius.
DoubleProperty m_layerEnvelopeCover
innermost - outermost
BooleanProperty m_checkForRingLayout
this is to check for the endcap ring layout
StringProperty m_exitVolume
the final ID container
Eigen::Affine3d Transform3D
void checkForInsert(std::vector< double > &radii, double radius) const
helper method needed for the Ring layout
bool setupFitsCache(LayerSetup &layerSetup, std::vector< InDet::LayerSetup > &layerSetupCache) const
Private helper method to check if a sector is compatible with the cache.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
BinningValue binningValue(size_t ba=0) const
The type/value of the binning.
std::vector< Trk::Layer * > checkZoverlap(std::vector< Trk::Layer * > &lays) const
Private helper method for merging of rings with z-overlap.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
CxxUtils::CachedUniquePtrT< Trk::Material > m_materialProperties
overal material properties of the ID
Ensure that the ATLAS eigen extensions are properly loaded.
virtual const SurfaceBounds & bounds() const =0
Surface Bounds method.
void associateLayer(const Layer &lay)
method to associate the associated Trk::Layer which is alreay owned
std::string to_string(const DetectorType &type)
virtual BinnedArraySpan< T *const > arrayObjects()=0
Return all objects of the Array non-const we can still modify the T.
#define takeSmaller(current, test)
StringProperty m_namespace
identificaton namespace
Eigen::Matrix< double, 3, 1 > Vector3D
void estimateLayerDimensions(const std::vector< Trk::Layer * > &layers, double &rMin, double &rMax, double &zMin, double &zMax) const
Private helper method to estimate the layer dimensions.
static void setInsideVolume(TrackingVolume &tvol, BoundarySurfaceFace face, TrackingVolume *insidevol)
protected method to set inside Volume of a BoundarySurface: input:
int ir
counter of the current depth
PublicToolHandle< Trk::ITrackingVolumeCreator > m_trackingVolumeCreator
< Helper Tool to create TrackingVolumes
std::shared_ptr< T > SharedObject
IntegerArrayProperty m_layerBinningTypeEndcap
binning type for the provided layers
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
#define ATH_MSG_WARNING(x)
bool ringLayout(const std::vector< Trk::Layer * > &layers, std::vector< double > &rmins, std::vector< double > &rmaxs) const
Private helper method for detection of Ring layout.
void glueVolumes(TrackingVolume &firstVol, BoundarySurfaceFace firstFace, TrackingVolume &secondVol, BoundarySurfaceFace secondFace) const
protected method to glue two Volumes together input:
Eigen::Translation< double, 3 > Translation3D
std::vector< Trk::Layer * > positiveLayers
const VolumeBounds & volumeBounds() const
returns the volumeBounds()
BinUtility * clone() const
Implizit Constructor.
def merge(input_file_pattern, output_file)
Merge many input LHE files into a single output file.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
std::vector< Trk::Layer * > negativeLayers
Trk::Layer * mergeDiscLayers(std::vector< Trk::Layer * > &dlays) const
BooleanProperty m_replaceJointBoundaries
run with replacement of all joint boundaries
BooleanProperty m_indexStaticLayers
forces robust indexing for layers
std::vector< Trk::Layer * > centralLayers
BooleanProperty m_buildBoundaryLayers
create boundary layers
std::vector< SharedObject< BoundarySurface< TrackingVolume > > > m_boundarySurfaces
IntegerArrayProperty m_colorCodesConfig
Color codes.
std::span< T > BinnedArraySpan
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
std::string identification
Trk::TrackingVolume * createFlushVolume(std::vector< InDet::LayerSetup > &layerSetupCache, double innerRadius, double &outerRadius, double extendZ) const
Private helper method to flush the cache into the id volumes - return volume is the one to be provide...
double halflengthZ() const
This method returns the halflengthZ.
virtual double r() const override final
This method returns the radius.