File indexing completed on 2025-09-17 08:55:24
0001 #pragma once
0002
0003 #include <JANA/JEventProcessor.h>
0004 #include <algorithm>
0005 #include <cctype>
0006 #include <string>
0007 #include <vector>
0008
0009 #include "extensions/spdlog/SpdlogMixin.h"
0010
0011 class DumpFlags_processor : public JEventProcessor, public eicrecon::SpdlogMixin {
0012 public:
0013
0014
0015
0016
0017
0018
0019 void Init() override;
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 void Process(const std::shared_ptr<const JEvent>& event) override;
0030
0031
0032
0033
0034
0035
0036
0037 void Finish() override;
0038
0039 private:
0040
0041 std::string m_python_file_name = "";
0042
0043
0044 std::string m_markdown_file_name = "";
0045
0046
0047 std::string m_json_file_name = "";
0048
0049
0050 std::string m_janaconfig_file_name = "jana.conf";
0051
0052
0053 bool m_print_to_screen = true;
0054
0055
0056 std::vector<std::string> m_reco_prefixes = {
0057 "B0TRK", "BEMC", "DRICH", "BTRK", "BVTX", "ECTRK", "EEMC", "FOFFMTRK", "HCAL",
0058 "MPGD", "RPOTS", "LOWQ2", "ZDC", "Tracking", "Reco", "Digi", "Calorimetry"};
0059
0060
0061 bool isReconstructionFlag(
0062 std::string
0063 flag_name) {
0064
0065
0066 std::transform(flag_name.begin(), flag_name.end(), flag_name.begin(),
0067 static_cast<int (*)(int)>(&std::tolower));
0068
0069 for (auto subsystem : m_reco_prefixes) {
0070
0071
0072 std::transform(subsystem.begin(), subsystem.end(), subsystem.begin(),
0073 static_cast<int (*)(int)>(&std::tolower));
0074
0075
0076
0077 if (flag_name.rfind(subsystem, 0) == 0) {
0078
0079 return true;
0080 }
0081 }
0082
0083
0084 return false;
0085 }
0086
0087 std::string findCategory(
0088 std::string
0089 flag_name) {
0090
0091
0092 std::transform(flag_name.begin(), flag_name.end(), flag_name.begin(),
0093 static_cast<int (*)(int)>(&std::tolower));
0094
0095 for (auto subsystem : m_reco_prefixes) {
0096
0097
0098 std::string original_subsystem_name = subsystem;
0099 std::transform(subsystem.begin(), subsystem.end(), subsystem.begin(),
0100 static_cast<int (*)(int)>(&std::tolower));
0101
0102
0103
0104 if (flag_name.rfind(subsystem, 0) == 0) {
0105
0106 return original_subsystem_name;
0107 }
0108 }
0109
0110
0111 return "";
0112 }
0113 };