  | 
  
    ATLAS Offline Software
    
   | 
 
 
 
 
Go to the documentation of this file.
   21 #include "GaudiKernel/EventContext.h" 
   30                                          const std::string& 
name,
 
   35   declareInterface<IEMTrackMatchBuilder>(
this);
 
   52   return StatusCode::SUCCESS;
 
   60   if (egammas == 
nullptr) {
 
   61     return StatusCode::SUCCESS;
 
   70   ATH_CHECK(caloDetDescrMgrHandle.isValid());
 
   81   return StatusCode::SUCCESS;
 
   90   if (!
eg || !trackPC) {
 
   92       "trackExecute: NULL pointer to egammaRec or TrackParticleContainer");
 
   93     return StatusCode::SUCCESS;
 
   98   if (cluster && cluster->
e() == 0.0) {
 
   99     ATH_MSG_WARNING(
"trackExecute: cluster energy is 0.0! Ignoring cluster.");
 
  100     return StatusCode::SUCCESS;
 
  104   std::vector<TrackMatch> trkMatches;
 
  121   if (!trkMatches.empty()) {
 
  123     std::sort(trkMatches.begin(), trkMatches.end(), 
m_sorter);
 
  135     const std::string 
key = 
EL(*trackPC, 0, ctx).dataID();
 
  138                                   << 
" hasPix: " << 
m.hasPix
 
  139                                   << 
" hitsScore: " << 
m.hitsScore);
 
  148   return StatusCode::SUCCESS;
 
  153                                    std::vector<TrackMatch>& trackMatches,
 
  168   std::array<double, 4> 
eta = { -999.0, -999.0, -999.0, -999.0 };
 
  169   std::array<double, 4> 
phi = { -999.0, -999.0, -999.0, -999.0 };
 
  170   std::array<double, 4> 
deltaEta = { -999.0, -999.0, -999.0, -999.0 };
 
  171   std::array<double, 4> 
deltaPhi = { -999.0, -999.0, -999.0, -999.0 };
 
  179   std::pair<std::vector<CaloSampling::CaloSample>,
 
  180             std::vector<std::unique_ptr<Trk::Surface>>>
 
  184         ->getMatchAtCalo(ctx,
 
  187                          layersAndSurfaces.first,
 
  188                          layersAndSurfaces.second,
 
  200   std::array<double, 4> etaRes = { -999.0, -999.0, -999.0, -999.0 };
 
  201   std::array<double, 4> phiRes = { -999.0, -999.0, -999.0, -999.0 };
 
  202   std::array<double, 4> deltaEtaRes = { -999.0, -999.0, -999.0, -999.0 };
 
  203   std::array<double, 4> deltaPhiRes = { -999.0, -999.0, -999.0, -999.0 };
 
  206         ->getMatchAtCalo(ctx,
 
  209                          layersAndSurfaces.first,
 
  210                          layersAndSurfaces.second,
 
  220   double deltaPhiRescale = deltaPhiRes[2];
 
  250                   << deltaPhiRes[2] << 
" / " << deltaEtaRes[2]);
 
  257   std::array<double, 4> 
eta1 = { -999.0, -999.0, -999.0, -999.0 };
 
  258   std::array<double, 4> phi1 = { -999.0, -999.0, -999.0, -999.0 };
 
  259   std::array<double, 4> 
deltaEta1 = { -999.0, -999.0, -999.0, -999.0 };
 
  260   std::array<double, 4> 
deltaPhi1 = { -999.0, -999.0, -999.0, -999.0 };
 
  263         ->getMatchAtCalo(ctx,
 
  266                          layersAndSurfaces.first,
 
  267                          layersAndSurfaces.second,
 
  288   trkmatch.deltaPhiRescaled = deltaPhiRes;
 
  314   trkmatch.hasPix = (nPixel > 0);
 
  322   trkmatch.hitsScore = 0;
 
  333     trkmatch.hitsScore += (nPixel * 5);
 
  336       trkmatch.hitsScore += 5;
 
  340       trkmatch.hitsScore += 10;
 
  344                             << 
" hitsScore : " << trkmatch.hitsScore);
 
  346   trackMatches.push_back(trkmatch);
 
  363   const double trkPhi = (!flip) ? candidatePerigee.parameters()[
Trk::phi]
 
  364                                 : -candidatePerigee.parameters()[
Trk::phi];
 
  365   const double trkEta =
 
  366     (!flip) ? candidatePerigee.eta() : -candidatePerigee.eta();
 
  367   const double z_perigee = candidatePerigee.position().z();
 
  368   const double r_perigee = candidatePerigee.position().perp();
 
  369   const Amg::Vector3D PerigeeXYZPosition(candidatePerigee.position().x(),
 
  370                                          candidatePerigee.position().y(),
 
  373   const double clusterEta = cluster->
eta();
 
  375   const double Et = cluster->
e() / cosh(trkEta);
 
  376   const double clusterPhi = cluster->
phi();
 
  379   if (std::abs(clusterEta) > 10.0 || Et < 10) {
 
  386       *cluster, PerigeeXYZPosition, isEndCap);
 
  388   const double clusterEtaCorrected = XYZClusterWrtTrackPerigee.eta();
 
  392     ATH_MSG_DEBUG(
" Fails broad window eta match (track eta, cluster eta, " 
  393                   "cluster eta corrected): ( " 
  394                   << trkEta << 
", " << clusterEta << 
", " << clusterEtaCorrected
 
  401     Et, trkEta, 
track->charge(), r_perigee, isEndCap);
 
  404     track->pt(), trkEta, 
track->charge(), r_perigee, isEndCap);
 
  406   const double clusterPhiCorrected = XYZClusterWrtTrackPerigee.phi();
 
  416   const double deltaPhiTrack =
 
  425       "FAILS broad window phi match (track phi, phirotCluster , phiRotTrack , " 
  426       << 
"cluster phi corrected, cluster phi): ( " << trkPhi << 
", " 
  427       << phiRotRescaled << 
", " << phiRotTrack << 
", " << clusterPhiCorrected
 
  428       << 
", " << clusterPhi << 
")");
 
  456   return match1.
dR < match2.
dR;
 
  
std::array< double, 4 > deltaPhiRescaled
 
Amg::Vector3D approxXYZwrtPoint(const xAOD::CaloCluster &cluster, const Amg::Vector3D &point, const bool isEndCap)
Function to get the (x,y,z) of the cluster wrt to a point (x0,y0,z0)
 
virtual double phi() const
The azimuthal angle ( ) of the particle.
 
virtual double pt() const override final
The transverse momentum ( ) of the particle.
 
@ deltaPhiRescaled
difference between the cluster phi (sampling 2) and the phi of the track extrapolated from the perige...
 
Const iterator class for DataVector/DataList.
 
Scalar phi() const
phi method
 
bool inBroadWindow(const EventContext &ctx, std::vector< TrackMatch > &trackMatches, const xAOD::CaloCluster &cluster, int trackNumber, const xAOD::TrackParticle &trkPB, const CaloDetDescrManager &caloDD) const
Compute for tracks passing the loose matching the distance between track extrapolated to 2nd sampling...
 
const_pointer_type cptr()
Dereference the pointer.
 
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloDetDescrMgrKey
 
Gaudi::Property< bool > m_useRescaleMetric
Boolean to use Rescale in the metric.
 
std::array< double, 4 > deltaPhi
 
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_TrackParticlesKey
name of TrackParticle container in TDS
 
StatusCode trackExecute(const EventContext &ctx, egammaRec *eg, const xAOD::TrackParticleContainer *trackPC, const CaloDetDescrManager &caloDD) const
execute method
 
Scalar eta() const
pseudorapidity method
 
Gaudi::Property< float > m_deltaEtaResolution
The resolutions: might be good to split in barrel/end-cap in the future.
 
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
 
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
 
double PhiROT(const double pt, const double eta, const int charge, const double r_start, const bool isEndCap)
Function to calculate the approximate rotation in phi/bending of a track until it reaches the calo.
 
Gaudi::Property< float > m_deltaPhiRescaleResolution
 
setEt setPhi setE277 setWeta2 eta1
 
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
 
@ expectInnermostPixelLayerHit
Do we expect a 0th-layer barrel hit for this track?
 
Gaudi::Property< bool > m_SecondPassRescale
Boolean to do second pass with Rescale.
 
TrackMatchSorter m_sorter
 
Gaudi::Property< double > m_narrowDeltaPhiRescale
narrow cut on deltaPhiRescale
 
Gaudi::Property< double > m_narrowDeltaPhiBrem
narrow cut on deltaPhi for electrons
 
Gaudi::Property< float > m_deltaPhiResolution
 
@ deltaPhi1
difference between the cluster eta (1st sampling) and the eta of the track extrapolated to the 1st sa...
 
virtual StatusCode executeRec(const EventContext &ctx, EgammaRecContainer *egammas) const override final
execute method
 
bool isBarrel(const xAOD::Egamma *eg)
return true if the cluster is in the barrel
 
double m_deltaPhiRescaleWeight
 
Description of a calorimeter cluster.
 
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
 
@ expectNextToInnermostPixelLayerHit
Do we expect a 1st-layer barrel hit for this track?
 
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
 
StatusCode initialize() override final
Gaudi algorithm hooks.
 
virtual double eta() const
The pseudorapidity ( ) of the particle.
 
::StatusCode StatusCode
StatusCode definition for legacy code.
 
std::vector< ElementLink< xAOD::TrackParticleContainer > > trackParticleLinks(const xAOD::TauJet *tau, xAOD::TauJetParameters::TauTrackFlag flag=xAOD::TauJetParameters::TauTrackFlag::classifiedCharged)
 
Gaudi::Property< double > m_MaxDeltaPhiRescale
@Maximum deltaPhi (Res) allowed for a match
 
This module defines the arguments passed from the BATCH driver to the BATCH worker.
 
Gaudi::Property< double > m_broadDeltaPhi
broad cut on deltaPhi
 
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
 
EMTrackMatchBuilder(const std::string &type, const std::string &name, const IInterface *parent)
Default constructor.
 
virtual bool isValid() override final
Can the handle be successfully dereferenced?
 
int summaryValueInt(const xAOD::TrackParticle &tp, const xAOD::SummaryType &info, int deflt=-999)
return the summary value for a TrackParticle or default value (-999) (to be used mostly in python whe...
 
Gaudi::Property< double > m_narrowDeltaPhiRescaleBrem
narrow cut on deltaPhiRescale for electrons
 
@ numberOfNextToInnermostPixelLayerHits
these are the hits in the 1st pixel barrel layer
 
@ deltaPhiLast
deltaPhi from the las point
 
std::array< double, 4 > deltaEta
 
StatusCode initialize(bool used=true)
 
Eigen::Matrix< double, 3, 1 > Vector3D
 
std::size_t numberOfSiHits(const xAOD::TrackParticle *tp)
return the number of Si hits in the track particle
 
bool isCandidateMatch(const xAOD::CaloCluster *cluster, const xAOD::TrackParticle *track, bool flip) const
Loose track-cluster matching.
 
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
 
Gaudi::Property< double > m_narrowDeltaEta
narrow cut on deltaEta
 
Gaudi::Property< bool > m_useScoring
Boolean to apply heuristic when tracks have close deltaR.
 
Gaudi::Property< float > m_distanceForScore
The distance from which one goes from using better deltaR to using score.
 
This class provides the client interface for accessing the detector description information common to...
 
A structure for keeping track match information.
 
#define ATH_MSG_WARNING(x)
 
Gaudi::Property< bool > m_useCandidateMatch
flag to turn on/off use of isCandidateMatch
 
bool operator()(const TrackMatch &match1, const TrackMatch &match2) const
 
@ numberOfPixelDeadSensors
number of dead pixel sensors crossed [unit8_t].
 
Class describing a TrackParticle.
 
@ deltaEta1
difference between the cluster eta (first sampling) and the eta of the track extrapolated to the firs...
 
Handle class for reading from StoreGate.
 
function object to sort track matches based on quality
 
Gaudi::Property< double > m_narrowDeltaPhi
narrow cut on deltaPhiRescale
 
constexpr int pow(int base, int exp) noexcept
 
ToolHandle< IEMExtrapolationTools > m_extrapolationTool
 
virtual double e() const
The total energy of the particle.
 
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
 
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
 
Gaudi::Property< double > m_broadDeltaEta
broad cut on deltaEta