EICrecon
JANA based reconstruction for the EPIC detector
Loading...
Searching...
No Matches
IrtCherenkovParticleIDConfig.h
Go to the documentation of this file.
1// Copyright 2023, Christopher Dilks
2// Subject to the terms in the LICENSE file found in the top-level directory.
3
4#pragma once
5
6#include <Evaluator/DD4hepUnits.h>
7#include <algorithms/logger.h>
8#include <spdlog/spdlog.h>
9
10namespace eicrecon {
11
12// radiator config parameters
14 double referenceRIndex; // reference radiator refractive index
15 double attenuation; // reference radiator attenuation length [mm]; set to 0 to disable
16 std::string smearingMode; // smearing type: "gaussian", "uniform"
17 double smearing; // smearing amount [radians]
18};
19
20// IRT algorithm config
22public:
24 // CONFIGURATION PARAMETERS
25 // NOTE: some defaults are hard-coded here; override externally
26
27 unsigned numRIndexBins = 100; // number of bins to interpolate the refractive index vs. energy
28
29 /* radiator-specific settings; handled by `RadiatorConfig` struct (see above)
30 * example: radiators.insert({ "Aerogel", RadiatorConfig{ ... }});
31 * radiators.insert({ "Gas", RadiatorConfig{ ... }});
32 */
33 std::map<std::string, RadiatorConfig> radiators;
34
35 /* list of PDG codes to identify with this PID algorithm
36 * example: std::vector<int> pdgList = { 11, 211, 321, 2212 };
37 */
38 std::vector<int> pdgList;
39
40 /* cheat modes: useful for test purposes, or idealizing; the real PID should run with all
41 * cheat modes off
42 */
43 bool cheatPhotonVertex = false; // if true, use MC photon vertex, wavelength, and refractive index
44 bool cheatTrueRadiator = false; // if true, use MC truth to obtain true radiator, for each hit
45
46 //
48
49 // boolean: true if any cheat mode is enabled
51
52 // stream all parameters
53 friend std::ostream& operator<<(std::ostream& os, const IrtCherenkovParticleIDConfig& cfg) {
54 os << fmt::format("{:=^60}", " IrtCherenkovParticleIDConfig Settings ") << std::endl;
55 auto print_param = [&os](auto name, auto val) {
56 os << fmt::format(" {:>20} = {:<}", name, val) << std::endl;
57 };
58 print_param("numRIndexBins", cfg.numRIndexBins);
59 print_param("cheatPhotonVertex", cfg.cheatPhotonVertex);
60 print_param("cheatTrueRadiator", cfg.cheatTrueRadiator);
61 os << "pdgList:" << std::endl;
62 for (const auto& pdg : cfg.pdgList)
63 os << fmt::format(" {}", pdg) << std::endl;
64 for (const auto& [name, rad] : cfg.radiators) {
65 os << fmt::format("{:-<60}", fmt::format("--- {} config ", name)) << std::endl;
66 print_param("smearingMode", rad.smearingMode);
67 print_param("smearing", rad.smearing);
68 print_param("referenceRIndex", rad.referenceRIndex);
69 print_param("attenuation", rad.attenuation);
70 }
71 os << fmt::format("{:=^60}", "") << std::endl;
72 return os;
73 };
74};
75
76} // namespace eicrecon
Definition IrtCherenkovParticleIDConfig.h:21
bool CheatModeEnabled() const
Definition IrtCherenkovParticleIDConfig.h:50
friend std::ostream & operator<<(std::ostream &os, const IrtCherenkovParticleIDConfig &cfg)
Definition IrtCherenkovParticleIDConfig.h:53
unsigned numRIndexBins
Definition IrtCherenkovParticleIDConfig.h:27
std::vector< int > pdgList
Definition IrtCherenkovParticleIDConfig.h:38
bool cheatTrueRadiator
Definition IrtCherenkovParticleIDConfig.h:44
std::map< std::string, RadiatorConfig > radiators
Definition IrtCherenkovParticleIDConfig.h:33
bool cheatPhotonVertex
Definition IrtCherenkovParticleIDConfig.h:43
-client
Definition CalorimeterClusterRecoCoG.cc:37
Definition IrtCherenkovParticleIDConfig.h:13
double attenuation
Definition IrtCherenkovParticleIDConfig.h:15
double smearing
Definition IrtCherenkovParticleIDConfig.h:17
double referenceRIndex
Definition IrtCherenkovParticleIDConfig.h:14
std::string smearingMode
Definition IrtCherenkovParticleIDConfig.h:16