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

#include <FPGAClusterConverter.h>

Inheritance diagram for FPGAClusterConverter:
Collaboration diagram for FPGAClusterConverter:

Public Member Functions

 FPGAClusterConverter (const std::string &type, const std::string &name, const IInterface *)
 
virtual ~FPGAClusterConverter ()=default
 
virtual StatusCode initialize () override final
 
virtual StatusCode convertHits (const std::vector< FPGATrackSimHit > &, InDet::PixelClusterCollection &, InDet::SCT_ClusterCollection &) const override final
 
virtual StatusCode convertHits (const std::vector< const FPGATrackSimHit * > &, InDet::PixelClusterCollection &, InDet::SCT_ClusterCollection &) const override final
 
virtual StatusCode convertHits (const std::vector< FPGATrackSimHit > &hits, xAOD::PixelClusterContainer &pixelCont, xAOD::StripClusterContainer &SCTCont) const override final
 
virtual StatusCode convertClusters (const std::vector< FPGATrackSimCluster > &, InDet::PixelClusterCollection &, InDet::SCT_ClusterCollection &) const override final
 
virtual StatusCode convertClusters (const std::vector< FPGATrackSimCluster > &cl, xAOD::PixelClusterContainer &pixelCont, xAOD::StripClusterContainer &SCTCont) const override final
 
virtual StatusCode convertSpacePoints (const std::vector< FPGATrackSimCluster > &fpgaSPs, xAOD::SpacePointContainer &SPStripCont, xAOD::SpacePointContainer &SPPixelCont, xAOD::StripClusterContainer &stripClusterCont, xAOD::PixelClusterContainer &pixelClusterCont) const override final
 
virtual StatusCode createPixelCluster (const FPGATrackSimHit &h, const std::vector< Identifier > &rdoList, std::unique_ptr< InDet::PixelCluster > &) const override final
 
virtual StatusCode createPixelCluster (const FPGATrackSimHit &h, const std::vector< Identifier > &rdoList, xAOD::PixelCluster &) const override final
 
virtual StatusCode createSCTCluster (const FPGATrackSimHit &h, const std::vector< Identifier > &rdoList, std::unique_ptr< InDet::SCT_Cluster > &) const override final
 
virtual StatusCode createSCTCluster (const FPGATrackSimHit &h, const std::vector< Identifier > &rdoList, xAOD::StripCluster &) const override final
 
virtual StatusCode createPixelCluster (const FPGATrackSimCluster &, std::unique_ptr< InDet::PixelCluster > &) const override final
 
virtual StatusCode createPixelCluster (const FPGATrackSimCluster &, xAOD::PixelCluster &) const override final
 
virtual StatusCode createSCTCluster (const FPGATrackSimCluster &, std::unique_ptr< InDet::SCT_Cluster > &) const override final
 
virtual StatusCode createSCTCluster (const FPGATrackSimCluster &, xAOD::StripCluster &) const override final
 
virtual StatusCode createSP (const FPGATrackSimCluster &cl, xAOD::SpacePoint &sp, xAOD::StripClusterContainer &clustersCont) const override final
 
virtual StatusCode createPixelSPs (xAOD::SpacePointContainer &pixelSPs, xAOD::PixelClusterContainer &clustersCont) const override final
 
virtual StatusCode getRdoList (std::vector< Identifier > &rdoList, const FPGATrackSimCluster &cluster) const override final
 
virtual StatusCode getRdoList (std::vector< Identifier > &rdoList, const FPGATrackSimHit &hit) const override final
 
virtual StatusCode getStripsInfo (const xAOD::StripCluster &cl, float &halfStripLength, Amg::Vector3D &stripDirection, Amg::Vector3D &stripCenter) const override final
 

Public Attributes

SG::ReadHandleKey< FPGATrackSimClusterCollectionm_FPGAClusterKey {this, "FPGATrackSimClusterKey","FPGAClusters","FPGATrackSim Clusters key"}
 
SG::ReadCondHandleKey< InDet::BeamSpotDatam_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }
 

Private Attributes

const PixelIDm_pixelId {nullptr}
 
const SCT_IDm_SCTId {nullptr}
 
const InDetDD::PixelDetectorManagerm_pixelManager {nullptr}
 
const InDetDD::SCT_DetectorManagerm_SCTManager {nullptr}
 
ToolHandle< ISiLorentzAngleToolm_lorentzAngleToolPixel {this, "LorentzAngleToolPixel", "SiLorentzAngleTool/PixelLorentzAngleTool", "Tool to retrieve Lorentz angle of Pixel"}
 
ToolHandle< ISiLorentzAngleToolm_lorentzAngleToolStrip {this, "LorentzAngleToolStrip", "SiLorentzAngleTool/SCTLorentzAngleTool", "Tool to retrieve Lorentz angle of SCT"}
 
Gaudi::Property< bool > m_skipStripSpacePointFormation {this, "skipStripSpFormation", true, "Should be enabled in case we want to test strip seeding"}
 
Gaudi::Property< bool > m_doShift {this, "doLorentzShift", false, "Apply Lorentz angle shift to the clusters"}
 
Gaudi::Property< bool > m_useInherentLocalCoordinates {this, "useFPGALocalCoordinates", true, "instead of getting indirectly the local coordinates from the cell position, use the values stored in FPGATrackSimHit objects"}
 
Gaudi::Property< bool > m_broadErrors {this, "broadErrors", false, "If true use cluster width to set errors, otherwise use avg pixel width"}
 

Detailed Description

Definition at line 40 of file FPGAClusterConverter.h.

Constructor & Destructor Documentation

◆ FPGAClusterConverter()

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

Definition at line 20 of file FPGAClusterConverter.cxx.

20  :
21  base_class(type, name, parent) {}

◆ ~FPGAClusterConverter()

virtual FPGAClusterConverter::~FPGAClusterConverter ( )
virtualdefault

Member Function Documentation

◆ convertClusters() [1/2]

StatusCode FPGAClusterConverter::convertClusters ( const std::vector< FPGATrackSimCluster > &  clusters,
InDet::PixelClusterCollection pixelColl,
InDet::SCT_ClusterCollection SCTColl 
) const
finaloverridevirtual

Definition at line 164 of file FPGAClusterConverter.cxx.

166  {
167  ATH_MSG_DEBUG("Found " << clusters.size() << " FPGATrackSimClusters [InDet]");
168  // reserve some memory
169  pixelColl.reserve(clusters.size());
170  SCTColl.reserve(clusters.size());
171  for(const FPGATrackSimCluster& cl : clusters) {
172 
173  FPGATrackSimHit clEq = cl.getClusterEquiv();
174  std::vector<Identifier> rdoList;
175  ATH_CHECK(getRdoList(rdoList, cl));
176 
177  std::unique_ptr<InDet::PixelCluster> pixelCl{};
178  std::unique_ptr<InDet::SCT_Cluster> SCTCl{};
179 
180  if (clEq.isPixel()) {
181  ATH_CHECK(createPixelCluster(clEq, rdoList, pixelCl));
182  if (pixelCl) pixelColl.push_back(std::move(pixelCl));
183  }
184  if (clEq.isStrip()) {
185  ATH_CHECK(createSCTCluster(clEq, rdoList, SCTCl));
186  if (SCTCl) SCTColl.push_back(std::move(SCTCl));
187  }
188  }
189 
190  ATH_MSG_DEBUG("pixelColl size: " << pixelColl.size() << " SCTColl size: " << SCTColl.size());
191 
192  return StatusCode::SUCCESS;
193 }

◆ convertClusters() [2/2]

StatusCode FPGAClusterConverter::convertClusters ( const std::vector< FPGATrackSimCluster > &  cl,
xAOD::PixelClusterContainer pixelCont,
xAOD::StripClusterContainer SCTCont 
) const
finaloverridevirtual

Definition at line 195 of file FPGAClusterConverter.cxx.

