|
ATLAS Offline Software
|
Go to the documentation of this file.
20 #include "GaudiKernel/EventContext.h"
47 ISvcLocator* pSvcLocator)
66 return StatusCode::SUCCESS;
72 ATH_MSG_INFO(
"===> egamma Selected Tracks Statistics ===========");
73 ATH_MSG_INFO(
"--- All Central Clusters: " << m_AllClusters);
74 ATH_MSG_INFO(
"--- Selected Central Clusters: " << m_SelectedClusters);
76 ATH_MSG_INFO(
"--- Selected Central Tracks: " << m_SelectedTracks);
78 ATH_MSG_INFO(
"--- Selected Central Si Tracks: " << m_SelectedSiTracks);
80 ATH_MSG_INFO(
"--- Selected TRT Tracks: " << m_SelectedTRTTracks);
81 if (m_doForwardTracks) {
82 ATH_MSG_INFO(
"--- All Forward Clusters: " << m_AllFwdClusters);
83 ATH_MSG_INFO(
"--- Selected Forward Tracks: " << m_SelectedFwdTracks);
85 ATH_MSG_INFO(
"<=================================================");
87 return StatusCode::SUCCESS;
118 auto viewCopy = std::make_unique<ConstDataVector<xAOD::TrackParticleContainer>>(
SG::VIEW_ELEMENTS);
128 ATH_CHECK(caloDetDescrMgrHandle.isValid());
133 std::vector<const xAOD::CaloCluster*> passingClusters;
136 passingClusters.push_back(cluster);
146 bool isNotValidForRefit = !checkIfValidForRefit(
track);
147 if (isNotValidForRefit) {
156 if (
selectTrack(ctx, cluster,
track, isNotValidForRefit, *calodetdescrmgr)) {
157 viewCopy->push_back(
track);
159 if (isNotValidForRefit) {
172 if (
selectTrack(ctx, cluster,
track, isNotValidForRefit, *calodetdescrmgr)) {
173 viewCopy->push_back(
track);
183 return StatusCode::SUCCESS;
194 if (cluster ==
nullptr ||
track ==
nullptr) {
201 const double trkPhi = candidatePerigee.parameters()[
Trk::phi];
202 const double trkEta = candidatePerigee.eta();
203 const double z_perigee = candidatePerigee.position().z();
204 const double r_perigee = candidatePerigee.position().perp();
205 const Amg::Vector3D PerigeeXYZPosition(candidatePerigee.position().x(),
206 candidatePerigee.position().y(),
214 const double Et = trkTRT ? cluster->
et() : cluster->
e() / cosh(trkEta);
217 if (std::abs(clusterEta) > 10.0 || std::abs(trkEta) > 10.0 || Et < 10.0) {
219 "FAILS sanity checks : Track Eta : " << trkEta <<
220 ", Cluster Eta " << clusterEta
253 const double clusterPhiCorrected = XYZClusterWrtTrackPerigee.phi();
278 "FAILS broad window phi match (track phi, phirotCluster , phiRotTrack , " <<
279 "cluster phi corrected, cluster phi): ( " <<
281 phiRotRescaled <<
", " <<
282 phiRotTrack <<
", " <<
283 clusterPhiCorrected <<
", " <<
284 cluster->
phi() <<
")"
291 if (trkTRT) {
return true; }
293 const double clusterEtaCorrected = XYZClusterWrtTrackPerigee.eta();
301 "FAILS broad window eta match (track eta, cluster eta, cluster eta corrected): ( " <<
303 cluster->
etaBE(2) <<
", " <<
304 clusterEtaCorrected <<
" )"
311 std::vector<CaloSampling::CaloSample>,
312 std::vector<std::unique_ptr<Trk::Surface>>
317 std::array<double, 4>
eta = { -999.0, -999.0, -999.0, -999.0 };
318 std::array<double, 4>
phi = { -999.0, -999.0, -999.0, -999.0 };
319 std::array<double, 4>
deltaEta = { -999.0, -999.0, -999.0, -999.0 };
320 std::array<double, 4>
deltaPhi = { -999.0, -999.0, -999.0, -999.0 };
325 layersAndSurfaces.first,
326 layersAndSurfaces.second,
355 std::array<double, 4> etaRes = { -999.0, -999.0, -999.0, -999.0 };
356 std::array<double, 4> phiRes = { -999.0, -999.0, -999.0, -999.0 };
357 std::array<double, 4> deltaEtaRes = { -999.0, -999.0, -999.0, -999.0 };
358 std::array<double, 4> deltaPhiRes = { -999.0, -999.0, -999.0, -999.0 };
364 layersAndSurfaces.first,
365 layersAndSurfaces.second,
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.
SG::WriteHandleKey< ConstDataVector< xAOD::TrackParticleContainer > > m_OutputTrkPartContainerKey
Gaudi::Accumulators::Counter m_AllFwdClusters
@ deltaPhiRescaled
difference between the cluster phi (sampling 2) and the phi of the track extrapolated from the perige...
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Scalar phi() const
phi method
Gaudi::Property< double > m_narrowDeltaPhiBrem
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Gaudi::Accumulators::Counter m_AllTRTTracks
Scalar eta() const
pseudorapidity method
virtual StatusCode initialize() override final
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
Gaudi::Accumulators::Counter m_AllTracks
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.
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
Gaudi::Accumulators::Counter m_SelectedSiTracks
Definition of CaloDetDescrManager.
An algorithm that can be simultaneously executed in multiple threads.
bool isBarrel(const xAOD::Egamma *eg)
return true if the cluster is in the barrel
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
Gaudi::Property< double > m_narrowDeltaEta
Narrow windows.
Handle class for recording to StoreGate.
Description of a calorimeter cluster.
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
Gaudi::Accumulators::Counter m_SelectedTracks
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
virtual double eta() const
The pseudorapidity ( ) of the particle.
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackParticleContainerKey
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Accumulators::Counter m_SelectedTRTTracks
Gaudi::Accumulators::Counter m_AllSiTracks
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clusterContainerKey
Names of input output collections.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
ToolHandle< IEMExtrapolationTools > m_extrapolationTool
Tool for extrapolation.
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::Accumulators::Counter m_SelectedClusters
Gaudi::Property< double > m_broadDeltaEta
Broad windows.
Gaudi::Property< bool > m_doForwardTracks
Private member flag to select forward tracks.
Gaudi::Property< double > m_narrowDeltaPhi
ToolHandle< IegammaCaloClusterSelector > m_egammaCaloClusterSelector
Tool to filter the calo clusters.
Gaudi::Accumulators::Counter m_SelectedFwdTracks
Helpers for checking error return status codes and reporting errors.
bool isFCAL(const xAOD::CaloCluster *cluster)
return true if the cluster (or the majority of its energy) is in the FCAL0
Gaudi::Accumulators::Counter m_AllClusters
StatusCode initialize(bool used=true)
Eigen::Matrix< double, 3, 1 > Vector3D
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloDetDescrMgrKey
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_fwdClusterContainerKey
Names of forward input output collections.
This class provides the client interface for accessing the detector description information common to...
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
egammaSelectedTrackCopy(const std::string &name, ISvcLocator *pSvcLocator)
Default constructor.
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_trackParticleTimeDecorKey
Gaudi::Property< double > m_narrowRescale
virtual StatusCode execute(const EventContext &ctx) const override final
@ numberOfSCTHits
number of hits in SCT [unit8_t].
Gaudi::Property< double > m_broadDeltaPhi
Class describing a TrackParticle.
Gaudi::Property< double > m_narrowRescaleBrem
Handle class for reading from StoreGate.
bool selectTrack(const EventContext &ctx, const xAOD::CaloCluster *cluster, const xAOD::TrackParticle *track, bool trkTRT, const CaloDetDescrManager &caloDD) const
Broad track selection.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual double e() const
The total energy of the particle.