ATLAS Offline Software
List of all members
InDet::SeedToTrackConversionTool Class Reference

#include <SeedToTrackConversionTool.h>

Inheritance diagram for InDet::SeedToTrackConversionTool:
Collaboration diagram for InDet::SeedToTrackConversionTool:

Public Member Functions

Constructor
 SeedToTrackConversionTool (const std::string &, const std::string &, const IInterface *)
 
Default destructor
virtual ~SeedToTrackConversionTool ()=default
 
Standard Athena-Algorithm initialize method
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
Main methods for seeds conversion
virtual void executeSiSPSeedSegments (SeedToTrackConversionData &data, const Trk::TrackParameters *, const int &, const std::vector< const Trk::SpacePoint * > &) const override
 seed trackparameters, number of tracks found:m_track.size(), list of spacepoints More...
 
virtual void newEvent (SeedToTrackConversionData &data, const Trk::TrackInfo &, const std::string &) const override
 
virtual void endEvent (SeedToTrackConversionData &data) const override
 
Print internal tool parameters and status
virtual MsgStream & dump (SeedToTrackConversionData &data, MsgStream &out) const override
 

Private Member Functions

Messaging methods
MsgStream & dumpconditions (SeedToTrackConversionData &data, MsgStream &out) const
 
MsgStream & dumpevent (SeedToTrackConversionData &data, MsgStream &out) const
 

Private Attributes

Tool handles
PublicToolHandle< Trk::IExtrapolatorm_extrapolator {this, "Extrapolator","Trk::Extrapolator", "extrapolator"}
 
ToolHandle< Trk::IRIO_OnTrackCreatorm_rotcreator {this, "RIO_OnTrackCreator", "Trk::RIO_OnTrackCreator/InDetRotCreator", "Creator ROT"}
 
Data handles
SG::WriteHandleKey< TrackCollectionm_seedsegmentsOutput {this, "OutputName", "SiSPSeedSegments", "SiSpSeedSegments Output Collection"}
 
Counters
std::atomic_int m_nprint {0}
 Kind output information. More...
 
std::atomic_int m_totseed {0}
 number of total seeds in the pass More...
 
std::atomic_int m_survived {0}
 number of survived seeds More...
 

Detailed Description

InDet::SeedToTrackConversionTool is tool that converts the seeds into track collection.

In AthenaMT, event dependent cache inside SeedToTrackConversionTool is not preferred. SeedToTrackConversionData class holds event dependent data for SeedToTrackConversionTool. Its object is instantiated in SiSPSeededTrackFinder::execute through SiTrackMakerEventData_xk.

Author
Weiming Yao <Weiming.Yao>

Definition at line 46 of file SeedToTrackConversionTool.h.

Constructor & Destructor Documentation

◆ SeedToTrackConversionTool()

InDet::SeedToTrackConversionTool::SeedToTrackConversionTool ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 23 of file SeedToTrackConversionTool.cxx.

26  : base_class(t, n, p)
27 {
28 }

◆ ~SeedToTrackConversionTool()

virtual InDet::SeedToTrackConversionTool::~SeedToTrackConversionTool ( )
virtualdefault

Member Function Documentation

◆ dump()

MsgStream & InDet::SeedToTrackConversionTool::dump ( SeedToTrackConversionData data,
MsgStream &  out 
) const
overridevirtual

Definition at line 147 of file SeedToTrackConversionTool.cxx.

148 {
149  out << std::endl;
150  if (m_nprint) dumpevent(data, out);
151  return dumpconditions(data, out);
152 }

◆ dumpconditions()

MsgStream & InDet::SeedToTrackConversionTool::dumpconditions ( SeedToTrackConversionData data,
MsgStream &  out 
) const
private

Definition at line 157 of file SeedToTrackConversionTool.cxx.

