23int main(
int argc,
char** argv)
27 std::string configDir;
29 configDir = std::string(argv[1]);
32 fmt::print(
"Using top-level configuration directory {}\n", configDir);
35 for(
int example = 1; example <= 6; example++) {
39 auto algo = std::make_unique<iguana::clas12::ZVertexFilter>();
40 algo->SetLogLevel(
"debug");
48 auto key = algo->PrepareEvent(4800);
49 assert((algo->GetRunNum(key) == 4800));
50 assert((algo->GetElectronZcuts(key).at(0) == -13.0));
51 assert((algo->GetElectronZcuts(key).at(1) == 12.0));
63 algo->SetElectronZcuts(-5.0, 3.0, key);
64 assert((algo->GetElectronZcuts(key).at(0) == -5.0));
65 assert((algo->GetElectronZcuts(key).at(1) == 3.0));
72 algo->SetConfigFile(configDir +
"/my_z_vertex_cuts.yaml");
74 auto key = algo->PrepareEvent(5500);
75 assert((algo->GetElectronZcuts(key).at(0) == -0.8));
76 assert((algo->GetElectronZcuts(key).at(1) == 0.7));
84 algo->SetConfigDirectory(configDir);
85 algo->SetConfigFile(
"my_z_vertex_cuts.yaml");
87 auto key = algo->PrepareEvent(0);
88 assert((algo->GetElectronZcuts(key).at(0) == -1.5));
89 assert((algo->GetElectronZcuts(key).at(1) == 1.3));
99 algo->SetConfigDirectory(configDir +
"/my_config_directory");
101 auto key = algo->PrepareEvent(0);
102 assert((algo->GetElectronZcuts(key).at(0) == -15.0));
103 assert((algo->GetElectronZcuts(key).at(1) == 15.0));
110 algo->SetConfigDirectory(configDir);
111 algo->SetConfigFile(
"my_combined_config_file.yaml");
113 auto key = algo->PrepareEvent(0);
114 assert((algo->GetElectronZcuts(key).at(0) == -33.0));
115 assert((algo->GetElectronZcuts(key).at(1) == 11.0));
121 fmt::print(stderr,
"ERROR: unknown example number '{}'\n", example);