|
ATLAS Offline Software
|
#include <MuonSystemExtensionTool.h>
|
| MuonSystemExtensionTool (const std::string &type, const std::string &name, const IInterface *parent) |
| Default AlgTool functions. More...
|
|
virtual | ~MuonSystemExtensionTool ()=default |
|
StatusCode | initialize () override |
|
bool | muonSystemExtension (const EventContext &ctx, SystemExtensionCache &cache) const override |
| get muon system extension More...
|
|
bool | muonLayerInterSections (const EventContext &ctx, const MuonCombined::TagBase &cmb_tag, SystemExtensionCache &cache) const override |
| Constructs the layer intersections from a primary muon track using the track states in the muon spectrometer. 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 |
|
Definition at line 31 of file MuonSystemExtensionTool.h.
◆ StoreGateSvc_t
◆ SurfaceVec
◆ MuonSystemExtensionTool()
Muon::MuonSystemExtensionTool::MuonSystemExtensionTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~MuonSystemExtensionTool()
virtual Muon::MuonSystemExtensionTool::~MuonSystemExtensionTool |
( |
| ) |
|
|
virtualdefault |
◆ 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()
◆ 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
◆ getSurfacesForIntersection()
get surfaces to be intersected for a given start parameters
Look whether one of the sectors has actually a recorded hit
Definition at line 274 of file MuonSystemExtensionTool.cxx.
284 std::vector<int> sectors;
288 if (cache.useHitSectors) {
289 const auto map_itr = cache.sectorsWithHits->find(regionIndex);
290 if (map_itr == cache.sectorsWithHits->end()) {
294 std::vector<int>::const_iterator sec_itr = std::find_if(
295 sectors.begin(), sectors.end(), [&map_itr](
const int& sector) ->
bool { return map_itr->second.count(sector); });
296 if (sec_itr == sectors.end()) {
303 for (
const int sector : sectors) {
308 ? [](
const MuonLayerSurface& s1,
309 const MuonLayerSurface&
s2) {
return s1.surfacePtr->center().perp() <
s2.surfacePtr->center().perp(); }
310 : [](
const MuonLayerSurface&
s1,
const MuonLayerSurface&
s2) {
311 return std::abs(
s1.surfacePtr->center().z()) < std::abs(
s2.surfacePtr->center().z());
◆ initialize()
StatusCode Muon::MuonSystemExtensionTool::initialize |
( |
| ) |
|
|
override |
◆ initializeGeometry()
bool Muon::MuonSystemExtensionTool::initializeGeometry |
( |
| ) |
|
|
private |
◆ initializeGeometryBarrel()
bool Muon::MuonSystemExtensionTool::initializeGeometryBarrel |
( |
int |
sector, |
|
|
const Amg::AngleAxis3D & |
sectorRotation |
|
) |
| |
|
private |
Definition at line 111 of file MuonSystemExtensionTool.cxx.
112 MuonChamberLayerDescription chamberLayerDescription;
115 constexpr
double xToZRotation = -M_PI_2;
124 Amg::Vector3D positionInSector(layerDescriptor.referencePosition, 0., 0.);
125 Amg::Vector3D globalPosition = sectorRotation * positionInSector;
129 trans.pretranslate(globalPosition);
133 surfaces.push_back(std::move(
data));
140 surface->
globalToLocal(globalPosition, globalPosition, lpos);
144 <<
" ref theta " << globalPosition.theta() <<
" phi " << globalPosition.phi() <<
" r "
145 << globalPosition.perp() <<
" pos " << globalPosition.x() <<
" " << globalPosition.y() <<
" "
146 << globalPosition.z() <<
" lpos3d " << lpos3d.x() <<
" " << lpos3d.y() <<
" " << lpos3d.z()
147 <<
" normal: x " << surface->
normal().x() <<
" y " << surface->
normal().y() <<
" z "
148 << surface->
normal().z());
◆ initializeGeometryEndcap()
Definition at line 66 of file MuonSystemExtensionTool.cxx.
71 MuonChamberLayerDescription chamberLayerDescription;
79 MuonChamberLayerDescriptor layerDescriptor = chamberLayerDescription.getDescriptor(sector, regionIndex,
layer);
80 Amg::Vector3D globalPosition(0., 0., layerDescriptor.referencePosition);
84 trans.pretranslate(globalPosition);
88 surfaces.push_back(std::move(
data));
98 << globalPosition.x() <<
" hit z " << globalPosition.z() <<
" lpos3d " << lpos3d.x() <<
" "
99 << lpos3d.y() <<
" " << lpos3d.z() <<
" lpos " << lpos[
Trk::loc1] <<
" " << lpos[
Trk::loc2]
100 <<
" center " << surface->
center().z() <<
" normal: phi " << surface->
normal().phi()
101 <<
" theta " << surface->
normal().theta() <<
" normal: x " << surface->
normal().x() <<
" y "
102 << surface->
normal().y() <<
" z " << surface->
normal().z());
103 globalPosition[0] += 100;
◆ 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.
◆ interfaceID()
static const InterfaceID& Muon::IMuonSystemExtensionTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
AlgTool and IAlgTool interface methods.
Definition at line 35 of file IMuonSystemExtensionTool.h.
36 static const InterfaceID IID_IMuonSystemExtensionTool(
"Muon::IMuonSystemExtensionTool", 1, 0);
37 return IID_IMuonSystemExtensionTool;
◆ makeInterSection()
Definition at line 246 of file MuonSystemExtensionTool.cxx.
249 double phi = sharedPtr->position().phi();
250 std::vector<int> sectors;
256 for (
const int& sec : sectors) {
257 if (
it.sector % 2 == sec % 2) {
262 ATH_MSG_DEBUG(
" sector " <<
it.sector <<
" selected " << sector <<
" nsectors " << sectors);
269 return MuonSystemExtension::Intersection{
nullptr,
it};
271 return MuonSystemExtension::Intersection{sharedPtr,
it};
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ muonLayerInterSections()
Constructs the layer intersections from a primary muon track using the track states in the muon spectrometer.
Get the proper surfaces for the intersections
Copy all track parameters in the MS into a separate vector
Calculate the minimum distance to the plane
We are trying to reconstruct the layer extensions of a combined track. There is no way that this can fail
Implements Muon::IMuonSystemExtensionTool.
Definition at line 317 of file MuonSystemExtensionTool.cxx.
327 const Trk::TrackParameters* entry_pars = cache.candidate->getCaloExtension()->muonEntryLayerIntersection();
330 std::vector<const Trk::TrackStateOnSurface*> ms_tsos;
331 ms_tsos.reserve(cmb_tsos->
size());
333 if (!(tsos->type(Trk::TrackStateOnSurface::Perigee) || tsos->type(Trk::TrackStateOnSurface::Parameter)))
335 const Trk::TrackParameters* params = tsos->trackParameters();
336 if (!params) return false;
337 const Trk::Surface& surf = params->associatedSurface();
338 if (!surf.associatedDetectorElement()) {
339 return entry_pars->associatedSurface().normal().dot(params->position() - entry_pars->associatedSurface().center())>0;
341 return m_idHelperSvc->isMuon(surf.associatedDetectorElement()->identify());
344 if (ms_tsos.empty()){
345 ATH_MSG_VERBOSE(
"A combined track without track parameters in the MS. THat should not happen");
350 if (surfaces.empty()) {
351 ATH_MSG_DEBUG(
"MS extenion without surfaces.. "<<cache.candidate->toString());
355 std::vector<Muon::MuonSystemExtension::Intersection> intersections;
357 std::vector<const Trk::TrackStateOnSurface*>::const_iterator itr = ms_tsos.begin();
358 std::vector<const Trk::TrackStateOnSurface*>::const_iterator
end = ms_tsos.end();
363 return std::abs(surf.
normal().dot(
a->trackParameters()->position() - surf.
center())) <
364 std::abs(surf.
normal().dot(
b->trackParameters()->position() - surf.
center()));
386 if (intersections.empty()) {
387 ATH_MSG_DEBUG(
"Failed to find the intersections for the combined track");
390 cache.candidate->setExtension(std::make_unique<MuonSystemExtension>(entry_pars, std::move(intersections)));
◆ muonSystemExtension()
get muon system extension
Get the calo extension
Implements Muon::IMuonSystemExtensionTool.
Definition at line 154 of file MuonSystemExtensionTool.cxx.
156 if (!cache.candidate->getCaloExtension()) {
157 if (!cache.extensionContainer) {
158 std::unique_ptr<Trk::CaloExtension> caloExtension =
161 ATH_MSG_VERBOSE(
"Failed to create the calo extension for "<<cache.candidate->toString());
164 cache.candidate->setExtension(caloExtension);
167 *cache.extensionContainer);
169 ATH_MSG_VERBOSE(
"Failed to create the calo extension for "<<cache.candidate->toString());
172 cache.candidate->setExtension(caloExtension);
176 if (!cache.createSystemExtension) {
177 ATH_MSG_VERBOSE(
"No system extension is required for "<<cache.candidate->toString());
181 const Trk::TrackParameters* currentPars = cache.candidate->getCaloExtension()->muonEntryLayerIntersection();
188 std::vector<MuonSystemExtension::Intersection> intersections;
191 std::vector<std::shared_ptr<const Trk::TrackParameters> > trackParametersVec;
200 <<
" r " << surface.
center().perp() <<
" z " << surface.
center().z());
202 std::unique_ptr<const Trk::TrackParameters> exPars{
220 std::shared_ptr<const Trk::TrackParameters> sharedPtr{std::move(exPars)};
221 trackParametersVec.emplace_back(sharedPtr);
230 currentPars = sharedPtr.get();
236 ATH_MSG_DEBUG(
"Completed extrapolation: destinations " << surfaces.size() <<
" intersections " << intersections.size());
237 if (intersections.empty()){
238 ATH_MSG_DEBUG(
"No system extensions are made for "<<cache.candidate->toString()
239 <<
" will accept the candidate: "<< (!cache.requireSystemExtension ?
"si":
"no"));
240 return !cache.requireSystemExtension;
242 cache.candidate->setExtension(
243 std::make_unique<MuonSystemExtension>(cache.candidate->getCaloExtension()->muonEntryLayerIntersection(), std::move(intersections)));
◆ 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.
◆ renounce()
◆ renounceArray()
◆ 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()
◆ m_caloExtensionTool
Initial value:{
this,
"ParticleCaloExtensionTool",
"Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool",
}
Definition at line 60 of file MuonSystemExtensionTool.h.
◆ m_detStore
◆ m_evtStore
◆ m_extrapolator
Initial value:{
this,
"Extrapolator",
"Trk::Extrapolator/AtlasExtrapolator",
}
Definition at line 65 of file MuonSystemExtensionTool.h.
◆ m_idHelperSvc
◆ m_referenceSurfaces
std::vector<std::vector<SurfaceVec> > Muon::MuonSystemExtensionTool::m_referenceSurfaces |
|
private |
◆ m_sectorMapping
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const override final
Specified for PlaneSurface: GlobalToLocal method without dynamic memory allocation - boolean checks i...
char data[hepevt_bytes_allocation_ATLAS]
bool hasPositiveDiagElems(const AmgSymMatrix(N) &mat)
Returns true if all diagonal elements of the covariance matrix are finite aka sane in the above defin...
Scalar phi() const
phi method
Tracking class to hold the extrapolation from a particle from the ID to the muon system (or the other...
Scalar eta() const
pseudorapidity method
const Amg::Vector3D & position() const
Access method for the position.
Eigen::Matrix< double, 2, 1 > Vector2D
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
void getSectors(double phi, std::vector< int > §ors) const
returns the main sector plus neighboring if the phi position is in an overlap region
LayerIndex
enum to classify the different layers in the muon spectrometer
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
@ loc2
generic first and second local coordinate
std::vector< size_t > vec
virtual const Trk::Track * primaryTrack() const
access to primary muon system track, zero if non available
#define ATH_MSG_VERBOSE(x)
const Amg::Vector3D & center() const
Returns the center position of the Surface.
const TrackParameters * muonEntryLayerIntersection() const
access to intersection with the muon entry layer return NULL if the intersection failed
std::vector< std::string > intersection(std::vector< std::string > &v1, std::vector< std::string > &v2)
void stable_sort(std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, std::reverse_iterator< DataModel_detail::iterator< DVL > > end, Compare comp)
Specialization of stable_sort for DataVector/List.
int getSector(double phi) const
returns the sector corresponding to the phi position
virtual void setOwner(IDataHandleHolder *o)=0
static unsigned int numberOfSectors()
return total number of sectors
static const std::string & regionName(DetectorRegionIndex index)
convert DetectorRegionIndex into a string
Eigen::Affine3d Transform3D
std::shared_ptr< const Trk::Surface > SurfacePtr
Out copy_if(In first, const In &last, Out res, const Pred &p)
virtual const Amg::Vector3D & normal() const
Returns the normal vector of the Surface (i.e.
double sectorPhi(int sector) const
returns the centeral phi position of a sector in radians
static const std::string & layerName(LayerIndex index)
convert LayerIndex into a string
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
static LayerIndex toLayerIndex(ChIndex index)
convert ChIndex into LayerIndex
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
DetectorRegionIndex
enum to classify the different layers in the muon spectrometer
represents the track state (measurement, material, fit parameters and quality) at a surface.
std::string to_string(const DetectorType &type)
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
Eigen::Matrix< double, 3, 1 > Vector3D
virtual std::string toString() const =0
print content to string
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
std::optional< double > intersect(const AmgVector(N)&posA, const AmgVector(N)&dirA, const AmgVector(N)&posB, const AmgVector(N)&dirB)
Calculates the closest approach of two lines.
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
static bool isSmall(int sector)
returns whether a sector is small
Eigen::AngleAxisd AngleAxis3D
StIndex
enum to classify the different station layers in the muon spectrometer
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
size_type size() const noexcept
Returns the number of elements in the collection.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.