|
ATLAS Offline Software
|
Go to the documentation of this file.
25 , m_particleStrategy(
muon)
27 declareInterface<IParticleCaloExtensionTool>(
this);
48 ATH_MSG_WARNING(
"Unsupported particle type, using strategy based on type "
59 return StatusCode::SUCCESS;
65 return StatusCode::SUCCESS;
68 std::unique_ptr<Trk::CaloExtension>
83 if (
el->trackParticle()) {
88 if (
muon->primaryTrackParticle()) {
102 const EventContext& ctx,
107 std::unique_ptr<Trk::CaloExtension>& extension = cache[
particle.index()];
108 if (extension ==
nullptr) {
111 return extension.get();
129 const EventContext& ctx,
131 const std::vector<bool>&
mask,
134 const size_t numparticles =
particles.size();
136 if (
mask.size() != numparticles) {
137 ATH_MSG_ERROR(
"mask does not have the same size as in input collection");
138 return StatusCode::FAILURE;
140 caloextensions.
reserve(numparticles);
144 for (
size_t i = 0;
i < numparticles; ++
i) {
146 std::unique_ptr<Trk::CaloExtension> extension =
148 caloextensions.
push_back(std::move(extension));
153 return StatusCode::SUCCESS;
156 std::unique_ptr<Trk::CaloExtension>
158 const EventContext& ctx,
164 }
else if (abs(
particle.pdgId()) == 13) {
169 if (pvtx ==
nullptr) {
186 std::unique_ptr<Trk::CaloExtension>
188 const EventContext& ctx,
204 std::unique_ptr<Trk::CaloExtension>
206 const EventContext& ctx,
224 if (std::abs(
particle.perigeeParameters().position().z()) > 6700.)
226 if (
particle.perigeeParameters().position().perp() > 4200.)
241 track.trackStateOnSurfaces()->begin();
242 for (; itTSoS !=
track.trackStateOnSurfaces()->
end(); ++itTSoS) {
244 if (!(**itTSoS).trackParameters() ||
252 ->associatedSurface()
253 .associatedDetectorElementIdentifier();
255 idExitParamers = (**itTSoS).trackParameters();
257 muonEntryParamers = (**itTSoS).trackParameters();
260 if (!idExitParamers && !muonEntryParamers) {
261 idExitParamers =
track.perigeeParameters();
265 idExitParamers ? idExitParamers : muonEntryParamers;
276 std::unique_ptr<Trk::CaloExtension>
283 << startPars.
position().perp() <<
" z "
284 << startPars.
position().z() <<
" momentum "
288 std::vector<const TrackStateOnSurface*>* material =
nullptr;
293 extrapolation_timer.start();
300 std::unique_ptr<std::vector<std::pair<std::unique_ptr<Trk::TrackParameters>,
int>>>
305 extrapolation_timer.stop();
309 for (
auto&
m : *material) {
312 <<
" param " <<
m->trackParameters() <<
" pos: r "
313 << (
m->trackParameters() ?
m->trackParameters()->position().perp()
316 << (
m->trackParameters() ?
m->trackParameters()->position().z() : -999)
318 << (
m->trackParameters() ?
m->trackParameters()->momentum().perp()
321 << (
m->materialEffectsOnTrack()
322 ?
m->materialEffectsOnTrack()->thicknessInX0()
328 if (!caloParameters) {
336 std::vector<CurvilinearParameters> caloLayers;
337 caloLayers.reserve(caloParameters->size() - 1);
338 ATH_MSG_DEBUG(
" Found calo parameters: " << caloParameters->size()
339 <<
" extrapolation exit ID="
342 for (
auto&
p : *caloParameters) {
349 caloEntry =
p.first.release();
351 caloEntry =
p.first.release();
353 muonEntry =
p.first.release();
355 muonEntry =
p.first.release();
357 bool isEntry =
p.second > 0;
371 caloLayers.emplace_back(
p.first->position(),
377 std::optional<
AmgSymMatrix(5)> covariance(std::nullopt);
378 if (
p.first->covariance()) {
381 caloLayers.emplace_back(
p.first->position(),
384 std::move(covariance),
391 std::abs(startPars.
position().perp() - 4255.) < 1.) {
393 muonEntry = startPars.
clone();
396 return std::make_unique<Trk::CaloExtension>(
397 caloEntry, muonEntry, std::move(caloLayers));
400 std::vector<std::unique_ptr<Trk::Surface>>
402 const std::vector<CaloSampling::CaloSample>& clusterLayers,
407 std::vector<std::unique_ptr<Trk::Surface>> caloSurfaces;
408 caloSurfaces.reserve(clusterLayers.size());
410 auto* surf =
m_calosurf->CreateUserSurface(lay, 0., eta, &caloDD);
412 caloSurfaces.emplace_back(surf);
420 std::unique_ptr<const Trk::TrackParameters>>>
422 const EventContext& ctx,
424 const std::vector<CaloSampling::CaloSample>& clusterLayers,
425 const std::vector<std::unique_ptr<Trk::Surface>>& caloSurfaces,
428 const auto* lastImpact = &startPars;
430 size_t numSteps = caloSurfaces.size();
432 std::unique_ptr<const Trk::TrackParameters>>>
434 caloParameters.reserve(numSteps);
435 for (
size_t i = 0;
i < numSteps; ++
i) {
436 std::unique_ptr<const Trk::TrackParameters> nextImpact =
444 caloParameters.emplace_back(clusterLayers[
i], std::move(nextImpact));
445 lastImpact = caloParameters.back().second.get();
448 return caloParameters;
452 std::unique_ptr<const Trk::TrackParameters>>>
454 const EventContext& ctx,
456 const std::vector<CaloSampling::CaloSample>& clusterLayers,
463 std::vector<std::unique_ptr<Trk::Surface>> caloSurfaces =
467 ctx, startPars, clusterLayers, caloSurfaces,
particleType);
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
def retrieve(aClass, aKey=None)
virtual ~ParticleCaloExtensionTool()
Const iterator class for DataVector/DataList.
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Group
Properties of a chain group.
Electron_v1 Electron
Definition of the current "egamma version".
virtual std::unique_ptr< Trk::CaloExtension > caloExtension(const EventContext &ctx, const xAOD::IParticle &particle) const override final
Method returning the calo layers crossed by the IParticle track or the IParticle itself if it is neut...
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.
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
ParticleHypothesis m_particleStrategy
ToolHandle< Trk::IExtrapolator > m_extrapolator
Class providing the definition of the 4-vector interface.
float y() const
Vertex y displacement.
Gaudi::Property< unsigned int > m_extrapolDetectorID
ToolHandle< GenericMonitoringTool > m_monTool
Monitoring tool for recording histograms of the alg in action.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
TrackParticle_v1 TrackParticle
Reference the current persistent version:
AmgSymMatrix(5) &GXFTrackState
virtual StatusCode caloExtensionCollection(const EventContext &ctx, const xAOD::IParticleContainer &particles, const std::vector< bool > &mask, CaloExtensionCollection &caloextensions) const override final
Method that can be used by algorithms that : A.
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
helper class to encode and decode a TrackParametersIdentifier
const AtlasDetectorID * m_detID
ToolHandle< ICaloSurfaceBuilder > m_calosurf
Tool to build calorimeter layer surfaces.
@ fFirstAtlasCaloTechnology
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a truth particle in the MC record.
TruthParticle_v1 TruthParticle
Typedef to implementation.
ParticleCaloExtensionTool(const std::string &, const std::string &, const IInterface *)
virtual StatusCode initialize() override final
NeutralParticle_v1 NeutralParticle
Reference the current persistent version:
unsigned int TrackParametersIdentifier
Gaudi::Property< bool > m_startFromPerigee
Class describing a truth vertex in the MC record.
Ensure that the ATLAS eigen extensions are properly loaded.
bool is_indet(Identifier id) const
double charge(const T &p)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
std::unordered_map< size_t, std::unique_ptr< Trk::CaloExtension > > Cache
Eigen::Matrix< double, 3, 1 > Vector3D
virtual StatusCode finalize() override final
struct TBPatternUnitContext Muon
float x() const
Vertex x displacement.
const Amg::Vector3D & momentum() const
Access method for the momentum.
std::vector< std::unique_ptr< Trk::Surface > > caloSurfacesFromLayers(const std::vector< CaloSampling::CaloSample > &clusterLayers, double eta, const CaloDetDescrManager &caloDD) const override final
Method returning a vector of calo surfaces give calo layers/samplings.
bool is_muon(Identifier id) const
This class provides the client interface for accessing the detector description information common to...
#define ATH_MSG_WARNING(x)
float z() const
Vertex longitudinal distance along the beam line form the origin.
virtual std::vector< std::pair< CaloSampling::CaloSample, std::unique_ptr< const Trk::TrackParameters > > > surfaceCaloExtension(const EventContext &ctx, const TrackParameters &startPars, const std::vector< CaloSampling::CaloSample > &clusterLayers, const std::vector< std::unique_ptr< Trk::Surface >> &caloSurfaces, ParticleHypothesis particleType) const override final
Method returning a vector of the Track Parameters at layers/samplings.
Gaudi::Property< std::string > m_particleTypeName
Class describing a TrackParticle.
Class describing a NeutralParticle.
size_type size() const noexcept
Returns the number of elements in the collection.
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
virtual ParametersBase< DIM, T > * clone() const override=0
clone method for polymorphic deep copy
virtual std::vector< std::pair< CaloSampling::CaloSample, std::unique_ptr< const Trk::TrackParameters > > > layersCaloExtension(const EventContext &ctx, const TrackParameters &startPars, const std::vector< CaloSampling::CaloSample > &clusterLayers, double eta, const CaloDetDescrManager &caloDD, ParticleHypothesis particleType) const override final
Method returning a vector of the Track Parameters at layers/samplings.
TrackParametersIdentifier encode(AtlasDetDescr::AtlasDetTechnology, CaloSampling::CaloSample, bool isEntryToVolume) const
Encodes a TrackParametersIdentifier from AtlasDetDescr::AtlasDetTechnology and CaloSampling::CaloSamp...