|
ATLAS Offline Software
|
#include <ParticleCaloExtensionTool.h>
|
| ParticleCaloExtensionTool (const std::string &, const std::string &, const IInterface *) |
|
virtual | ~ParticleCaloExtensionTool () |
|
virtual StatusCode | initialize () override final |
|
virtual StatusCode | finalize () 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 277 of file ParticleCaloExtensionTool.cxx.
283 << startPars.position().perp() <<
" z "
284 << startPars.position().z() <<
" momentum "
285 << startPars.momentum().mag());
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) {
331 TrackParametersIdHelper parsIdHelper;
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));
◆ 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 101 of file ParticleCaloExtensionTool.cxx.
107 std::unique_ptr<Trk::CaloExtension>& extension = cache[
particle.index()];
108 if (extension ==
nullptr) {
111 return extension.get();
◆ caloExtension() [4/7]
◆ caloExtension() [5/7]
Definition at line 205 of file ParticleCaloExtensionTool.cxx.
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;
◆ 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 115 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 128 of file ParticleCaloExtensionTool.cxx.
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;
◆ 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 401 of file ParticleCaloExtensionTool.cxx.
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);
◆ 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
◆ finalize()
StatusCode Trk::ParticleCaloExtensionTool::finalize |
( |
| ) |
|
|
finaloverridevirtual |
◆ 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 453 of file ParticleCaloExtensionTool.cxx.
463 std::vector<std::unique_ptr<Trk::Surface>> caloSurfaces =
467 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 421 of file ParticleCaloExtensionTool.cxx.
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;
◆ 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 129 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 149 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 136 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.