197  {
198  ATH_MSG_DEBUG("Found " << clusters.size() << " FPGATrackSimClusters [xAOD]");
199  // reserve some memory
200  pixelCont.reserve(clusters.size());
201  SCTCont.reserve(clusters.size());
202 
203  for(const FPGATrackSimCluster& cl : clusters) {
204 
205  FPGATrackSimHit clEq = cl.getClusterEquiv();
206 
207  std::vector<Identifier> rdoList;
208  ATH_CHECK(getRdoList(rdoList, cl));
209 
210  if (clEq.isPixel()) {
211  xAOD::PixelCluster *xaod_pcl = new xAOD::PixelCluster();
212  pixelCont.push_back(xaod_pcl);
213  ATH_CHECK(createPixelCluster(clEq, rdoList, *xaod_pcl));
214  }
215  if (clEq.isStrip()) {
216  xAOD::StripCluster *xaod_scl = new xAOD::StripCluster();
217  SCTCont.push_back(xaod_scl);
218  ATH_CHECK(createSCTCluster(clEq, rdoList, *xaod_scl));
219  }
220  }
221 
222  ATH_MSG_DEBUG("xAOD pixelCont size: " << pixelCont.size() << " xAOD SCTCont size: " << SCTCont.size());
223 
224  return StatusCode::SUCCESS;
225 }

◆ convertHits() [1/3]

StatusCode FPGAClusterConverter::convertHits ( const std::vector< const FPGATrackSimHit * > &  hits,
InDet::PixelClusterCollection pixelColl,
InDet::SCT_ClusterCollection SCTColl 
) const
finaloverridevirtual

Definition at line 75 of file FPGAClusterConverter.cxx.

77  {
78  ATH_MSG_DEBUG("Found " << hits.size() << " FPGATrackSimHits [InDet]");
79 
80  // *** Match FPGATrackSimHit to FPGATrackSimCluster
82  if (!FPGAClustersHandle.isValid()) {
83  ATH_MSG_FATAL("Failed to retrieve FPGATrackSimClusterCollection");
84  return StatusCode::FAILURE;
85  }
86  const FPGATrackSimClusterCollection *FPGAClusterColl = FPGAClustersHandle.cptr();
87 
88  for(const FPGATrackSimHit *h : hits){
89  IdentifierHash hash = h->getIdentifierHash();
91  for (const FPGATrackSimCluster& cluster: *FPGAClusterColl){
92  FPGATrackSimHit clusterEq = cluster.getClusterEquiv();
93  if (hash == clusterEq.getIdentifierHash()) {
94  cl = cluster;
95  break;
96  }
97  }
98  FPGATrackSimHit clEq = cl.getClusterEquiv();
99 
100  // --- DEBUG
101  ATH_MSG_DEBUG("Hit identifier " << h->getIdentifierHash());
102  ATH_MSG_DEBUG("Cluster identifier " << clEq.getIdentifierHash());
103  // ---
104 
105  // *** FPGATrackSimCluster matched
106 
107  std::vector<Identifier> rdoList;
108  ATH_CHECK(getRdoList(rdoList,cl));
109 
110  std::unique_ptr<InDet::PixelCluster> pixelCl{};
111  std::unique_ptr<InDet::SCT_Cluster> SCTCl{};
112 
113  if (clEq.isPixel()) {
114  ATH_CHECK(createPixelCluster(clEq, rdoList, pixelCl));
115  if (pixelCl) pixelColl.push_back(std::move(pixelCl));
116  }
117  if (clEq.isStrip()) {
118  ATH_CHECK(createSCTCluster(clEq, rdoList, SCTCl));
119  if (SCTCl) SCTColl.push_back(std::move(SCTCl));
120  }
121 
122  }
123 
124  ATH_MSG_DEBUG("pixelColl size: " << pixelColl.size() << " SCTColl size: " << SCTColl.size());
125 
126  return StatusCode::SUCCESS;
127 
128 }

◆ convertHits() [2/3]

StatusCode FPGAClusterConverter::convertHits ( const std::vector< FPGATrackSimHit > &  hits,
InDet::PixelClusterCollection pixelColl,
InDet::SCT_ClusterCollection SCTColl 
) const
finaloverridevirtual

Definition at line 44 of file FPGAClusterConverter.cxx.

46  {
47  ATH_MSG_DEBUG("Found " << hits.size() << " FPGATrackSimHits [InDet]");
48  // reserve some memory
49  pixelColl.reserve(hits.size());
50  SCTColl.reserve(hits.size());
51  for(const FPGATrackSimHit& h : hits) {
52 
53  std::vector<Identifier> rdoList;
54  ATH_CHECK(getRdoList(rdoList, h));
55 
56  std::unique_ptr<InDet::PixelCluster> pixelCl{};
57  std::unique_ptr<InDet::SCT_Cluster> SCTCl{};
58 
59  if (h.isPixel()) {
60  ATH_CHECK(createPixelCluster(h, rdoList, pixelCl));
61  if (pixelCl) pixelColl.push_back(std::move(pixelCl));
62  }
63  if (h.isStrip()) {
64  ATH_CHECK(createSCTCluster(h, rdoList, SCTCl));
65  if (SCTCl) SCTColl.push_back(std::move(SCTCl));
66  }
67  }
68 
69  ATH_MSG_DEBUG("pixelColl size: " << pixelColl.size() << " SCTColl size: " << SCTColl.size() );
70 
71  return StatusCode::SUCCESS;
72 }

◆ convertHits() [3/3]

StatusCode FPGAClusterConverter::convertHits ( const std::vector< FPGATrackSimHit > &  hits,
xAOD::PixelClusterContainer pixelCont,
xAOD::StripClusterContainer SCTCont 
) const
finaloverridevirtual

Definition at line 131 of file FPGAClusterConverter.cxx.

133  {
134  ATH_MSG_DEBUG("Found " << hits.size() << " FPGATrackSimHits [xAOD]");
135  // reserve some memory
136  pixelCont.reserve(hits.size());
137  SCTCont.reserve(hits.size());
138  for(const FPGATrackSimHit& h : hits) {
139 
140  std::vector<Identifier> rdoList;
141  ATH_CHECK(getRdoList(rdoList, h));
142 
143  if (h.isPixel()) {
144  xAOD::PixelCluster *xaod_pcl = new xAOD::PixelCluster();
145  pixelCont.push_back(xaod_pcl);
146  ATH_CHECK(createPixelCluster(h, rdoList, *xaod_pcl));
147  }
148  if (h.isStrip()) {
149  xAOD::StripCluster *xaod_scl = new xAOD::StripCluster();
150  SCTCont.push_back(xaod_scl);
151  ATH_CHECK(createSCTCluster(h, rdoList, *xaod_scl));
152  if(!xaod_scl->rdoList().size())
153  SCTCont.pop_back();
154  }
155  }
156 
157  ATH_MSG_DEBUG("xAOD pixelCont size: " << pixelCont.size() << " xAOD pixelCont size: " << SCTCont.size());
158 
159  return StatusCode::SUCCESS;
160 }

◆ convertSpacePoints()

StatusCode FPGAClusterConverter::convertSpacePoints ( const std::vector< FPGATrackSimCluster > &  fpgaSPs,
xAOD::SpacePointContainer SPStripCont,
xAOD::SpacePointContainer SPPixelCont,
xAOD::StripClusterContainer stripClusterCont,
xAOD::PixelClusterContainer pixelClusterCont 
) const
finaloverridevirtual

Definition at line 227 of file FPGAClusterConverter.cxx.

231  {
232  ATH_MSG_INFO("Converting Pixel SPs");
233  SPPixelCont.reserve(pixelClusterCont.size());
234  ATH_CHECK(createPixelSPs(SPPixelCont, pixelClusterCont));
235 
237  ATH_MSG_INFO("Converting Strip SPs");
238  SPStripCont.reserve(fpgaSPs.size());
239  for (const FPGATrackSimCluster& cl : fpgaSPs) {
240  xAOD::SpacePoint* xaod_sp = new xAOD::SpacePoint();
241  SPStripCont.push_back(xaod_sp);
242  ATH_CHECK(createSP(cl, *xaod_sp, stripClusterCont));
243  if (!xaod_sp->elementIdList().size()) SPStripCont.pop_back();
244  }
245  }
246 
247  return StatusCode::SUCCESS;
248 }

◆ createPixelCluster() [1/4]

StatusCode FPGAClusterConverter::createPixelCluster ( const FPGATrackSimCluster cluster,
std::unique_ptr< InDet::PixelCluster > &  cl 
) const
finaloverridevirtual

Definition at line 624 of file FPGAClusterConverter.cxx.

