ATLAS Offline Software
Functions
TrackingUtilities Namespace Reference

Functions

StatusCode convertInDetToXaodCluster (const InDet::PixelCluster &indetCluster, const InDetDD::SiDetectorElement &element, xAOD::PixelCluster &xaodCluster)
 
StatusCode convertInDetToXaodCluster (const InDet::SCT_Cluster &indetCluster, const InDetDD::SiDetectorElement &element, xAOD::StripCluster &xaodCluster)
 
StatusCode convertXaodToInDetCluster (const xAOD::PixelCluster &xaodCluster, const InDetDD::SiDetectorElement &element, const PixelID &pixelID, InDet::PixelCluster *&indetCluster)
 
StatusCode convertXaodToInDetCluster (const xAOD::StripCluster &xaodCluster, const InDetDD::SiDetectorElement &element, const SCT_ID &stripID, InDet::SCT_Cluster *&indetCluster, double shift=0.)
 
StatusCode convertInDetToXaodCluster (const HGTD_Cluster &indetCluster, const InDetDD::HGTD_DetectorElement &element, xAOD::HGTDCluster &xaodCluster)
 
StatusCode convertXaodToInDetCluster (const xAOD::HGTDCluster &xaodCluster, const InDetDD::HGTD_DetectorElement &element, ::HGTD_Cluster *&indetCluster)
 
std::pair< xAOD::MeasVector< 1 >, xAOD::MeasMatrix< 1 > > convertSCT_LocalPosCov (const InDet::SCT_Cluster &cluster)
 
std::pair< float, float > computeOmegas (const xAOD::PixelCluster &cluster, const PixelID &pixelID)
 
StatusCode convertTrkToXaodPixelSpacePoint (const InDet::PixelSpacePoint &trkSpacePoint, xAOD::SpacePoint &xaodSpacePoint)
 
StatusCode convertTrkToXaodStripSpacePoint (const InDet::SCT_SpacePoint &trkSpacePoint, const Amg::Vector3D &vertex, xAOD::SpacePoint &xaodSpacePoint)
 

Function Documentation

◆ computeOmegas()

std::pair< float, float > TrackingUtilities::computeOmegas ( const xAOD::PixelCluster cluster,
const PixelID pixelID 
)

Definition at line 9 of file InnerDetector/InDetMeasurementUtilities/src/Helpers.cxx.

11  {
12  const std::vector<Identifier>& rod_list_cluster = cluster.rdoList();
13  const std::vector<float>& charge_list_cluster = cluster.chargeList();
14 
15  if (rod_list_cluster.size() != charge_list_cluster.size()) {
16  return {-1.f, -1.f};
17  }
18 
19  int colmax = std::numeric_limits<int>::min();
20  int rowmax = std::numeric_limits<int>::min();
21  int colmin = std::numeric_limits<int>::max();
22  int rowmin = std::numeric_limits<int>::max();
23 
24  float qRowMin = 0.f;
25  float qRowMax = 0.f;
26  float qColMin = 0.f;
27  float qColMax = 0.f;
28 
29  for (std::size_t i(0); i<rod_list_cluster.size(); ++i) {
30  const Identifier& this_rdo = rod_list_cluster.at(i);
31  const float this_charge = charge_list_cluster.at(i);
32 
33  const int row = pixelID.phi_index(this_rdo);
34  if (row > rowmax) {
35  rowmax = row;
36  qRowMax = this_charge;
37  } else if (row == rowmax) {
38  qRowMax += this_charge;
39  }
40 
41  if (row < rowmin) {
42  rowmin = row;
43  qRowMin = this_charge;
44  } else if (row == rowmin) {
45  qRowMin += this_charge;
46  }
47 
48  const int col = pixelID.eta_index(this_rdo);
49  if (col > colmax) {
50  colmax = col;
51  qColMax = this_charge;
52  } else if (col == colmax) {
53  qColMax += this_charge;
54  }
55 
56  if (col < colmin) {
57  colmin = col;
58  qColMin = this_charge;
59  } else if (col == colmin) {
60  qColMin += this_charge;
61  }
62  } // loop on rdos and charges
63 
64  float omegax = -1.f;
65  float omegay = -1.f;
66  if(qRowMin + qRowMax > 0) omegax = qRowMax/(qRowMin + qRowMax);
67  if(qColMin + qColMax > 0) omegay = qColMax/(qColMin + qColMax);
68 
69  return std::make_pair(omegax, omegay);
70  }

◆ convertInDetToXaodCluster() [1/3]

StatusCode TrackingUtilities::convertInDetToXaodCluster ( const HGTD_Cluster indetCluster,
const InDetDD::HGTD_DetectorElement element,
xAOD::HGTDCluster xaodCluster 
)

Definition at line 21 of file ClusterConversionUtilities.cxx.

