|
ATLAS Offline Software
|
Go to the documentation of this file.
31 void copySummaryValue(
42 ISvcLocator* pSvcLocator)
66 return StatusCode::SUCCESS;
72 ATH_MSG_INFO(
"====> GSF fitting Statistics ============");
74 ATH_MSG_INFO(
"Failed Fit Tracks: " << m_FailedFitTracks);
75 ATH_MSG_INFO(
"Not refitted due to selection: " << m_FailedSiliconRequirFit);
76 ATH_MSG_INFO(
"<========================================");
77 return StatusCode::SUCCESS;
100 std::make_unique<xAOD::TrackParticleContainer>(),
101 std::make_unique<xAOD::TrackParticleAuxContainer>()));
113 std::vector<const xAOD::TrackParticle*> siliconTrkTracks;
114 siliconTrkTracks.reserve(16);
115 std::vector<TrackWithIndex> trtAloneTrkTracks;
116 trtAloneTrkTracks.reserve(8);
119 ATH_CHECK(trackParticle->trackLink().isValid());
120 const Trk::Track* trktrack = trackParticle->track();
124 siliconTrkTracks.push_back(trackParticle);
127 trtAloneTrkTracks.emplace_back(std::make_unique<Trk::Track>(*trktrack),
128 trackParticle->index());
133 std::vector<TrackWithIndex> refitted;
134 refitted.reserve(siliconTrkTracks.size());
135 std::vector<TrackWithIndex> failedfit;
145 const size_t refittedCount = refitted.size();
146 const size_t failedCount = failedfit.size();
147 const size_t trtCount = trtAloneTrkTracks.size();
148 const size_t totalCount = refittedCount + failedCount + trtCount;
151 cPtrTracks->
reserve(totalCount);
152 cPtrTrkPart->
reserve(totalCount);
166 return StatusCode::SUCCESS;
171 const EventContext& ctx,
172 const std::vector<const xAOD::TrackParticle*>&
input,
173 std::vector<TrackWithIndex>& refitted,
174 std::vector<TrackWithIndex>& failedfit)
const
180 if (
status == StatusCode::SUCCESS) {
182 refitted.emplace_back(std::move(cache.refittedTrack), in->index());
185 failedfit.emplace_back(std::make_unique<Trk::Track>(*
track), in->index());
188 return StatusCode::SUCCESS;
193 const EventContext& ctx,
194 std::vector<TrackWithIndex>& refitted,
195 std::vector<TrackWithIndex>& failedfit,
196 std::vector<TrackWithIndex>& trtAlone,
203 for (
auto& trk : refitted) {
207 finalTrkPartContainer,
208 inputTrkPartContainer,
212 for (
auto& trk : failedfit) {
216 finalTrkPartContainer,
217 inputTrkPartContainer,
221 for (
auto& trk : trtAlone) {
225 finalTrkPartContainer,
226 inputTrkPartContainer,
229 return StatusCode::SUCCESS;
234 const EventContext& ctx,
239 bool isRefitted)
const
248 "Could not create TrackParticle!!! for Track: " << *(trk_info.
track));
249 return StatusCode::SUCCESS;
257 tP(
"originalTrackParticle");
259 *inputTrkPartContainer, origIndex, ctx);
260 tP(*aParticle) = linkToOriginal;
263 auto rtsos = trk_info.
track->trackStateOnSurfaces()->rbegin();
264 for (; rtsos != trk_info.
track->trackStateOnSurfaces()->rend(); ++rtsos) {
266 (*rtsos)->trackParameters() !=
nullptr &&
267 (*rtsos)->measurementOnTrack() !=
nullptr &&
268 !(*rtsos)->measurementOnTrack()->type(
270 QoverPLast = (*rtsos)->trackParameters()->parameters()[
Trk::qOverP];
275 QoverPLM(*aParticle) = QoverPLast;
286 *finalTracks, finalTracks->
size() - 1, ctx);
288 return StatusCode::SUCCESS;
294 bool isRefitted)
const
300 tPL(
"truthParticleLink");
301 if (tPL.isAvailable(original)) {
302 tPL(created) = tPL(original);
306 tMP(created) = tMP(original);
310 tT(created) = tT(original);
314 tO(created) = tO(original);
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
StatusCode createCollections(const EventContext &ctx, std::vector< TrackWithIndex > &refitted, std::vector< TrackWithIndex > &failedfit, std::vector< TrackWithIndex > &trtAlone, TrackCollection *finalTracks, xAOD::TrackParticleContainer *finalTrkPartContainer, const xAOD::TrackParticleContainer *inputTrkPartContainer) const
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackParticleContainerKey
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
@ numberOfInnermostPixelLayerSplitHits
number of Pixel 0th layer barrel hits split by cluster splitting
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Gaudi::Property< bool > m_doSlimTrkTracks
Option to slim the Trk::Tracks.
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_selectedTrackParticleContainerKey
Names of input output collections.
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
Helper class to provide type-safe access to aux data.
@ numberOfNextToInnermostPixelLayerSplitHits
number of Pixel 1st layer barrel hits split by cluster splitting
void setTrackLink(const ElementLink< TrackCollection > &track)
Set the link to the original track.
ToolHandle< IegammaTrkRefitterTool > m_trkRefitTool
The track refitter.
Gaudi::Property< int > m_MinNoSiHits
@Cut on minimum silicon hits
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
@ numberOfTRTHits
number of TRT hits [unit8_t].
EMBremCollectionBuilder(const std::string &name, ISvcLocator *pSvcLocator)
An algorithm that can be simultaneously executed in multiple threads.
StatusCode createNew(const EventContext &ctx, TrackWithIndex &Info, TrackCollection *finalTracks, xAOD::TrackParticleContainer *finalTrkPartContainer, const xAOD::TrackParticleContainer *inputTrkPartContainer, bool isRefitted) const
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_OutputTrkPartContainerKey
@ numberOfTRTSharedHits
number of TRT hits used by more than one track
Gaudi::Property< bool > m_doHGTD
Option to copy HGTD time to new gsf tracks.
Gaudi::Property< bool > m_doSCT
Option to copy SCT holes estimation.
Handle class for recording to StoreGate.
virtual StatusCode initialize() override final
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
SummaryType
Enumerates the different types of information stored in Summary.
ToolHandle< Trk::ITrackSlimmingTool > m_slimTool
Tool to slim tracks
::StatusCode StatusCode
StatusCode definition for legacy code.
pointer_type ptr()
Dereference the pointer.
std::atomic_uint m_FailedSiliconRequirFit
SG::WriteHandleKey< TrackCollection > m_OutputTrackContainerKey
@ numberOfPixelOutliers
these are the pixel outliers, including the b-layer [unit8_t].
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
@ numberOfPixelSplitHits
number of Pixel all-layer hits split by cluster splitting [unit8_t].
@ numberOfSCTHoles
number of SCT holes [unit8_t].
Helper struct to store the Trk::Track corresponding to a TrackParticle and the index of the Track Par...
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< bool > m_doTRT
Option to copy TRT holes estimation.
virtual StatusCode execute(const EventContext &ctx) const override final
std::atomic_uint m_RefittedTracks
uint8_t hasValidTime() const
Returns whether or not the track has a valid time.
Helpers for checking error return status codes and reporting errors.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
Gaudi::Property< bool > m_doTruth
Option to do truth.
float time() const
Returns the time.
const_pointer_type ptr()
Dereference the pointer.
@ numberOfTRTOutliers
number of TRT outliers [unit8_t].
void setSummaryValue(uint8_t &value, const SummaryType &information)
Set method for TrackSummary values.
void setHasValidTime(uint8_t hasValidTime)
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
@ numberOfSCTOutliers
number of SCT outliers [unit8_t].
#define ATH_MSG_WARNING(x)
@ numberOfSCTDeadSensors
number of dead SCT sensors crossed [unit8_t].
std::unique_ptr< Trk::Track > track
@ numberOfInnermostPixelLayerSharedHits
number of Pixel 0th layer barrel hits shared by several tracks.
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ PseudoMeasurementOnTrack
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
std::atomic_uint m_FailedFitTracks
@ numberOfPixelDeadSensors
number of dead pixel sensors crossed [unit8_t].
Class describing a TrackParticle.
const T * at(size_type n) const
Access an element, as an rvalue.
StatusCode refitTracks(const EventContext &ctx, const std::vector< const xAOD::TrackParticle * > &input, std::vector< TrackWithIndex > &refitted, std::vector< TrackWithIndex > &failedfit) const
@ numberOfSCTDoubleHoles
number of Holes in both sides of a SCT module [unit8_t].
Handle class for reading from StoreGate.
@ numberOfNextToInnermostPixelLayerSharedHits
number of Pixel 1st layer barrel hits shared by several tracks.
void copyOverInfo(xAOD::TrackParticle &created, const xAOD::TrackParticle &original, bool isRefitted) const
@ numberOfTRTHoles
number of TRT holes [unit8_t].
ToolHandle< Trk::ITrackParticleCreatorTool > m_particleCreatorTool
Tool to create track particle.
size_type size() const noexcept
Returns the number of elements in the collection.
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Gaudi::Property< bool > m_doPix
Option to copy pixel holes estimation.