624  {
625  ATH_MSG_DEBUG("\t Create InDet::PixelCluster from FPGATrackSimCluster");
626  FPGATrackSimHit clEq = cluster.getClusterEquiv();
627  std::vector<Identifier> rdoList;
628  ATH_CHECK(getRdoList(rdoList, cluster));
629  ATH_CHECK(createPixelCluster(clEq, rdoList, cl));
630  return StatusCode::SUCCESS;
631 }

◆ createPixelCluster() [2/4]

StatusCode FPGAClusterConverter::createPixelCluster ( const FPGATrackSimCluster cluster,
xAOD::PixelCluster cl 
) const
finaloverridevirtual

Definition at line 633 of file FPGAClusterConverter.cxx.

633  {
634  ATH_MSG_DEBUG("\t Create xAOD::PixelCluster from FPGATrackSimCluster");
635  FPGATrackSimHit clEq = cluster.getClusterEquiv();
636  std::vector<Identifier> rdoList;
637  ATH_CHECK(getRdoList(rdoList, cluster));
638  ATH_CHECK(createPixelCluster(clEq, rdoList, cl));
639  return StatusCode::SUCCESS;
640 }

◆ createPixelCluster() [3/4]

StatusCode FPGAClusterConverter::createPixelCluster ( const FPGATrackSimHit h,
const std::vector< Identifier > &  rdoList,
std::unique_ptr< InDet::PixelCluster > &  cl 
) const
finaloverridevirtual

Definition at line 250 of file FPGAClusterConverter.cxx.

250  {
251  ATH_MSG_DEBUG("\tCreate InDet::PixelCluster from FPGATrackSimHit");
252 
253  IdentifierHash hash = h.getIdentifierHash();
254 
255  float etaWidth = h.getEtaWidth();
256  float phiWidth = h.getPhiWidth();
257  int phiIndex = h.getPhiIndex();
258  int etaIndex = h.getEtaIndex();
259 
261 
262  if( !pDE ) {
263  ATH_MSG_ERROR("Detector Element doesn't exist " << hash);
264  return StatusCode::FAILURE;
265  }
266 
267  // *** Get cell from id
268  Identifier wafer_id = m_pixelId->wafer_id(hash);
269  Identifier hit_id = m_pixelId->pixel_id(wafer_id, phiIndex, etaIndex);
271  if(!cell.isValid()) {
272  ATH_MSG_DEBUG("\t\tcell not valid");
273  return StatusCode::FAILURE;
274  }
275  const InDetDD::PixelModuleDesign* design (dynamic_cast<const InDetDD::PixelModuleDesign*>(&pDE->design()));
276 
277  // **** Get InDet::SiWidth
278 
279  int colMin = static_cast<int>(etaIndex-0.5*etaWidth);
280  int colMax = colMin+etaWidth;
281 
282  int rowMin = static_cast<int>(phiIndex-0.5*phiWidth);
283  int rowMax = rowMin+phiWidth;
284 
285  double etaW = design->widthFromColumnRange(colMin, colMax-1);
286  double phiW = design->widthFromRowRange(rowMin, rowMax-1);
287 
288  InDet::SiWidth siWidth(Amg::Vector2D(phiWidth,etaWidth),Amg::Vector2D(phiW,etaW));
289 
290  // **** Get SiLocalPosition from cell id and define Amg::Vector2D position
292  Amg::Vector2D localPos(silPos);
293 
294  //TODO: understand if shift is needed
295  if (m_doShift) {
296  double shift = m_lorentzAngleToolPixel->getLorentzShift(hash,Gaudi::Hive::currentContext());
297  Amg::Vector2D localPosShift(localPos[Trk::locX]+shift,localPos[Trk::locY]);
298  localPos = localPosShift;
299  }
300 
301  Amg::Vector3D globalPos = pDE->globalPosition(localPos);
302  ATH_MSG_DEBUG("\t\tLocal position: x=" << localPos.x() << " y=" << localPos.y() );
303  ATH_MSG_DEBUG("\t\tGlobal position: x=" << globalPos.x() << " y=" << globalPos.y() << " z=" << globalPos.z() );
304 
305  Amg::MatrixX cov(2,2);
306  cov.setZero();
307 
308  if (m_broadErrors) {
309  cov(0,0) = siWidth.phiR()*siWidth.phiR()/12;
310  cov(1,1) = siWidth.z()*siWidth.z()/12;
311  }
312  else {
313  cov(0,0) = siWidth.phiR()*siWidth.phiR()/(12*siWidth.colRow().x()*siWidth.colRow().x());
314  cov(1,1) = siWidth.z()*siWidth.z()/(12*siWidth.colRow().y()*siWidth.colRow().y());
315  }
316 
317  float dummy_omegax = 0.5;
318  float dummy_omegay = 0.5;
319  bool split = false;
320  float splitProb1 = 0;
321  float splitProb2 = 0;
322 
323  cl = std::make_unique<InDet::PixelCluster>(hit_id, localPos, std::vector<Identifier>(rdoList), siWidth, pDE, Amg::MatrixX(cov), dummy_omegax, dummy_omegay, split, splitProb1, splitProb2);
324 
325  return StatusCode::SUCCESS;
326 }

◆ createPixelCluster() [4/4]

StatusCode FPGAClusterConverter::createPixelCluster ( const FPGATrackSimHit h,
const std::vector< Identifier > &  rdoList,
xAOD::PixelCluster cl 
) const
finaloverridevirtual

Definition at line 328 of file FPGAClusterConverter.cxx.

328  {
329  ATH_MSG_DEBUG("\tCreate xAOD::PixelCluster from FPGATrackSimHit");
330 
331  IdentifierHash hash = h.getIdentifierHash();
332 
334 
335  if( !pDE ) {
336  ATH_MSG_ERROR("Detector Element doesn't exist " << hash);
337  return StatusCode::FAILURE;
338  }
339 
340  // *** Get cell from id
341  Identifier wafer_id = m_pixelId->wafer_id(hash);
342  Identifier hit_id = m_pixelId->pixel_id(wafer_id, h.getPhiIndex(), h.getEtaIndex());
344  if(!cell.isValid()) {
345  ATH_MSG_DEBUG("\t\tcell not valid");
346  return StatusCode::FAILURE;
347  }
348  const InDetDD::PixelModuleDesign* design (dynamic_cast<const InDetDD::PixelModuleDesign*>(&pDE->design()));
349 
350  // **** Get InDet::SiWidth
351  int rowmin = h.getMinPhiIndex();
352  int rowmax = h.getMaxPhiIndex();
353  int colmin = h.getMinEtaIndex();
354  int colmax = h.getMaxEtaIndex();
355 
356  // Quick test to check that none of these 4 hit some number limits
357  // Check for uninitialized values (still at int min/max)
358  if (colmin == std::numeric_limits<int>::max() || colmax == std::numeric_limits<int>::min() ||
360  ATH_MSG_ERROR("Pixel cluster indices appear uninitialized: colmin=" << colmin << ", colmax=" << colmax
361  << ", rowmin=" << rowmin << ", rowmax=" << rowmax);
362  return StatusCode::FAILURE;
363  }
364  // Check for negative indices
365  if (colmin < 0 || colmax < 0 || rowmin < 0 || rowmax < 0) {
366  ATH_MSG_ERROR("Pixel cluster indices out of range: colmin=" << colmin << ", colmax=" << colmax
367  << ", rowmin=" << rowmin << ", rowmax=" << rowmax);
368  return StatusCode::FAILURE;
369  }
370  // Check for max < min
371  if (colmax < colmin || rowmax < rowmin) {
372  ATH_MSG_ERROR("Pixel cluster index max < min: colmin=" << colmin << ", colmax=" << colmax
373  << ", rowmin=" << rowmin << ", rowmax=" << rowmax);
374  return StatusCode::FAILURE;
375  }
376 
377  double zWidth = design->widthFromColumnRange(colmin, colmax);
378  double phiRWidth = design->widthFromRowRange(rowmin, rowmax);
379 
380  InDet::SiWidth siWidth(Amg::Vector2D(h.getPhiWidth(),h.getEtaWidth()), Amg::Vector2D(phiRWidth,zWidth));
381 
382 
383  // **** Get SiLocalPosition from cell id and define Amg::Vector2D position
385  Amg::Vector2D localPos(silPos);
386 
388  // replace localPos with the one stored in the FPGATrackSimHit
389  localPos(0,0) = h.getPhiCoord();
390  localPos(1,0) = h.getEtaCoord();
391  }
392  //TODO: understand if shift is needed
393  if (m_doShift) {
394  double shift = m_lorentzAngleToolPixel->getLorentzShift(hash,Gaudi::Hive::currentContext());
395  Amg::Vector2D localPosShift(localPos[Trk::locX]+shift,localPos[Trk::locY]);
396  localPos = localPosShift;
397  }
398 
399  ATH_MSG_DEBUG("\t\tLocal position: x=" << localPos.x() << " y=" << localPos.y() );
400 
401  Amg::MatrixX cov(2,2);
402  cov.setZero();
403 
404  if (m_broadErrors) {
405  cov(0,0) = siWidth.phiR()*siWidth.phiR()/12;
406  cov(1,1) = siWidth.z()*siWidth.z()/12;
407  }
408  else {
409  cov(0,0) = siWidth.phiR()*siWidth.phiR()/(12*siWidth.colRow().x()*siWidth.colRow().x());
410  cov(1,1) = siWidth.z()*siWidth.z()/(12*siWidth.colRow().y()*siWidth.colRow().y());
411  }
412 
413  bool split = false;
414  float splitProb1 = 0;
415  float splitProb2 = 0;
416 
417  Eigen::Matrix<float,2,1> localPosition(localPos.x(), localPos.y());
418  Eigen::Matrix<float,2,2> localCovariance;
419  localCovariance.setZero();
420  localCovariance(0, 0) = cov(0, 0);
421  localCovariance(1, 1) = cov(1, 1);
422 
423  Eigen::Matrix<float,3,1> globalPosition(h.getX(),h.getY(),h.getZ());
424  ATH_MSG_DEBUG("\t\tGlobal position: x=" << globalPosition.x() << " y=" << globalPosition.y() << " z=" << globalPosition.z() );
425 
426  cl.setMeasurement<2>(hash, localPosition, localCovariance);
427  cl.setIdentifier( rdoList.front().get_compact() );
428  cl.setRDOlist(rdoList);
429  cl.globalPosition() = globalPosition;
430  cl.setChannelsInPhiEta(siWidth.colRow()[0], siWidth.colRow()[1]);
431  cl.setWidthInEta(static_cast<float>(siWidth.widthPhiRZ()[1]));
432  cl.setIsSplit(split);
433  cl.setSplitProbabilities(splitProb1, splitProb2);
434  ATH_MSG_DEBUG("\t\txaod width in eta " << cl.widthInEta());
435 
436  return StatusCode::SUCCESS;
437 }

