|
ATLAS Offline Software
|
#include <EMExtrapolationTools.h>
|
| EMExtrapolationTools (const std::string &type, const std::string &name, const IInterface *parent) |
| Constructor with parameters. More...
|
|
virtual | ~EMExtrapolationTools ()=default |
| Destructor. More...
|
|
virtual StatusCode | initialize () override final |
| initialize method More...
|
|
virtual std::pair< std::vector< CaloSampling::CaloSample >, std::vector< std::unique_ptr< Trk::Surface > > > | getClusterLayerSurfaces (const xAOD::CaloCluster &cluster, const CaloDetDescrManager &caloDD) const override final |
|
virtual StatusCode | getMatchAtCalo (const EventContext &ctx, const xAOD::CaloCluster &cluster, const xAOD::TrackParticle &trkPB, const std::vector< CaloSampling::CaloSample > &samples, const std::vector< std::unique_ptr< Trk::Surface >> &surfaces, std::array< double, 4 > &eta, std::array< double, 4 > &phi, std::array< double, 4 > &deltaEta, std::array< double, 4 > &deltaPhi, unsigned int extrapFrom=fromPerigee) const override final |
| get eta, phi, deltaEta, and deltaPhi at the four calorimeter layers given the Trk::ParametersBase. More...
|
|
virtual bool | matchesAtCalo (const xAOD::CaloCluster *cluster, const xAOD::Vertex *vertex, float etaAtCalo, float phiAtCalo) const override final |
| test for vertex-to-cluster match given also the positions at the calorimeter from the vertex extrapolation
More...
|
|
virtual bool | getEtaPhiAtCalo (const EventContext &ctx, const xAOD::Vertex *vertex, float *etaAtCalo, float *phiAtCalo) const override final |
| get eta, phi at EM2 given a vertex which is converted to NeutralParameters. More...
|
|
virtual bool | getEtaPhiAtCalo (const EventContext &ctx, const Trk::TrackParameters *trkPar, float *etaAtCalo, float *phiAtCalo) const override final |
| get eta, phi at EM2 given NeutralParameters. More...
|
|
Amg::Vector3D | getMomentumAtVertex (const EventContext &ctx, const xAOD::Vertex &, unsigned int) const override final |
| get the momentum of the i-th trackParticle assiciated to the vertex at vertex (designed for conversions) More...
|
|
Amg::Vector3D | getMomentumAtVertex (const EventContext &ctx, const xAOD::Vertex &, bool reuse=true) const override final |
| get sum of the momenta at the vertex (designed for conversions). 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 |
|
Tools for track extrapolation to the calorimeter
- Author
- Thomas Koffas, Christos Anastopoulos
Definition at line 44 of file EMExtrapolationTools.h.
◆ StoreGateSvc_t
◆ TrkExtrapDef
Enum for track extrapolation to calo.
Enumerator |
---|
fromLastMeasurement | from the last measurement of TrackParticle
|
fromPerigee | from the perigee of TrackParticle
|
fromPerigeeRescaled | from the perigee of TrackParticle recaled by Ecluster
|
fromCaloToPerigee | from the calo to the perigee - fast extrapolation
|
Definition at line 32 of file IEMExtrapolationTools.h.
◆ EMExtrapolationTools()
EMExtrapolationTools::EMExtrapolationTools |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
Constructor with parameters.
Definition at line 61 of file EMExtrapolationTools.cxx.
67 declareInterface<IEMExtrapolationTools>(
this);
◆ ~EMExtrapolationTools()
virtual EMExtrapolationTools::~EMExtrapolationTools |
( |
| ) |
|
|
virtualdefault |
◆ 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
◆ getClusterLayerSurfaces()
Implements IEMExtrapolationTools.
Definition at line 96 of file EMExtrapolationTools.cxx.
104 constexpr std::array<CaloSampling::CaloSample, 4> barrelLayers = {
110 constexpr std::array<CaloSampling::CaloSample, 4> endcapLayers = {
116 constexpr std::array<CaloSampling::CaloSample, 4> endcapLayersAboveEta2p5 = {
120 constexpr std::array<CaloSampling::CaloSample, 1> forwardLayers = {
124 std::vector<CaloSampling::CaloSample> clusterLayers;
125 clusterLayers.reserve(4);
130 getClusterLayers(barrelLayers, clusterLayers, cluster);
134 if(std::abs(cluster.
eta()) < 2.5){
135 getClusterLayers(endcapLayers, clusterLayers, cluster);
138 getClusterLayers(endcapLayersAboveEta2p5, clusterLayers, cluster);
142 getClusterLayers(forwardLayers, clusterLayers, cluster);
145 std::vector<std::unique_ptr<Trk::Surface>> caloSurfaces =
147 clusterLayers, cluster.
eta(), caloDD);
149 return { std::move(clusterLayers), std::move(caloSurfaces) };
◆ getEtaPhiAtCalo() [1/2]
bool EMExtrapolationTools::getEtaPhiAtCalo |
( |
const EventContext & |
ctx, |
|
|
const Trk::TrackParameters * |
trkPar, |
|
|
float * |
etaAtCalo, |
|
|
float * |
phiAtCalo |
|
) |
| const |
|
finaloverridevirtual |
get eta, phi at EM2 given NeutralParameters.
Return false if the extrapolation fails
Implements IEMExtrapolationTools.
Definition at line 357 of file EMExtrapolationTools.cxx.
365 if (fabs(trkPar->
eta()) < 1.425) {
373 std::unique_ptr<Trk::CaloExtension> extension =
nullptr;
377 ATH_MSG_WARNING(
"Could not create an extension from getEtaPhiAtCalo ");
382 *extension, intersections, &layersToSelect);
384 for (
const auto&
p : intersections) {
388 *etaAtCalo = std::get<1>(
p);
389 *phiAtCalo = std::get<2>(
p);
393 <<
i <<
" " << std::get<1>(
p) <<
" " << std::get<2>(
p));
◆ getEtaPhiAtCalo() [2/2]
bool EMExtrapolationTools::getEtaPhiAtCalo |
( |
const EventContext & |
ctx, |
|
|
const xAOD::Vertex * |
vertex, |
|
|
float * |
etaAtCalo, |
|
|
float * |
phiAtCalo |
|
) |
| const |
|
finaloverridevirtual |
◆ getMatchAtCalo()
StatusCode EMExtrapolationTools::getMatchAtCalo |
( |
const EventContext & |
ctx, |
|
|
const xAOD::CaloCluster & |
cluster, |
|
|
const xAOD::TrackParticle & |
trkPB, |
|
|
const std::vector< CaloSampling::CaloSample > & |
samples, |
|
|
const std::vector< std::unique_ptr< Trk::Surface >> & |
surfaces, |
|
|
std::array< double, 4 > & |
eta, |
|
|
std::array< double, 4 > & |
phi, |
|
|
std::array< double, 4 > & |
deltaEta, |
|
|
std::array< double, 4 > & |
deltaPhi, |
|
|
unsigned int |
extrapFrom = fromPerigee |
|
) |
| const |
|
finaloverridevirtual |
get eta, phi, deltaEta, and deltaPhi at the four calorimeter layers given the Trk::ParametersBase.
Implements IEMExtrapolationTools.
Definition at line 157 of file EMExtrapolationTools.cxx.
179 if (cluster.
e() < 10 && trkPB.
pt() < 10) {
181 << cluster.
e() <<
" , or too small track pt" << trkPB.
pt());
182 return StatusCode::FAILURE;
185 bool didExtension =
false;
187 intersections.reserve(samples.size());
189 switch (extrapFrom) {
191 Trk::Perigee trkPar = getRescaledPerigee(trkPB, cluster);
194 didExtension = !extension.empty();
195 for (
const auto&
i : extension) {
196 intersections.emplace_back(
197 i.first,
i.second->position().eta(),
i.second->position().phi());
204 didExtension = !extension.empty();
205 for (
const auto&
i : extension) {
206 intersections.emplace_back(
207 i.first,
i.second->position().eta(),
i.second->position().phi());
212 unsigned int index(0);
218 if (position.perp() > 1550. || std::abs(position.z()) > 3750.) {
220 didExtension =
false;
222 const auto extension =
225 didExtension = !extension.empty();
226 for (
const auto&
i : extension) {
227 intersections.emplace_back(
228 i.first,
i.second->position().eta(),
i.second->position().phi());
243 << extrapFrom <<
" for a track with : "
244 <<
" Track Pt " << trkPB.
pt() <<
" Track Eta " << trkPB.
eta()
245 <<
" Track Phi " << trkPB.
phi() <<
" Track Fitter "
247 return StatusCode::FAILURE;
251 const bool flipSign = trkPB.
charge() > 0;
253 for (
const auto&
p : intersections) {
268 eta[
i] = std::get<1>(
p);
269 phi[
i] = std::get<2>(
p);
281 return StatusCode::SUCCESS;
◆ getMomentumAtVertex() [1/2]
get sum of the momenta at the vertex (designed for conversions).
Retrieve from auxdata if available and <reuse> is true
Implements IEMExtrapolationTools.
Definition at line 454 of file EMExtrapolationTools.cxx.
462 if (
vertex.nTrackParticles() == 0) {
463 ATH_MSG_WARNING(
"getMomentumAtVertex : vertex has no track particles!");
466 if (reuse && accPx.isAvailable(
vertex) && accPy.isAvailable(
vertex) &&
467 accPz.isAvailable(
vertex)) {
472 for (
unsigned int i = 0;
i <
vertex.nTrackParticles(); ++
i) {
◆ getMomentumAtVertex() [2/2]
get the momentum of the i-th trackParticle assiciated to the vertex at vertex (designed for conversions)
Implements IEMExtrapolationTools.
Definition at line 401 of file EMExtrapolationTools.cxx.
408 }
else if (
vertex.vxTrackAtVertexAvailable() &&
409 !
vertex.vxTrackAtVertex().empty()) {
412 ATH_MSG_DEBUG(
"getMomentumAtVertex : getting from vxTrackAtVertex");
413 const auto& trkAtVertex =
vertex.vxTrackAtVertex()[
index];
415 if (!paramAtVertex) {
420 }
else if (
vertex.nTrackParticles() == 1) {
423 "getMomentumAtVertex : 1 track only, getting from first measurement");
425 unsigned int paramindex(0);
430 momentum +=
tp->curvilinearParameters(paramindex).momentum();
434 ATH_MSG_DEBUG(
"getMomentumAtVertex : extrapolating to perigee surface");
440 std::unique_ptr<const Trk::TrackParameters>
params =
◆ getTRTsection()
Return +/- 1 (2) if track is in positive/negative TRT barrel (endcap)
Definition at line 482 of file EMExtrapolationTools.cxx.
490 "No trt ID guessing TRT section based on eta: " << trkPB->
eta());
491 return (trkPB->
eta() > 0 ? 1 : -1) * (fabs(trkPB->
eta()) < 0.6 ? 1 : 2);
504 rItTSoS = trackStates->
rbegin();
505 rItTSoS != trackStates->
rend();
509 (*rItTSoS)->measurementOnTrack() !=
nullptr &&
510 !((*rItTSoS)->measurementOnTrack()->type(
512 trkPar = (*rItTSoS)->measurementOnTrack();
523 const Identifier tid =
sf.associatedDetectorElementIdentifier();
◆ initialize()
StatusCode EMExtrapolationTools::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 & IEMExtrapolationTools::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
◆ matchesAtCalo()
test for vertex-to-cluster match given also the positions at the calorimeter from the vertex extrapolation
Implements IEMExtrapolationTools.
Definition at line 290 of file EMExtrapolationTools.cxx.
295 if (!cluster || !
vertex) {
307 if ((TRTsection == 2 && (cluster->
eta() <= 0.6 || cluster->
eta() >= 2.4)) ||
309 (cluster->
eta() >= -0.6 || cluster->
eta() <= -2.4)) ||
310 (TRTsection == 1 && (cluster->
eta() <= -0.1 || cluster->
eta() >= 1.3)) ||
311 (TRTsection == -1 && (cluster->
eta() >= 0.1 || cluster->
eta() <= -1.3))) {
323 return (
deltaEta < dEtaV[abs(TRTsection)] &&
◆ 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()
◆ 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_detStore
◆ m_enableTRT
Gaudi::Property<bool> EMExtrapolationTools::m_enableTRT { this, "EnableTRT", true } |
|
private |
◆ m_evtStore
◆ m_extrapolator
Initial value:{
this,
"Extrapolator",
"Trk::Extrapolator/AtlasExtrapolator"
}
Definition at line 123 of file EMExtrapolationTools.h.
◆ m_narrowDeltaEta
Gaudi::Property<double> EMExtrapolationTools::m_narrowDeltaEta { this, "NarrowDeltaEta", 0.05 } |
|
private |
◆ m_narrowDeltaPhi
Gaudi::Property<double> EMExtrapolationTools::m_narrowDeltaPhi { this, "NarrowDeltaPhi", 0.05 } |
|
private |
◆ m_narrowDeltaPhiTRTbarrel
Gaudi::Property<double> EMExtrapolationTools::m_narrowDeltaPhiTRTbarrel |
|
private |
◆ m_narrowDeltaPhiTRTendcap
Gaudi::Property<double> EMExtrapolationTools::m_narrowDeltaPhiTRTendcap |
|
private |
◆ m_ParticleCaloExtensionTool
Initial value:{
this,
"CaloExtensionTool",
"Trk::ParticleCaloExtensionTool/EMParticleCaloExtensionTool"
}
Definition at line 117 of file EMExtrapolationTools.h.
◆ m_TRTbarrelDeltaEta
Gaudi::Property<double> EMExtrapolationTools::m_TRTbarrelDeltaEta |
|
private |
◆ m_TRTendcapDeltaEta
Gaudi::Property<double> EMExtrapolationTools::m_TRTendcapDeltaEta { this, "TRTendcapDeltaEta", 0.2 } |
|
private |
◆ m_trtId
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
const Trk::CurvilinearParameters curvilinearParameters(unsigned int index) const
Returns a curvilinear representation of the parameters at 'index'.
virtual double phi() const
The azimuthal angle ( ) of the particle.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
void midPointEtaPhiPerLayerVector(const Trk::CaloExtension &extension, EtaPhiPerLayerVector &result, const LayersToSelect *selection=nullptr)
Scalar phi() const
phi method
Helper class to provide type-safe access to aux data.
float charge() const
Returns the charge.
const_reverse_iterator rend() const noexcept
Return a const_reverse_iterator pointing at the beginning of the collection.
Scalar eta() const
pseudorapidity method
const Amg::Vector3D & position() const
Access method for the position.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
@ LastMeasurement
Parameter defined at the position of the last measurement.
bool isValid() const
Test to see if the link can be dereferenced.
bool indexOfParameterAtPosition(unsigned int &index, ParameterPosition position) const
Function to determine if this TrackParticle contains track parameters at a certain position,...
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 ...
float etaSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
const Trk::Perigee & perigeeParameters() const
Returns the Trk::MeasuredPerigee track parameters.
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
bool inEndcap() const
Returns true if at least one clustered cell in the endcap.
std::size_t numberOfSiTracks(const xAOD::Photon *eg)
return the number of Si tracks in the conversion
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
virtual double eta() const
The pseudorapidity ( ) of the particle.
TrackFitter trackFitter() const
Returns the fitter.
@ FirstMeasurement
Parameter defined at the position of the 1st measurement.
::StatusCode StatusCode
StatusCode definition for legacy code.
bool inBarrel() const
Returns true if at least one clustered cell in the barrel.
std::vector< std::tuple< CaloSampling::CaloSample, double, double > > EtaPhiPerLayerVector
float phiSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
const_reverse_iterator rbegin() const noexcept
Return a const_reverse_iterator pointing past the end of the collection.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
virtual const Surface & associatedSurface() const =0
Interface method to get the associated Surface.
std::reverse_iterator< const_iterator > const_reverse_iterator
Standard const_reverse_iterator.
const ElementLink< TrackCollection > & trackLink() const
Returns a link (which can be invalid) to the Trk::Track which was used to make this TrackParticle.
Eigen::Matrix< double, 3, 1 > Vector3D
const Amg::Vector3D & momentum() const
Access method for the momentum.
float eSample(const CaloSample sampling) const
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
@ PseudoMeasurementOnTrack
double eta() const
Access method for pseudorapidity - from momentum.
Class describing a TrackParticle.
const Trk::Track * track() const
Returns a pointer (which can be NULL) to the Trk::Track which was used to make this TrackParticle.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
virtual double e() const
The total energy of the particle.
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
std::set< CaloSampling::CaloSample > LayersToSelect
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)