|
ATLAS Offline Software
|
#include <HGTD_LayerBuilderCond.h>
|
| HGTD_LayerBuilderCond (const std::string &, const std::string &, const IInterface *) |
| AlgTool style constructor. More...
|
|
virtual | ~HGTD_LayerBuilderCond () |
| Destructor. More...
|
|
virtual StatusCode | initialize () override |
| AlgTool initialize method. More...
|
|
virtual std::unique_ptr< const std::vector< Trk::CylinderLayer * > > | cylindricalLayers (const EventContext &ctx, SG::WriteCondHandle< Trk::TrackingGeometry > &whandle) const override final |
| LayerBuilder interface method - returning Barrel-like layers. More...
|
|
virtual std::unique_ptr< const std::vector< Trk::DiscLayer * > > | discLayers (const EventContext &ctx, SG::WriteCondHandle< Trk::TrackingGeometry > &whandle) const override final |
| LayerBuilder interface method - returning Endcap-like layers. More...
|
|
virtual std::unique_ptr< const std::vector< Trk::PlaneLayer * > > | planarLayers (const EventContext &ctx, SG::WriteCondHandle< Trk::TrackingGeometry > &whandle) const override final |
| LayerBuilder interface method - returning Planar-like layers. More...
|
|
virtual const std::string & | identification () const override final |
| Name identification. 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 |
|
| DeclareInterfaceID (ILayerBuilderCond, 1, 0) |
| Creates the InterfaceID and interfaceID() method. More...
|
|
virtual void | validationAction () const |
| Validation Action: Can be implemented optionally, outside access to internal validation steps. More...
|
|
The HGTD_LayerBuilderCond parses the senstive detector elments and orders them onto a Disc surface; no cylindrical layers are expected. This implementation is based on what done in the SiLayerBuilderCond, adapted to the HGTD use case.
Definition at line 48 of file HGTD_LayerBuilderCond.h.
◆ StoreGateSvc_t
◆ HGTD_LayerBuilderCond()
HGTD_LayerBuilderCond::HGTD_LayerBuilderCond |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~HGTD_LayerBuilderCond()
HGTD_LayerBuilderCond::~HGTD_LayerBuilderCond |
( |
| ) |
|
|
virtualdefault |
◆ cylindricalLayers()
|
inlinefinaloverridevirtual |
◆ 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]
◆ DeclareInterfaceID()
Creates the InterfaceID and interfaceID() method.
◆ 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);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ 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()
◆ discLayerMaterial()
◆ discLayers()
LayerBuilder interface method - returning Endcap-like layers.
position & bounds of the active Layer
Implements Trk::ILayerBuilderCond.
Definition at line 92 of file HGTD_LayerBuilderCond.cxx.
95 ATH_MSG_DEBUG(
"calling HGTD_LayerBuilderCond::discLayers()" );
99 ATH_MSG_ERROR(
"HGTD Detector Manager or ID Helper could not be retrieved - giving up.");
105 if(*readHandle ==
nullptr){
111 InDetDD::HGTD_DetectorElementCollection::const_iterator hgtdDetIter = readCdo->begin();
117 for (; hgtdDetIter != readCdo->end(); ++hgtdDetIter){
118 Identifier currentId((*hgtdDetIter)->identify());
127 ATH_MSG_DEBUG(
"Configured to build " << nlayers <<
" *2 disc-like layers (+ additional support layers)." );
130 std::vector<float> discZpos(2*nlayers,0.);
131 std::vector< std::vector<Trk::SurfaceOrderPosition> > discSurfaces(2*nlayers, std::vector<Trk::SurfaceOrderPosition>());
134 int sumCheckhgtdModules = 0;
135 unsigned int currentlayer = 0;
140 hgtdDetIter = readCdo->begin();
141 for (; hgtdDetIter != readCdo->end(); ++hgtdDetIter){
144 if ( (*hgtdDetIter) ) {
146 Identifier currentId((*hgtdDetIter)->identify());
157 float currentZ = (*hgtdDetIter)->center().z();
161 currentlayer += currentZ > 0. ? nlayers : 0;
166 discZpos[currentlayer] = currentZ;
169 float currentRmin = (*hgtdDetIter)->rMin();
170 float currentRmax = (*hgtdDetIter)->rMax();
171 ATH_MSG_DEBUG(
" ---- rmin/rmax: " << currentRmin <<
"/" << currentRmax );
172 if (maxRmax<currentRmax)
173 maxRmax = currentRmax;
174 if (minRmin>currentRmin)
175 minRmin = currentRmin;
179 const Amg::Vector3D& orderPosition = (*hgtdDetIter)->center();
193 const_cast<Trk::Surface*
>(&((*hgtdDetIter)->surface())),
197 discSurfaces[currentlayer].push_back(surfaceOrder);
199 }
else if (!(*hgtdDetIter))
200 ATH_MSG_WARNING(
"Not valid pointer to HGTD Detector element... something wrong with the Id dictionary?");
208 auto discLayers = std::make_unique<std::vector<Trk::DiscLayer*> >();
213 for (
auto& thisDiscZpos : discZpos) {
218 ATH_MSG_DEBUG(
" -> With Rmin/Rmax (est) : " << minRmin <<
" / " << maxRmax );
222 std::vector<float> rBins = {minRmin};
223 std::vector<std::vector<float>> phiBins = {{}};
230 std::vector<Trk::BinUtility*>* subBinUtilitiesPhi =
new std::vector<Trk::BinUtility*>;
233 for (
unsigned int bin = 0;
bin < rBins.size()-1;
bin++) {
235 subBinUtilitiesPhi->push_back(BinUtilityY);
240 auto currentBinnedArray =
241 std::make_unique<Trk::BinnedArray1D1D<Trk::Surface>>(
242 discSurfaces[discCounter], BinUtilityR, subBinUtilitiesPhi);
246 int discSurfacesNum = (discSurfaces[discCounter]).
size();
248 ATH_MSG_DEBUG(
"Constructed BinnedArray for DiscLayer with "<< discSurfacesNum <<
" SubSurfaces." );
255 std::map< const Trk::Surface*,Amg::Vector3D > uniqueSurfaceMap;
259 size_t dsumCheckSurfaces = 0;
261 for (
const auto & asurfIter : arraySurfaces){
264 usmIter = uniqueSurfaceMap.find(asurfIter);
265 lastPhi = asurfIter->center().phi();
266 if (usmIter != uniqueSurfaceMap.end()) {
268 << asurfIter->center().eta() <<
" / "
269 << asurfIter->center().phi());
271 uniqueSurfaceMap[asurfIter] = asurfIter->center();
275 "valid phi value was = "
276 << lastPhi <<
" --> discCounter: " << discCounter);
279 sumCheckhgtdModules += dsumCheckSurfaces;
291 auto olDescriptor = std::make_unique<HGTD_OverlapDescriptor>(
292 currentBinnedArray.get(), rBins, phiBins);
300 std::move(currentBinnedArray),
303 std::move(olDescriptor));
312 ATH_MSG_DEBUG( hgtdModules <<
" HGTD Modules parsed for Disc Layer dimensions." );
314 ATH_MSG_DEBUG( sumCheckhgtdModules <<
" HGTD Modules filled in Disc Layer Arrays." );
315 if ( hgtdModules-sumCheckhgtdModules )
316 ATH_MSG_WARNING( hgtdModules-sumCheckhgtdModules <<
" Modules not registered properly in binned array." );
◆ evaluateBestBinning()
void HGTD_LayerBuilderCond::evaluateBestBinning |
( |
std::vector< Trk::SurfaceOrderPosition > & |
surfaces, |
|
|
std::vector< float > & |
rBins, |
|
|
float & |
maxRadius, |
|
|
std::vector< std::vector< float >> & |
phiBins |
|
) |
| |
|
staticprivate |
Definition at line 346 of file HGTD_LayerBuilderCond.cxx.
351 std::vector < std::pair< float, float> > centers = {};
352 centers.reserve(surfaces.size());
353 for (
auto& orderedSurface : surfaces) {
354 centers.emplace_back(orderedSurface.second.perp(), orderedSurface.second.phi());
358 std::sort(centers.begin(), centers.end(),
359 [](
const std::pair< float, float>&
a,
const std::pair< float, float>&
b) ->
bool {
360 return a.first < b.first;
368 std::vector<float> finerBinning = {};
369 finerBinning.reserve(
bins);
378 std::vector<int> phiIndices = {};
379 std::vector<float> tmpRadii = {};
381 for (
auto& center : centers) {
382 float phi = center.second;
383 const auto boundVal = std::lower_bound(finerBinning.begin(), finerBinning.end(),
phi);
387 if (
std::find(phiIndices.begin(), phiIndices.end(),
phiIndex)==phiIndices.end()) {
389 tmpRadii.push_back(center.first);
393 auto& prevRadius = tmpRadii.at(
index);
394 if ( std::abs(prevRadius - center.first)<1
e-5 ) {
395 const auto boundVal = std::lower_bound(finerBinning.begin(), finerBinning.end(),
phi);
400 float r = 0.5*(prevRadius+center.first);
402 tmpRadii = {prevRadius};
409 rBins.push_back(maxRadius);
413 std::vector< std::vector < float > > binnedCenters = {{}};
415 for (
auto& center : centers) {
416 float r = center.first;
417 float phi = center.second;
418 const auto boundVal = std::lower_bound(rBins.begin(), rBins.end(),
r);
420 if (
int(binnedCenters.size())<rIndex)
421 binnedCenters.push_back({
phi});
423 binnedCenters.back().push_back(
phi);
429 for (
auto& centersInBin : binnedCenters) {
431 std::sort(centersInBin.begin(), centersInBin.end());
433 phiBins.back().push_back(-
M_PI);
435 }
else phiBins.push_back({-
M_PI});
437 float phi = 0.5*(centersInBin.at(
index)+centersInBin.at(
index+1));
438 phiBins.back().push_back(
phi);
◆ 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
◆ identification()
const std::string & HGTD_LayerBuilderCond::identification |
( |
| ) |
const |
|
inlinefinaloverridevirtual |
◆ initialize()
StatusCode HGTD_LayerBuilderCond::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.
◆ 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.
◆ planarLayers()
|
inlinefinaloverridevirtual |
◆ registerSurfacesToLayer()
Definition at line 334 of file HGTD_LayerBuilderCond.cxx.
338 for (
const auto & surfaces : layerSurfaces) {
341 (*surfaces).associateLayer(lay);
◆ renounce()
◆ renounceArray()
◆ retrieveHGTDdetElements()
◆ 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.
◆ updateVHKA()
◆ validationAction()
virtual void Trk::ILayerBuilderCond::validationAction |
( |
| ) |
const |
|
inlinevirtualinherited |
Validation Action: Can be implemented optionally, outside access to internal validation steps.
Definition at line 66 of file ILayerBuilderCond.h.
◆ m_detStore
◆ m_discEnvelopeR
float HGTD_LayerBuilderCond::m_discEnvelopeR |
|
private |
◆ m_discThickness
float HGTD_LayerBuilderCond::m_discThickness |
|
private |
◆ m_evtStore
◆ m_HGTD_ReadKey
Initial value:{
this,
"HGTD_ReadKey",
"HGTD_DetectorElementCollection",
"Key of output HGTD_DetectorElementCollection for HGTD"
}
Definition at line 109 of file HGTD_LayerBuilderCond.h.
◆ m_hgtdHelper
◆ m_hgtdMgr
◆ m_identification
std::string HGTD_LayerBuilderCond::m_identification |
|
private |
◆ m_phiBins
int HGTD_LayerBuilderCond::m_phiBins |
|
private |
◆ m_rBins
int HGTD_LayerBuilderCond::m_rBins |
|
private |
◆ m_runGeometryValidation
bool HGTD_LayerBuilderCond::m_runGeometryValidation |
|
private |
◆ m_setLayerAssociation
bool HGTD_LayerBuilderCond::m_setLayerAssociation |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
SG::ReadCondHandleKey< InDetDD::HGTD_DetectorElementCollection > m_HGTD_ReadKey
const HGTD_DetectorManager * m_hgtdMgr
the HGTD Detector Manager
virtual std::unique_ptr< const std::vector< Trk::DiscLayer * > > discLayers(const EventContext &ctx, SG::WriteCondHandle< Trk::TrackingGeometry > &whandle) const override final
LayerBuilder interface method - returning Endcap-like layers.
Scalar phi() const
phi method
int m_phiBins
set the number of bins
std::string find(const std::string &s)
return a remapped string
int m_rBins
set the number of bins
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
int endcap(const Identifier &id) const
Values of different levels (failure returns 0)
float m_discThickness
set disc thickness
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_runGeometryValidation
run geometry validation
const std::string & key() const
Return the StoreGate ID for the referenced object.
int layer(const Identifier &id) const
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
static void evaluateBestBinning(std::vector< Trk::SurfaceOrderPosition > &surfaces, std::vector< float > &rBins, float &maxRadius, std::vector< std::vector< float >> &phiBins)
bool m_setLayerAssociation
Set Layer Association.
Eigen::Affine3d Transform3D
const Trk::BinnedLayerMaterial discLayerMaterial(double rMin, double rMax) const
layer association
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
float m_discEnvelopeR
set disc envelope
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
StatusCode initialize(bool used=true)
Eigen::Matrix< double, 3, 1 > Vector3D
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
std::shared_ptr< T > SharedObject
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)
int eta_module(const Identifier &id) const
Eigen::Translation< double, 3 > Translation3D
int phi_module(const Identifier &id) const
std::string m_identification
string identification
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
SG::ReadCondHandle< InDetDD::HGTD_DetectorElementCollection > retrieveHGTDdetElements(const EventContext &ctx) const
helper method to construct HGTD materia
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
std::span< T > BinnedArraySpan
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
const HGTD_ID * m_hgtdHelper
HGTD Id Helper.
std::pair< SharedObject< Surface >, Amg::Vector3D > SurfaceOrderPosition
void registerSurfacesToLayer(Trk::BinnedArraySpan< Trk::Surface *const > &surfaces, const Trk::Layer &layer) const
void addDependency(const EventIDRange &range)