Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ReconstructionBase.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ReconstructionBase.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2019-2021 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
10 
30 
33  ActsExamples::Sequencer& sequencer) {
34  using namespace ActsExamples;
35 
36  // Read some standard options
37  auto logLevel = Options::readLogLevel(vars);
38 
39  // Read truth hits from CSV files
40  auto simHitReaderCfg = Options::readCsvSimHitReaderConfig(vars);
41  simHitReaderCfg.inputStem = "hits";
42  simHitReaderCfg.outputSimHits = "hits";
43  sequencer.addReader(
44  std::make_shared<CsvSimHitReader>(simHitReaderCfg, logLevel));
45 
46  return simHitReaderCfg;
47 }
48 
51  ActsExamples::Sequencer& sequencer) {
52  using namespace ActsExamples;
53 
54  // Read some standard options
55  auto logLevel = Options::readLogLevel(vars);
56 
57  // Read particles (initial states) and clusters from CSV files
58  auto particleReader = Options::readCsvParticleReaderConfig(vars);
59  particleReader.inputStem = "particles_initial";
60  particleReader.outputParticles = "particles_initial";
61  sequencer.addReader(
62  std::make_shared<CsvParticleReader>(particleReader, logLevel));
63 
64  return particleReader;
65 }
66 
69  ActsExamples::Sequencer& sequencer,
70  std::shared_ptr<const ActsExamples::RandomNumbers> rnd,
71  std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry,
72  const std::string& inputSimHits) {
73  using namespace ActsExamples;
74 
75  // Read some standard options
76  auto logLevel = Options::readLogLevel(vars);
77 
78  auto digiCfg = ActsExamples::DigitizationConfig(
79  vars["digi-merge"].as<bool>(), vars["digi-merge-nsigma"].as<double>(),
80  vars["digi-merge-common-corner"].as<bool>(),
82  vars["digi-config-file"].as<std::string>()));
83  // Common options for digitization
84  digiCfg.inputSimHits = inputSimHits;
85  digiCfg.randomNumbers = std::move(rnd);
86  digiCfg.trackingGeometry = std::move(trackingGeometry);
87  sequencer.addAlgorithm(
88  std::make_shared<DigitizationAlgorithm>(digiCfg, logLevel));
89 
90  if (not vars["dump-digi-config"].as<std::string>().empty()) {
91  writeDigiConfigToJson(digiCfg.digitizationConfigs,
92  vars["dump-digi-config"].as<std::string>());
93  }
94 
95  return digiCfg;
96 }
97 
100  ActsExamples::Sequencer& sequencer,
101  std::shared_ptr<const ActsExamples::RandomNumbers> rnd,
102  const std::string& inputParticles) {
103  using namespace ActsExamples;
104  using namespace Acts::UnitLiterals;
105 
106  // Read some standard options
107  auto logLevel = Options::readLogLevel(vars);
108 
109  // Create smeared particles states
110  ParticleSmearing::Config particleSmearingCfg =
112  particleSmearingCfg.inputParticles = inputParticles;
113  particleSmearingCfg.outputTrackParameters = "smearedparameters";
114  particleSmearingCfg.randomNumbers = std::move(rnd);
115  sequencer.addAlgorithm(
116  std::make_shared<ParticleSmearing>(particleSmearingCfg, logLevel));
117 
118  return particleSmearingCfg;
119 }
120 
123  ActsExamples::Sequencer& sequencer) {
124  using namespace ActsExamples;
125  // Read some standard options
126  auto logLevel = Options::readLogLevel(vars);
127 
128  // Read particles (initial states) from CSV files
129  auto measurementsReader = Options::readCsvMeasurementReaderConfig(vars);
130  measurementsReader.outputMeasurements = "measurements";
131  measurementsReader.outputMeasurementSimHitsMap = "measurements2hits";
132  measurementsReader.outputSourceLinks = "source_links";
133  measurementsReader.outputClusters = "clusters";
134  sequencer.addReader(
135  std::make_shared<CsvMeasurementReader>(measurementsReader, logLevel));
136 
137  return measurementsReader;
138 }