21 typedef std::vector<std::pair<std::regex, ConstituentsEDMType>> TypeRegexes;
22 typedef std::vector<std::pair<std::regex, std::string>>
StringRegexes;
23 typedef std::vector<std::pair<std::regex, ConstituentsSortOrder>> SortRegexes;
24 typedef std::vector<std::pair<std::regex, ConstituentsSelection>> SelRegexes;
27 const std::string&
name,
28 const std::vector<std::string>& input_variables,
29 const TypeRegexes& type_regexes) {
33 for (
const auto&
varname: input_variables) {
36 if (
pos != std::string::npos){
42 input.flip_sign =
false;
44 "iparticle type matching");
51 const std::string&
name,
52 const std::vector<std::string>& input_variables,
53 const TypeRegexes& type_regexes,
54 const SortRegexes& sort_regexes,
55 const SelRegexes& select_regexes,
61 "track order matching");
63 "track selection matching");
64 for (
const auto&
varname: input_variables) {
68 "track type matching");
70 input.flip_sign=
false;
85 const std::string &
name,
86 const std::vector<std::string> & input_variables,
91 TypeRegexes iparticle_type_regexes {
96 TypeRegexes trk_type_regexes {
117 SortRegexes trk_sort_regexes {
123 SelRegexes trk_select_regexes {
134 if (
name.find(
"tracks") != std::string::npos){
137 flip_sequences=
std::regex(
".*signed_[dz]0.*");
140 flip_sequences=
std::regex(
"(.*signed_[dz]0.*)|d0|z0SinTheta");
142 config = get_track_input_config(
143 name, input_variables,
144 trk_type_regexes, trk_sort_regexes, trk_select_regexes,
145 flip_sequences, flip_config);
147 config.output_name =
"tracks";
149 else if (
name.find(
"flows") != std::string::npos){
150 config = get_iparticle_input_config(
151 name, input_variables,
152 iparticle_type_regexes);
154 config.output_name =
"flows";
157 throw std::runtime_error(
158 "Unknown constituent type: " +
name +
". Only tracks and flows are supported."