34 : FW::
BareAlgorithm(
"DigitizationAlgorithm", lvl), m_cfg(std::move(cfg)) {
36 throw std::invalid_argument(
"Missing input hits collection");
39 throw std::invalid_argument(
"Missing output clusters collection");
42 throw std::invalid_argument(
"Missing tracking geometry");
45 throw std::invalid_argument(
"Missing planar module stepper");
48 throw std::invalid_argument(
"Missing random numbers tool");
60 dg.surface->associatedDetectorElement());
61 if (not dg.detectorElement) {
66 if (not dg.digitizer) {
83 const auto it = m_digitizables.find(moduleGeoId);
84 if (
it == m_digitizables.end()) {
88 const auto& dg =
it->second;
90 const auto invTransfrom = dg.surface->transform(ctx.
geoContext).inverse();
93 for (
auto ih = moduleHits.begin(); ih != moduleHits.end(); ++ih) {
94 const auto& hit = *ih;
95 const auto idx =
hits.index_of(ih);
97 Acts::Vector2D localIntersect = (invTransfrom * hit.position()).head<2>();
99 invTransfrom.linear() * hit.unitDirection();
102 const auto thickness = dg.detectorElement->thickness();
103 const auto lorentzAngle = dg.digitizer->lorentzAngle();
104 auto lorentzShift =
thickness * std::tan(lorentzAngle);
105 lorentzShift *= -(dg.digitizer->readoutDirection());
107 std::vector<Acts::DigitizationStep> dSteps =
108 m_cfg.planarModuleStepper->cellSteps(ctx.
geoContext, *dg.digitizer,
109 localIntersect, localDirection);
111 if (!dSteps.size()) {
119 double totalPath = 0.;
121 std::vector<Acts::DigitizationCell> usedCells;
122 usedCells.reserve(dSteps.size());
124 for (
auto dStep : dSteps) {
126 localX += dStep.stepLength * dStep.stepCellCenter.x();
127 localY += dStep.stepLength * dStep.stepCellCenter.y();
128 totalPath += dStep.stepLength;
130 dStep.stepCell.channel1,
135 localX += lorentzShift;
149 cov << 0.05, 0., 0., 0., 0.05, 0., 0., 0.,
155 std::move(cov), localX, localY, hit.time(), std::move(usedCells));
159 clusters.emplace_hint(clusters.end(), hit.geometryId(),
160 std::move(pCluster));
164 ACTS_DEBUG(
"digitized " <<
hits.size() <<
" hits into " << clusters.size()
168 ctx.
eventStore.
add(m_cfg.outputClusters, std::move(clusters));