104 keepOrDropAll_(
drop),
107 produces<GenParticleCollection>();
108 produces<edm::Association<reco::GenParticleCollection>>();
126 std::vector<size_t> &allIndices) {
129 size_t cachedIndex =
index;
134 if (
find(allIndices.begin(), allIndices.end(),
index) == allIndices.end()) {
135 allIndices.push_back(
index);
136 if (cachedIndex !=
index) {
147 std::vector<size_t> &allIndices) {
150 size_t cachedIndex =
index;
155 if (
find(allIndices.begin(), allIndices.end(),
index) == allIndices.end()) {
156 allIndices.push_back(
index);
157 if (cachedIndex !=
index) {
171 ::helper::SelectCode code;
176 <<
"selections \"keep *\" and \"drop *\" can be used only as first options. Here used in position # "
179 switch (code.keepOrDrop_) {
180 case ::helper::SelectCode::kDrop:
183 case ::helper::SelectCode::kKeep:
197 const size_t n =
src->size();
201 const pair<StringCutObjectSelector<GenParticle>, SelectCode> &
sel =
select_[
j];
202 SelectCode code =
sel.second;
204 for (
size_t i = 0;
i <
n; ++
i) {
207 int keepOrDrop =
keep;
208 switch (code.keepOrDrop_) {
209 case SelectCode::kKeep:
212 case SelectCode::kDrop:
216 std::vector<size_t> allIndicesDa;
217 std::vector<size_t> allIndicesMo;
218 switch (code.daughtersDepth_) {
219 case SelectCode::kAll:
222 case SelectCode::kFirst:
227 switch (code.mothersDepth_) {
228 case SelectCode::kAll:
231 case SelectCode::kFirst:
241 for (
size_t i = 0;
i <
n; ++
i) {
250 auto out = std::make_unique<GenParticleCollection>();
266 vector<size_t> daIndxs, daNewIndxs;
268 std::sort(daNewIndxs.begin(), daNewIndxs.end());
269 for (
size_t i = 0;
i < daNewIndxs.size(); ++
i)
272 vector<size_t> moIndxs, moNewIndxs;
274 std::sort(moNewIndxs.begin(), moNewIndxs.end());
275 for (
size_t i = 0;
i < moNewIndxs.size(); ++
i)
280 auto orig2new = std::make_unique<edm::Association<reco::GenParticleCollection>>(oh);
283 orig2newFiller.fill();
288 vector<size_t> &daNewIndxs,
292 if (
find(daIndxs.begin(), daIndxs.end(), dau.
key()) == daIndxs.end()) {
293 daIndxs.push_back(dau.
key());
296 daNewIndxs.push_back(
idx);
307 vector<size_t> &moNewIndxs,
311 if (
find(moIndxs.begin(), moIndxs.end(), mom.
key()) == moIndxs.end()) {
312 moIndxs.push_back(mom.
key());
315 moNewIndxs.push_back(
idx);