|  | 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;
 
   62 std::unique_ptr<Trk::CaloExtension>
 
   75     if (
el->trackParticle()) {
 
   80     if (
muon->primaryTrackParticle()) {
 
   93   const EventContext& ctx,
 
   98   std::unique_ptr<Trk::CaloExtension>& extension = cache[
particle.index()];
 
   99   if (extension == 
nullptr) {
 
  102   return extension.get();
 
  120   const EventContext& ctx,
 
  122   const std::vector<bool>& 
mask,
 
  125   const size_t numparticles = 
particles.size();
 
  127   if (
mask.size() != numparticles) {
 
  128     ATH_MSG_ERROR(
"mask does not have the same size as in input collection");
 
  129     return StatusCode::FAILURE;
 
  131   caloextensions.
reserve(numparticles);
 
  135   for (
size_t i = 0; 
i < numparticles; ++
i) {
 
  137       std::unique_ptr<Trk::CaloExtension> extension =
 
  139       caloextensions.
push_back(std::move(extension));
 
  144   return StatusCode::SUCCESS;
 
  147 std::unique_ptr<Trk::CaloExtension>
 
  149   const EventContext& ctx,
 
  155   if (pvtx == 
nullptr) {
 
  172 std::unique_ptr<Trk::CaloExtension>
 
  174   const EventContext& ctx,
 
  191 std::unique_ptr<Trk::CaloExtension>
 
  193   const EventContext& ctx,
 
  204     if (std::abs(
particle.perigeeParameters().position().z()) > 6700.)
 
  206     if (
particle.perigeeParameters().position().perp() > 4200.)
 
  221     track.trackStateOnSurfaces()->begin();
 
  222   for (; itTSoS != 
track.trackStateOnSurfaces()->
end(); ++itTSoS) {
 
  224     if (!(**itTSoS).trackParameters() ||
 
  232                              ->associatedSurface()
 
  233                              .associatedDetectorElementIdentifier();
 
  235       idExitParamers = (**itTSoS).trackParameters();
 
  237       muonEntryParamers = (**itTSoS).trackParameters();
 
  240   if (!idExitParamers && !muonEntryParamers) {
 
  241     idExitParamers = 
track.perigeeParameters();
 
  245     idExitParamers ? idExitParamers : muonEntryParamers;
 
  256 std::unique_ptr<Trk::CaloExtension>
 
  263                 << startPars.
position().perp() << 
" z " 
  264                 << startPars.
position().z() << 
" momentum " 
  270   extrapolation_timer.start();
 
  277       std::vector<std::pair<std::unique_ptr<Trk::TrackParameters>, 
int>>>
 
  282   extrapolation_timer.stop();
 
  284   if (!caloParameters) {
 
  291   std::unique_ptr<TrackParameters> caloEntry = 
nullptr;
 
  292   std::unique_ptr<TrackParameters> muonEntry = 
nullptr;
 
  293   std::vector<CurvilinearParameters> caloLayers;
 
  294   caloLayers.reserve(caloParameters->size() - 1);
 
  295   ATH_MSG_DEBUG(
" Found calo parameters: " << caloParameters->size()
 
  296                                            << 
"  extrapolation exit ID=" 
  299   for (
auto& 
p : *caloParameters) {
 
  306       caloEntry = std::move(
p.first);
 
  308       caloEntry = std::move(
p.first);
 
  310       muonEntry = std::move(
p.first);
 
  312       muonEntry = std::move(
p.first);
 
  314       bool isEntry = 
p.second > 0;
 
  325         caloLayers.emplace_back(
p.first->position(),
 
  331         std::optional<
AmgSymMatrix(5)> covariance(std::nullopt);
 
  332         if (
p.first->covariance()) {
 
  335         caloLayers.emplace_back(
p.first->position(),
 
  338                                 std::move(covariance),
 
  345       std::abs(startPars.
position().perp() - 4255.) < 1.) {
 
  350   return std::make_unique<Trk::CaloExtension>(
 
  351       std::move(caloEntry), std::move(muonEntry), std::move(caloLayers));
 
  354 std::vector<std::unique_ptr<Trk::Surface>>
 
  356   const std::vector<CaloSampling::CaloSample>& clusterLayers,
 
  361   std::vector<std::unique_ptr<Trk::Surface>> caloSurfaces;
 
  362   caloSurfaces.reserve(clusterLayers.size());
 
  364     auto* surf = 
m_calosurf->CreateUserSurface(lay, 0., 
eta, &caloDD);
 
  366       caloSurfaces.emplace_back(surf);
 
  374                       std::unique_ptr<const Trk::TrackParameters>>>
 
  376   const EventContext& ctx,
 
  378   const std::vector<CaloSampling::CaloSample>& clusterLayers,
 
  379   const std::vector<std::unique_ptr<Trk::Surface>>& caloSurfaces,
 
  382   const auto* lastImpact = &startPars;
 
  384   size_t numSteps = caloSurfaces.size();
 
  386                         std::unique_ptr<const Trk::TrackParameters>>>
 
  388   caloParameters.reserve(numSteps);
 
  389   for (
size_t i = 0; 
i < numSteps; ++
i) {
 
  390     std::unique_ptr<const Trk::TrackParameters> nextImpact =
 
  398       caloParameters.emplace_back(clusterLayers[
i], std::move(nextImpact));
 
  399       lastImpact = caloParameters.back().second.get();
 
  402   return caloParameters;
 
  406                       std::unique_ptr<const Trk::TrackParameters>>>
 
  408   const EventContext& ctx,
 
  410   const std::vector<CaloSampling::CaloSample>& clusterLayers,
 
  417   std::vector<std::unique_ptr<Trk::Surface>> caloSurfaces =
 
  421     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 through calorimeter Layers Both the caloEntryLayerIntersecti...
Scalar eta() const
pseudorapidity method
const Amg::Vector3D & position() const
Access method for the position.
std::unique_ptr< ParametersBase< DIM, T > > uniqueClone() const
clone method for polymorphic deep copy returning unique_ptr; it is not overriden, but uses the existi...
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
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 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...