Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
#include <ParticleCaloExtensionTool.h>
|
| ParticleCaloExtensionTool (const std::string &, const std::string &, const IInterface *) |
|
virtual | ~ParticleCaloExtensionTool () |
|
virtual StatusCode | initialize () override final |
|
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 neutral/TruthParticle The memory ownership is handled by the unique_ptr. More...
|
|
virtual const Trk::CaloExtension * | caloExtension (const EventContext &ctx, const xAOD::IParticle &particle, IParticleCaloExtensionTool::Cache &cache) const override final |
| Method to return the calo layers crossed (CaloExtension) by the IParticle track or the IParticle itself if it is neutral/TruthParticle. More...
|
|
virtual const Trk::CaloExtension * | caloExtension (const xAOD::IParticle &particle, const CaloExtensionCollection &cache) const override final |
| Method to return the calo layers crossed (CaloExtension) by the IParticle track or the IParticle itself if it is neutral/TruthParticle It returns the result stored in the CaloExtensionCollection created by the caloExtensionCollection method below. More...
|
|
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. More...
|
|
virtual std::unique_ptr< Trk::CaloExtension > | caloExtension (const EventContext &ctx, const TrackParameters &startPars, PropDirection propDir, ParticleHypothesis particleType) const override final |
| Method returning a unique_ptr to the caloExtension given the relevant starting point parameters , direction and particle hypothesis. More...
|
|
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. More...
|
|
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. More...
|
|
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. 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 44 of file ParticleCaloExtensionTool.h.
◆ Cache
◆ StoreGateSvc_t
◆ ParticleCaloExtensionTool()
Trk::ParticleCaloExtensionTool::ParticleCaloExtensionTool |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~ParticleCaloExtensionTool()
Trk::ParticleCaloExtensionTool::~ParticleCaloExtensionTool |
( |
| ) |
|
|
virtualdefault |
◆ caloExtension() [1/7]
Method returning a unique_ptr to the caloExtension given the relevant starting point parameters , direction and particle hypothesis.
- Parameters
-
ctx | event context needed for multithreading |
startPars | the starting track parameters |
propDir | extrapolation direction |
particleType | type of particle |
Implements Trk::IParticleCaloExtensionTool.
Definition at line 257 of file ParticleCaloExtensionTool.cxx.
263 << startPars.position().perp() <<
" z "
264 << startPars.position().z() <<
" momentum "
265 << startPars.momentum().mag());
270 extrapolation_timer.start();
277 std::vector<std::pair<std::unique_ptr<Trk::TrackParameters>,
int>>>
282 extrapolation_timer.stop();
284 if (!caloParameters) {
288 TrackParametersIdHelper parsIdHelper;
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.) {
347 muonEntry = startPars.uniqueClone();
350 return std::make_unique<Trk::CaloExtension>(
351 std::move(caloEntry), std::move(muonEntry), std::move(caloLayers));
◆ caloExtension() [2/7]
◆ caloExtension() [3/7]
Method to return the calo layers crossed (CaloExtension) by the IParticle track or the IParticle itself if it is neutral/TruthParticle.
An alg looping over a single collection of IParticles re-using them multiple times can use a local cache of the form std::unordered_map<size_t,std::unique_ptr<Trk::CaloExtension>>. The key is the value of IParticle::index()
This method adds the relevant extension to the cache look-up table which retains ownership.
- Parameters
-
ctx | event context needed for multithreading |
particle | reference to the Particle |
cache | the look-up table cache |
- Returns
- ptr to a const CaloExtension (owned by the cache)
Implements Trk::IParticleCaloExtensionTool.
Definition at line 92 of file ParticleCaloExtensionTool.cxx.
98 std::unique_ptr<Trk::CaloExtension>& extension = cache[
particle.index()];
99 if (extension ==
nullptr) {
102 return extension.get();
◆ caloExtension() [4/7]
◆ caloExtension() [5/7]
Definition at line 192 of file ParticleCaloExtensionTool.cxx.
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;
◆ caloExtension() [6/7]
◆ caloExtension() [7/7]
Method to return the calo layers crossed (CaloExtension) by the IParticle track or the IParticle itself if it is neutral/TruthParticle It returns the result stored in the CaloExtensionCollection created by the caloExtensionCollection method below.
In this case, the CaloExtensionCollection (DataVector<CaloExtension>) owns the caloExtension.
- Parameters
-
particle | reference to the Particle |
cache | The CaloExtensionCollections |
- Returns
- ptr to a const CaloExtension (owned by the cache)
Implements Trk::IParticleCaloExtensionTool.
Definition at line 106 of file ParticleCaloExtensionTool.cxx.
◆ caloExtensionCollection()
Method that can be used by algorithms that : A.
Have an IParticleCollection B. Define a mask of the size of that collection C. Want back a Calo Extension Collection alligned with the input collection i.e 1 to 1 correspondance with the input collection. The Collection can then be used as such to retrieve the extensions or manipulated and written to StoreGate.
- Parameters
-
ctx | event context needed for multithreading |
particles | The input collection |
mask | contains true for the elements for which to permorm an extension, false otherwise |
- Returns
- caloextension Output to be filled, will contain unfilled CaloExtension where the mask was false, otherwise it contains the relevant result.
Implements Trk::IParticleCaloExtensionTool.
Definition at line 119 of file ParticleCaloExtensionTool.cxx.
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;
◆ caloSurfacesFromLayers()
Method returning a vector of calo surfaces give calo layers/samplings.
- Parameters
-
ctx | event context needed for multithreading |
clusterLayers | the layers (should be ordered) we aim to |
eta | eta used for the depth |
Implements Trk::IParticleCaloExtensionTool.
Definition at line 355 of file ParticleCaloExtensionTool.cxx.
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);
◆ 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
◆ initialize()
StatusCode Trk::ParticleCaloExtensionTool::initialize |
( |
| ) |
|
|
finaloverridevirtual |
◆ 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()
const InterfaceID & Trk::IParticleCaloExtensionTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
◆ layersCaloExtension()
Method returning a vector of the Track Parameters at layers/samplings.
- Parameters
-
ctx | event context needed for multithreading |
startPars | the starting track parameters |
clusterLayers | the layers (should be ordered) we aim to |
eta | eta used for the depth |
particleType | type of particle |
Implements Trk::IParticleCaloExtensionTool.
Definition at line 407 of file ParticleCaloExtensionTool.cxx.
417 std::vector<std::unique_ptr<Trk::Surface>> caloSurfaces =
421 ctx, startPars, clusterLayers, caloSurfaces,
particleType);
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ 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()
◆ surfaceCaloExtension()
Method returning a vector of the Track Parameters at layers/samplings.
- Parameters
-
ctx | event context needed for multithreading |
startPars | the starting track parameters |
clusterLayers | the layers (should be ordered) we aim to |
clusterSurfaces | the surfaces for each layer |
particleType | type of particle |
The clusterLayers and clusterSurfaces need to be 1-1 this can be done via the caloSurfacesFromLayers method above.
Implements Trk::IParticleCaloExtensionTool.
Definition at line 375 of file ParticleCaloExtensionTool.cxx.
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;
◆ 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_calosurf
Initial value:{
this,
"CaloSurfaceBuilder",
"",
"Tool to build calorimeter layer surfaces"
}
Tool to build calorimeter layer surfaces.
Definition at line 127 of file ParticleCaloExtensionTool.h.
◆ m_detID
◆ m_detStore
◆ m_evtStore
◆ m_extrapolator
ToolHandle<Trk::IExtrapolator> Trk::ParticleCaloExtensionTool::m_extrapolator { this, "Extrapolator", "" } |
|
private |
◆ m_extrapolDetectorID
Gaudi::Property<unsigned int> Trk::ParticleCaloExtensionTool::m_extrapolDetectorID |
|
private |
Initial value:{
this,
"ExtrapolationDetectorID",
"The detector this tool should extrapolate through. Expects a "
"Trk::GeometrySignature enum value."
}
Definition at line 147 of file ParticleCaloExtensionTool.h.
◆ m_monTool
◆ m_particleStrategy
◆ m_particleTypeName
Gaudi::Property<std::string> Trk::ParticleCaloExtensionTool::m_particleTypeName |
|
private |
Initial value:{
this, "ParticleType", "muon",
"The particle type used during extrapolation when not passed via the "
"method interfaces"
": muon, pion, nonInteracting"}
Definition at line 134 of file ParticleCaloExtensionTool.h.
◆ m_startFromPerigee
Gaudi::Property<bool> Trk::ParticleCaloExtensionTool::m_startFromPerigee |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
def retrieve(aClass, aKey=None)
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...
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
ParticleHypothesis m_particleStrategy
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
ToolHandle< Trk::IExtrapolator > m_extrapolator
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.
virtual void setOwner(IDataHandleHolder *o)=0
@ 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
const AtlasDetectorID * m_detID
ToolHandle< ICaloSurfaceBuilder > m_calosurf
Tool to build calorimeter layer surfaces.
@ fFirstAtlasCaloTechnology
Class describing a truth particle in the MC record.
TruthParticle_v1 TruthParticle
Typedef to implementation.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
NeutralParticle_v1 NeutralParticle
Reference the current persistent version:
unsigned int TrackParametersIdentifier
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Gaudi::Property< bool > m_startFromPerigee
Class describing a truth vertex in the MC record.
ParametersBase< TrackParametersDim, Charged > TrackParameters
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.
Eigen::Matrix< double, 3, 1 > Vector3D
struct TBPatternUnitContext Muon
float x() const
Vertex x displacement.
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
#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.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
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.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.