◆ createPixelSPs()

StatusCode FPGAClusterConverter::createPixelSPs ( xAOD::SpacePointContainer pixelSPs,
xAOD::PixelClusterContainer clustersCont 
) const
finaloverridevirtual

Definition at line 661 of file FPGAClusterConverter.cxx.

661  {
662 
663  for (const xAOD::PixelCluster* p_cl : clustersCont)
664  {
665  pixelSPs.emplace_back(new xAOD::SpacePoint);
666 
667  // Global position
668  Eigen::Matrix<float, 3, 1> globalPos(p_cl->globalPosition().x(), p_cl->globalPosition().y(), p_cl->globalPosition().z());
669 
670  // Covariance
671  // TODO: check if we need to scale covariance based on rotation matrix like in PixelSpacePointFormationTool.cxx
672  const float & cov_r = p_cl->localCovariance<2>()(0,0);
673  const float & cov_z = p_cl->localCovariance<2>()(1,0);
674 
675  pixelSPs.back()->setSpacePoint(
676  p_cl->identifierHash(),
677  globalPos,
678  cov_r,
679  cov_z,
680  std::vector< const xAOD::UncalibratedMeasurement* >({ p_cl }) // measurement list
681  );
682  }
683 
684  return StatusCode::SUCCESS;
685 }

◆ createSCTCluster() [1/4]

StatusCode FPGAClusterConverter::createSCTCluster ( const FPGATrackSimCluster cluster,
std::unique_ptr< InDet::SCT_Cluster > &  cl 
) const
finaloverridevirtual

Definition at line 642 of file FPGAClusterConverter.cxx.

642  {
643  ATH_MSG_DEBUG("\t Create InDet::SCT_Cluster from FPGATrackSimCluster");
644  FPGATrackSimHit clEq = cluster.getClusterEquiv();
645  std::vector<Identifier> rdoList;
646  ATH_CHECK(getRdoList(rdoList, cluster));
647  ATH_CHECK(createSCTCluster(clEq, rdoList,cl));
648  return StatusCode::SUCCESS;
649 }

◆ createSCTCluster() [2/4]

StatusCode FPGAClusterConverter::createSCTCluster ( const FPGATrackSimCluster cluster,
xAOD::StripCluster cl 
) const
finaloverridevirtual

Definition at line 651 of file FPGAClusterConverter.cxx.

651  {
652  ATH_MSG_DEBUG("\t Create xAOD::StripCluster from FPGATrackSimCluster");
653  FPGATrackSimHit clEq = cluster.getClusterEquiv();
654  std::vector<Identifier> rdoList;
655  ATH_CHECK(getRdoList(rdoList, cluster));
656  ATH_CHECK(createSCTCluster(clEq, rdoList, cl));
657  return StatusCode::SUCCESS;
658 }

◆ createSCTCluster() [3/4]

StatusCode FPGAClusterConverter::createSCTCluster ( const FPGATrackSimHit h,
const std::vector< Identifier > &  rdoList,
std::unique_ptr< InDet::SCT_Cluster > &  cl 
) const
finaloverridevirtual

Definition at line 439 of file FPGAClusterConverter.cxx.

