81 {
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100 std::unique_ptr<IJetGroupProduct> jgp (nullptr);
101
102 if (siblings.empty()) {
104 return jgp;
105 }
106
107
108 for(const auto& s : siblings) {
109 if (satisfiedBy.at(s).empty()) {
111 return jgp;
112 }
113 }
114
115
116 std::map<int, std::vector<std::size_t>> clique_map;
117 std::for_each(siblings.begin(),
118 siblings.end(),
119 [&clique_map, &condClique](std::size_t s){
120 auto clique = condClique[s];
121 if (clique != -1) {
122 clique_map[clique].push_back(s);}});
123
124
125
126 auto n_required = std::accumulate(siblings.cbegin(),
127 siblings.cend(),
128 0u,
129 [&condMult, &condCap](const auto& sofar,
130 const auto& ind){
131 return sofar +
132 condMult.at(ind)*condCap.at(ind);});
133
134
135 bool cap1{true};
136 for(const auto& s: siblings) {
137 if (condCap.at(s) != 1) {
138 cap1 = false;
139 break;
140 }
141 }
142
143 if (simpleTree and cap1) {
144 if (clique_map.size() == 1){
146 n_required));
147 return jgp;
148 }
149
150
151
152
153
154
155 bool enough{true};
156 for (const auto& s : siblings) {
157 if ((satisfiedBy.at(s)).size() < n_required) {
158 enough = false;
159 break;
160 }
161 }
162
163 if (enough) {
165 satisfiedBy));
166 return jgp;
167 }
168
171 satisfiedBy));
172 return jgp;
173 }
174
176 return jgp;
177 }
178
179
180
181
182
183
184 if (parentCap == 0 and siblings.size() == 1) {
185
187 satisfiedBy,
188 jg2elemjgs));
189 return jgp;
190 }
191
192
193
194
195
196
197
198
199
201 jg2elemjgs));
202 return jgp;
203}
bool willPassSimpleTree(const std::vector< std::size_t > &siblings, const CondInd2JetGroupsInds &satisfiedBy, const std::vector< std::size_t > &condMult)