24  {
25  IdentifierHash idHash = element.identifyHash();
26 
27  auto localPos = indetCluster.localPosition();
28  auto localCov = indetCluster.localCovariance();
29 
30  const float time = indetCluster.time();
31  const float timeResolution = indetCluster.timeResolution();
32 
33  const auto& RDOs = indetCluster.rdoList();
34  const auto& ToTs = indetCluster.totList();
35 
36  // Time to fill the xaod cluster
37  Eigen::Matrix<float,3,1> localPosition = Eigen::Matrix<float,3,1>::Zero();
38  localPosition(0, 0) = localPos.x();
39  localPosition(1, 0) = localPos.y();
40  localPosition(2, 0) = time;
41 
42  Eigen::Matrix<float,3,3> localCovariance = Eigen::Matrix<float,3,3>::Zero();
43  localCovariance(0, 0) = localCov(0, 0);
44  localCovariance(1, 1) = localCov(1, 1);
45  localCovariance(2, 2) = timeResolution * timeResolution;
46 
47  xaodCluster.setMeasurement<3>(idHash, localPosition, localCovariance);
48  xaodCluster.setIdentifier( indetCluster.identify().get_compact() );
49  xaodCluster.setRDOlist(RDOs);
50  xaodCluster.setToTlist(ToTs);
51 
52  return StatusCode::SUCCESS;
53  }

◆ convertInDetToXaodCluster() [2/3]

StatusCode TrackingUtilities::convertInDetToXaodCluster ( const InDet::PixelCluster indetCluster,
const InDetDD::SiDetectorElement element,
xAOD::PixelCluster xaodCluster 
)

Definition at line 55 of file ClusterConversionUtilities.cxx.

58  {
59  IdentifierHash idHash = element.identifyHash();
60 
61  auto localPos = indetCluster.localPosition();
62  auto localCov = indetCluster.localCovariance();
63 
64  Eigen::Matrix<float,2,1> localPosition(localPos.x(), localPos.y());
65 
66  Eigen::Matrix<float,2,2> localCovariance;
67  localCovariance.setZero();
68  localCovariance(0, 0) = localCov(0, 0);
69  localCovariance(1, 1) = localCov(1, 1);
70 
71  auto globalPos = indetCluster.globalPosition();
72  Eigen::Matrix<float, 3, 1> globalPosition(globalPos.x(), globalPos.y(), globalPos.z());
73 
74  const auto& RDOs = indetCluster.rdoList();
75  const auto& ToTs = indetCluster.totList();
76  const auto& charges = indetCluster.chargeList();
77  const auto& width = indetCluster.width();
78  auto isSplit = indetCluster.isSplit();
79  auto splitProbability1 = indetCluster.splitProbability1();
80  auto splitProbability2 = indetCluster.splitProbability2();
81 
82  xaodCluster.setMeasurement<2>(idHash, localPosition, localCovariance);
83  xaodCluster.setIdentifier( indetCluster.identify().get_compact() );
84  xaodCluster.setRDOlist(RDOs);
85  xaodCluster.globalPosition() = globalPosition;
86  xaodCluster.setToTlist(ToTs);
88  xaodCluster.setChargelist(charges);
90  xaodCluster.setLVL1A(indetCluster.LVL1A());
91  xaodCluster.setChannelsInPhiEta(width.colRow()[0], width.colRow()[1]);
92  xaodCluster.setWidthInEta(static_cast<float>(width.widthPhiRZ()[1]));
93  xaodCluster.setIsSplit(isSplit);
94  xaodCluster.setSplitProbabilities(splitProbability1, splitProbability2);
95 
96  return StatusCode::SUCCESS;
97  }

◆ convertInDetToXaodCluster() [3/3]

StatusCode TrackingUtilities::convertInDetToXaodCluster ( const InDet::SCT_Cluster indetCluster,
const InDetDD::SiDetectorElement element,
xAOD::StripCluster xaodCluster 
)

Definition at line 122 of file ClusterConversionUtilities.cxx.

125  {
126  IdentifierHash idHash = element.identifyHash();
127 
128  const auto [localPosition, localCovariance] = convertSCT_LocalPosCov(indetCluster);
129 
130  auto globalPos = indetCluster.globalPosition();
131  Eigen::Matrix<float, 3, 1> globalPosition(globalPos.x(), globalPos.y(), globalPos.z());
132 
133  const auto& RDOs = indetCluster.rdoList();
134  const auto& width = indetCluster.width();
135 
136  xaodCluster.setMeasurement<1>(idHash, localPosition, localCovariance);
137  xaodCluster.setIdentifier( indetCluster.identify().get_compact() );
138  xaodCluster.setRDOlist(RDOs);
139  xaodCluster.globalPosition() = globalPosition;
140  xaodCluster.setChannelsInPhi(width.colRow()[0]);
141 
142  return StatusCode::SUCCESS;
143  }

◆ convertSCT_LocalPosCov()

std::pair< xAOD::MeasVector< 1 >, xAOD::MeasMatrix< 1 > > TrackingUtilities::convertSCT_LocalPosCov ( const InDet::SCT_Cluster cluster)

Definition at line 99 of file ClusterConversionUtilities.cxx.