439  {
440  ATH_MSG_DEBUG("\t Create InDet::SCTCluster from FPGATrackSimHit ");
441 
442 
443  IdentifierHash hash = h.getIdentifierHash();
444 
445  float phiWidth = h.getPhiWidth();
446  int strip = static_cast<int>(h.getPhiIndex());
447  ATH_CHECK(strip >= 0);
449  ATH_CHECK(pDE != nullptr);
450 
451 
452  Identifier wafer_id = m_SCTId->wafer_id(hash);
453  Identifier strip_id = m_SCTId->strip_id(wafer_id, strip);
455  ATH_MSG_DEBUG("\t\tcell: " << cell);
456  ATH_MSG_DEBUG("\t\tstrip_id " << strip_id);
457  ATH_MSG_DEBUG("\t\tstrip: " << cell);
458  ATH_MSG_DEBUG("\t\tStrip from idHelper: " << m_SCTId->strip(strip_id) );
459 
460  const InDetDD::SCT_ModuleSideDesign* design;
461  if (pDE->isBarrel()){
462  design = (static_cast<const InDetDD::SCT_ModuleSideDesign*>(&pDE->design()));
463  } else{
464  design = (static_cast<const InDetDD::StripStereoAnnulusDesign*>(&pDE->design()));
465  }
466 
467  const int firstStrip = m_SCTId->strip(rdoList.front());
468  const int lastStrip = m_SCTId->strip(rdoList.back());
469  const int row = m_SCTId->row(rdoList.front());
470  const int firstStrip1D = design->strip1Dim (firstStrip, row );
471  const int lastStrip1D = design->strip1Dim( lastStrip, row );
472  const InDetDD::SiCellId cell1(firstStrip1D);
473  const InDetDD::SiCellId cell2(lastStrip1D);
474  const InDetDD::SiLocalPosition firstStripPos( pDE->rawLocalPositionOfCell(cell1 ));
475  const InDetDD::SiLocalPosition lastStripPos( pDE->rawLocalPositionOfCell(cell2) );
476  const InDetDD::SiLocalPosition centre( (firstStripPos+lastStripPos) * 0.5 );
477  const double width = design->stripPitch() * ( lastStrip - firstStrip + 1 );
478 
479  const std::pair<InDetDD::SiLocalPosition, InDetDD::SiLocalPosition> ends( design->endsOfStrip(centre) );
480  const double stripLength( std::abs(ends.first.xEta() - ends.second.xEta()) );
481 
482  InDet::SiWidth siWidth(Amg::Vector2D(phiWidth,1), Amg::Vector2D(width,stripLength) ); //TODO: ok??
483  Amg::Vector2D localPos(centre.xPhi(), centre.xEta());
484 
485  ATH_MSG_DEBUG("\t\tcentre eta: " << centre.xEta() << " phi: " << centre.xPhi());
486  ATH_MSG_DEBUG("\t\tStrip length: " << stripLength );
487  ATH_MSG_DEBUG("\t\tlocal position before shift: " << localPos.x() << " phi: " << localPos.y());
488  if (m_doShift) {
489  double shift = m_lorentzAngleToolStrip->getLorentzShift(hash,Gaudi::Hive::currentContext());
490  Amg::Vector2D localPosShift(localPos[Trk::locX]+shift,localPos[Trk::locY]);
491  localPos = localPosShift;
492  }
493 
494  Amg::Vector3D globalPos = pDE->globalPosition(localPos);
495  ATH_MSG_DEBUG("\t\tLocal position: x=" << localPos.x() << " y=" << localPos.y() );
496  ATH_MSG_DEBUG("\t\tGlobal position: x=" << globalPos.x() << " y=" << globalPos.y() << " z=" << globalPos.z() );
497 
498  // Fill cov matrix. TODO: compare with https://gitlab.cern.ch/atlas/athena/-/blob/main/InnerDetector/InDetRecTools/SiClusterizationTool/src/ClusterMakerTool.cxx and xAOD function
499  const double col_x = siWidth.colRow().x();
500  const double col_y = siWidth.colRow().y();
501 
502  double scale_factor = 1.;
503  if ( std::abs(col_x-1) < std::numeric_limits<double>::epsilon() )
504  scale_factor = 1.05;
505  else if ( std::abs(col_x-2) < std::numeric_limits<double>::epsilon() )
506  scale_factor = 0.27;
507 
508  auto cov = Amg::MatrixX(2,2);
509  cov.setIdentity();
510  cov.fillSymmetric(0, 0, scale_factor * scale_factor * siWidth.phiR() * siWidth.phiR() * (1./12.));
511  cov.fillSymmetric(1, 1, siWidth.z() * siWidth.z() / col_y / col_y * (1./12.));
512 
513  // rotation for endcap SCT
514  if(pDE->design().shape() == InDetDD::Trapezoid || pDE->design().shape() == InDetDD::Annulus) {
515  double sn = pDE->sinStereoLocal(localPos);
516  double sn2 = sn*sn;
517  double cs2 = 1.-sn2;
518  double w = pDE->phiPitch(localPos)/pDE->phiPitch();
519  double v0 = (cov)(0,0)*w*w;
520  double v1 = (cov)(1,1);
521  cov.fillSymmetric( 0, 0, cs2 * v0 + sn2 * v1 );
522  cov.fillSymmetric( 0, 1, sn * std::sqrt(cs2) * (v0 - v1) );
523  cov.fillSymmetric( 1, 1, sn2 * v0 + cs2 * v1 );
524  }
525 
526  cl = std::make_unique<InDet::SCT_Cluster>(strip_id, localPos, std::vector<Identifier>(rdoList), siWidth, pDE, Amg::MatrixX(cov));
527 
528  return StatusCode::SUCCESS;
529 }

◆ createSCTCluster() [4/4]

StatusCode FPGAClusterConverter::createSCTCluster ( const FPGATrackSimHit h,
const std::vector< Identifier > &  rdoList,
xAOD::StripCluster cl 
) const
finaloverridevirtual

Definition at line 531 of file FPGAClusterConverter.cxx.

531  {
532  ATH_MSG_DEBUG("\t Create xAOD::StripCluster from FPGATrackSimHit ");
533  //https://gitlab.cern.ch/atlas/athena/-/blob/main/InnerDetector/InDetRecTools/SiClusterizationTool/src/SCT_ClusteringTool.cxx
534 
535  IdentifierHash hash = h.getIdentifierHash();
536 
537  float phiWidth = h.getPhiWidth();
538  int strip = static_cast<int>(h.getPhiIndex());
539  ATH_CHECK(strip >= 0);
541  ATH_CHECK(pDE != nullptr);
542 
543  Identifier wafer_id = m_SCTId->wafer_id(hash);
544  Identifier strip_id = m_SCTId->strip_id(wafer_id, strip);
546  ATH_MSG_DEBUG("\t\tcell: " << cell);
547  ATH_MSG_DEBUG("\t\tstrip_id " << strip_id);
548  ATH_MSG_DEBUG("\t\tstrip: " << cell);
549  ATH_MSG_DEBUG("\t\tStrip from idHelper: " << m_SCTId->strip(strip_id) );
550 
551  const InDetDD::SCT_ModuleSideDesign* design;
552  if (pDE->isBarrel()){
553  design = (static_cast<const InDetDD::SCT_ModuleSideDesign*>(&pDE->design()));
554  } else{
555  design = (static_cast<const InDetDD::StripStereoAnnulusDesign*>(&pDE->design()));
556  }
557 
558  const int firstStrip = m_SCTId->strip(rdoList.front());
559  const int lastStrip = m_SCTId->strip(rdoList.back());
560  const int row = m_SCTId->row(rdoList.front());
561  const int firstStrip1D = design->strip1Dim (firstStrip, row );
562  const int lastStrip1D = design->strip1Dim( lastStrip, row );
563  const InDetDD::SiCellId cell1(firstStrip1D);
564  const InDetDD::SiCellId cell2(lastStrip1D);
565  if (cell2 != design->cellIdInRange(cell2) || cell1 != design->cellIdInRange(cell1)) { // this seems to solve EFTRACK-743
566  ATH_MSG_WARNING("Cell ID out of range. Skip making this Strip cluster");
567  return StatusCode::SUCCESS;
568  }
569  const InDetDD::SiLocalPosition firstStripPos( pDE->rawLocalPositionOfCell(cell1 ));
570  const InDetDD::SiLocalPosition lastStripPos( pDE->rawLocalPositionOfCell(cell2) );
571  const InDetDD::SiLocalPosition centre( (firstStripPos+lastStripPos) * 0.5 );
572  const double width = design->stripPitch() * ( lastStrip - firstStrip + 1 );
573 
574  const std::pair<InDetDD::SiLocalPosition, InDetDD::SiLocalPosition> ends( design->endsOfStrip(centre) );
575  const double stripLength( std::abs(ends.first.xEta() - ends.second.xEta()) );
576 
577  InDet::SiWidth siWidth(Amg::Vector2D(phiWidth,1), Amg::Vector2D(width,stripLength) ); //TODO: ok??
578  Amg::Vector2D localPos(centre.xPhi(), centre.xEta());
580  // replace localPos with the one stored in the FPGATrackSimHit
581  localPos(0,0) = h.getPhiCoord();
582  }
583  ATH_MSG_DEBUG("\t\tcentre eta: " << centre.xEta() << " phi: " << centre.xPhi());
584  ATH_MSG_DEBUG("\t\tStrip length: " << stripLength );
585  ATH_MSG_DEBUG("\t\tlocal position before shift: " << localPos.x() << " phi: " << localPos.y());
586 
587  if (m_doShift) {
588  double shift = m_lorentzAngleToolStrip->getLorentzShift(hash,Gaudi::Hive::currentContext());
589  Amg::Vector2D localPosShift(localPos[Trk::locX]+shift,localPos[Trk::locY]);
590  localPos = localPosShift;
591  }
592 
593  ATH_MSG_DEBUG("\t\tLocal position: x=" << localPos.x() << " y=" << localPos.y() );
594 
595  /* TODO */
596  Eigen::Matrix<float,1,1> localPosition;
597  Eigen::Matrix<float,1,1> localCovariance;
598  localCovariance.setZero();
599 
600  if (pDE->isBarrel()) {
601  localPosition(0, 0) = localPos.x();
602  localCovariance(0, 0) = pDE->phiPitch() * pDE->phiPitch() * (1./12.);
603  } else {
604  InDetDD::SiCellId cellId = pDE->cellIdOfPosition(localPos);
605  const InDetDD::StripStereoAnnulusDesign *designNew = dynamic_cast<const InDetDD::StripStereoAnnulusDesign *>(&pDE->design());
606  if ( designNew == nullptr ) return StatusCode::FAILURE;
607  InDetDD::SiLocalPosition localInPolar = designNew->localPositionOfCellPC(cellId);
608  localPosition(0, 0) = localInPolar.xPhi();
609  localCovariance(0, 0) = designNew->phiPitchPhi() * designNew->phiPitchPhi() * (1./12.);
610  }
611 
612  Eigen::Matrix<float,3,1> globalPosition(h.getX(),h.getY(),h.getZ());
613  ATH_MSG_DEBUG("\t\tGlobal position: x=" << globalPosition.x() << " y=" << globalPosition.y() << " z=" << globalPosition.z() );
614 
615  cl.setMeasurement<1>(hash, localPosition, localCovariance);
616  cl.setIdentifier( rdoList.front().get_compact() );
617  cl.setRDOlist(rdoList);
618  cl.globalPosition() = globalPosition;
619  cl.setChannelsInPhi(siWidth.colRow()[0]);
620 
621  return StatusCode::SUCCESS;
622 }

