|
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 32 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);
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()
◆ 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 232 of file MuonSystemExtensionTool.cxx.
242 std::vector<int> sectors;
246 if (cache.useHitSectors) {
247 const auto map_itr = cache.sectorsWithHits->find(regionIndex);
248 if (map_itr == cache.sectorsWithHits->end()) {
252 std::vector<int>::const_iterator sec_itr = std::find_if(
253 sectors.begin(), sectors.end(), [&map_itr](
const int& sector) ->
bool { return map_itr->second.count(sector); });
254 if (sec_itr == sectors.end()) {
261 for (
const int sector : sectors) {
266 [&muonEntryPars](
const MuonLayerSurface& s1,
const MuonLayerSurface&
s2) {
267 return std::abs(pathAlongPars(muonEntryPars,s1.surfacePtr->center())) <
268 std::abs(pathAlongPars(muonEntryPars,s2.surfacePtr->center()));
272 for (
auto& s1 : surfaces) {
275 <<
", pathAlongPars "<<pathAlongPars(muonEntryPars,
s1.surfacePtr->center())
276 <<std::endl<<(*
s1.surfacePtr));
◆ initialize()
StatusCode Muon::MuonSystemExtensionTool::initialize |
( |
| ) |
|
|
override |
◆ initializeGeometry()
bool Muon::MuonSystemExtensionTool::initializeGeometry |
( |
| ) |
|
|
private |
◆ initializeGeometryBarrel()
bool Muon::MuonSystemExtensionTool::initializeGeometryBarrel |
( |
int |
sector, |
|
|
const Amg::Transform3D & |
sectorRotation |
|
) |
| |
|
private |
Definition at line 106 of file MuonSystemExtensionTool.cxx.
107 MuonChamberLayerDescription chamberLayerDescription;
110 constexpr
double xToZRotation = -M_PI_2;
119 Amg::Vector3D positionInSector(layerDescriptor.referencePosition, 0., 0.);
120 Amg::Vector3D globalPosition = sectorRotation * positionInSector;
124 trans.pretranslate(globalPosition);
125 std::unique_ptr<Trk::PlaneSurface> surface = std::make_unique<Trk::PlaneSurface>(trans);
130 <<
" ref theta " << globalPosition.theta() <<
" phi " << globalPosition.phi() <<
" r "
131 << globalPosition.perp() <<
" pos " <<
Amg::toString(globalPosition)
136 surfaces.push_back(std::move(
data));
◆ initializeGeometryEndcap()
Definition at line 70 of file MuonSystemExtensionTool.cxx.
75 MuonChamberLayerDescription chamberLayerDescription;
83 MuonChamberLayerDescriptor layerDescriptor = chamberLayerDescription.getDescriptor(sector, regionIndex,
layer);
86 std::unique_ptr<Trk::PlaneSurface> surface = std::make_unique<Trk::PlaneSurface>(trans);
97 MuonLayerSurface
data(std::move(surface), sector, regionIndex,
layer);
98 surfaces.push_back(std::move(
data));
◆ 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;
◆ 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
The parameters are not muon paramaters or the parameters are before the entrance parameters
The track parameters belong the same surface. Do nothing
Check whether there're measurement parameters that are closer to the target surface
Implements Muon::IMuonSystemExtensionTool.
Definition at line 282 of file MuonSystemExtensionTool.cxx.
286 const Trk::Track* cmbTrk = cmbTag.primaryTrack();
288 ATH_MSG_WARNING(
"A combined tag without any track? Please check "<<cmbTag.toString());
292 const Trk::TrackParameters* entryPars = cache.candidate->getCaloExtension()->muonEntryLayerIntersection();
293 std::vector<const Trk::TrackStateOnSurface*> cmbParVec{};
296 std::vector<Muon::MuonSystemExtension::Intersection> intersections{};
304 if (!msTSOS->measurementOnTrack()) {
310 if (!
m_idHelperSvc->isMuon(measId) || pathAlongPars(msPars, msPars.position() - entryPars->
position())< 0.){
324 if (lastSurf.layerIndex == layerIdx && lastSurf.regionIndex == regionIdx && lastSurf.sector == sector) {
328 SurfaceVec::const_iterator surfItr = std::find_if(refSurfaces.begin(), refSurfaces.end(),
329 [&layerIdx](
const MuonLayerSurface& surf){
330 return surf.layerIndex == layerIdx;
332 if (surfItr == refSurfaces.end()) {
338 lastSurf = (*surfItr);
344 if (!tsosInChamb->measurementOnTrack())
continue;
347 if (std::abs(pathAlongPars(chPars, chPars.position() -
target.center())) >
348 std::abs(pathAlongPars(*msTSOS->trackParameters(),
349 msTSOS->trackParameters()->position() -
target.center()))) {
356 std::unique_ptr<Trk::TrackParameters> exPars{
m_extrapolator->extrapolate(ctx, *msTSOS->trackParameters(),
360 <<
", sector: "<<sector
363 <<
" to surface "<<std::endl<<
target<<std::endl
364 <<
", sector: "<<lastSurf.sector
367 <<
" pathAlongPars "<<pathAlongPars(*msTSOS->trackParameters(),
target.center())
368 <<
", dir: "<<
Amg::toString(msTSOS->trackParameters()->momentum().unit()));
371 intersections.emplace_back(std::move(exPars), lastSurf);
377 if (intersections.empty()) {
378 ATH_MSG_DEBUG(
"Failed to find the intersections for the combined track");
381 cache.candidate->setExtension(std::make_unique<MuonSystemExtension>(entryPars, std::move(intersections)));
◆ muonSystemExtension()
get muon system extension
Get the calo extension
Implements Muon::IMuonSystemExtensionTool.
Definition at line 143 of file MuonSystemExtensionTool.cxx.
145 if (!cache.candidate->getCaloExtension()) {
146 if (!cache.extensionContainer) {
147 std::unique_ptr<Trk::CaloExtension> caloExtension =
150 ATH_MSG_VERBOSE(
"Failed to create the calo extension for "<<cache.candidate->toString());
153 cache.candidate->setExtension(caloExtension);
156 *cache.extensionContainer);
158 ATH_MSG_VERBOSE(
"Failed to create the calo extension for "<<cache.candidate->toString());
161 cache.candidate->setExtension(caloExtension);
165 if (!cache.createSystemExtension) {
166 ATH_MSG_VERBOSE(
"No system extension is required for "<<cache.candidate->toString());
170 const Trk::TrackParameters* currentPars = cache.candidate->getCaloExtension()->muonEntryLayerIntersection();
177 std::vector<MuonSystemExtension::Intersection> intersections;
180 std::vector<std::shared_ptr<Trk::TrackParameters> > trackParametersVec;
189 <<
" r " << surface.
center().perp() <<
" z " << surface.
center().z());
191 std::unique_ptr<Trk::TrackParameters> exPars{
m_extrapolator->extrapolate(ctx, *currentPars, surface,
197 ATH_MSG_DEBUG(
"Extrapolated in event "<<ctx.eventID().event_number()<<
" track @ "<<
m_printer->print(*exPars));
208 std::shared_ptr<Trk::TrackParameters> sharedPtr{std::move(exPars)};
209 trackParametersVec.emplace_back(sharedPtr);
211 intersections.emplace_back(sharedPtr,
it);
216 currentPars = sharedPtr.get();
218 ATH_MSG_DEBUG(
"Extrapolation reached at "<<
m_printer->print(*sharedPtr)<<
" has larger uncertainties than "<<
222 ATH_MSG_DEBUG(
"Completed extrapolation: destinations " << surfaces.size() <<
" intersections " << intersections.size());
223 if (intersections.empty()){
224 ATH_MSG_DEBUG(
"No system extensions are made for "<<cache.candidate->toString()
225 <<
" will accept the candidate: "<< (!cache.requireSystemExtension ?
"si":
"no"));
226 return !cache.requireSystemExtension;
228 cache.candidate->setExtension(std::make_unique<MuonSystemExtension>(cache.candidate->getCaloExtension()->muonEntryLayerIntersection(),
229 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 58 of file MuonSystemExtensionTool.h.
◆ m_detStore
◆ m_edmHelperSvc
Initial value:{this,"edmHelper","Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
"Handle to the service providing the IMuonEDMHelperSvc interface"}
Definition at line 69 of file MuonSystemExtensionTool.h.
◆ m_evtStore
◆ m_extrapolator
ToolHandle<Trk::IExtrapolator> Muon::MuonSystemExtensionTool::m_extrapolator {this,"Extrapolator",""} |
|
private |
◆ m_idHelperSvc
◆ m_printer
◆ m_referenceSurfaces
◆ m_sectorMapping
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
char data[hepevt_bytes_allocation_ATLAS]
Const iterator class for DataVector/DataList.
bool hasPositiveDiagElems(const AmgSymMatrix(N) &mat)
Returns true if all diagonal elements of the covariance matrix are finite aka sane in the above defin...
Tracking class to hold the extrapolation from a particle from the ID to the muon system (or the other...
const Amg::Vector3D & position() const
Access method for the position.
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
Amg::Transform3D getTranslateZ3D(const double Z)
: Returns a shift transformation along the z-axis
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
#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
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
Amg::Transform3D getRotateZ3D(double angle)
get a rotation transformation around Z-axis
static const std::string & regionName(DetectorRegionIndex index)
convert DetectorRegionIndex into a string
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Eigen::Affine3d Transform3D
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.
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 ...
Amg::Transform3D getRotateY3D(double angle)
get a rotation transformation around Y-axis
Eigen::Matrix< double, 3, 1 > Vector3D
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
#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
StIndex
enum to classify the different station layers in the muon spectrometer
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
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.