158 {
159  out << "|----------------------------------------------------------------------"
160  << "-------------------|"
161  << std::endl;
162  out << "| Output Collection Name | " << m_seedsegmentsOutput << std::endl;
163  out << "} Name of pattern recognition | " << data.patternName() << std::endl;
164  out << "|----------------------------------------------------------------------"
165  << "-------------------|"
166  << std::endl;
167  return out;
168 }

◆ dumpevent()

MsgStream & InDet::SeedToTrackConversionTool::dumpevent ( SeedToTrackConversionData data,
MsgStream &  out 
) const
private

Definition at line 173 of file SeedToTrackConversionTool.cxx.

174 {
175  out << "|---------------------------------------------------------------------|"
176  << std::endl;
177  out << "| Name of SeedFinder | " << data.patternName()
178  << " | " << std::endl;
179  out << "| Number of All seeds | " << std::setw(12) << m_totseed
180  << " | " << std::endl;
181  out << "| Number of survived seeds | " << std::setw(12) << m_survived
182  << " | " << std::endl;
183  out << "|---------------------------------------------------------------------|"
184  << std::endl;
185  return out;
186 }

◆ endEvent()

void InDet::SeedToTrackConversionTool::endEvent ( SeedToTrackConversionData data) const
overridevirtual

Definition at line 78 of file SeedToTrackConversionTool.cxx.

79 {
80  // Print event information
81  //
82  if (msgLevel()<=0) {
83  m_nprint=1;
85  }
86 
87  ATH_MSG_DEBUG(" Check SiSPSeedSegments Collection (" << m_seedsegmentsOutput << ") " << data.seedSegmentsCollection()->size() << " trackinfo: "
88  << data.trackInfo());
90  if (seedsegmentsOutput.record(std::move(data.seedSegmentsCollection())).isFailure()) {
91  ATH_MSG_ERROR("Could not save converted SiSPSeedSegments tracks");
92  }
93 }

◆ executeSiSPSeedSegments()

void InDet::SeedToTrackConversionTool::executeSiSPSeedSegments ( SeedToTrackConversionData data,
const Trk::TrackParameters Tp,
const int &  mtrk,
const std::vector< const Trk::SpacePoint * > &  Sp 
) const
overridevirtual

seed trackparameters, number of tracks found:m_track.size(), list of spacepoints

Definition at line 95 of file SeedToTrackConversionTool.cxx.

99 {
100  const EventContext& ctx = Gaudi::Hive::currentContext();
101  ++m_totseed; // accumulate all seeds
102  if (mtrk>0) ++m_survived; // survided seeds
103  std::vector<const Trk::PrepRawData*> prdsInSp;
104  for (const Trk::SpacePoint* s: Sp) {
105  const std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*>& prds = s->clusterList();
106  if (prds.first) prdsInSp.push_back(prds.first);
107  if (prds.second && prds.first != prds.second) prdsInSp.push_back(prds.second);
108  }
109  Trk::PerigeeSurface persurf;
110  std::unique_ptr<Trk::TrackParameters> per(m_extrapolator->extrapolate(ctx,*Tp, persurf, Trk::anyDirection, false, Trk::nonInteracting));
111  std::unique_ptr<Trk::TrackParameters> prevpar(Tp->uniqueClone());
112  if (per) {
113  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern;
114  typePattern.set(Trk::TrackStateOnSurface::Perigee);
115  const Trk::TrackStateOnSurface* pertsos = new Trk::TrackStateOnSurface(nullptr, std::move(per), nullptr, typePattern);
116  auto traj = std::make_unique<Trk::TrackStates>();
117  traj->push_back(pertsos);
118  for (const Trk::PrepRawData* prd: prdsInSp) {
119  const Trk::Surface& surf = prd->detectorElement()->surface(prd->identify());
120  std::unique_ptr<Trk::TrackParameters> thispar(m_extrapolator->extrapolate(ctx,*prevpar, surf, Trk::alongMomentum, false, Trk::nonInteracting));
121  if (thispar) {
122  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern;
123  typePattern.set(Trk::TrackStateOnSurface::Measurement);
124  std::unique_ptr<Trk::RIO_OnTrack> rot(m_rotcreator->correct(*prd, *thispar, ctx));
125  if (rot) {
126  const Trk::TrackStateOnSurface* tsos = new Trk::TrackStateOnSurface(std::move(rot), thispar->uniqueClone(), nullptr, typePattern);
127  traj->push_back(tsos);
128  prevpar = std::move(thispar);
129  }
130  }
131  }
132 
133  if (mtrk>0) { // survived seeds set as
134  data.trackInfo().setTrackFitter(Trk::TrackInfo::xKalman); // xkalman
135  } else {
136  data.trackInfo().setTrackFitter(Trk::TrackInfo::Unknown);
137  }
138  Trk::Track* t = new Trk::Track(data.trackInfo(), std::move(traj), nullptr);
139  if (t) data.seedSegmentsCollection()->push_back(t);
140  }
141 }

