|
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 231 of file MuonSystemExtensionTool.cxx.
241 std::vector<int> sectors;
245 if (cache.useHitSectors) {
246 const auto map_itr = cache.sectorsWithHits->find(regionIndex);
247 if (map_itr == cache.sectorsWithHits->end()) {
251 std::vector<int>::const_iterator sec_itr = std::find_if(
252 sectors.begin(), sectors.end(), [&map_itr](
const int& sector) ->
bool { return map_itr->second.count(sector); });
253 if (sec_itr == sectors.end()) {
260 for (
const int sector : sectors) {
265 [&muonEntryPars](
const MuonLayerSurface& s1,
const MuonLayerSurface&
s2) {
266 return std::abs(pathAlongPars(muonEntryPars,s1.surfacePtr->center())) <
267 std::abs(pathAlongPars(muonEntryPars,s2.surfacePtr->center()));
271 for (
auto& s1 : surfaces) {
274 <<
", pathAlongPars "<<pathAlongPars(muonEntryPars,
s1.surfacePtr->center())
275 <<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 105 of file MuonSystemExtensionTool.cxx.
106 MuonChamberLayerDescription chamberLayerDescription;
109 constexpr
double xToZRotation = -M_PI_2;
118 Amg::Vector3D positionInSector(layerDescriptor.referencePosition, 0., 0.);
119 Amg::Vector3D globalPosition = sectorRotation * positionInSector;
123 trans.pretranslate(globalPosition);
124 std::unique_ptr<Trk::PlaneSurface> surface = std::make_unique<Trk::PlaneSurface>(trans);
129 <<
" ref theta " << globalPosition.theta() <<
" phi " << globalPosition.phi() <<
" r "
130 << globalPosition.perp() <<
" pos " <<
Amg::toString(globalPosition)
135 surfaces.push_back(std::move(
data));
◆ initializeGeometryEndcap()
Definition at line 69 of file MuonSystemExtensionTool.cxx.
74 MuonChamberLayerDescription chamberLayerDescription;
82 MuonChamberLayerDescriptor layerDescriptor = chamberLayerDescription.getDescriptor(sector, regionIndex,
layer);
85 std::unique_ptr<Trk::PlaneSurface> surface = std::make_unique<Trk::PlaneSurface>(trans);
96 MuonLayerSurface
data(std::move(surface), sector, regionIndex,
layer);
97 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 281 of file MuonSystemExtensionTool.cxx.
285 const Trk::Track* cmbTrk = cmbTag.primaryTrack();
287 ATH_MSG_WARNING(
"A combined tag without any track? Please check "<<cmbTag.toString());
291 const Trk::TrackParameters* entryPars = cache.candidate->getCaloExtension()->muonEntryLayerIntersection();
292 std::vector<const Trk::TrackStateOnSurface*> cmbParVec{};
295 std::vector<Muon::MuonSystemExtension::Intersection> intersections{};
303 if (!msTSOS->measurementOnTrack()) {
309 if (!
m_idHelperSvc->isMuon(measId) || pathAlongPars(msPars, msPars.position() - entryPars->
position())< 0.){
323 if (lastSurf.layerIndex == layerIdx && lastSurf.regionIndex == regionIdx && lastSurf.sector == sector) {
327 SurfaceVec::const_iterator surfItr = std::find_if(refSurfaces.begin(), refSurfaces.end(),
328 [&layerIdx](
const MuonLayerSurface& surf){
329 return surf.layerIndex == layerIdx;
331 if (surfItr == refSurfaces.end()) {
337 lastSurf = (*surfItr);
343 if (!tsosInChamb->measurementOnTrack())
continue;
346 if (std::abs(pathAlongPars(chPars, chPars.position() -
target.center())) >
347 std::abs(pathAlongPars(*msTSOS->trackParameters(),
348 msTSOS->trackParameters()->position() -
target.center()))) {
355 std::unique_ptr<Trk::TrackParameters> exPars{
m_extrapolator->extrapolate(ctx, *msTSOS->trackParameters(),
359 <<
", sector: "<<sector
362 <<
" to surface "<<std::endl<<
target<<std::endl
363 <<
", sector: "<<lastSurf.sector
366 <<
" pathAlongPars "<<pathAlongPars(*msTSOS->trackParameters(),
target.center())
367 <<
", dir: "<<
Amg::toString(msTSOS->trackParameters()->momentum().unit()));
370 intersections.emplace_back(std::move(exPars), lastSurf);
376 if (intersections.empty()) {
377 ATH_MSG_DEBUG(
"Failed to find the intersections for the combined track");
380 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 142 of file MuonSystemExtensionTool.cxx.
144 if (!cache.candidate->getCaloExtension()) {
145 if (!cache.extensionContainer) {
146 std::unique_ptr<Trk::CaloExtension> caloExtension =
149 ATH_MSG_VERBOSE(
"Failed to create the calo extension for "<<cache.candidate->toString());
152 cache.candidate->setExtension(caloExtension);
155 *cache.extensionContainer);
157 ATH_MSG_VERBOSE(
"Failed to create the calo extension for "<<cache.candidate->toString());
160 cache.candidate->setExtension(caloExtension);
164 if (!cache.createSystemExtension) {
165 ATH_MSG_VERBOSE(
"No system extension is required for "<<cache.candidate->toString());
169 const Trk::TrackParameters* currentPars = cache.candidate->getCaloExtension()->muonEntryLayerIntersection();
176 std::vector<MuonSystemExtension::Intersection> intersections;
179 std::vector<std::shared_ptr<Trk::TrackParameters> > trackParametersVec;
188 <<
" r " << surface.
center().perp() <<
" z " << surface.
center().z());
190 std::unique_ptr<Trk::TrackParameters> exPars{
m_extrapolator->extrapolate(ctx, *currentPars, surface,
196 ATH_MSG_DEBUG(
"Extrapolated in event "<<ctx.eventID().event_number()<<
" track @ "<<
m_printer->print(*exPars));
207 std::shared_ptr<Trk::TrackParameters> sharedPtr{std::move(exPars)};
208 trackParametersVec.emplace_back(sharedPtr);
210 intersections.emplace_back(sharedPtr,
it);
215 currentPars = sharedPtr.get();
217 ATH_MSG_DEBUG(
"Extrapolation reached at "<<
m_printer->print(*sharedPtr)<<
" has larger uncertainties than "<<
221 ATH_MSG_DEBUG(
"Completed extrapolation: destinations " << surfaces.size() <<
" intersections " << intersections.size());
222 if (intersections.empty()){
223 ATH_MSG_DEBUG(
"No system extensions are made for "<<cache.candidate->toString()
224 <<
" will accept the candidate: "<< (!cache.requireSystemExtension ?
"si":
"no"));
225 return !cache.requireSystemExtension;
227 cache.candidate->setExtension(std::make_unique<MuonSystemExtension>(cache.candidate->getCaloExtension()->muonEntryLayerIntersection(),
228 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
static bool isSmall(int sector)
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.
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.