ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
FPGAActsTrkConverter Class Reference

#include <FPGAActsTrkConverter.h>

Inheritance diagram for FPGAActsTrkConverter:
Collaboration diagram for FPGAActsTrkConverter:

Public Member Functions

 FPGAActsTrkConverter (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~FPGAActsTrkConverter ()=default
 
virtual StatusCode initialize () override final
 
virtual StatusCode findProtoTracks (const EventContext &ctx, const xAOD::PixelClusterContainer &pixelContainer, const xAOD::StripClusterContainer &stripContainer, std::vector< ActsTrk::ProtoTrack > &foundProtoTracks, const std::vector< std::vector< FPGATrackSimHit >> &hitsInRoads, const std::vector< FPGATrackSimRoad > &roads) const override final
 
virtual StatusCode findProtoTracks (const EventContext &ctx, const xAOD::PixelClusterContainer &pixelContainer, const xAOD::StripClusterContainer &stripContainer, std::vector< ActsTrk::ProtoTrack > &foundProtoTracks, const std::vector< FPGATrackSimTrack > &tracks) const override final
 

Protected Member Functions

std::unique_ptr< Acts::BoundTrackParameters > makeParams (const FPGATrackSimRoad &road) const
 
std::unique_ptr< Acts::BoundTrackParameters > makeParams (const FPGATrackSimTrack &track) const
 

Private Attributes

const PixelIDm_pixelId {nullptr}
 
const SCT_IDm_SCTId {nullptr}
 

Detailed Description

Definition at line 17 of file FPGAActsTrkConverter.h.

Constructor & Destructor Documentation

◆ FPGAActsTrkConverter()

FPGAActsTrkConverter::FPGAActsTrkConverter ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 11 of file FPGAActsTrkConverter.cxx.

13  : base_class(type,name,parent) { }

◆ ~FPGAActsTrkConverter()

virtual FPGAActsTrkConverter::~FPGAActsTrkConverter ( )
virtualdefault

Member Function Documentation

◆ findProtoTracks() [1/2]

StatusCode FPGAActsTrkConverter::findProtoTracks ( const EventContext &  ctx,
const xAOD::PixelClusterContainer pixelContainer,
const xAOD::StripClusterContainer stripContainer,
std::vector< ActsTrk::ProtoTrack > &  foundProtoTracks,
const std::vector< FPGATrackSimTrack > &  tracks 
) const
finaloverridevirtual

Definition at line 76 of file FPGAActsTrkConverter.cxx.

80  {
81 
82  ATH_MSG_INFO("Creating Acts proto-tracks from FPGA tracks...");
83 
84  if (tracks.size()>1){
85  for(const FPGATrackSimTrack& track: tracks) {
86  std::vector<ActsTrk::ATLASUncalibSourceLink> points;
87  const std::vector <FPGATrackSimHit>& hits = track.getFPGATrackSimHits();
88 
89  if (hits.size()>0){
90 
91  // TODO: move from loops over cluster container to links
92 
93  for(const FPGATrackSimHit& h : hits){
94  IdentifierHash hash = h.getIdentifierHash();
95  if (h.isReal()){
96  if (h.isPixel()){
97  Identifier wafer_id = m_pixelId->wafer_id(hash);
98  Identifier id = m_pixelId->pixel_id(wafer_id, h.getPhiIndex(), h.getEtaIndex());
99  for (const xAOD::PixelCluster *cl : pixelContainer){
100  if (id == cl->rdoList().front()) points.push_back(ActsTrk::makeATLASUncalibSourceLink(&pixelContainer,cl->index(),ctx));
101  }
102  }
103  if (h.isStrip()) {
104  int strip = static_cast<int>(h.getPhiCoord());
105  Identifier wafer_id = m_SCTId->wafer_id(hash);
106  Identifier id = m_SCTId->strip_id(wafer_id, strip);
107  for (const xAOD::StripCluster *cl : stripContainer){
108  if (id == cl->rdoList().front()) points.push_back(ActsTrk::makeATLASUncalibSourceLink(&stripContainer,cl->index(),ctx));
109  }
110  }
111  }
112  }
113  ATH_MSG_INFO("\tMade a proto-track with " <<points.size()<<" clusters");
114 
115  // Make the intput perigee
116  std::unique_ptr<Acts::BoundTrackParameters> inputPerigee = makeParams(track);
117  foundProtoTracks.emplace_back(points,std::move(inputPerigee));
118  }
119  }
120  }
121 
122  return StatusCode::SUCCESS;
123 }

◆ findProtoTracks() [2/2]

StatusCode FPGAActsTrkConverter::findProtoTracks ( const EventContext &  ctx,
const xAOD::PixelClusterContainer pixelContainer,
const xAOD::StripClusterContainer stripContainer,
std::vector< ActsTrk::ProtoTrack > &  foundProtoTracks,
const std::vector< std::vector< FPGATrackSimHit >> &  hitsInRoads,
const std::vector< FPGATrackSimRoad > &  roads 
) const
finaloverridevirtual

Definition at line 28 of file FPGAActsTrkConverter.cxx.

33  {
34 
35  ATH_MSG_INFO("Creating Acts proto-tracks from FPGA roads...");
36 
37  if (hitsInRoads.size() > 0) {
38 
39  for(size_t roadIndex=0; roadIndex<=hitsInRoads.size()-1;roadIndex++) {
40  std::vector<ActsTrk::ATLASUncalibSourceLink> points;
41 
42  if (hitsInRoads.at(roadIndex).size()>0) {
43  // TODO: move from loops over cluster container to links
44  for(const FPGATrackSimHit& h : hitsInRoads.at(roadIndex)){
45  IdentifierHash hash = h.getIdentifierHash();
46  if (h.isReal()) {
47  if (h.isPixel()){
48  Identifier wafer_id = m_pixelId->wafer_id(hash);
49  Identifier id = m_pixelId->pixel_id(wafer_id, h.getPhiIndex(), h.getEtaIndex());
50  for (const xAOD::PixelCluster *cl : pixelContainer){
51  if (id == cl->rdoList().front()) points.push_back(ActsTrk::makeATLASUncalibSourceLink(&pixelContainer,cl->index(),ctx));
52  }
53  }
54  if (h.isStrip()) {
55  int strip = static_cast<int>(h.getPhiCoord());
56  Identifier wafer_id = m_SCTId->wafer_id(hash);
57  Identifier id = m_SCTId->strip_id(wafer_id, strip);
58  for (const xAOD::StripCluster *cl : stripContainer){
59  if (id == cl->rdoList().front()) points.push_back(ActsTrk::makeATLASUncalibSourceLink(&stripContainer,cl->index(),ctx));
60  }
61  }
62  }
63  }
64  ATH_MSG_INFO("\tMade a proto-track with " <<points.size()<<" clusters");
65 
66  // Make the input perigee
67  std::unique_ptr<Acts::BoundTrackParameters> inputPerigee = makeParams(roads.at(roadIndex));
68  foundProtoTracks.emplace_back(points,std::move(inputPerigee));
69  }
70  }
71  }
72 
73  return StatusCode::SUCCESS;
74 }

◆ initialize()

StatusCode FPGAActsTrkConverter::initialize ( )
finaloverridevirtual

Definition at line 16 of file FPGAActsTrkConverter.cxx.

16  {
17 
18  ATH_MSG_DEBUG("Initializing FPGAActsTrkConverter...");
19 
20  // Get SCT & pixel Identifier helpers
21  ATH_CHECK(detStore()->retrieve(m_pixelId, "PixelID"));
22  ATH_CHECK(detStore()->retrieve(m_SCTId, "SCT_ID"));
23 
24  return StatusCode::SUCCESS;
25 
26 }

◆ makeParams() [1/2]

std::unique_ptr< Acts::BoundTrackParameters > FPGAActsTrkConverter::makeParams ( const FPGATrackSimRoad road) const
protected

Definition at line 125 of file FPGAActsTrkConverter.cxx.

125  {
126  using namespace Acts::UnitLiterals;
127 
128  std::shared_ptr<const Acts::Surface> actsSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(Acts::Vector3(0., 0., 0.));
129  Acts::BoundVector params;
130 
131  constexpr double GeVToMeV = 1000;
132  double d0=0.; //?
133  double z0=0.; //?
134  double phi=road.getX();
135  double eta=0.2;
136  double theta=2*std::atan(std::exp(-eta));
137  double qop=road.getY()/GeVToMeV; //
138  double t=0.; //?
139  ATH_MSG_DEBUG("\tphi=" <<phi << " eta=" << eta << " qop=" << qop);
140 
141  params << d0, z0, phi, theta, qop, t;
142 
143  // Covariance - TODO
144  Acts::BoundSquareMatrix cov = Acts::BoundSquareMatrix::Identity();
145  cov *= (GeVToMeV*GeVToMeV);
146 
147  // some ACTS paperwork
148  Trk::ParticleHypothesis hypothesis = Trk::pion;
150  Acts::PdgParticle absPdg = Acts::makeAbsolutePdgParticle(Acts::ePionPlus);
151  Acts::ParticleHypothesis actsHypothesis{
152  absPdg, mass, Acts::AnyCharge{1.0f}};
153 
154  return std::make_unique<Acts::BoundTrackParameters>(actsSurface, params,
155  cov, actsHypothesis);
156 
157 }

◆ makeParams() [2/2]

std::unique_ptr< Acts::BoundTrackParameters > FPGAActsTrkConverter::makeParams ( const FPGATrackSimTrack track) const
protected

Definition at line 160 of file FPGAActsTrkConverter.cxx.

160  {
161 
162  using namespace Acts::UnitLiterals;
163  std::shared_ptr<const Acts::Surface> actsSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(Acts::Vector3(0., 0., 0.));
164  Acts::BoundVector params;
165 
166  constexpr double GeVToMeV = 1000;
167  double d0=track.getD0();
168  double z0=track.getZ0();
169  double phi=track.getPhi();
170  double theta=track.getTheta();
171  double qop=track.getQOverPt();
172  double t=0.;
173 
174  params << d0, z0, phi, theta, qop, t;
175  ATH_MSG_DEBUG("\td0= " << d0 << " z0=" <<z0 << " phi=" <<phi << " theta=" << theta<< " qoverp=" << qop);
176 
177  // Covariance - let's be honest and say we have no clue ;-)
178  Acts::BoundSquareMatrix cov = Acts::BoundSquareMatrix::Identity();
179  cov *= (GeVToMeV*GeVToMeV);
180 
181  // some ACTS paperwork
182  Trk::ParticleHypothesis hypothesis = Trk::pion;
184  Acts::PdgParticle absPdg = Acts::makeAbsolutePdgParticle(Acts::ePionPlus);
185  Acts::ParticleHypothesis actsHypothesis{
186  absPdg, mass, Acts::AnyCharge{1.0f}};
187 
188  return std::make_unique<Acts::BoundTrackParameters>(actsSurface, params,
189  cov, actsHypothesis);
190 
191 }

Member Data Documentation

◆ m_pixelId

const PixelID* FPGAActsTrkConverter::m_pixelId {nullptr}
private

Definition at line 41 of file FPGAActsTrkConverter.h.

◆ m_SCTId

const SCT_ID* FPGAActsTrkConverter::m_SCTId {nullptr}
private

Definition at line 42 of file FPGAActsTrkConverter.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
SiliconTech::strip
@ strip
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
FPGATrackSimTrack
Definition: FPGATrackSimTrack.h:16
FPGAActsTrkConverter::m_SCTId
const SCT_ID * m_SCTId
Definition: FPGAActsTrkConverter.h:42
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:71
python.SystemOfUnits.MeV
int MeV
Definition: SystemOfUnits.py:154
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
FPGATrackSimRoad::getX
float getX() const
Definition: FPGATrackSimRoad.h:74
dqt_zlumi_pandas.mass
mass
Definition: dqt_zlumi_pandas.py:170
PixelID::wafer_id
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
Definition: PixelID.h:364
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
FPGATrackSimHit
Definition: FPGATrackSimHit.h:38
Trk::ParticleHypothesis
ParticleHypothesis
Definition: ParticleHypothesis.h:25
ActsTrk::makeATLASUncalibSourceLink
ATLASUncalibSourceLink makeATLASUncalibSourceLink(const xAOD::UncalibratedMeasurementContainer *container, std::size_t index, [[maybe_unused]] const EventContext &ctx)
Definition: ATLASSourceLink.h:31
h
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
LArG4ShowerLibProcessing.hits
hits
Definition: LArG4ShowerLibProcessing.py:136
Trk::pion
@ pion
Definition: ParticleHypothesis.h:29
TRT::Track::d0
@ d0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:62
test_pyathena.parent
parent
Definition: test_pyathena.py:15
xAOD::StripCluster_v1
Definition: StripCluster_v1.h:17
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
FPGAActsTrkConverter::m_pixelId
const PixelID * m_pixelId
Definition: FPGAActsTrkConverter.h:41
Trk::ParticleMasses::mass
constexpr double mass[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:53
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
xAOD::ParticleHypothesis
ParticleHypothesis
Definition: TrackingPrimitives.h:192
FPGATrackSimRoad::getY
float getY() const
Definition: FPGATrackSimRoad.h:75
xAOD::PixelCluster_v1
Definition: PixelCluster_v1.h:17
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
PixelID::pixel_id
Identifier pixel_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int phi_index, int eta_index) const
For an individual pixel.
Definition: PixelID.h:432
FPGAActsTrkConverter::makeParams
std::unique_ptr< Acts::BoundTrackParameters > makeParams(const FPGATrackSimRoad &road) const
Definition: FPGAActsTrkConverter.cxx:125
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
SCT_ID::wafer_id
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
For a single side of module.
Definition: SCT_ID.h:464
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:26
SCT_ID::strip_id
Identifier strip_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side, int strip) const
For an individual strip.
Definition: SCT_ID.h:535