forked from sPHENIX-Collaboration/acts
/
DigitizationAlgorithm.hpp
69 lines (58 loc) · 2.16 KB
/
DigitizationAlgorithm.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// This file is part of the Acts project.
//
// Copyright (C) 2017 CERN for the benefit of the Acts project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#pragma once
#include "Acts/Geometry/GeometryIdentifier.hpp"
#include "ActsExamples/Framework/BareAlgorithm.hpp"
#include "ActsExamples/Framework/RandomNumbers.hpp"
#include <memory>
#include <string>
#include <unordered_map>
namespace Acts {
class DigitizationModule;
class IdentifiedDetectorElement;
class PlanarModuleStepper;
class Surface;
class TrackingGeometry;
} // namespace Acts
namespace ActsExamples {
/// Create planar clusters from simulation hits.
class DigitizationAlgorithm final : public BareAlgorithm {
public:
struct Config {
/// Input collection of simulated hits.
std::string inputSimulatedHits;
/// Output collection of clusters.
std::string outputClusters;
/// Tracking geometry required to access global-to-local transforms.
std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry;
/// Module stepper for geometric clustering.
std::shared_ptr<const Acts::PlanarModuleStepper> planarModuleStepper;
/// Random numbers tool.
std::shared_ptr<const RandomNumbers> randomNumbers;
};
/// Construct the digitization algorithm.
///
/// @param cfg is the algorithm configuration
/// @param lvl is the logging level
DigitizationAlgorithm(Config cfg, Acts::Logging::Level lvl);
/// Build clusters from input simulation hits.
///
/// @param txt is the algorithm context with event information
/// @return a process code indication success or failure
ProcessCode execute(const AlgorithmContext& ctx) const final override;
private:
struct Digitizable {
const Acts::Surface* surface = nullptr;
const Acts::IdentifiedDetectorElement* detectorElement = nullptr;
const Acts::DigitizationModule* digitizer = nullptr;
};
Config m_cfg;
/// Lookup container for all digitizable surfaces
std::unordered_map<Acts::GeometryIdentifier, Digitizable> m_digitizables;
};
} // namespace ActsExamples