Skip to content

Commit f1d4be1

Browse files
committed
fix: get rid of IrtCherenkovParticleIDConfig::Print
1 parent f0e3ea2 commit f1d4be1

File tree

3 files changed

+23
-26
lines changed

3 files changed

+23
-26
lines changed

src/algorithms/pid/IrtCherenkovParticleID.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void IrtCherenkovParticleID::init(CherenkovDetectorCollection* irt_det_coll) {
4141
m_irt_det_coll = irt_det_coll;
4242

4343
// print the configuration parameters
44-
m_cfg.Print<algorithms::LogLevel::kDebug>(this);
44+
debug() << m_cfg << endmsg;
4545

4646
// inform the user if a cheat mode is enabled
4747
m_cfg.PrintCheats(this);

src/algorithms/pid/IrtCherenkovParticleID.h

-22
Original file line numberDiff line numberDiff line change
@@ -111,26 +111,4 @@ void IrtCherenkovParticleIDConfig::PrintCheats(const eicrecon::IrtCherenkovParti
111111
print_param("cheatTrueRadiator", cheatTrueRadiator, "use MC truth to obtain true radiator");
112112
}
113113

114-
// print all parameters
115-
template <algorithms::LogLevel lvl>
116-
void IrtCherenkovParticleIDConfig::Print(const eicrecon::IrtCherenkovParticleID* logger) {
117-
logger->log<lvl>("{:=^60}", " IrtCherenkovParticleIDConfig Settings ");
118-
auto print_param = [&logger](auto name, auto val) {
119-
logger->log<lvl>(" {:>20} = {:<}", name, val);
120-
};
121-
print_param("numRIndexBins", numRIndexBins);
122-
PrintCheats<lvl>(logger, true);
123-
logger->log<lvl>("pdgList:");
124-
for (const auto& pdg : pdgList)
125-
logger->log<lvl>(" {}", pdg);
126-
for (const auto& [name, rad] : radiators) {
127-
logger->log<lvl>("{:-<60}", fmt::format("--- {} config ", name));
128-
print_param("smearingMode", rad.smearingMode);
129-
print_param("smearing", rad.smearing);
130-
print_param("referenceRIndex", rad.referenceRIndex);
131-
print_param("attenuation", rad.attenuation);
132-
}
133-
logger->log<lvl>("{:=^60}", "");
134-
}
135-
136114
} // namespace eicrecon

src/algorithms/pid/IrtCherenkovParticleIDConfig.h

+22-3
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,27 @@ class IrtCherenkovParticleIDConfig {
5555
// boolean: true if any cheat mode is enabled
5656
bool CheatModeEnabled() const { return cheatPhotonVertex || cheatTrueRadiator; }
5757

58-
// print all parameters
59-
template <algorithms::LogLevel lvl = algorithms::LogLevel::kDebug>
60-
void Print(const eicrecon::IrtCherenkovParticleID* logger);
58+
// stream all parameters
59+
friend std::ostream& operator<<(std::ostream& os, const IrtCherenkovParticleIDConfig& cfg) {
60+
os << fmt::format("{:=^60}", " IrtCherenkovParticleIDConfig Settings ") << std::endl;
61+
auto print_param = [&os](auto name, auto val) {
62+
os << fmt::format(" {:>20} = {:<}", name, val) << std::endl;
63+
};
64+
print_param("numRIndexBins", cfg.numRIndexBins);
65+
//PrintCheats<lvl>(logger, true);
66+
os << "pdgList:" << std::endl;
67+
for (const auto& pdg : cfg.pdgList)
68+
os << fmt::format(" {}", pdg) << std::endl;
69+
for (const auto& [name, rad] : cfg.radiators) {
70+
os << fmt::format("{:-<60}", fmt::format("--- {} config ", name)) << std::endl;
71+
print_param("smearingMode", rad.smearingMode);
72+
print_param("smearing", rad.smearing);
73+
print_param("referenceRIndex", rad.referenceRIndex);
74+
print_param("attenuation", rad.attenuation);
75+
}
76+
os << fmt::format("{:=^60}", "") << std::endl;
77+
return os;
78+
};
6179
};
80+
6281
} // namespace eicrecon

0 commit comments

Comments
 (0)