ATLAS Offline Software
FPGAClusterConverter.cxx
Go to the documentation of this file.
1 
2 // Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 
4 #include "FPGAClusterConverter.h"
5 
10 
13 
17 
19 
20 FPGAClusterConverter::FPGAClusterConverter(const std::string& type, const std::string& name, const IInterface* parent):
21  base_class(type, name, parent) {}
22 
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"));
32  ATH_CHECK(m_lorentzAngleTool.retrieve());
33 
36 
37  return StatusCode::SUCCESS;
38 
39 }
40 
41 // Functions converting collections of FPGATrackSim Hits or Clusters into InDet or xAOD cluster collections / containers
42 
43 StatusCode FPGAClusterConverter::convertHits(const std::vector<FPGATrackSimHit>& hits,
45  InDet::SCT_ClusterCollection& SCTColl) const {
46  ATH_MSG_DEBUG("Found " << hits.size() << " FPGATrackSimHits [InDet]");
47  // reserve some memory
48  pixelColl.reserve(hits.size());
49  SCTColl.reserve(hits.size());
50  for(const FPGATrackSimHit& h : hits) {
51 
52  std::vector<Identifier> rdoList;
53  ATH_CHECK(getRdoList(rdoList, h));
54 
55  std::unique_ptr<InDet::PixelCluster> pixelCl{};
56  std::unique_ptr<InDet::SCT_Cluster> SCTCl{};
57 
58  if (h.isPixel()) {
59  ATH_CHECK(createPixelCluster(h, rdoList, pixelCl));
60  if (pixelCl) pixelColl.push_back(std::move(pixelCl));
61  }
62  if (h.isStrip()) {
63  ATH_CHECK(createSCTCluster(h, rdoList, SCTCl));
64  if (SCTCl) SCTColl.push_back(std::move(SCTCl));
65  }
66  }
67 
68  ATH_MSG_DEBUG("pixelColl size: " << pixelColl.size() << " SCTColl size: " << SCTColl.size() );
69 
70  return StatusCode::SUCCESS;
71 }
72 
73 // To be used in Track conversion
74 StatusCode FPGAClusterConverter::convertHits(const std::vector<const FPGATrackSimHit*>& hits,
76  InDet::SCT_ClusterCollection& SCTColl) const {
77  ATH_MSG_DEBUG("Found " << hits.size() << " FPGATrackSimHits [InDet]");
78 
79  // *** Match FPGATrackSimHit to FPGATrackSimCluster
81  if (!FPGAClustersHandle.isValid()) {
82  ATH_MSG_FATAL("Failed to retrieve FPGATrackSimClusterCollection");
83  return StatusCode::FAILURE;
84  }
85  const FPGATrackSimClusterCollection *FPGAClusterColl = FPGAClustersHandle.cptr();
86 
87  for(const FPGATrackSimHit *h : hits){
88  IdentifierHash hash = h->getIdentifierHash();
90  for (const FPGATrackSimCluster& cluster: *FPGAClusterColl){
91  FPGATrackSimHit clusterEq = cluster.getClusterEquiv();
92  if (hash == clusterEq.getIdentifierHash()) {
93  cl = cluster;
94  break;
95  }
96  }
97  FPGATrackSimHit clEq = cl.getClusterEquiv();
98 
99  // --- DEBUG
100  ATH_MSG_DEBUG("Hit identifier " << h->getIdentifierHash());
101  ATH_MSG_DEBUG("Cluster identifier " << clEq.getIdentifierHash());
102  // ---
103 
104  // *** FPGATrackSimCluster matched
105 
106  std::vector<Identifier> rdoList;
107  ATH_CHECK(getRdoList(rdoList,cl));
108 
109  std::unique_ptr<InDet::PixelCluster> pixelCl{};
110  std::unique_ptr<InDet::SCT_Cluster> SCTCl{};
111 
112  if (clEq.isPixel()) {
113  ATH_CHECK(createPixelCluster(clEq, rdoList, pixelCl));
114  if (pixelCl) pixelColl.push_back(std::move(pixelCl));
115  }
116  if (clEq.isStrip()) {
117  ATH_CHECK(createSCTCluster(clEq, rdoList, SCTCl));
118  if (SCTCl) SCTColl.push_back(std::move(SCTCl));
119  }
120 
121  }
122 
123  ATH_MSG_DEBUG("pixelColl size: " << pixelColl.size() << " SCTColl size: " << SCTColl.size());
124 
125  return StatusCode::SUCCESS;
126 
127 }
128 
129 
130 StatusCode FPGAClusterConverter::convertHits(const std::vector<FPGATrackSimHit>& hits,
131  xAOD::PixelClusterContainer& pixelCont,
132  xAOD::StripClusterContainer& SCTCont) const {
133  ATH_MSG_DEBUG("Found " << hits.size() << " FPGATrackSimHits [xAOD]");
134  // reserve some memory
135  pixelCont.reserve(hits.size());
136  SCTCont.reserve(hits.size());
137  for(const FPGATrackSimHit& h : hits) {
138 
139  std::vector<Identifier> rdoList;
140  ATH_CHECK(getRdoList(rdoList, h));
141 
142  if (h.isPixel()) {
143  xAOD::PixelCluster *xaod_pcl = new xAOD::PixelCluster();
144  pixelCont.push_back(xaod_pcl);
145  ATH_CHECK(createPixelCluster(h, rdoList, *xaod_pcl));
146  }
147  if (h.isStrip()) {
148  xAOD::StripCluster *xaod_scl = new xAOD::StripCluster();
149  SCTCont.push_back(xaod_scl);
150  ATH_CHECK(createSCTCluster(h, rdoList, *xaod_scl));
151  }
152  }
153 
154  ATH_MSG_DEBUG("xAOD pixelCont size: " << pixelCont.size() << " xAOD pixelCont size: " << SCTCont.size());
155 
156  return StatusCode::SUCCESS;
157 }
158 
159 
160 
161 StatusCode FPGAClusterConverter::convertClusters(const std::vector<FPGATrackSimCluster>& clusters,
163  InDet::SCT_ClusterCollection& SCTColl) const {
164  ATH_MSG_DEBUG("Found " << clusters.size() << " FPGATrackSimClusters [InDet]");
165  // reserve some memory
166  pixelColl.reserve(clusters.size());
167  SCTColl.reserve(clusters.size());
168  for(const FPGATrackSimCluster& cl : clusters) {
169 
170  FPGATrackSimHit clEq = cl.getClusterEquiv();
171  std::vector<Identifier> rdoList;
172  ATH_CHECK(getRdoList(rdoList, cl));
173 
174  std::unique_ptr<InDet::PixelCluster> pixelCl{};
175  std::unique_ptr<InDet::SCT_Cluster> SCTCl{};
176 
177  if (clEq.isPixel()) {
178  ATH_CHECK(createPixelCluster(clEq, rdoList, pixelCl));
179  if (pixelCl) pixelColl.push_back(std::move(pixelCl));
180  }
181  if (clEq.isStrip()) {
182  ATH_CHECK(createSCTCluster(clEq, rdoList, SCTCl));
183  if (SCTCl) SCTColl.push_back(std::move(SCTCl));
184  }
185  }
186 
187  ATH_MSG_DEBUG("pixelColl size: " << pixelColl.size() << " SCTColl size: " << SCTColl.size());
188 
189  return StatusCode::SUCCESS;
190 }
191 
192 StatusCode FPGAClusterConverter::convertClusters(const std::vector<FPGATrackSimCluster>& clusters,
193  xAOD::PixelClusterContainer& pixelCont,
194  xAOD::StripClusterContainer& SCTCont) const {
195  ATH_MSG_DEBUG("Found " << clusters.size() << " FPGATrackSimClusters [xAOD]");
196  // reserve some memory
197  pixelCont.reserve(clusters.size());
198  SCTCont.reserve(clusters.size());
199 
200  for(const FPGATrackSimCluster& cl : clusters) {
201 
202  FPGATrackSimHit clEq = cl.getClusterEquiv();
203 
204  std::vector<Identifier> rdoList;
205  ATH_CHECK(getRdoList(rdoList, cl));
206 
207  if (clEq.isPixel()) {
208  xAOD::PixelCluster *xaod_pcl = new xAOD::PixelCluster();
209  pixelCont.push_back(xaod_pcl);
210  ATH_CHECK(createPixelCluster(clEq, rdoList, *xaod_pcl));
211  }
212  if (clEq.isStrip()) {
213  xAOD::StripCluster *xaod_scl = new xAOD::StripCluster();
214  SCTCont.push_back(xaod_scl);
215  ATH_CHECK(createSCTCluster(clEq, rdoList, *xaod_scl));
216  }
217  }
218 
219  ATH_MSG_DEBUG("xAOD pixelCont size: " << pixelCont.size() << " xAOD SCTCont size: " << SCTCont.size());
220 
221  return StatusCode::SUCCESS;
222 }
223 
224 StatusCode FPGAClusterConverter::convertSpacePoints(const std::vector<FPGATrackSimCluster>& fpgaSPs,
225  const std::vector<FPGATrackSimCluster>& fpgaClusters,
226  xAOD::SpacePointContainer& SPStripCont,
227  xAOD::SpacePointContainer& SPPixelCont,
228  xAOD::StripClusterContainer& stripClusterCont,
229  xAOD::PixelClusterContainer& pixelClusterCont) const {
230 
231 
232  for(const FPGATrackSimCluster& cl : fpgaSPs) {
233  FPGATrackSimHit clEq = cl.getClusterEquiv();
234  xAOD::SpacePoint *xaod_sp = new xAOD::SpacePoint();
235  SPStripCont.push_back(xaod_sp);
236  ATH_CHECK(createSP(cl, *xaod_sp, stripClusterCont));
237  }
238 
239  for(const FPGATrackSimCluster& cl : fpgaClusters) {
240  FPGATrackSimHit clEq = cl.getClusterEquiv();
241  if ( clEq.isPixel()) {
242  xAOD::SpacePoint *xaod_sp = new xAOD::SpacePoint();
243  SPPixelCont.push_back(xaod_sp);
244  ATH_CHECK(createSP(cl, *xaod_sp, pixelClusterCont));
245  }
246  }
247  return StatusCode::SUCCESS;
248 }
249 
250 StatusCode FPGAClusterConverter::createPixelCluster(const FPGATrackSimHit& h, const std::vector<Identifier>& rdoList, std::unique_ptr<InDet::PixelCluster>& cl) const {
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_lorentzAngleTool->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  cov(0,0) = siWidth.phiR()*siWidth.phiR()/12;
309  cov(1,1) = siWidth.z()*siWidth.z()/12;
310  float dummy_omegax = 0.5;
311  float dummy_omegay = 0.5;
312  bool split = false;
313  float splitProb1 = 0;
314  float splitProb2 = 0;
315 
316  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);
317 
318  return StatusCode::SUCCESS;
319 }
320 
321 StatusCode FPGAClusterConverter::createPixelCluster(const FPGATrackSimHit& h,const std::vector<Identifier>& rdoList, xAOD::PixelCluster &cl) const {
322  ATH_MSG_DEBUG("\tCreate xAOD::PixelCluster from FPGATrackSimHit");
323 
324  IdentifierHash hash = h.getIdentifierHash();
325 
326  float etaWidth = h.getEtaWidth();
327  float phiWidth = h.getPhiWidth();
328  int phiIndex = h.getPhiIndex();
329  int etaIndex = h.getEtaIndex();
330 
332 
333  if( !pDE ) {
334  ATH_MSG_ERROR("Detector Element doesn't exist " << hash);
335  return StatusCode::FAILURE;
336  }
337 
338  // *** Get cell from id
339  Identifier wafer_id = m_pixelId->wafer_id(hash);
340  Identifier hit_id = m_pixelId->pixel_id(wafer_id, phiIndex, etaIndex);
342  if(!cell.isValid()) {
343  ATH_MSG_DEBUG("\t\tcell not valid");
344  return StatusCode::FAILURE;
345  }
346  const InDetDD::PixelModuleDesign* design (dynamic_cast<const InDetDD::PixelModuleDesign*>(&pDE->design()));
347 
348  // **** Get InDet::SiWidth
349 
350  int colMin = static_cast<int>(etaIndex-0.5*etaWidth);
351  int colMax = colMin+etaWidth;
352 
353  int rowMin = static_cast<int>(phiIndex-0.5*phiWidth);
354  int rowMax = rowMin+phiWidth;
355 
356  double etaW = design->widthFromColumnRange(colMin, colMax-1);
357  double phiW = design->widthFromRowRange(rowMin, rowMax-1);
358 
359  InDet::SiWidth siWidth(Amg::Vector2D(phiWidth,etaWidth),Amg::Vector2D(phiW,etaW));
360 
361  // **** Get SiLocalPosition from cell id and define Amg::Vector2D position
363  Amg::Vector2D localPos(silPos);
364 
365  //TODO: understand if shift is needed
366 
367  if (m_doShift) {
368  double shift = m_lorentzAngleTool->getLorentzShift(hash,Gaudi::Hive::currentContext());
369  Amg::Vector2D localPosShift(localPos[Trk::locX]+shift,localPos[Trk::locY]);
370  localPos = localPosShift;
371  }
372 
373  ATH_MSG_DEBUG("\t\tLocal position: x=" << localPos.x() << " y=" << localPos.y() );
374 
375  Amg::MatrixX cov(2,2);
376  cov.setZero();
377 
378  cov(0,0) = siWidth.phiR()*siWidth.phiR()/12;
379  cov(1,1) = siWidth.z()*siWidth.z()/12;
380 
381  float omegax = 0.5;
382  float omegay = 0.5;
383  bool split = false;
384  float splitProb1 = 0;
385  float splitProb2 = 0;
386 
387  Eigen::Matrix<float,2,1> localPosition(localPos.x(), localPos.y());
388  Eigen::Matrix<float,2,2> localCovariance;
389  localCovariance.setZero();
390  localCovariance(0, 0) = cov(0, 0);
391  localCovariance(1, 1) = cov(1, 1);
392 
393  Eigen::Matrix<float,3,1> globalPosition(h.getX(),h.getY(),h.getZ());
394  ATH_MSG_DEBUG("\t\tGlobal position: x=" << globalPosition.x() << " y=" << globalPosition.y() << " z=" << globalPosition.z() );
395 
396  cl.setMeasurement<2>(hash, localPosition, localCovariance);
397  cl.setIdentifier( rdoList.front().get_compact() );
398  cl.setRDOlist(rdoList);
399  cl.globalPosition() = globalPosition;
400  cl.setChannelsInPhiEta(siWidth.colRow()[0], siWidth.colRow()[1]);
401  cl.setWidthInEta(static_cast<float>(siWidth.widthPhiRZ()[1]));
402  cl.setOmegas(omegax, omegay);
403  cl.setIsSplit(split);
404  cl.setSplitProbabilities(splitProb1, splitProb2);
405  ATH_MSG_DEBUG("\t\txaod width in eta " << cl.widthInEta());
406 
407  return StatusCode::SUCCESS;
408 }
409 
410 StatusCode FPGAClusterConverter::createSCTCluster(const FPGATrackSimHit& h, const std::vector<Identifier>& rdoList, std::unique_ptr<InDet::SCT_Cluster>& cl) const {
411  ATH_MSG_DEBUG("\t Create InDet::SCTCluster from FPGATrackSimHit ");
412 
413 
414  IdentifierHash hash = h.getIdentifierHash();
415 
416  float phiWidth = h.getPhiWidth();
417  int strip = static_cast<int>(h.getPhiCoord());
418  ATH_CHECK(strip >= 0);
420  ATH_CHECK(pDE != nullptr);
421 
422 
423  Identifier wafer_id = m_SCTId->wafer_id(hash);
424  Identifier strip_id = m_SCTId->strip_id(wafer_id, strip);
426  ATH_MSG_DEBUG("\t\tcell: " << cell);
427  ATH_MSG_DEBUG("\t\tstrip_id " << strip_id);
428  ATH_MSG_DEBUG("\t\tstrip: " << cell);
429  ATH_MSG_DEBUG("\t\tStrip from idHelper: " << m_SCTId->strip(strip_id) );
430 
431  const InDetDD::SCT_ModuleSideDesign* design;
432  if (pDE->isBarrel()){
433  design = (static_cast<const InDetDD::SCT_ModuleSideDesign*>(&pDE->design()));
434  } else{
435  design = (static_cast<const InDetDD::StripStereoAnnulusDesign*>(&pDE->design()));
436  }
437 
438  const int firstStrip = m_SCTId->strip(rdoList.front());
439  const int lastStrip = m_SCTId->strip(rdoList.back());
440  const int row = m_SCTId->row(rdoList.front());
441  const int firstStrip1D = design->strip1Dim (firstStrip, row );
442  const int lastStrip1D = design->strip1Dim( lastStrip, row );
443  const InDetDD::SiCellId cell1(firstStrip1D);
444  const InDetDD::SiCellId cell2(lastStrip1D);
445  const InDetDD::SiLocalPosition firstStripPos( pDE->rawLocalPositionOfCell(cell1 ));
446  const InDetDD::SiLocalPosition lastStripPos( pDE->rawLocalPositionOfCell(cell2) );
447  const InDetDD::SiLocalPosition centre( (firstStripPos+lastStripPos) * 0.5 );
448  const double width = design->stripPitch() * ( lastStrip - firstStrip + 1 );
449 
450  const std::pair<InDetDD::SiLocalPosition, InDetDD::SiLocalPosition> ends( design->endsOfStrip(centre) );
451  const double stripLength( std::abs(ends.first.xEta() - ends.second.xEta()) );
452 
453  InDet::SiWidth siWidth(Amg::Vector2D(phiWidth,1), Amg::Vector2D(width,stripLength) ); //TODO: ok??
454  Amg::Vector2D localPos(centre.xPhi(), centre.xEta());
455 
456  ATH_MSG_DEBUG("\t\tcentre eta: " << centre.xEta() << " phi: " << centre.xPhi());
457  ATH_MSG_DEBUG("\t\tStrip length: " << stripLength );
458  ATH_MSG_DEBUG("\t\tlocal position before shift: " << localPos.x() << " phi: " << localPos.y());
459  if (m_doShift) {
460  double shift = m_lorentzAngleTool->getLorentzShift(hash,Gaudi::Hive::currentContext());
461  Amg::Vector2D localPosShift(localPos[Trk::locX]+shift,localPos[Trk::locY]);
462  localPos = localPosShift;
463  }
464 
465  Amg::Vector3D globalPos = pDE->globalPosition(localPos);
466  ATH_MSG_DEBUG("\t\tLocal position: x=" << localPos.x() << " y=" << localPos.y() );
467  ATH_MSG_DEBUG("\t\tGlobal position: x=" << globalPos.x() << " y=" << globalPos.y() << " z=" << globalPos.z() );
468 
469  // Fill cov matrix. TODO: compare with https://gitlab.cern.ch/atlas/athena/-/blob/main/InnerDetector/InDetRecTools/SiClusterizationTool/src/ClusterMakerTool.cxx and xAOD function
470  const double col_x = siWidth.colRow().x();
471  const double col_y = siWidth.colRow().y();
472 
473  double scale_factor = 1.;
474  if ( std::abs(col_x-1) < std::numeric_limits<double>::epsilon() )
475  scale_factor = 1.05;
476  else if ( std::abs(col_x-2) < std::numeric_limits<double>::epsilon() )
477  scale_factor = 0.27;
478 
479  auto cov = Amg::MatrixX(2,2);
480  cov.setIdentity();
481  cov.fillSymmetric(0, 0, scale_factor * scale_factor * siWidth.phiR() * siWidth.phiR() * (1./12.));
482  cov.fillSymmetric(1, 1, siWidth.z() * siWidth.z() / col_y / col_y * (1./12.));
483 
484  // rotation for endcap SCT
485  if(pDE->design().shape() == InDetDD::Trapezoid || pDE->design().shape() == InDetDD::Annulus) {
486  double sn = pDE->sinStereoLocal(localPos);
487  double sn2 = sn*sn;
488  double cs2 = 1.-sn2;
489  double w = pDE->phiPitch(localPos)/pDE->phiPitch();
490  double v0 = (cov)(0,0)*w*w;
491  double v1 = (cov)(1,1);
492  cov.fillSymmetric( 0, 0, cs2 * v0 + sn2 * v1 );
493  cov.fillSymmetric( 0, 1, sn * std::sqrt(cs2) * (v0 - v1) );
494  cov.fillSymmetric( 1, 1, sn2 * v0 + cs2 * v1 );
495  }
496 
497  cl = std::make_unique<InDet::SCT_Cluster>(strip_id, localPos, std::vector<Identifier>(rdoList), siWidth, pDE, Amg::MatrixX(cov));
498 
499  return StatusCode::SUCCESS;
500 }
501 
502 StatusCode FPGAClusterConverter::createSCTCluster(const FPGATrackSimHit& h, const std::vector<Identifier>& rdoList, xAOD::StripCluster& cl) const {
503  ATH_MSG_DEBUG("\t Create xAOD::StripCluster from FPGATrackSimHit ");
504  //https://gitlab.cern.ch/atlas/athena/-/blob/main/InnerDetector/InDetRecTools/SiClusterizationTool/src/SCT_ClusteringTool.cxx
505 
506  IdentifierHash hash = h.getIdentifierHash();
507 
508  float phiWidth = h.getPhiWidth();
509  int strip = static_cast<int>(h.getPhiCoord());
510  ATH_CHECK(strip >= 0);
512  ATH_CHECK(pDE != nullptr);
513 
514  Identifier wafer_id = m_SCTId->wafer_id(hash);
515  Identifier strip_id = m_SCTId->strip_id(wafer_id, strip);
517  ATH_MSG_DEBUG("\t\tcell: " << cell);
518  ATH_MSG_DEBUG("\t\tstrip_id " << strip_id);
519  ATH_MSG_DEBUG("\t\tstrip: " << cell);
520  ATH_MSG_DEBUG("\t\tStrip from idHelper: " << m_SCTId->strip(strip_id) );
521 
522  const InDetDD::SCT_ModuleSideDesign* design;
523  if (pDE->isBarrel()){
524  design = (static_cast<const InDetDD::SCT_ModuleSideDesign*>(&pDE->design()));
525  } else{
526  design = (static_cast<const InDetDD::StripStereoAnnulusDesign*>(&pDE->design()));
527  }
528 
529  const int firstStrip = m_SCTId->strip(rdoList.front());
530  const int lastStrip = m_SCTId->strip(rdoList.back());
531  const int row = m_SCTId->row(rdoList.front());
532  const int firstStrip1D = design->strip1Dim (firstStrip, row );
533  const int lastStrip1D = design->strip1Dim( lastStrip, row );
534  const InDetDD::SiCellId cell1(firstStrip1D);
535  const InDetDD::SiCellId cell2(lastStrip1D);
536  const InDetDD::SiLocalPosition firstStripPos( pDE->rawLocalPositionOfCell(cell1 ));
537  const InDetDD::SiLocalPosition lastStripPos( pDE->rawLocalPositionOfCell(cell2) );
538  const InDetDD::SiLocalPosition centre( (firstStripPos+lastStripPos) * 0.5 );
539  const double width = design->stripPitch() * ( lastStrip - firstStrip + 1 );
540 
541  const std::pair<InDetDD::SiLocalPosition, InDetDD::SiLocalPosition> ends( design->endsOfStrip(centre) );
542  const double stripLength( std::abs(ends.first.xEta() - ends.second.xEta()) );
543 
544  InDet::SiWidth siWidth(Amg::Vector2D(phiWidth,1), Amg::Vector2D(width,stripLength) ); //TODO: ok??
545  Amg::Vector2D localPos(centre.xPhi(), centre.xEta());
546  ATH_MSG_DEBUG("\t\tcentre eta: " << centre.xEta() << " phi: " << centre.xPhi());
547  ATH_MSG_DEBUG("\t\tStrip length: " << stripLength );
548  ATH_MSG_DEBUG("\t\tlocal position before shift: " << localPos.x() << " phi: " << localPos.y());
549 
550  if (m_doShift) {
551  double shift = m_lorentzAngleTool->getLorentzShift(hash,Gaudi::Hive::currentContext());
552  Amg::Vector2D localPosShift(localPos[Trk::locX]+shift,localPos[Trk::locY]);
553  localPos = localPosShift;
554  }
555 
556  ATH_MSG_DEBUG("\t\tLocal position: x=" << localPos.x() << " y=" << localPos.y() );
557 
558  /* TODO */
559  Eigen::Matrix<float,1,1> localPosition;
560  Eigen::Matrix<float,1,1> localCovariance;
561  localCovariance.setZero();
562 
563  if (pDE->isBarrel()) {
564  localPosition(0, 0) = localPos.x();
565  localCovariance(0, 0) = pDE->phiPitch() * pDE->phiPitch() * (1./12.);
566  } else {
567  InDetDD::SiCellId cellId = pDE->cellIdOfPosition(localPos);
568  const InDetDD::StripStereoAnnulusDesign *designNew = dynamic_cast<const InDetDD::StripStereoAnnulusDesign *>(&pDE->design());
569  if ( designNew == nullptr ) return StatusCode::FAILURE;
570  InDetDD::SiLocalPosition localInPolar = designNew->localPositionOfCellPC(cellId);
571  localPosition(0, 0) = localInPolar.xPhi();
572  localCovariance(0, 0) = designNew->phiPitchPhi() * designNew->phiPitchPhi() * (1./12.);
573  }
574 
575  Eigen::Matrix<float,3,1> globalPosition(h.getX(),h.getY(),h.getZ());
576  ATH_MSG_DEBUG("\t\tGlobal position: x=" << globalPosition.x() << " y=" << globalPosition.y() << " z=" << globalPosition.z() );
577 
578  cl.setMeasurement<1>(hash, localPosition, localCovariance);
579  cl.setIdentifier( rdoList.front().get_compact() );
580  cl.setRDOlist(rdoList);
581  cl.globalPosition() = globalPosition;
582  cl.setChannelsInPhi(siWidth.colRow()[0]);
583 
584  return StatusCode::SUCCESS;
585 }
586 
587 StatusCode FPGAClusterConverter::createPixelCluster(const FPGATrackSimCluster& cluster, std::unique_ptr<InDet::PixelCluster>& cl) const {
588  ATH_MSG_DEBUG("\t Create InDet::PixelCluster from FPGATrackSimCluster");
589  FPGATrackSimHit clEq = cluster.getClusterEquiv();
590  std::vector<Identifier> rdoList;
591  ATH_CHECK(getRdoList(rdoList, cluster));
592  ATH_CHECK(createPixelCluster(clEq, rdoList, cl));
593  return StatusCode::SUCCESS;
594 }
595 
597  ATH_MSG_DEBUG("\t Create xAOD::PixelCluster from FPGATrackSimCluster");
598  FPGATrackSimHit clEq = cluster.getClusterEquiv();
599  std::vector<Identifier> rdoList;
600  ATH_CHECK(getRdoList(rdoList, cluster));
601  ATH_CHECK(createPixelCluster(clEq, rdoList, cl));
602  return StatusCode::SUCCESS;
603 }
604 
605 StatusCode FPGAClusterConverter::createSCTCluster(const FPGATrackSimCluster& cluster, std::unique_ptr<InDet::SCT_Cluster>& cl) const {
606  ATH_MSG_DEBUG("\t Create InDet::SCT_Cluster from FPGATrackSimCluster");
607  FPGATrackSimHit clEq = cluster.getClusterEquiv();
608  std::vector<Identifier> rdoList;
609  ATH_CHECK(getRdoList(rdoList, cluster));
610  ATH_CHECK(createSCTCluster(clEq, rdoList,cl));
611  return StatusCode::SUCCESS;
612 }
613 
615  ATH_MSG_DEBUG("\t Create xAOD::StripCluster from FPGATrackSimCluster");
616  FPGATrackSimHit clEq = cluster.getClusterEquiv();
617  std::vector<Identifier> rdoList;
618  ATH_CHECK(getRdoList(rdoList, cluster));
619  ATH_CHECK(createSCTCluster(clEq, rdoList, cl));
620  return StatusCode::SUCCESS;
621 }
622 
624 
625  FPGATrackSimHit clEq = cl.getClusterEquiv();
626  std::vector<Identifier> rdoList;
627  ATH_CHECK(getRdoList(rdoList, cl));
628 
629  //Get xAOD::PixelCluster from FPGA cluster
630  std::unique_ptr<xAOD::PixelClusterContainer> clusterCont = std::make_unique<xAOD::PixelClusterContainer>();
631  std::unique_ptr<xAOD::PixelClusterAuxContainer> clusterAuxCont = std::make_unique<xAOD::PixelClusterAuxContainer>();
632  clusterCont->setStore(clusterAuxCont.get() );
633 
634  xAOD::PixelCluster *xaod_pcl = new xAOD::PixelCluster();
635  clusterCont->push_back(xaod_pcl);
636  ATH_CHECK(createPixelCluster(clEq, rdoList, *xaod_pcl));
637 
638  // Global position and covariance
639 
640  Eigen::Matrix<float,3,1> globalPos(clEq.getX(),clEq.getY(),clEq.getZ());
641 
642  // Covariance (to be cross-checked)
643  float cov_r = xaod_pcl->localCovariance<2>()(0,0);
644  float cov_z = xaod_pcl->localCovariance<2>()(1,0);
645 
646  // idHash and measurements
647  unsigned int idHash = clEq.getIdentifierHash();
648  std::vector< const xAOD::UncalibratedMeasurement* > measurements;
649 
650  for (auto orig_cl : clustersCont) {
651  if (clEq.getIdentifierHash()==orig_cl->identifierHash()) measurements.push_back(orig_cl);
652  }
653 
654  // Fill xAOD::SpacePoint
655  sp.setSpacePoint(
656  idHash,
657  globalPos,
658  cov_r,
659  cov_z,
660  measurements
661  );
662 
663 
664 
665  return StatusCode::SUCCESS;
666 }
667 
668 
670 
672  const InDet::BeamSpotData* beamSpot = *beamSpotHandle;
673  Amg::Vector3D vertex = beamSpot->beamVtx().position();
674 
675  FPGATrackSimHit clEq = cl.getClusterEquiv();
676 
678  std::vector<Identifier> rdoList;
679  ATH_CHECK(getRdoList(rdoList, cl));
680 
681  // **** Get global SpacePoint infos ****
682 
683  //Get xAOD::StripCluster from FPGA SP
684  std::unique_ptr<xAOD::StripClusterContainer> clusterCont = std::make_unique<xAOD::StripClusterContainer>();
685  std::unique_ptr<xAOD::StripClusterAuxContainer> clusterAuxCont = std::make_unique<xAOD::StripClusterAuxContainer>();
686  clusterCont->setStore(clusterAuxCont.get() );
687 
688  xAOD::StripCluster *xaod_scl = new xAOD::StripCluster();
689  clusterCont->push_back(xaod_scl);
690  ATH_CHECK(createSCTCluster(clEq, rdoList, *xaod_scl));
691 
692  // Global position and covariance
693 
694  Eigen::Matrix<float,3,1> globalPos(clEq.getX(),clEq.getY(),clEq.getZ());
695 
696  // Covariance
697  // TODO: update to ITk? Can it be done as for pixel? (L728-729)?
698  // Lines taken from SCT_SpacePoint::setupLocalCovarianceSCT()
699  float deltaY = 0.0004; // roughly pitch of SCT (80 mu) / sqrt(12)
700  float covTerm = 1600.*deltaY;
701  Eigen::Matrix<float, 2, 1> variance(0.1, 8.*covTerm);
703  // Swap r/z covariance terms for endcap clusters
704  if ( element->isEndcap() )
705  std::swap( variance(0, 0), variance(1, 0) );
706  float cov_r = variance(0,0);
707  float cov_z = variance(1,0);
708 
709  // ***** Get Strips related infos *****
710 
711  // idHashes and measurements
712  std::vector<unsigned int> idHashList;
713  std::vector<const xAOD::UncalibratedMeasurement_v1*> measurements;
714 
715  //Get measurements
716 
717  float topHalfStripLength, bottomHalfStripLength;
718  Amg::Vector3D topStripDirection;
719  Amg::Vector3D bottomStripDirection;
720  Amg::Vector3D stripCenter1;
721  Amg::Vector3D stripCenter2;
722  int index = 0;
723  for (const FPGATrackSimHit& h : cl.getHitList()) {
724  idHashList.push_back(h.getIdentifierHash());
725  for (auto orig_cl : clustersCont) {
726  if (h.getIdentifierHash()==orig_cl->identifierHash()) {
727  if (index == 0) {ATH_CHECK(getStripsInfo(*orig_cl, topHalfStripLength, topStripDirection, stripCenter1));}
728  if (index == 1) {ATH_CHECK(getStripsInfo(*orig_cl, bottomHalfStripLength, bottomStripDirection, stripCenter2));}
729  measurements.push_back(orig_cl);
730  index++;
731  }
732  }
733  }
734 
735  Amg::Vector3D topTrajDir = 2. * ( stripCenter1 - vertex);
736  Amg::Vector3D topStripCenter = 0.5 * topTrajDir;
737  Amg::Vector3D stripCenterDistance = stripCenter1 - stripCenter2;
738 
739  ATH_MSG_DEBUG("topHalfStripLength = " << topHalfStripLength << " bottomHalfStripLength = " << bottomHalfStripLength);
740  ATH_MSG_DEBUG("topStripDirection = (" << topStripDirection.x() <<", " << topStripDirection.y() <<", " << topStripDirection.z() <<") " << "bottomStripDirection = (" << bottomStripDirection.x() <<", " << bottomStripDirection.y() <<", " << bottomStripDirection.z() <<") " );
741  ATH_MSG_DEBUG("stripCenterDistance = (" << stripCenterDistance.x() <<", " << stripCenterDistance.y() <<", " << stripCenterDistance.z() << ")" );
742  ATH_MSG_DEBUG("topStripCenter = (" << topStripCenter.x() <<", " << topStripCenter.y() <<", " << topStripCenter.z() << ")" );
743 
744  // Fill xAOD::SpacePoint
745  sp.setSpacePoint(
746  idHashList,
747  globalPos,
748  cov_r,
749  cov_z,
750  measurements,
751  topHalfStripLength,
752  bottomHalfStripLength,
753  topStripDirection.cast<float>(),
754  bottomStripDirection.cast<float>(),
755  stripCenterDistance.cast<float>(),
756  topStripCenter.cast<float>()
757  );
758 
759 
760 
761  return StatusCode::SUCCESS;
762 
763 }
764 
765 StatusCode FPGAClusterConverter::getRdoList(std::vector<Identifier> &rdoList, const FPGATrackSimCluster& cluster) const {
766 
767  std::vector<FPGATrackSimHit> hits = cluster.getHitList();
768 
769  for (const FPGATrackSimHit& h : hits) {
770  IdentifierHash hash = h.getIdentifierHash();
771  int phiIndex = h.getPhiIndex();
772  int etaIndex = h.getEtaIndex();
773 
774  if (h.isPixel()) {
775  Identifier wafer_id_hit = m_pixelId->wafer_id(hash);
776  Identifier hit_id = m_pixelId->pixel_id(wafer_id_hit, phiIndex, etaIndex);
777  rdoList.push_back(hit_id);
778  }
779  if (h.isStrip()) {
780  Identifier wafer_id_hit = m_SCTId->wafer_id(hash);
781  Identifier hit_id = m_SCTId->strip_id(wafer_id_hit, int(phiIndex));
782  rdoList.push_back(hit_id);
783  }
784  }
785 
786  return StatusCode::SUCCESS;
787 
788 }
789 
790 
791 StatusCode FPGAClusterConverter::getRdoList(std::vector<Identifier> &rdoList, const FPGATrackSimHit& h) const {
792 
793  IdentifierHash hash = h.getIdentifierHash();
794  int phiIndex = h.getPhiIndex();
795  int etaIndex = h.getEtaIndex();
796 
797  if (h.isPixel()) {
798  Identifier wafer_id_hit = m_pixelId->wafer_id(hash);
799  Identifier hit_id = m_pixelId->pixel_id(wafer_id_hit, phiIndex, etaIndex);
800  rdoList.push_back(hit_id);
801  }
802  if (h.isStrip()) {
803  Identifier wafer_id_hit = m_SCTId->wafer_id(hash);
804  Identifier hit_id = m_SCTId->strip_id(wafer_id_hit, int(phiIndex));
805  rdoList.push_back(hit_id);
806  }
807 
808  return StatusCode::SUCCESS;
809 }
810 
811 StatusCode FPGAClusterConverter::getStripsInfo(const xAOD::StripCluster& cl, float& halfStripLength, Amg::Vector3D& stripDirection, Amg::Vector3D& stripCenter) const {
812 
813  const int strip = m_SCTId->strip(cl.rdoList().front());
814  IdentifierHash hash = cl.identifierHash();
815 
817 
818  Identifier wafer_id = m_SCTId->wafer_id(hash);
819  Identifier strip_id = m_SCTId->strip_id(wafer_id, strip);
821 
822  const InDetDD::SiLocalPosition localPos( pDE->rawLocalPositionOfCell(cell ));
823  std::pair<Amg::Vector3D, Amg::Vector3D> end = (pDE->endsOfStrip(localPos));
824  stripCenter = 0.5 * (end.first + end.second);
825  Amg::Vector3D stripDir = end.first - end.second;
826 
827  halfStripLength = 0.5 * stripDir.norm();
828  stripDirection = stripDir / (2. * (halfStripLength));
829 
830  return StatusCode::SUCCESS;
831 }
832 
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
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
query_example.row
row
Definition: query_example.py:24
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_SCTManager
const InDetDD::SCT_DetectorManager * m_SCTManager
Definition: FPGAClusterConverter.h:95
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
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
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
Trk::locX
@ locX
Definition: ParamDefs.h:37
InDetDD::PixelModuleDesign::widthFromRowRange
double widthFromRowRange(const int rowMin, const int rowMax) const
Method to calculate phi width from a row range.
Definition: PixelModuleDesign.cxx:167
InDetDD::PixelModuleDesign
Definition: PixelModuleDesign.h:48
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:38
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
FPGATrackSimCluster
Definition: FPGATrackSimCluster.h:24
makeComparison.deltaY
int deltaY
Definition: makeComparison.py:44
FPGAClusterConverter::m_lorentzAngleTool
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
Definition: FPGAClusterConverter.h:97
SCT_ModuleSideDesign.h
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
index
Definition: index.py:1
InDetDD::SCT_ModuleSideDesign
Definition: SCT_ModuleSideDesign.h:40
FPGAClusterConverter::m_FPGAClusterKey
SG::ReadHandleKey< FPGATrackSimClusterCollection > m_FPGAClusterKey
Definition: FPGAClusterConverter.h:85
InDet::SiWidth::widthPhiRZ
const Amg::Vector2D & widthPhiRZ() const
Definition: SiWidth.h:121
InDetDD::DetectorDesign::shape
virtual DetectorShape shape() const
Shape of element.
Definition: DetectorDesign.cxx:96
FPGAClusterConverter::convertHits
virtual StatusCode convertHits(const std::vector< FPGATrackSimHit > &, InDet::PixelClusterCollection &, InDet::SCT_ClusterCollection &) const override final
Definition: FPGAClusterConverter.cxx:43
FPGATrackSimHit::getX
float getX() const
Definition: FPGATrackSimHit.h:137
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
xAOD::SpacePoint_v1
Definition: SpacePoint_v1.h:29
xAOD::SpacePoint
SpacePoint_v1 SpacePoint
Definition: Event/xAOD/xAODInDetMeasurement/xAODInDetMeasurement/SpacePoint.h:12
FPGAClusterConverter::convertSpacePoints
virtual StatusCode convertSpacePoints(const std::vector< FPGATrackSimCluster > &fpgaSPs, const std::vector< FPGATrackSimCluster > &fpgaClusters, xAOD::SpacePointContainer &SPStripCont, xAOD::SpacePointContainer &SPPixelCont, xAOD::StripClusterContainer &stripClusterCont, xAOD::PixelClusterContainer &pixelClusterCont) const override final
Definition: FPGAClusterConverter.cxx:224
InDetDD::SCT_DetectorManager::getDetectorElement
virtual SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements via Identifier
Definition: SCT_DetectorManager.cxx:64
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
FPGAClusterConverter::m_pixelManager
const InDetDD::PixelDetectorManager * m_pixelManager
Definition: FPGAClusterConverter.h:94
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
FPGAClusterConverter::getStripsInfo
virtual StatusCode getStripsInfo(const xAOD::StripCluster &cl, float &halfStripLength, Amg::Vector3D &stripDirection, Amg::Vector3D &stripCenter) const override final
Definition: FPGAClusterConverter.cxx:811
FPGATrackSimHit
Definition: FPGATrackSimHit.h:41
FPGAClusterConverter::m_SCTId
const SCT_ID * m_SCTId
Definition: FPGAClusterConverter.h:93
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:92
AtlasDetectorID.h
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
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
SpacePointCollection.h
InDetDD::PixelModuleDesign::widthFromColumnRange
double widthFromColumnRange(const int colMin, const int colMax) const
Method to calculate eta width from a column range.
Definition: PixelModuleDesign.cxx:155
PixelDetectorManager.h
FPGAClusterConverter::FPGAClusterConverter
FPGAClusterConverter(const std::string &type, const std::string &name, const IInterface *)
Definition: FPGAClusterConverter.cxx:20
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:410
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::SiLocalPosition::xEta
double xEta() const
position along eta direction:
Definition: SiLocalPosition.h:118
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
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:623
SCT_ID::row
int row(const Identifier &id) const
Definition: SCT_ID.h:758
InDetDD::StripStereoAnnulusDesign
Definition: StripStereoAnnulusDesign.h:50
FPGAClusterConverter::getRdoList
virtual StatusCode getRdoList(std::vector< Identifier > &rdoList, const FPGATrackSimCluster &cluster) const override final
Definition: FPGAClusterConverter.cxx:765
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:138
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
xAOD::UncalibratedMeasurement_v1::localCovariance
ConstMatrixMap< N > localCovariance() const
Returns the local covariance of the measurement.
xAOD::SpacePoint_v1::setSpacePoint
void setSpacePoint(DetectorIDHashType idHash, const Eigen::Matrix< float, 3, 1 > &globPos, float cov_r, float cov_z, const std::vector< const xAOD::UncalibratedMeasurement * > &measurementIndexes)
Definition: SpacePoint_v1.cxx:103
FPGATrackSimHit::getIdentifierHash
unsigned getIdentifierHash() const
Definition: FPGATrackSimHit.h:81
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
FPGAClusterConverter::convertClusters
virtual StatusCode convertClusters(const std::vector< FPGATrackSimCluster > &, InDet::PixelClusterCollection &, InDet::SCT_ClusterCollection &) const override final
Definition: FPGAClusterConverter.cxx:161
FPGATrackSimHit::isPixel
bool isPixel() const
Definition: FPGATrackSimHit.h:64
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
FPGATrackSimHit::getZ
float getZ() const
Definition: FPGATrackSimHit.h:139
FPGAClusterConverter::m_doShift
bool m_doShift
Definition: FPGAClusterConverter.h:88
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:228
IdentifierHash.h
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:86
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
StripStereoAnnulusDesign.h
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:109
InDetDD::SCT_ModuleSideDesign::strip1Dim
virtual int strip1Dim(int strip, int row) const override
only relevant for SCT.
Definition: SCT_ModuleSideDesign.h:279
SCT_ID::strip
int strip(const Identifier &id) const
Definition: SCT_ID.h:764
PixelModuleDesign.h
InDetDD::SolidStateDetectorElementBase::globalPosition
HepGeom::Point3D< double > globalPosition(const HepGeom::Point3D< double > &localPos) const
transform a reconstruction local position into a global position (inline):
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
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
InDet::SiWidth::colRow
const Amg::Vector2D & colRow() const
Definition: SiWidth.h:115
python.BuildSignatureFlags.beamSpot
AthConfigFlags beamSpot(AthConfigFlags flags, str instanceName, str recoMode)
Definition: BuildSignatureFlags.py:454
InDet::SiWidth::phiR
double phiR() const
Definition: SiWidth.h:126
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
SCT_DetectorManager.h
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:200
InDetDD::SiDetectorElement::design
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
InDet::SCT_ClusterCollection
Trk::PrepRawDataCollection< SCT_Cluster > SCT_ClusterCollection
Definition: SCT_ClusterCollection.h:26
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:26
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
FPGAClusterConverter::initialize
virtual StatusCode initialize() override final
Definition: FPGAClusterConverter.cxx:23
InDet::SiWidth::z
double z() const
Definition: SiWidth.h:131
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
InDet::PixelClusterCollection
Trk::PrepRawDataCollection< PixelCluster > PixelClusterCollection
Definition: PixelClusterCollection.h:26
InDetDD::Trapezoid
@ Trapezoid
Definition: DetectorDesign.h:42
FPGAClusterConverter.h
InDetDD::PixelDetectorManager::getDetectorElement
virtual SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements : via Identifier
Definition: PixelDetectorManager.cxx:80
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