◆ createSP()

StatusCode FPGAClusterConverter::createSP ( const FPGATrackSimCluster cl,
xAOD::SpacePoint sp,
xAOD::StripClusterContainer clustersCont 
) const
finaloverridevirtual

Definition at line 688 of file FPGAClusterConverter.cxx.

688  {
689 
691  const InDet::BeamSpotData* beamSpot = *beamSpotHandle;
692  Amg::Vector3D vertex = beamSpot->beamVtx().position();
693 
694  const FPGATrackSimHit& clEq = cl.getClusterEquiv();
695 
696  const IdentifierHash& hash = clEq.getIdentifierHash();
697 
698  // Global position and covariance
699 
700  Eigen::Matrix<float,3,1> globalPos(clEq.getX(),clEq.getY(),clEq.getZ());
701 
702  // Covariance
703  // TODO: update to ITk? Can it be done as for pixel? (L728-729)?
704  // Lines taken from SCT_SpacePoint::setupLocalCovarianceSCT()
705  float deltaY = 0.0004; // roughly pitch of SCT (80 mu) / sqrt(12)
706  float covTerm = 1600.*deltaY;
707  Eigen::Matrix<float, 2, 1> variance(0.1, 8.*covTerm);
709  // Swap r/z covariance terms for endcap clusters
710  if ( element->isEndcap() )
711  std::swap( variance(0, 0), variance(1, 0) );
712  float cov_r = variance(0,0);
713  float cov_z = variance(1,0);
714 
715  // ***** Get Strips related infos *****
716 
717  // idHashes and measurements
718  std::vector<unsigned int> idHashList;
719  std::vector<const xAOD::UncalibratedMeasurement_v1*> measurements;
720 
721  //Get measurements
722 
723  float topHalfStripLength, bottomHalfStripLength;
724  Amg::Vector3D topStripDirection;
725  Amg::Vector3D bottomStripDirection;
726  Amg::Vector3D stripCenter1;
727  Amg::Vector3D stripCenter2;
728  int index = 0;
729  for (const FPGATrackSimHit& h : cl.getHitList()) {
730  idHashList.push_back(h.getIdentifierHash());
731  for (auto orig_cl : clustersCont) {
732  if (h.getIdentifierHash()==orig_cl->identifierHash()) {
733  if (index == 0) {ATH_CHECK(getStripsInfo(*orig_cl, topHalfStripLength, topStripDirection, stripCenter1));}
734  if (index == 1) {ATH_CHECK(getStripsInfo(*orig_cl, bottomHalfStripLength, bottomStripDirection, stripCenter2));}
735  measurements.push_back(orig_cl);
736  index++;
737  }
738  }
739  }
740 
741  Amg::Vector3D topTrajDir = 2. * ( stripCenter1 - vertex);
742  Amg::Vector3D topStripCenter = 0.5 * topTrajDir;
743  Amg::Vector3D stripCenterDistance = stripCenter1 - stripCenter2;
744 
745  ATH_MSG_DEBUG("topHalfStripLength = " << topHalfStripLength << " bottomHalfStripLength = " << bottomHalfStripLength);
746  ATH_MSG_DEBUG("topStripDirection = (" << topStripDirection.x() <<", " << topStripDirection.y() <<", " << topStripDirection.z() <<") " << "bottomStripDirection = (" << bottomStripDirection.x() <<", " << bottomStripDirection.y() <<", " << bottomStripDirection.z() <<") " );
747  ATH_MSG_DEBUG("stripCenterDistance = (" << stripCenterDistance.x() <<", " << stripCenterDistance.y() <<", " << stripCenterDistance.z() << ")" );
748  ATH_MSG_DEBUG("topStripCenter = (" << topStripCenter.x() <<", " << topStripCenter.y() <<", " << topStripCenter.z() << ")" );
749 
750  // Fill xAOD::SpacePoint
751  sp.setSpacePoint(
752  std::move(idHashList),
753  globalPos,
754  cov_r,
755  cov_z,
756  std::move(measurements),
757  topHalfStripLength,
758  bottomHalfStripLength,
759  topStripDirection.cast<float>(),
760  bottomStripDirection.cast<float>(),
761  stripCenterDistance.cast<float>(),
762  topStripCenter.cast<float>()
763  );
764 
765  return StatusCode::SUCCESS;
766 }

◆ getRdoList() [1/2]

StatusCode FPGAClusterConverter::getRdoList ( std::vector< Identifier > &  rdoList,
const FPGATrackSimCluster cluster 
) const
finaloverridevirtual

Definition at line 768 of file FPGAClusterConverter.cxx.

768  {
769 
770  std::vector<FPGATrackSimHit> hits = cluster.getHitList();
771 
772  for (const FPGATrackSimHit& h : hits) {
773  IdentifierHash hash = h.getIdentifierHash();
774  int phiIndex = h.getPhiIndex();
775  int etaIndex = h.getEtaIndex();
776 
777  if (h.isPixel()) {
778  Identifier wafer_id_hit = m_pixelId->wafer_id(hash);
779  Identifier hit_id = m_pixelId->pixel_id(wafer_id_hit, phiIndex, etaIndex);
780  rdoList.push_back(hit_id);
781  }
782  if (h.isStrip()) {
783  Identifier wafer_id_hit = m_SCTId->wafer_id(hash);
784  Identifier hit_id = m_SCTId->strip_id(wafer_id_hit, int(phiIndex));
785  rdoList.push_back(hit_id);
786  }
787  }
788 
789  return StatusCode::SUCCESS;
790 
791 }

◆ getRdoList() [2/2]

StatusCode FPGAClusterConverter::getRdoList ( std::vector< Identifier > &  rdoList,
const FPGATrackSimHit hit 
) const
finaloverridevirtual

Definition at line 794 of file FPGAClusterConverter.cxx.

794  {
795 
796  IdentifierHash hash = h.getIdentifierHash();
797  int phiIndex = h.getPhiIndex();
798  int etaIndex = h.getEtaIndex();
799 
800  if (h.isPixel()) {
801  Identifier wafer_id_hit = m_pixelId->wafer_id(hash);
802  Identifier hit_id = m_pixelId->pixel_id(wafer_id_hit, phiIndex, etaIndex);
803  rdoList.push_back(hit_id);
804  }
805  if (h.isStrip()) {
806  Identifier wafer_id_hit = m_SCTId->wafer_id(hash);
807  Identifier hit_id = m_SCTId->strip_id(wafer_id_hit, int(phiIndex));
808  rdoList.push_back(hit_id);
809  }
810 
811  return StatusCode::SUCCESS;
812 }

◆ getStripsInfo()

StatusCode FPGAClusterConverter::getStripsInfo ( const xAOD::StripCluster cl,
float &  halfStripLength,
Amg::Vector3D stripDirection,
Amg::Vector3D stripCenter 
) const
finaloverridevirtual

Definition at line 814 of file FPGAClusterConverter.cxx.

