 |
ATLAS Offline Software
|
#include <MuonSystemExtensionTool.h>
Definition at line 32 of file MuonSystemExtensionTool.h.
◆ DetRegIdx
◆ SurfaceVec
◆ ~MuonSystemExtensionTool()
virtual Muon::MuonSystemExtensionTool::~MuonSystemExtensionTool |
( |
| ) |
|
|
virtualdefault |
◆ 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 219 of file MuonSystemExtensionTool.cxx.
221 using namespace MuonStationIndex;
225 if (eta < -1.05) regionIndex = DetectorRegionIndex::EndcapC;
226 if (eta > 1.05) regionIndex = DetectorRegionIndex::EndcapA;
230 std::vector<int> sectors;
234 if (cache.useHitSectors) {
235 const auto map_itr = cache.sectorsWithHits->find(regionIndex);
236 if (map_itr == cache.sectorsWithHits->end()) {
240 std::vector<int>::const_iterator sec_itr = std::find_if(
241 sectors.begin(), sectors.end(), [&map_itr](
const int sector) ->
bool { return map_itr->second.count(sector); });
242 if (sec_itr == sectors.end()) {
244 <<
" in MuonStation " <<
regionName(regionIndex));
249 for (
const int sector : sectors) {
251 surfaces.insert(surfaces.end(), toInsert.begin(), toInsert.end());
254 [&muonEntryPars](
const MuonLayerSurface& s1,
const MuonLayerSurface&
s2) {
255 return std::abs(pathAlongPars(muonEntryPars,s1.surfacePtr->center())) <
256 std::abs(pathAlongPars(muonEntryPars,s2.surfacePtr->center()));
260 for (
auto& s1 : surfaces) {
263 <<
", pathAlongPars "<<pathAlongPars(muonEntryPars,
s1.surfacePtr->center())
264 <<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 94 of file MuonSystemExtensionTool.cxx.
95 MuonChamberLayerDescription chamberLayerDescription;
97 using namespace MuonStationIndex;
99 constexpr
double xToZRotation = -M_PI_2;
108 Amg::Vector3D positionInSector(layerDescriptor.referencePosition, 0., 0.);
109 Amg::Vector3D globalPosition = sectorRotation * positionInSector;
113 trans.pretranslate(globalPosition);
114 std::unique_ptr<Trk::PlaneSurface> surface = std::make_unique<Trk::PlaneSurface>(trans);
119 <<
" ref theta " << globalPosition.theta() <<
" phi " << globalPosition.phi() <<
" r "
120 << globalPosition.perp() <<
" pos " <<
Amg::toString(globalPosition)
125 surfaces.push_back(std::move(
data));
◆ initializeGeometryEndcap()
Definition at line 61 of file MuonSystemExtensionTool.cxx.
63 using namespace MuonStationIndex;
67 MuonChamberLayerDescription chamberLayerDescription;
74 MuonChamberLayerDescriptor layerDescriptor = chamberLayerDescription.getDescriptor(sector, regionIndex,
layer);
77 std::unique_ptr<Trk::PlaneSurface> surface = std::make_unique<Trk::PlaneSurface>(trans);
85 MuonLayerSurface
data(std::move(surface), sector, regionIndex,
layer);
86 surfaces.push_back(std::move(
data));
◆ muonLayerInterSections()
bool Muon::MuonSystemExtensionTool::muonLayerInterSections |
( |
const EventContext & |
ctx, |
|
|
const MuonCombined::TagBase & |
cmb_tag, |
|
|
SystemExtensionCache & |
cache |
|
) |
| const |
|
override |
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
Definition at line 270 of file MuonSystemExtensionTool.cxx.
274 const Trk::Track* cmbTrk = cmbTag.primaryTrack();
276 ATH_MSG_WARNING(
"A combined tag without any track? Please check "<<cmbTag.toString());
280 const Trk::TrackParameters* entryPars = cache.candidate->getCaloExtension()->muonEntryLayerIntersection();
281 std::vector<const Trk::TrackStateOnSurface*> cmbParVec{};
284 std::vector<MuonSystemExtension::Intersection> intersections{};
285 MuonLayerSurface lastSurf{};
292 if (!msTSOS->measurementOnTrack()) {
298 if (!
m_idHelperSvc->isMuon(measId) || pathAlongPars(msPars, msPars.position() - entryPars->
position())< 0.){
303 using namespace MuonStationIndex;
306 if (layerIdx == LayerIndex::BarrelExtended) {
314 if (lastSurf.layerIndex == layerIdx && lastSurf.regionIndex == regionIdx && lastSurf.sector == sector) {
318 SurfaceVec::const_iterator surfItr = std::find_if(refSurfaces.begin(), refSurfaces.end(),
319 [&layerIdx](
const MuonLayerSurface& surf){
320 return surf.layerIndex == layerIdx;
322 if (surfItr == refSurfaces.end()) {
324 <<
", sector: "<<sector <<
", layer: "<<
layerName(layerIdx)
328 lastSurf = (*surfItr);
334 if (!tsosInChamb->measurementOnTrack())
continue;
337 if (std::abs(pathAlongPars(chPars, chPars.position() -
target.center())) >
338 std::abs(pathAlongPars(*msTSOS->trackParameters(),
339 msTSOS->trackParameters()->position() -
target.center()))) {
346 std::unique_ptr<Trk::TrackParameters> exPars{
m_extrapolator->extrapolate(ctx, *msTSOS->trackParameters(),
350 <<
", sector: "<<sector <<
", layer: "<<
layerName(layerIdx)
351 <<
", region index: "<<
regionName(regionIdx) <<
" to surface "<<std::endl<<
target<<std::endl
352 <<
", sector: "<<lastSurf.sector <<
", layer: "<<
layerName(lastSurf.layerIndex)
353 <<
", region index: "<<
regionName(lastSurf.regionIndex)
354 <<
" pathAlongPars "<<pathAlongPars(*msTSOS->trackParameters(),
target.center())
355 <<
", dir: "<<
Amg::toString(msTSOS->trackParameters()->momentum().unit()));
358 intersections.emplace_back(std::move(exPars), lastSurf);
364 if (intersections.empty()) {
365 ATH_MSG_DEBUG(
"Failed to find the intersections for the combined track");
368 cache.candidate->setExtension(std::make_unique<MuonSystemExtension>(entryPars, std::move(intersections)));
◆ muonSystemExtension()
bool Muon::MuonSystemExtensionTool::muonSystemExtension |
( |
const EventContext & |
ctx, |
|
|
SystemExtensionCache & |
cache |
|
) |
| const |
|
override |
get muon system extension
Get the calo extension
Definition at line 130 of file MuonSystemExtensionTool.cxx.
132 if (!cache.candidate->getCaloExtension()) {
133 if (!cache.extensionContainer) {
134 std::unique_ptr<Trk::CaloExtension> caloExtension =
137 ATH_MSG_VERBOSE(
"Failed to create the calo extension for "<<cache.candidate->toString());
140 cache.candidate->setExtension(caloExtension);
143 *cache.extensionContainer);
145 ATH_MSG_VERBOSE(
"Failed to create the calo extension for "<<cache.candidate->toString());
148 cache.candidate->setExtension(caloExtension);
152 if (!cache.createSystemExtension) {
153 ATH_MSG_VERBOSE(
"No system extension is required for "<<cache.candidate->toString());
157 const Trk::TrackParameters* currentPars = cache.candidate->getCaloExtension()->muonEntryLayerIntersection();
164 std::vector<MuonSystemExtension::Intersection> intersections;
167 std::vector<std::shared_ptr<Trk::TrackParameters> > trackParametersVec;
170 for (
const MuonLayerSurface&
it : surfaces) {
176 <<
" r " << surface.
center().perp() <<
" z " << surface.
center().z());
178 std::unique_ptr<Trk::TrackParameters> exPars{
m_extrapolator->extrapolate(ctx, *currentPars, surface,
184 ATH_MSG_DEBUG(
"Extrapolated in event "<<ctx.eventID().event_number()<<
" track @ "<<
m_printer->print(*exPars));
195 std::shared_ptr<Trk::TrackParameters> sharedPtr{std::move(exPars)};
196 trackParametersVec.emplace_back(sharedPtr);
198 intersections.emplace_back(sharedPtr,
it);
203 currentPars = sharedPtr.get();
205 ATH_MSG_DEBUG(
"Extrapolation reached at "<<
m_printer->print(*sharedPtr)<<
" has larger uncertainties than "<<
209 ATH_MSG_DEBUG(
"Completed extrapolation: destinations " << surfaces.size() <<
" intersections " << intersections.size());
210 if (intersections.empty()){
211 ATH_MSG_DEBUG(
"No system extensions are made for "<<cache.candidate->toString()
212 <<
" will accept the candidate: "<< (!cache.requireSystemExtension ?
"si":
"no"));
213 return !cache.requireSystemExtension;
215 cache.candidate->setExtension(std::make_unique<MuonSystemExtension>(cache.candidate->getCaloExtension()->muonEntryLayerIntersection(),
216 std::move(intersections)));
◆ m_caloExtensionTool
Initial value:{
this,
"ParticleCaloExtensionTool",
"Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool",
}
Definition at line 58 of file MuonSystemExtensionTool.h.
◆ 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_extrapolator
ToolHandle<Trk::IExtrapolator> Muon::MuonSystemExtensionTool::m_extrapolator {this,"Extrapolator",""} |
|
private |
◆ m_idHelperSvc
◆ m_printer
◆ m_referenceSurfaces
◆ m_sectorMapping
The documentation for this class was generated from the following files:
LayerIndex
enum to classify the different layers in the muon spectrometer
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 through calorimeter Layers Both the caloEntryLayerIntersecti...
const Amg::Vector3D & position() const
Access method for the position.
const float EO[NO]
Energy levels for Oxygen.
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
#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 nullptr 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
Amg::Transform3D getRotateZ3D(double angle)
get a rotation transformation around Z-axis
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 bool isSmall(int sector)
represents the track state (measurement, material, fit parameters and quality) at a surface.
const std::string & layerName(LayerIndex index)
convert LayerIndex into a string
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 ...
constexpr int toInt(const ParamDefs p)
Amg::Transform3D getRotateY3D(double angle)
get a rotation transformation around Y-axis
Eigen::Matrix< double, 3, 1 > Vector3D
const std::string & regionName(DetectorRegionIndex index)
convert DetectorRegionIndex into a string
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DetectorRegionIndex
enum to classify the different layers in the muon spectrometer
#define ATH_MSG_WARNING(x)
MuonStationIndex::StIndex StIndex
LayerIndex toLayerIndex(ChIndex index)
convert ChIndex into LayerIndex
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.