◆ finalize()

StatusCode InDet::SeedToTrackConversionTool::finalize ( )
overridevirtual

Definition at line 60 of file SeedToTrackConversionTool.cxx.

61 {
62  return AlgTool::finalize();
63 }

◆ initialize()

StatusCode InDet::SeedToTrackConversionTool::initialize ( )
overridevirtual

Definition at line 32 of file SeedToTrackConversionTool.cxx.

33 {
34 
36  if (sc.isFailure()) return sc;
37 
38  if (m_extrapolator.retrieve().isFailure()) {
39  ATH_MSG_FATAL ("Could not retrieve "<< m_extrapolator);
40  return StatusCode::FAILURE;
41  } else {
42  ATH_MSG_VERBOSE( "initialize() Retrieved service " << m_extrapolator);
43  }
44 
45  // Retrieve the Track RotCreator tool
46  if (m_rotcreator.retrieve().isFailure()) {
47  ATH_MSG_FATAL ("Could not retrieve "<< m_rotcreator);
48  return StatusCode::FAILURE;
49  } else {
50  ATH_MSG_VERBOSE( "initialize() Retrieved service " << m_rotcreator);
51  }
52 
53  ATH_CHECK(m_seedsegmentsOutput.initialize());
54 
55  return StatusCode::SUCCESS;
56 }

◆ newEvent()

void InDet::SeedToTrackConversionTool::newEvent ( SeedToTrackConversionData data,
const Trk::TrackInfo info,
const std::string &  patternName 
) const
overridevirtual

Definition at line 65 of file SeedToTrackConversionTool.cxx.

66 {
67  data.seedSegmentsCollection() = std::make_unique<TrackCollection>();
68  m_totseed = 0;
69  m_survived = 0;
70 
71  data.trackInfo() = info;
72  data.patternName() = patternName;
73  if (static_cast<int>(data.patternName().find("Forward"))>-1) {
74  data.trackInfo().setPatternRecognitionInfo(Trk::TrackInfo::SiSpacePointsSeedMaker_ForwardTracks);
75  }
76 }

Member Data Documentation

◆ m_extrapolator

PublicToolHandle<Trk::IExtrapolator> InDet::SeedToTrackConversionTool::m_extrapolator {this, "Extrapolator","Trk::Extrapolator", "extrapolator"}
private

Definition at line 85 of file SeedToTrackConversionTool.h.

◆ m_nprint

std::atomic_int InDet::SeedToTrackConversionTool::m_nprint {0}
mutableprivate

Kind output information.

Definition at line 98 of file SeedToTrackConversionTool.h.

◆ m_rotcreator

ToolHandle<Trk::IRIO_OnTrackCreator > InDet::SeedToTrackConversionTool::m_rotcreator {this, "RIO_OnTrackCreator", "Trk::RIO_OnTrackCreator/InDetRotCreator", "Creator ROT"}
private

Definition at line 87 of file SeedToTrackConversionTool.h.

◆ m_seedsegmentsOutput

SG::WriteHandleKey<TrackCollection> InDet::SeedToTrackConversionTool::m_seedsegmentsOutput {this, "OutputName", "SiSPSeedSegments", "SiSpSeedSegments Output Collection"}
private