814  {
815 
816  const int &strip = m_SCTId->strip(cl.rdoList().front());
817  const IdentifierHash &hash = cl.identifierHash();
818 
820 
821  const Identifier &wafer_id = m_SCTId->wafer_id(hash);
822  const Identifier &strip_id = m_SCTId->strip_id(wafer_id, strip);
823  const InDetDD::SiCellId & cell = pDE->cellIdFromIdentifier(strip_id);
824 
825  const InDetDD::SiLocalPosition localPos( pDE->rawLocalPositionOfCell(cell ));
826  std::pair<Amg::Vector3D, Amg::Vector3D> end = (pDE->endsOfStrip(localPos));
827  stripCenter = 0.5 * (end.first + end.second);
828  Amg::Vector3D stripDir = end.first - end.second;
829 
830  halfStripLength = 0.5 * stripDir.norm();
831  stripDirection = stripDir / (2. * (halfStripLength));
832 
833  return StatusCode::SUCCESS;
834 }

◆ initialize()

StatusCode FPGAClusterConverter::initialize ( )
finaloverridevirtual

Definition at line 23 of file FPGAClusterConverter.cxx.

23  {
24 
25  ATH_MSG_DEBUG("Initializing FPGAClusterConverter...");
26 
27  // Get SCT & pixel Identifier helpers
28  ATH_CHECK(detStore()->retrieve(m_pixelId, "PixelID"));
29  ATH_CHECK(detStore()->retrieve(m_SCTId, "SCT_ID"));
34 
37 
38  return StatusCode::SUCCESS;
39 
40 }

Member Data Documentation

◆ m_beamSpotKey

SG::ReadCondHandleKey< InDet::BeamSpotData > FPGAClusterConverter::m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }

Definition at line 85 of file FPGAClusterConverter.h.

◆ m_broadErrors

Gaudi::Property<bool> FPGAClusterConverter::m_broadErrors {this, "broadErrors", false, "If true use cluster width to set errors, otherwise use avg pixel width"}
private

Definition at line 101 of file FPGAClusterConverter.h.

◆ m_doShift

Gaudi::Property<bool> FPGAClusterConverter::m_doShift {this, "doLorentzShift", false, "Apply Lorentz angle shift to the clusters"}
private

Definition at line 99 of file FPGAClusterConverter.h.

◆ m_FPGAClusterKey

SG::ReadHandleKey<FPGATrackSimClusterCollection> FPGAClusterConverter::m_FPGAClusterKey {this, "FPGATrackSimClusterKey","FPGAClusters","FPGATrackSim Clusters key"}

Definition at line 84 of file FPGAClusterConverter.h.

◆ m_lorentzAngleToolPixel

ToolHandle<ISiLorentzAngleTool> FPGAClusterConverter::m_lorentzAngleToolPixel {this, "LorentzAngleToolPixel", "SiLorentzAngleTool/PixelLorentzAngleTool", "Tool to retrieve Lorentz angle of Pixel"}
private

Definition at line 95 of file FPGAClusterConverter.h.

◆ m_lorentzAngleToolStrip

ToolHandle<ISiLorentzAngleTool> FPGAClusterConverter::m_lorentzAngleToolStrip {this, "LorentzAngleToolStrip", "SiLorentzAngleTool/SCTLorentzAngleTool", "Tool to retrieve Lorentz angle of SCT"}
private

Definition at line 96 of file FPGAClusterConverter.h.

◆ m_pixelId

const PixelID* FPGAClusterConverter::m_pixelId {nullptr}
private

Definition at line 90 of file FPGAClusterConverter.h.

◆ m_pixelManager

const InDetDD::PixelDetectorManager* FPGAClusterConverter::m_pixelManager {nullptr}
private

Definition at line 92 of file FPGAClusterConverter.h.

◆ m_SCTId

const SCT_ID* FPGAClusterConverter::m_SCTId {nullptr}
private

Definition at line 91 of file FPGAClusterConverter.h.

◆ m_SCTManager

const InDetDD::SCT_DetectorManager* FPGAClusterConverter::m_SCTManager {nullptr}
private

Definition at line 93 of file FPGAClusterConverter.h.

◆ m_skipStripSpacePointFormation

Gaudi::Property<bool> FPGAClusterConverter::m_skipStripSpacePointFormation {this, "skipStripSpFormation", true, "Should be enabled in case we want to test strip seeding"}
private

Definition at line 98 of file FPGAClusterConverter.h.

◆ m_useInherentLocalCoordinates

Gaudi::Property<bool> FPGAClusterConverter::m_useInherentLocalCoordinates {this, "useFPGALocalCoordinates", true, "instead of getting indirectly the local coordinates from the cell position, use the values stored in FPGATrackSimHit objects"}
private

Definition at line 100 of file FPGAClusterConverter.h.