99  {
100  const InDetDD::SiDetectorElement& element{*cluster.detectorElement()};
101  auto localPos = cluster.localPosition();
102 
103  float localPosition = 0.f, localCovariance = 0.f;
104  if (element.isBarrel()) {
105  localPosition = localPos.x();
106  localCovariance = element.phiPitch() * element.phiPitch() * one_over_twelve;
107  } else {
108  InDetDD::SiCellId cellId = element.cellIdOfPosition(localPos);
109  const auto* design = dynamic_cast<const InDetDD::StripStereoAnnulusDesign *>(&element.design());
110  if ( design == nullptr ) {
111  THROW_EXCEPTION("Invalid bounds from "<<cluster);
112  }
113  InDetDD::SiLocalPosition localInPolar = design->localPositionOfCellPC(cellId);
114  localPosition = localInPolar.xPhi();
115  localCovariance = design->phiPitchPhi() * design->phiPitchPhi() * one_over_twelve;
116  }
117 
118  return std::make_pair(xAOD::MeasVector<1>{localPosition},
119  xAOD::MeasMatrix<1>{localCovariance});
120  }

◆ convertTrkToXaodPixelSpacePoint()

StatusCode TrackingUtilities::convertTrkToXaodPixelSpacePoint ( const InDet::PixelSpacePoint trkSpacePoint,
xAOD::SpacePoint xaodSpacePoint 
)

Definition at line 12 of file SpacePointConversionUtilities.cxx.

14  {
15  unsigned int idHash = trkSpacePoint.elementIdList().first;
16  const auto& globPos = trkSpacePoint.globalPosition();
17 
18  const InDet::SiCluster* c = static_cast<const InDet::SiCluster*>(trkSpacePoint.clusterList().first);
19  const InDetDD::SiDetectorElement *de = c->detectorElement();
20  const Amg::Transform3D &Tp = de->surface().transform();
21 
22  float r_3 = static_cast<float>( Tp(0,2) );
23  float r_4 = static_cast<float>( Tp(1,2) );
24  float r_5 = static_cast<float>( Tp(2,2) );
25 
26  const Amg::MatrixX& v = c->localCovariance();
27  float f22 = static_cast<float>( v(1,1) );
28  float wid = static_cast<float>( c->width().z() );
29  float cov = wid*wid*.08333;
30  if(cov < f22) cov = f22;
31  float covr = 6 * cov * (r_5*r_5);
32  float covz = 6 * cov * (r_3*r_3 + r_4*r_4);
33 
34  xaodSpacePoint.setSpacePoint(idHash,
35  globPos.cast<float>(),
36  covr,
37  covz,
38  {});
39 
40  return StatusCode::SUCCESS;
41  }

◆ convertTrkToXaodStripSpacePoint()

StatusCode TrackingUtilities::convertTrkToXaodStripSpacePoint ( const InDet::SCT_SpacePoint trkSpacePoint,
const Amg::Vector3D vertex,
xAOD::SpacePoint xaodSpacePoint 
)

Definition at line 43 of file SpacePointConversionUtilities.cxx.

46  {
47  std::pair<unsigned int, unsigned int> idHashes = trkSpacePoint.elementIdList();
48  const auto& globPos = trkSpacePoint.globalPosition();
49 
50  const InDet::SiCluster *c0 = static_cast<const InDet::SiCluster *>(trkSpacePoint.clusterList().first);
51  const InDet::SiCluster *c1 = static_cast<const InDet::SiCluster *>(trkSpacePoint.clusterList().second);
52  const InDetDD::SiDetectorElement *d0 = c0->detectorElement();
53  const InDetDD::SiDetectorElement *d1 = c1->detectorElement();
54 
55  Amg::Vector2D lc0 = c0->localPosition();
56  Amg::Vector2D lc1 = c1->localPosition();
57 
58  std::pair<Amg::Vector3D, Amg::Vector3D> e0 =
59  (d0->endsOfStrip(InDetDD::SiLocalPosition(lc0.y(), lc0.x(), 0.)));
60  std::pair<Amg::Vector3D, Amg::Vector3D> e1 =
61  (d1->endsOfStrip(InDetDD::SiLocalPosition(lc1.y(), lc1.x(), 0.)));
62 
63  auto stripCenter_1 = 0.5 * (e0.first + e0.second);
64  auto stripDir_1 = e0.first - e0.second;
65  auto trajDir_1 = 2. * ( stripCenter_1 - vertex);
66 
67  auto stripCenter_2 = 0.5 * (e1.first + e1.second);
68  auto stripDir_2 = e1.first - e1.second;
69 
70  float topHalfStripLength = 0.5 * stripDir_1.norm();
71  Eigen::Matrix<double, 3, 1> topStripDirection = - stripDir_1 / (2. * topHalfStripLength);
72  Eigen::Matrix<double, 3, 1> topStripCenter = 0.5 * trajDir_1;
73  float bottomHalfStripLength = 0.5 * stripDir_2.norm();
74  Eigen::Matrix<double, 3, 1> bottomStripDirection = - stripDir_2 / (2. * bottomHalfStripLength);
75  Eigen::Matrix<double, 3, 1> stripCenterDistance = stripCenter_1 - stripCenter_2;
76 
77  const Amg::MatrixX& v = trkSpacePoint.localCovariance();
78  float f22 = static_cast<float>( v(1,1) );
79 
80  float covr = d0->isBarrel() ? .1 : 8.*f22;
81  float covz = d0->isBarrel() ? 8.*f22 : .1;
82 
83  xaodSpacePoint.setSpacePoint({idHashes.first, idHashes.second},
84  globPos.cast<float>(),
85  covr,
86  covz,
87  {},
88  topHalfStripLength,
89  bottomHalfStripLength,
90  topStripDirection.cast<float>(),
91  bottomStripDirection.cast<float>(),
92  stripCenterDistance.cast<float>(),
93  topStripCenter.cast<float>());
94 
95  return StatusCode::SUCCESS;
96  }

