ATLAS Offline Software
Loading...
Searching...
No Matches
ReFitTrackWithTruth.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
6// ReFitTrackWithTruth.h, (c) ATLAS Detector Software
7// Take a track and replace the cluster position with the
8// associated truth particle truth position
10
11#ifndef TRKREFITALG_REFITTRACKWITHTRUTH_H
12#define TRKREFITALG_REFITTRACKWITHTRUTH_H
13
14// Base class
16#include "GaudiKernel/ToolHandle.h"
17#include "GaudiKernel/ServiceHandle.h"
18#include "GaudiKernel/MsgStream.h"
22#include "InDetSimEvent/SiHit.h"
26#include "TrkTrack/Track.h"
34
35class AtlasDetectorID;
36class PixelID;
37class TRandom3;
38
39namespace Trk{
40
41class ITrackFitter;
45
53
55
56public:
57
59
61 ReFitTrackWithTruth(const std::string &name,ISvcLocator *pSvcLocator);
62
63 virtual StatusCode initialize() override;
64 virtual StatusCode execute() override;
65
66private:
67
68 std::vector<SiHit> matchSiHitsToCluster( const int uniqueIdToMatch,
69 const InDet::PixelCluster* pixClus,
70 SG::ReadHandle<AtlasHitsVector<SiHit>> &siHitCollection) const;
71
72 static bool IsClusterFromTruth( const InDet::PixelCluster* pixClus,
73 const int uniqueIdToMatch,
74 const InDetSimDataCollection &sdoCollection) ;
75
76 HepGeom::Point3D<double> smearTruthPosition( const HepGeom::Point3D<double>& orig,
77 const int bec,
78 const int layer_disk,
79 const InDetDD::SiDetectorDesign* design) const;
80
81 double getPhiPosResolution(int layer) const;
82 double getEtaPosResolution(int layer) const;
83 double getPhiPosErrorFactor(int layer) const;
84 double getEtaPosErrorFactor(int layer) const;
85
86 // input/output track container
87 SG::ReadHandleKey<TrackCollection> m_inputTrackColName{this,"InputTrackColName","","collection name for tracks to be refitted"}; // Name of the input Trackcollection
88 SG::WriteHandleKey<TrackCollection> m_outputTrackCollectionName{this,"OutputTrackColName","ReFitted_TracksWithTruth","collection name for output tracks"};
89
90 // TRandom3 generator for hit-resolution smearing
91 boost::thread_specific_ptr<TRandom3> m_random;
92
93 // --- fitter steering
94 Trk::RunOutlierRemoval m_runOutlier = false; // switch whether to run outlier logics or not
95 int m_matEffects = 3; // type of material interaction in extrapolation
96
97 Gaudi::Property<bool> m_saveWrongHits {this, "SaveWrongHits", false}; // If running on Reco Tracks, can have wrong hits
98 Gaudi::Property<bool> m_fixWrongHits {this, "FixWrongHits", false}; // If running on Reco Tracks, fix wrong hits
99 Gaudi::Property<bool> m_rejNoiseHits {this, "RejectNoiseHits", false}; // If running on Reco Tracks, can have noise hits
100
102
103 // --- job options
104 SG::ReadHandleKey<SiHitCollection> m_siHitCollectionName{this,"SiHitCollectionName","PixelHits",""}; // SiHitCollection storegate key
105 SG::ReadHandleKey<InDetSimDataCollection> m_SDOContainerName{this,"MC_SDOs","PixelSDO_Map"}; // SDO Container storegate key
106 SG::ReadHandleKey<TrackTruthCollection> m_truthMapName{this,"TruthMap","InDetTracksTruthCollection"}; // TruthMap name storegate key
107
108 // smearing
109 Gaudi::Property<std::vector<float> > m_resolutionRPhi{this, "ResolutionRPhi", {}}; // per-layer resolution
110 Gaudi::Property<std::vector<float> > m_resolutionZ{this, "ResolutionZ", {}}; // per-layer resolution
111 Gaudi::Property<std::vector<float> > m_errorRPhi{this, "ErrorFactorRPhi", {}}; // per-layer error - multiplicative factor * res.
112 Gaudi::Property<std::vector<float> > m_errorZ{this, "ErrorFactorZ", {}}; // per-layer error - multiplicative factor * res.
113
114 // -- algorithm members
115 ToolHandle<Trk::ITrackFitter> m_ITrackFitter
116 {this, "FitterTool", "Trk::GlobalChi2Fitter/InDetTrackFitter" };
117 ToolHandle<Trk::IExtendedTrackSummaryTool> m_trkSummaryTool
118 {this, "SummaryTool", "Trk::TrackSummaryTool/InDetTrackSummaryTool" };
119 ToolHandle<Trk::IPRDtoTrackMapTool> m_assoTool
120 {this, "AssociationTool", "Trk::PRDtoTrackMapTool" };
121 const AtlasDetectorID* m_idHelper = nullptr;
122 const PixelID* m_pixelID = nullptr;
123
124};
125
126}
127
128#endif //TRKREFITALG_REFITTRACKWITHTRUTH_H
129
This is an Identifier helper class for the Pixel subdetector.
Handle class for recording to StoreGate.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Base class for the detector design classes for Pixel and SCT.
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:67
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
Interface for handling the mapping between Trk::Track and Trk::PrepRawData.
Provides the abstract interface for track fitting in the common ATLAS Tracking EDM.
The abstract interface base class for track selector tools.
Interface for condensing Trk::Track properties and associated hits to a (non-fittable) foot print,...
Gaudi::Property< bool > m_rejNoiseHits
SG::ReadHandleKey< InDetSimDataCollection > m_SDOContainerName
Trk::RunOutlierRemoval m_runOutlier
double getEtaPosErrorFactor(int layer) const
static bool IsClusterFromTruth(const InDet::PixelCluster *pixClus, const int uniqueIdToMatch, const InDetSimDataCollection &sdoCollection)
Gaudi::Property< bool > m_fixWrongHits
Gaudi::Property< std::vector< float > > m_resolutionRPhi
Gaudi::Property< std::vector< float > > m_resolutionZ
SG::ReadHandleKey< TrackTruthCollection > m_truthMapName
const PixelID * m_pixelID
Pixel ID.
std::vector< SiHit > matchSiHitsToCluster(const int uniqueIdToMatch, const InDet::PixelCluster *pixClus, SG::ReadHandle< AtlasHitsVector< SiHit > > &siHitCollection) const
boost::thread_specific_ptr< TRandom3 > m_random
smear away!
virtual StatusCode initialize() override
ReFitTrackWithTruth(const std::string &name, ISvcLocator *pSvcLocator)
standard Algorithm constructor
Trk::ParticleHypothesis m_ParticleHypothesis
Gaudi::Property< std::vector< float > > m_errorZ
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trkSummaryTool
the track summary tool
SG::ReadHandleKey< SiHitCollection > m_siHitCollectionName
SG::ReadHandleKey< TrackCollection > m_inputTrackColName
Gaudi::Property< std::vector< float > > m_errorRPhi
virtual StatusCode execute() override
const AtlasDetectorID * m_idHelper
Detector ID helper.
ToolHandle< Trk::IPRDtoTrackMapTool > m_assoTool
Tool to create and populate PRD to track.
double getEtaPosResolution(int layer) const
Gaudi::Property< bool > m_saveWrongHits
double getPhiPosResolution(int layer) const
SG::WriteHandleKey< TrackCollection > m_outputTrackCollectionName
double getPhiPosErrorFactor(int layer) const
HepGeom::Point3D< double > smearTruthPosition(const HepGeom::Point3D< double > &orig, const int bec, const int layer_disk, const InDetDD::SiDetectorDesign *design) const
ToolHandle< Trk::ITrackFitter > m_ITrackFitter
the refit tool
Ensure that the ATLAS eigen extensions are properly loaded.
bool RunOutlierRemoval
switch to toggle quality processing after fit
Definition FitterTypes.h:22
ParticleHypothesis
Enumeration for Particle hypothesis respecting the interaction with material.