The documentation for this class was generated from the following files:
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
FPGAClusterConverter::m_doShift
Gaudi::Property< bool > m_doShift
Definition: FPGAClusterConverter.h:99
FPGAClusterConverter::m_skipStripSpacePointFormation
Gaudi::Property< bool > m_skipStripSpacePointFormation
Definition: FPGAClusterConverter.h:98
InDetDD::SiDetectorElement::isEndcap
bool isEndcap() const
InDetDD::SCT_ModuleSideDesign::stripPitch
virtual double stripPitch(const SiLocalPosition &chargePos) const =0
give the strip pitch (dependence on position needed for forward)
FPGAClusterConverter::m_lorentzAngleToolPixel
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleToolPixel
Definition: FPGAClusterConverter.h:95
FPGAClusterConverter::m_SCTManager
const InDetDD::SCT_DetectorManager * m_SCTManager
Definition: FPGAClusterConverter.h:93
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
InDetDD::SolidStateDetectorElementBase::cellIdOfPosition
SiCellId cellIdOfPosition(const Amg::Vector2D &localPos) const
As in previous method but returns SiCellId.
Definition: SolidStateDetectorElementBase.cxx:224
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
FPGATrackSimCluster::getHitList
hitVector const & getHitList() const
Definition: FPGATrackSimCluster.h:30
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
SiliconTech::strip
@ strip
FPGATrackSimHit::isStrip
bool isStrip() const
Definition: FPGATrackSimHit.h:65
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
DataVector::emplace_back
value_type emplace_back(value_type pElem)
Add an element to the end of the collection.
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Trk::locX
@ locX
Definition: ParamDefs.h:37
InDetDD::PixelModuleDesign
Definition: PixelModuleDesign.h:45
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:38
FPGATrackSimCluster
Definition: FPGATrackSimCluster.h:24
xAOD::SpacePoint_v1::elementIdList
const std::vector< DetectorIDHashType > & elementIdList() const
Returns the IdentifierHash of the spacepoint (corresponds to the detector element IdentifierHash)
Definition: SpacePoint_v1.cxx:14
makeComparison.deltaY
int deltaY
Definition: makeComparison.py:44
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
index
Definition: index.py:1
InDetDD::SCT_ModuleSideDesign
Definition: SCT_ModuleSideDesign.h:40
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
FPGAClusterConverter::m_FPGAClusterKey
SG::ReadHandleKey< FPGATrackSimClusterCollection > m_FPGAClusterKey
Definition: FPGAClusterConverter.h:84
InDetDD::DetectorDesign::shape
virtual DetectorShape shape() const
Shape of element.
Definition: DetectorDesign.cxx:96
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
FPGATrackSimHit::getX
float getX() const
Definition: FPGATrackSimHit.h:149
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:200
FPGAClusterConverter::m_useInherentLocalCoordinates
Gaudi::Property< bool > m_useInherentLocalCoordinates
Definition: FPGAClusterConverter.h:100
keylayer_zslicemap.row
row
Definition: keylayer_zslicemap.py:155
xAOD::SpacePoint_v1
Definition: SpacePoint_v1.h:29
xAOD::SpacePoint
SpacePoint_v1 SpacePoint
Definition: Event/xAOD/xAODInDetMeasurement/xAODInDetMeasurement/SpacePoint.h:12
FPGAClusterConverter::m_broadErrors
Gaudi::Property< bool > m_broadErrors
Definition: FPGAClusterConverter.h:101
InDetDD::SCT_DetectorManager::getDetectorElement
virtual const SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements via Identifier
Definition: SCT_DetectorManager.cxx:66
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
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:360
xAOD::StripCluster_v1::rdoList
const std::vector< Identifier > rdoList() const
Returns the list of identifiers of the channels building the cluster.
Definition: StripCluster_v1.cxx:37
FPGAClusterConverter::m_pixelManager
const InDetDD::PixelDetectorManager * m_pixelManager
Definition: FPGAClusterConverter.h:92
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:92
FPGAClusterConverter::m_lorentzAngleToolStrip
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleToolStrip
Definition: FPGAClusterConverter.h:96
FPGAClusterConverter::getStripsInfo
virtual StatusCode getStripsInfo(const xAOD::StripCluster &cl, float &halfStripLength, Amg::Vector3D &stripDirection, Amg::Vector3D &stripCenter) const override final
Definition: FPGAClusterConverter.cxx:814
FPGATrackSimHit
Definition: FPGATrackSimHit.h:41
FPGAClusterConverter::m_SCTId
const SCT_ID * m_SCTId
Definition: FPGAClusterConverter.h:91
InDetDD::SiLocalPosition
Definition: SiLocalPosition.h:31
InDetDD::SiLocalPosition::xPhi
double xPhi() const
position along phi direction:
Definition: SiLocalPosition.h:123
FPGAClusterConverter::m_pixelId
const PixelID * m_pixelId
Definition: FPGAClusterConverter.h:90
xAOD::StripCluster
StripCluster_v1 StripCluster
Define the version of the strip cluster class.
Definition: StripCluster.h:13
InDetDD::SiDetectorElement::phiPitch
double phiPitch() const
Pitch (inline methods)
FPGATrackSimClusterCollection
std::vector< FPGATrackSimCluster > FPGATrackSimClusterCollection
Definition: FPGATrackSimClusterCollection.h:13
InDetDD::SiDetectorElement::cellIdFromIdentifier
virtual SiCellId cellIdFromIdentifier(const Identifier &identifier) const override final
SiCellId from Identifier.
Definition: SiDetectorElement.cxx:120
InDetDD::SCT_ModuleSideDesign::cellIdInRange
virtual SiCellId cellIdInRange(const SiCellId &cellId) const override
Check if cell is in range.
Definition: SCT_ModuleSideDesign.cxx:101
FPGAClusterConverter::createSCTCluster
virtual StatusCode createSCTCluster(const FPGATrackSimHit &h, const std::vector< Identifier > &rdoList, std::unique_ptr< InDet::SCT_Cluster > &) const override final
Definition: FPGAClusterConverter.cxx:439
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
parseMapping.v0
def v0
Definition: parseMapping.py:149
SCT_CalibAlgs::firstStrip
@ firstStrip
Definition: SCT_CalibNumbers.h:10
xAOD::PixelCluster
PixelCluster_v1 PixelCluster
Define the version of the pixel cluster class.
Definition: Event/xAOD/xAODInDetMeasurement/xAODInDetMeasurement/PixelCluster.h:13
InDetDD::Annulus
@ Annulus
Definition: DetectorDesign.h:42
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
FPGAClusterConverter::createSP
virtual StatusCode createSP(const FPGATrackSimCluster &cl, xAOD::SpacePoint &sp, xAOD::StripClusterContainer &clustersCont) const override final
Definition: FPGAClusterConverter.cxx:688
SCT_ID::row
int row(const Identifier &id) const
Definition: SCT_ID.h:758
InDetDD::StripStereoAnnulusDesign
Definition: StripStereoAnnulusDesign.h:50
xAOD::SpacePoint_v1::setSpacePoint
void setSpacePoint(DetectorIDHashType idHash, const Eigen::Matrix< float, 3, 1 > &globPos, float cov_r, float cov_z, std::vector< const xAOD::UncalibratedMeasurement * > &&measurementIndexes)
Definition: SpacePoint_v1.cxx:123
FPGAClusterConverter::getRdoList
virtual StatusCode getRdoList(std::vector< Identifier > &rdoList, const FPGATrackSimCluster &cluster) const override final
Definition: FPGAClusterConverter.cxx:768
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
FPGATrackSimHit::getY
float getY() const
Definition: FPGATrackSimHit.h:150
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
FPGATrackSimHit::getIdentifierHash
unsigned getIdentifierHash() const
Definition: FPGATrackSimHit.h:81
DataVector::back
const T * back() const
Access the last element in the collection as an rvalue.
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
FPGATrackSimHit::isPixel
bool isPixel() const
Definition: FPGATrackSimHit.h:64
FPGATrackSimHit::getZ
float getZ() const
Definition: FPGATrackSimHit.h:151
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
InDetDD::SiDetectorElement::endsOfStrip
std::pair< Amg::Vector3D, Amg::Vector3D > endsOfStrip(const Amg::Vector2D &position) const
Special method for SCT to retrieve the two ends of a "strip" Returned coordinates are in global frame...
Definition: SiDetectorElement.cxx:339
FPGAClusterConverter::createPixelCluster
virtual StatusCode createPixelCluster(const FPGATrackSimHit &h, const std::vector< Identifier > &rdoList, std::unique_ptr< InDet::PixelCluster > &) const override final
Definition: FPGAClusterConverter.cxx:250
FPGATrackSimCluster::getClusterEquiv
FPGATrackSimHit const & getClusterEquiv() const
Definition: FPGATrackSimCluster.h:31
InDetDD::StripStereoAnnulusDesign::phiPitchPhi
double phiPitchPhi(const SiLocalPosition &localPosition) const
Definition: StripStereoAnnulusDesign.h:291
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
InDetDD::SiDetectorElement::isBarrel
bool isBarrel() const
FPGAClusterConverter::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: FPGAClusterConverter.h:85
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
InDetDD::SiCellId
Definition: SiCellId.h:29
eflowRec::phiIndex
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
Definition: EtaPhiLUT.cxx:23
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
InDetDD::SolidStateDetectorElementBase::rawLocalPositionOfCell
Amg::Vector2D rawLocalPositionOfCell(const SiCellId &cellId) const
Returns position (center) of cell.
Definition: SolidStateDetectorElementBase.cxx:230
InDet::BeamSpotData
Definition: BeamSpotData.h:21
xAOD::PixelCluster_v1
Definition: PixelCluster_v1.h:17
h
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:108
InDetDD::SCT_ModuleSideDesign::strip1Dim
virtual int strip1Dim(int strip, int row) const override
only relevant for SCT.
Definition: SCT_ModuleSideDesign.h:279
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
SCT_ID::strip
int strip(const Identifier &id) const
Definition: SCT_ID.h:764
InDetDD::SolidStateDetectorElementBase::globalPosition
HepGeom::Point3D< double > globalPosition(const HepGeom::Point3D< double > &localPos) const
transform a reconstruction local position into a global position (inline):
DataVector::pop_back
void pop_back()
Remove the last element from the collection.
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:428
InDetDD::SiDetectorElement::sinStereoLocal
double sinStereoLocal(const Amg::Vector2D &localPos) const
Angle of strip in local frame with respect to the etaAxis.
Definition: SiDetectorElement.cxx:288
SCT_CalibAlgs::lastStrip
@ lastStrip
Definition: SCT_CalibNumbers.h:10
xAOD::phiWidth
phiWidth
Definition: RingSetConf_v1.cxx:612
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
InDet::SiWidth
Definition: SiWidth.h:25
python.BuildSignatureFlags.beamSpot
AthConfigFlags beamSpot(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:475
InDetDD::PixelDetectorManager::getDetectorElement
virtual const SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements : via Identifier
Definition: PixelDetectorManager.cxx:80
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
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:198
InDetDD::SiDetectorElement::design
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
InDetDD::StripStereoAnnulusDesign::localPositionOfCellPC
SiLocalPosition localPositionOfCellPC(const SiCellId &cellId) const
This is for debugging only.
Definition: StripStereoAnnulusDesign.cxx:428
InDetDD::SCT_ModuleSideDesign::endsOfStrip
virtual std::pair< SiLocalPosition, SiLocalPosition > endsOfStrip(const SiLocalPosition &position) const override=0
give the ends of strips
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:25
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
FPGAClusterConverter::createPixelSPs
virtual StatusCode createPixelSPs(xAOD::SpacePointContainer &pixelSPs, xAOD::PixelClusterContainer &clustersCont) const override final
Definition: FPGAClusterConverter.cxx:661
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
InDetDD::Trapezoid
@ Trapezoid
Definition: DetectorDesign.h:42
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
Identifier
Definition: IdentifierFieldParser.cxx:14