◆ convertXaodToInDetCluster() [1/3]

StatusCode TrackingUtilities::convertXaodToInDetCluster ( const xAOD::HGTDCluster xaodCluster,
const InDetDD::HGTD_DetectorElement element,
::HGTD_Cluster *&  indetCluster 
)

Definition at line 356 of file ClusterConversionUtilities.cxx.

358  {
359 
360  const auto& locPos = xaodCluster.localPosition<3>();
361  Amg::Vector2D localPosition(locPos(0,0), locPos(1,0));
362  float time = locPos(2,0);
363 
364  InDetDD::SiLocalPosition centroid(localPosition);
365  const Identifier id = element.identifierOfPosition(centroid);
366 
367  auto errorMatrix = Amg::MatrixX(2,2);
368  errorMatrix.setIdentity();
369  errorMatrix.fillSymmetric(0, 0, xaodCluster.localCovariance<3>()(0, 0));
370  errorMatrix.fillSymmetric(1, 1, xaodCluster.localCovariance<3>()(1, 1));
371  float time_resolution = std::sqrt(xaodCluster.localCovariance<3>()(2, 2));
372 
373  double etaWidth = 1.3;
374  double phiWidth = 1.3;
375  int channelsPhi = 1;
376  int channelsEta = 1;
377  InDet::SiWidth width( Amg::Vector2D(channelsPhi, channelsEta), Amg::Vector2D(phiWidth, etaWidth) );
378 
379  indetCluster = new ::HGTD_Cluster(id,
380  localPosition,
381  std::vector<Identifier>(xaodCluster.rdoList()),
382  width,
383  &element,
384  std::move(errorMatrix),
385  time,
386  time_resolution,
387  std::vector<int>(xaodCluster.totList()));
388 
389  return StatusCode::SUCCESS;
390  }

◆ convertXaodToInDetCluster() [2/3]

StatusCode TrackingUtilities::convertXaodToInDetCluster ( const xAOD::PixelCluster xaodCluster,
const InDetDD::SiDetectorElement element,
const PixelID pixelID,
InDet::PixelCluster *&  indetCluster 
)

Definition at line 145 of file ClusterConversionUtilities.cxx.

149  {
150  const InDetDD::PixelModuleDesign* design(dynamic_cast<const InDetDD::PixelModuleDesign*>(&element.design()));
151  if (design == nullptr) {
152  return StatusCode::FAILURE;
153  }
154 
155  const auto& locPos = xaodCluster.localPosition<2>();
156  Amg::Vector2D localPosition(locPos(0,0), locPos(1,0));
157 
158  InDetDD::SiLocalPosition centroid(localPosition);
159  const Identifier id = element.identifierOfPosition(centroid);
160 
161  const auto& globalPos = xaodCluster.globalPosition();
162  Amg::Vector3D globalPosition(globalPos(0, 0), globalPos(1, 0), globalPos(2, 0));
163 
164  auto errorMatrix = Amg::MatrixX(2,2);
165  errorMatrix.setIdentity();
166  errorMatrix.fillSymmetric(0, 0, xaodCluster.localCovariance<2>()(0, 0));
167  errorMatrix.fillSymmetric(1, 1, xaodCluster.localCovariance<2>()(1, 1));
168 
169  int colmax = std::numeric_limits<int>::min();
170  int rowmax = std::numeric_limits<int>::min();
171  int colmin = std::numeric_limits<int>::max();
172  int rowmin = std::numeric_limits<int>::max();
173 
174  float qRowMin = 0.f;
175  float qRowMax = 0.f;
176  float qColMin = 0.f;
177  float qColMax = 0.f;
178 
179  const std::vector<Identifier>& rod_list_cluster = xaodCluster.rdoList();
180  const std::vector<float>& charge_list_cluster = xaodCluster.chargeList();
181  if (rod_list_cluster.size() != charge_list_cluster.size()) {
182  return StatusCode::FAILURE;
183  }
184 
185  for (std::size_t i(0); i<rod_list_cluster.size(); ++i) {
186  const Identifier& this_rdo = rod_list_cluster.at(i);
187  const float this_charge = charge_list_cluster.at(i);
188 
189  const int row = pixelID.phi_index(this_rdo);
190  if (row > rowmax) {
191  rowmax = row;
192  qRowMax = this_charge;
193  } else if (row == rowmax) {
194  qRowMax += this_charge;
195  }
196 
197  if (row < rowmin) {
198  rowmin = row;
199  qRowMin = this_charge;
200  } else if (row == rowmin) {
201  qRowMin += this_charge;
202  }
203 
204  const int col = pixelID.eta_index(this_rdo);
205  if (col > colmax) {
206  colmax = col;
207  qColMax = this_charge;
208  } else if (col == colmax) {
209  qColMax += this_charge;
210  }
211 
212  if (col < colmin) {
213  colmin = col;
214  qColMin = this_charge;
215  } else if (col == colmin) {
216  qColMin += this_charge;
217  }
218 
219  }
220 
221  // Compute omega for charge interpolation correction (if required)
222  // Two pixels may have charge=0 (very rarely, hopefully)
223  float omegax = -1.f;
224  float omegay = -1.f;
225  if(qRowMin + qRowMax > 0) omegax = qRowMax/(qRowMin + qRowMax);
226  if(qColMin + qColMax > 0) omegay = qColMax/(qColMin + qColMax);
227 
228  double etaWidth = design->widthFromColumnRange(colmin, colmax);
229  double phiWidth = design->widthFromRowRange(rowmin, rowmax);
230  InDet::SiWidth width( Amg::Vector2D(xaodCluster.channelsInPhi(), xaodCluster.channelsInEta()),
231  Amg::Vector2D(phiWidth,etaWidth) );
232 
233  indetCluster = new InDet::PixelCluster(id,
234  localPosition,
235  globalPosition,
236  std::vector<Identifier>(xaodCluster.rdoList()),
237  xaodCluster.lvl1a(),
238  std::vector<int>(xaodCluster.totList()),
239  std::vector<float>(xaodCluster.chargeList()),
240  width,
241  &element,
242  std::move(errorMatrix),
243  omegax,
244  omegay,
245  xaodCluster.isSplit(),
246  xaodCluster.splitProbability1(),
247  xaodCluster.splitProbability2());
248 
249  return StatusCode::SUCCESS;
250  }

