|
ATLAS Offline Software
|
Go to the documentation of this file.
22 #include "GaudiKernel/EventContext.h"
40 rescaled << trkPB.
d0(), trkPB.
z0(), trkPB.
phi0(), trkPB.
theta(),
53 if (cluster.hasSampling(lay)) {
54 destLayers.emplace_back(lay);
62 const std::string&
name,
67 declareInterface<IEMExtrapolationTools>(
this);
91 return StatusCode::SUCCESS;
94 std::pair<std::vector<CaloSampling::CaloSample>,
95 std::vector<std::unique_ptr<Trk::Surface>>>
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) };
158 const EventContext& ctx,
161 const std::vector<CaloSampling::CaloSample>& samples,
162 const std::vector<std::unique_ptr<Trk::Surface>>& surfaces,
163 std::array<double, 4>&
eta,
164 std::array<double, 4>&
phi,
167 unsigned int extrapFrom)
const
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;
293 float phiAtCalo)
const
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)] &&
335 float* phiAtCalo)
const
351 vertex->position(),
momentum.unit() * 1.e10, +1, surface, std::nullopt);
360 float* phiAtCalo)
const
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));
403 unsigned int index)
const
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 =
462 if (
vertex.nTrackParticles() == 0) {
463 ATH_MSG_WARNING(
"getMomentumAtVertex : vertex has no track particles!");
472 for (
unsigned int i = 0;
i <
vertex.nTrackParticles(); ++
i) {
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();
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.
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
Scalar theta() const
theta method
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
provides Calorimeter Sampling enum
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
@ LastMeasurement
Parameter defined at the position of the last measurement.
bool const RAWDATA *ch2 const
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.
@ 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.
Description of a calorimeter cluster.
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.
void setParameters(T *h, TGraphAsymmErrors *tg)
bool inBarrel() const
Returns true if at least one clustered cell in the barrel.
Principal data class for CaloCell clusters.
std::vector< std::tuple< CaloSampling::CaloSample, double, double > > EtaPhiPerLayerVector
float phiSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
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 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.
double charge(const T &p)
Eigen::Matrix< double, 3, 1 > Vector3D
const Amg::Vector3D & momentum() const
Access method for the momentum.
float eSample(const CaloSample sampling) const
Class describing a Vertex.
This class provides the client interface for accessing the detector description information common to...
#define ATH_MSG_WARNING(x)
@ PseudoMeasurementOnTrack
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
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.
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 .)