Definition at line 93 of file SeedToTrackConversionTool.h.

◆ m_survived

std::atomic_int InDet::SeedToTrackConversionTool::m_survived {0}
mutableprivate

number of survived seeds

Definition at line 100 of file SeedToTrackConversionTool.h.

◆ m_totseed

std::atomic_int InDet::SeedToTrackConversionTool::m_totseed {0}
mutableprivate

number of total seeds in the pass

Definition at line 99 of file SeedToTrackConversionTool.h.


The documentation for this class was generated from the following files:
grepfile.info
info
Definition: grepfile.py:38
Trk::anyDirection
@ anyDirection
Definition: PropDirection.h:22
Trk::SpacePoint
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:35
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
Trk::TrackStateOnSurface::Perigee
@ Perigee
This represents a perigee, and so will contain a Perigee object only.
Definition: TrackStateOnSurface.h:117
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
InDet::SeedToTrackConversionTool::dump
virtual MsgStream & dump(SeedToTrackConversionData &data, MsgStream &out) const override
Definition: SeedToTrackConversionTool.cxx:147
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
InDet::SeedToTrackConversionTool::dumpconditions
MsgStream & dumpconditions(SeedToTrackConversionData &data, MsgStream &out) const
Definition: SeedToTrackConversionTool.cxx:157
Trk::PerigeeSurface
Definition: PerigeeSurface.h:43
Trk::ParametersBase::uniqueClone
std::unique_ptr< ParametersBase< DIM, T > > uniqueClone() const
clone method for polymorphic deep copy returning unique_ptr; it is not overriden, but uses the existi...
Definition: ParametersBase.h:97
initialize
void initialize()
Definition: run_EoverP.cxx:894
xAOD::JetInput::Track
@ Track
Definition: JetContainerInfo.h:61
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
Trk::alongMomentum
@ alongMomentum
Definition: PropDirection.h:20
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
InDet::SeedToTrackConversionTool::m_survived
std::atomic_int m_survived
number of survived seeds
Definition: SeedToTrackConversionTool.h:100
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
InDet::SeedToTrackConversionTool::m_nprint
std::atomic_int m_nprint
Kind output information.
Definition: SeedToTrackConversionTool.h:98
InDet::SeedToTrackConversionTool::m_rotcreator
ToolHandle< Trk::IRIO_OnTrackCreator > m_rotcreator
Definition: SeedToTrackConversionTool.h:88
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
InDet::SeedToTrackConversionTool::dumpevent
MsgStream & dumpevent(SeedToTrackConversionData &data, MsgStream &out) const
Definition: SeedToTrackConversionTool.cxx:173
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
InDet::SeedToTrackConversionTool::m_totseed
std::atomic_int m_totseed
number of total seeds in the pass
Definition: SeedToTrackConversionTool.h:99
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
InDet::SeedToTrackConversionTool::m_extrapolator
PublicToolHandle< Trk::IExtrapolator > m_extrapolator
Definition: SeedToTrackConversionTool.h:86
Trk::PrepRawData
Definition: PrepRawData.h:62
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
Trk::nonInteracting
@ nonInteracting
Definition: ParticleHypothesis.h:25
InDet::SeedToTrackConversionTool::m_seedsegmentsOutput
SG::WriteHandleKey< TrackCollection > m_seedsegmentsOutput
Definition: SeedToTrackConversionTool.h:93
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
Trk::TrackInfo::SiSpacePointsSeedMaker_ForwardTracks
@ SiSpacePointsSeedMaker_ForwardTracks
Entries allowing to distinguish different seed makers.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:241
DEBUG
#define DEBUG
Definition: page_access.h:11
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
Trk::TrackStateOnSurface::Measurement
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Definition: TrackStateOnSurface.h:101
Trk::TrackInfo::xKalman
@ xKalman
tracks produced by xKalman
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:47
Trk::TrackInfo::Unknown
@ Unknown
Track fitter not defined.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:41