◆ convertXaodToInDetCluster() [3/3]

StatusCode TrackingUtilities::convertXaodToInDetCluster ( const xAOD::StripCluster xaodCluster,
const InDetDD::SiDetectorElement element,
const SCT_ID stripID,
InDet::SCT_Cluster *&  indetCluster,
double  shift = 0. 
)

Definition at line 252 of file ClusterConversionUtilities.cxx.

257  {
258  bool isBarrel = element.isBarrel();
259  const InDetDD::SCT_ModuleSideDesign* design = nullptr;
260  if (not isBarrel) {
261  design = dynamic_cast<const InDetDD::StripStereoAnnulusDesign*>(&element.design());
262  } else {
263  design = dynamic_cast<const InDetDD::SCT_ModuleSideDesign*>(&element.design());
264  }
265 
266  if (design == nullptr) {
267  return StatusCode::FAILURE;
268  }
269 
270  const auto designShape = design->shape();
271 
272 
273  const auto& rdoList = xaodCluster.rdoList();
274  Identifier id = rdoList.front();
275 
276  const auto& localPos = xaodCluster.localPosition<1>();
277 
278  double pos_x = localPos(0, 0);
279  double pos_y = 0;
280  if (not isBarrel) {
281  const Identifier firstStripId = rdoList.front();
282  int firstStrip = stripID.strip(firstStripId);
283  int stripRow = stripID.row(firstStripId);
284  int clusterSizeInStrips = xaodCluster.channelsInPhi();
285  auto clusterPosition = design->localPositionOfCluster(design->strip1Dim(firstStrip, stripRow), clusterSizeInStrips);
286  pos_x = clusterPosition.xPhi() + shift;
287  pos_y = clusterPosition.xEta();
288  }
289 
290  Amg::Vector2D locpos = Amg::Vector2D( pos_x, pos_y );
291 
292  // Most of the following is taken from what is done in ClusterMakerTool
293  // Need to make this computation instead of using the local pos
294  // with local pos instead some differences w.r.t. reference are observed
295  const auto& firstStrip = stripID.strip(rdoList.front());
296  const auto& lastStrip = stripID.strip(rdoList.back());
297  const auto& row = stripID.row(rdoList.front());
298  const int firstStrip1D = design->strip1Dim (firstStrip, row );
299  const int lastStrip1D = design->strip1Dim( lastStrip, row );
300  const InDetDD::SiCellId cell1(firstStrip1D);
301  const InDetDD::SiCellId cell2(lastStrip1D);
302  const InDetDD::SiLocalPosition firstStripPos( element.rawLocalPositionOfCell(cell1 ));
303  const InDetDD::SiLocalPosition lastStripPos( element.rawLocalPositionOfCell(cell2) );
304  const InDetDD::SiLocalPosition centre( (firstStripPos+lastStripPos) * 0.5 );
305  const double clusterWidth = design->stripPitch() * ( lastStrip - firstStrip + 1 );
306 
307  const std::pair<InDetDD::SiLocalPosition, InDetDD::SiLocalPosition> ends( design->endsOfStrip(centre) );
308  const double stripLength( std::abs(ends.first.xEta() - ends.second.xEta()) );
309 
310  InDet::SiWidth width( Amg::Vector2D(xaodCluster.channelsInPhi(), 1),
311  Amg::Vector2D(clusterWidth, stripLength) );
312 
313  const double col_x = width.colRow().x();
314  const double col_y = width.colRow().y();
315 
316  double scale_factor = 1.;
317  if ( col_x == 1 )
318  scale_factor = 1.05;
319  else if ( col_x == 2 )
320  scale_factor = 0.27;
321 
322  auto errorMatrix = Amg::MatrixX(2,2);
323  errorMatrix.setIdentity();
324  errorMatrix.fillSymmetric(0, 0, scale_factor * scale_factor * width.phiR() * width.phiR() * one_over_twelve);
325  errorMatrix.fillSymmetric(1, 1, width.z() * width.z() / col_y / col_y * one_over_twelve);
326 
327  if( designShape == InDetDD::Trapezoid or
328  designShape == InDetDD::Annulus) {
329  // rotation for endcap SCT
330 
331  // The following is being computed with the local position,
332  // without considering the lorentz shift
333  // So we remove it from the local position
334  Amg::Vector2D local(pos_x - shift, pos_y);
335  double sn = element.sinStereoLocal(local);
336  double sn2 = sn * sn;
337  double cs2 = 1. - sn2;
338  double w = element.phiPitch(local) / element.phiPitch();
339  double v0 = errorMatrix(0,0) * w * w;
340  double v1 = errorMatrix(1,1);
341  errorMatrix.fillSymmetric( 0, 0, cs2 * v0 + sn2 * v1 );
342  errorMatrix.fillSymmetric( 0, 1, sn * std::sqrt(cs2) * (v0 - v1) );
343  errorMatrix.fillSymmetric( 1, 1, sn2 * v0 + cs2 * v1 );
344  }
345 
346  indetCluster = new InDet::SCT_Cluster(id,
347  locpos,
348  std::vector<Identifier>(rdoList),
349  width,
350  &element,
351  std::move(errorMatrix));
352 
353  return StatusCode::SUCCESS;
354  }
Trk::SpacePoint::clusterList
const std::pair< const PrepRawData *, const PrepRawData * > & clusterList() const
return the pair of cluster pointers by reference
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:127
InDetDD::SolidStateDetectorElementBase::identifierOfPosition
Identifier identifierOfPosition(const Amg::Vector2D &localPos) const
Full identifier of the cell for a given position: assumes a raw local position (no Lorentz shift)
Definition: SolidStateDetectorElementBase.cxx:217
query_example.row
row
Definition: query_example.py:24
xAOD::PixelCluster_v1::chargeList
const std::vector< float > & chargeList() const
Returns the list of charges of the channels building the cluster.
InDetDD::SCT_ModuleSideDesign::stripPitch
virtual double stripPitch(const SiLocalPosition &chargePos) const =0
give the strip pitch (dependence on position needed for forward)
xAOD::PixelCluster_v1::setTotalCharge
void setTotalCharge(float totalCharge)
Sets the total charge.
PixelID::phi_index
int phi_index(const Identifier &id) const
Definition: PixelID.h:658
xAOD::StripCluster_v1::setChannelsInPhi
void setChannelsInPhi(int channelsInPhi)
Sets the dimensions of the cluster in numbers of channels in phi (x)
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
InDetDD::PixelModuleDesign
Definition: PixelModuleDesign.h:48
xAOD::StripCluster_v1::channelsInPhi
int channelsInPhi() const
Returns the dimensions of the cluster in numbers of channels in phi (x), respectively.
Trk::SpacePoint::globalPosition
virtual const Amg::Vector3D & globalPosition() const override final
Interface method to get the global Position.
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:146
egammaEnergyPositionAllSamples::e1
double e1(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 1st sampling
xAOD::PixelCluster_v1::rdoList
const std::vector< Identifier > rdoList() const
Returns the list of identifiers of the channels building the cluster.
Definition: PixelCluster_v1.cxx:42
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
InDetDD::SCT_ModuleSideDesign
Definition: SCT_ModuleSideDesign.h:40
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
InDetDD::DetectorDesign::shape
virtual DetectorShape shape() const
Shape of element.
Definition: DetectorDesign.cxx:96
InDet::PixelCluster::isSplit
bool isSplit() const
access mehtods for splitting
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:249
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
extractSporadic.c1
c1
Definition: extractSporadic.py:134
Trk::PrepRawData::localCovariance
const Amg::MatrixX & localCovariance() const
return const ref to the error matrix
xAOD::HGTDCluster_v1::setRDOlist
void setRDOlist(const std::vector< Identifier > &rdolist)
Sets the list of identifiers of the channels building the cluster.
Definition: HGTDCluster_v1.cxx:15
xAOD::xAODInDetMeasurement::Utilities::computeTotalToT
int computeTotalToT(const SG::AuxElement &cluster)
Definition: Event/xAOD/xAODInDetMeasurement/Root/Utilities.cxx:22
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
InDet::PixelCluster::splitProbability1
double splitProbability1() const
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:253
InDetDD::SolidStateDetectorElementBase::surface
Trk::Surface & surface()
Element Surface.
Trk::PrepRawData::rdoList
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
Identifier::get_compact
value_type get_compact() const
Get the compact id.
dq_defect_virtual_defect_validation.d1
d1
Definition: dq_defect_virtual_defect_validation.py:79
xAOD::PixelCluster_v1::setRDOlist
void setRDOlist(const std::vector< Identifier > &rdolist)
Sets the list of identifiers of the channels building the cluster.
Definition: PixelCluster_v1.cxx:32
xAOD::PixelCluster_v1::setChargelist
void setChargelist(const std::vector< float > &charges)
Sets the list of charges of the channels building the cluster.
xAOD::PixelCluster_v1::setIsSplit
void setIsSplit(bool isSplit)
Sets if the cluster is split or not.
InDetSecVtxTruthMatchUtils::isSplit
bool isSplit(int matchInfo)
Definition: InDetSecVtxTruthMatchTool.h:83
xAOD::PixelCluster_v1::setWidthInEta
void setWidthInEta(float widthInEta)
Sets the width of the cluster in eta (y) direction.
InDet::PixelCluster::totList
const std::vector< int > & totList() const
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:202
xAOD::PixelCluster_v1::setTotalToT
void setTotalToT(int totalToT)
Sets the total ToT.
InDetDD::SolidStateDetectorElementBase::identifyHash
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
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
xAOD::PixelCluster_v1::splitProbability2
float splitProbability2() const
xAOD::PixelCluster_v1::setSplitProbabilities
void setSplitProbabilities(float prob1, float prob2)
Sets the splitting probabilities for the cluster.
InDetDD::SiLocalPosition
Definition: SiLocalPosition.h:31
InDetDD::SiLocalPosition::xPhi
double xPhi() const
position along phi direction:
Definition: SiLocalPosition.h:123
hotSpotInTAG.c0
c0
Definition: hotSpotInTAG.py:192
InDetDD::SiDetectorElement::phiPitch
double phiPitch() const
Pitch (inline methods)
InDet::PixelCluster::splitProbability2
double splitProbability2() const
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:257
xAOD::UncalibratedMeasurement_v1::setIdentifier
void setIdentifier(const DetectorIdentType measId)
Sets the full Identifier of the measurement.
columnar::ContainerId::cluster
@ cluster
parseMapping.v0
def v0
Definition: parseMapping.py:149
SCT_CalibAlgs::firstStrip
@ firstStrip
Definition: SCT_CalibNumbers.h:10
lumiFormat.i
int i
Definition: lumiFormat.py:85
InDetDD::Annulus
@ Annulus
Definition: DetectorDesign.h:42
SCT_ID::row
int row(const Identifier &id) const
Definition: SCT_ID.h:758
InDetDD::StripStereoAnnulusDesign
Definition: StripStereoAnnulusDesign.h:50
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
xAOD::PixelCluster_v1::setToTlist
void setToTlist(const std::vector< int > &tots)
Sets the list of ToT of the channels building the cluster.
TRT::Track::d0
@ d0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:62
Trk::RIO_OnTrackType::HGTD_Cluster
@ HGTD_Cluster
Definition: RIO_OnTrack.h:63
PixelID::eta_index
int eta_index(const Identifier &id) const
Definition: PixelID.h:664
InDet::PixelCluster::LVL1A
int LVL1A() const
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:270
xAOD::HGTDCluster_v1::totList
const std::vector< int > & totList() const
Returns the list of Time Over Threshold of the channels building the cluster.
xAOD::HGTDCluster_v1::setToTlist
void setToTlist(const std::vector< int > &tots)
Sets the list of ToT of the channels building the cluster.
xAOD::UncalibratedMeasurement_v1::localCovariance
ConstMatrixMap< N > localCovariance() const
Returns the local covariance of the measurement.
HGTD_Cluster::timeResolution
virtual float timeResolution() const
Definition: HGTD_Cluster.h:116
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
InDet::SCT_Cluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SCT_Cluster.h:34
xAOD::UncalibratedMeasurement_v1::localPosition
ConstVectorMap< N > localPosition() const
Returns the local position of the measurement.
Trk::MeasurementBase::localCovariance
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
Definition: MeasurementBase.h:138
xAOD::PixelCluster_v1::setLVL1A
void setLVL1A(int lvl1a)
Sets the LVL1 accept.
xAOD::MeasVector
Eigen::Matrix< float, N, 1 > MeasVector
Abrivation of the Matrix & Covariance definitions.
Definition: MeasurementDefs.h:53
InDetDD::local
@ local
Definition: InDetDD_Defs.h:16
xAOD::xAODInDetMeasurement::Utilities::computeTotalCharge
float computeTotalCharge(const SG::AuxElement &cluster)
Definition: Event/xAOD/xAODInDetMeasurement/Root/Utilities.cxx:9
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
xAOD::PixelCluster_v1::globalPosition
ConstVectorMap< 3 > globalPosition() const
Returns the global position of the pixel cluster.
Definition: PixelCluster_v1.cxx:15
Trk::SpacePoint::elementIdList
const std::pair< IdentifierHash, IdentifierHash > & elementIdList() const
return the pair of Ids of the element by reference
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:122
Trk::PrepRawData::localPosition
const Amg::Vector2D & localPosition() const
return the local position reference
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
InDetDD::SiDetectorElement::isBarrel
bool isBarrel() const
xAOD::PixelCluster_v1::totList
const std::vector< int > & totList() const
Returns the list of ToT of the channels building the cluster.
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
THROW_EXCEPTION
#define THROW_EXCEPTION(MESSAGE)
Definition: throwExcept.h:10
query_example.col
col
Definition: query_example.py:7
InDetDD::SCT_ModuleSideDesign::localPositionOfCluster
virtual SiLocalPosition localPositionOfCluster(const SiCellId &cellId, int cluserSize) const =0
InDetDD::SiCellId
Definition: SiCellId.h:29
InDet::PixelCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:49
python.PyAthena.v
v
Definition: PyAthena.py:154
InDet::SiCluster::globalPosition
const Amg::Vector3D & globalPosition() const
return global position reference
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
InDet::SiCluster::width
const InDet::SiWidth & width() const
return width class reference
xAOD::StripCluster_v1::setRDOlist
void setRDOlist(const std::vector< Identifier > &rdolist)
Sets the list of identifiers of the channels building the cluster.
Definition: StripCluster_v1.cxx:29
InDetDD::SolidStateDetectorElementBase::rawLocalPositionOfCell
Amg::Vector2D rawLocalPositionOfCell(const SiCellId &cellId) const
Returns position (center) of cell.
Definition: SolidStateDetectorElementBase.cxx:230
xAOD::UncalibratedMeasurement_v1::setMeasurement
void setMeasurement(const DetectorIDHashType idHash, MeasVector< N > locPos, MeasMatrix< N > locCov)
Sets IdentifierHash, local position and local covariance of the measurement.
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
InDetDD::SCT_ModuleSideDesign::strip1Dim
virtual int strip1Dim(int strip, int row) const override
only relevant for SCT.
Definition: SCT_ModuleSideDesign.h:279
TrackingUtilities::convertSCT_LocalPosCov
std::pair< xAOD::MeasVector< 1 >, xAOD::MeasMatrix< 1 > > convertSCT_LocalPosCov(const InDet::SCT_Cluster &cluster)
Definition: ClusterConversionUtilities.cxx:99
SCT_ID::strip
int strip(const Identifier &id) const
Definition: SCT_ID.h:764
xAOD::PixelCluster_v1::setChannelsInPhiEta
void setChannelsInPhiEta(int channelsInPhi, int channelsInEta)
Sets the dimensions of the cluster in numbers of channels in phi (x) and eta (y) directions.
Definition: PixelCluster_v1.cxx:55
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
HGTD_Cluster::totList
virtual const std::vector< int > & totList() const
Definition: HGTD_Cluster.h:118
InDet::SiWidth
Definition: SiWidth.h:25
xAOD::StripCluster_v1::globalPosition
ConstVectorMap< 3 > globalPosition() const
Returns the global position of the strip cluster.
Definition: StripCluster_v1.cxx:15
python.LArCondContChannels.isBarrel
isBarrel
Definition: LArCondContChannels.py:659
xAOD::MeasMatrix
Eigen::Matrix< float, N, N > MeasMatrix
Definition: MeasurementDefs.h:55
egammaEnergyPositionAllSamples::e0
double e0(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in pre-sampler
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
xAOD::PixelCluster_v1::channelsInEta
int channelsInEta() const
InDetDD::SiDetectorElement::design
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
xAOD::HGTDCluster_v1::rdoList
const std::vector< Identifier > rdoList() const
Returns the list of identifiers of the channels building the cluster.
Definition: HGTDCluster_v1.cxx:23
Trk::Surface::transform
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
python.compressB64.c
def c
Definition: compressB64.py:93
InDetDD::SCT_ModuleSideDesign::endsOfStrip
virtual std::pair< SiLocalPosition, SiLocalPosition > endsOfStrip(const SiLocalPosition &position) const override=0
give the ends of strips
HGTD_Cluster::time
virtual float time() const
Definition: HGTD_Cluster.h:114
InDet::SiCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/SiCluster.h:40
NSWL1::centroid
Vertex centroid(const Polygon &p)
Definition: GeoUtils.cxx:59
xAOD::PixelCluster_v1::channelsInPhi
int channelsInPhi() const
Returns the dimensions of the cluster in numbers of channels in phi (x) and eta (y) directions,...
xAOD::PixelCluster_v1::splitProbability1
float splitProbability1() const
Returns the splitting probabilities for the cluster.
InDetDD::Trapezoid
@ Trapezoid
Definition: DetectorDesign.h:42
xAOD::PixelCluster_v1::lvl1a
int lvl1a() const
Return the LVL1 accept.
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
InDet::PixelCluster::chargeList
const std::vector< float > & chargeList() const
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:210
xAOD::PixelCluster_v1::isSplit
bool isSplit() const
Returns if the cluster is split or not.
Identifier
Definition: IdentifierFieldParser.cxx:14