Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Calibrator.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Calibrator.cc
1 #include "Calibrator.h"
2 
6  const Acts::SourceLink& sourceLink,
8 {
9  trackState.setUncalibratedSourceLink(sourceLink);
10  const ActsSourceLink sl = sourceLink.get<ActsSourceLink>();
11  const ActsSourceLink::Index index = sl.index();
12  std::visit(
13  [&](const auto& uncalibmeas)
14  {
15  std::array<Acts::BoundIndices, 2> indices;
16  indices[0] = Acts::BoundIndices::eBoundLoc0;
17  indices[1] = Acts::BoundIndices::eBoundLoc1;
18 
20  loc(0) = uncalibmeas.parameters()[Acts::eBoundLoc0];
21  loc(1) = uncalibmeas.parameters()[Acts::eBoundLoc1];
22 
23  auto cov = uncalibmeas.covariance();
24  const TrkrDefs::cluskey cluskey = sl.cluskey();
25  const uint8_t layer = TrkrDefs::getLayer(cluskey);
26  const double misalignmentFactor = gctx.get<alignmentTransformationContainer*>()->getMisalignmentFactor(layer);
27 
29 
30  for (int i = 0; i < cov.rows(); i++)
31  {
32  for (int j = 0; j < cov.cols(); j++)
33  {
34  expandedCov(i, j) = cov(i, j) * misalignmentFactor;
35  }
36  }
37 
39  indices,
40  loc, expandedCov);
41 
42  trackState.allocateCalibrated(meas.size());
43  trackState.setCalibrated(meas);
44  },
45  (measurements)[index]);
46 }
47 
50  const Acts::CalibrationContext& cctx,
51  const Acts::SourceLink& sourceLink,
53 {
55  gctx,
56  cctx,
57  sourceLink,
58  trackState);
59 }