@@ -2515,7 +2515,7 @@ void createNewParti(AnalysisObjects* ao, vector<Node*> *criteria, std::vector<my
25152515 alv.SetPxPyPzE (0 ,0 ,0 ,0 );
25162516 DEBUG (" \n " );
25172517 }
2518- ao->combos . insert ( pair <string,vector<dbxParticle> > ( name, combination) ) ;
2518+ ( ao->combos )[ name] = combination;
25192519
25202520 vector<vector<int >> bad_combinations;
25212521 set<vector<int >> good_combinations;
@@ -2569,8 +2569,8 @@ void createNewParti(AnalysisObjects* ao, vector<Node*> *criteria, std::vector<my
25692569 particles->at (jp)->index =temp_index[abs (1 +tidx1)]; // means we respect order -1, -2
25702570 DEBUG (" new index: " << particles->at (jp)->index <<" \n " );
25712571 } else {
2572- // particles->at(jp)->index=ipart;
2573- // particles->at(jp)->collection=name;
2572+ particles->at (jp)->index =ipart;
2573+ particles->at (jp)->collection =name;
25742574 ;
25752575 }
25762576 }
@@ -2579,10 +2579,9 @@ void createNewParti(AnalysisObjects* ao, vector<Node*> *criteria, std::vector<my
25792579 DEBUG (" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ P or F: ~~~~~~ " <<ppassed<<" \n " );
25802580 if (!ppassed) {
25812581
2582- DEBUG (" Removing:" <<name<<" " <<ipart<<" th combi.\n " );
2583- (ao->combos ).find (name)->second .erase ( (ao->combos ).find (name)->second .begin ()+ipart);
2584- bad_combinations.push_back (combi_out[ipart]);
2585- good_combinations.erase (combi_out[ipart]);
2582+ DEBUG (" marking as bad:" <<name<<" " <<ipart<<" th combi.\n " );
2583+ bad_combinations.push_back (combi_out[ipart]);
2584+ good_combinations.erase (combi_out[ipart]);
25862585 } else {
25872586 good_combinations.insert (combi_out[ipart]);
25882587 }
@@ -2650,10 +2649,20 @@ void createNewParti(AnalysisObjects* ao, vector<Node*> *criteria, std::vector<my
26502649 cutIterator++;
26512650 }// end of cut iterator loop
26522651
2652+ // remove the bad combinations here
2653+ for (int ipart=ipart_max-1 ; ipart>=0 ; ipart--){ // loop over combis
2654+ std::vector< vector<int > >::iterator itb; // bad list iterator
2655+ itb=find (bad_combinations.begin (), bad_combinations.end (), combi_out[ipart]);
2656+ if ( itb != bad_combinations.end () ) {
2657+ DEBUG (" Removing:" <<ipart<<" of combis:" <<(ao->combos ).find (name)->second .size () );
2658+ (ao->combos ).find (name)->second .erase ( (ao->combos ).find (name)->second .begin ()+ipart);
2659+ }
2660+ }
2661+
26532662 if (requested_max<=0 ) { // probably no particle available,never here
26542663 vector<vector<int >> table_B;
26552664 indicesA indexA={table_B, 0 , 0 };
2656- ao->combosA . insert ( pair <string, indicesA > ( name, indexA) ) ;
2665+ ( ao->combosA )[ name] = indexA;
26572666 return ;
26582667 }
26592668
@@ -2739,7 +2748,7 @@ void createNewParti(AnalysisObjects* ao, vector<Node*> *criteria, std::vector<my
27392748 }
27402749
27412750 indicesA indexA={table_B, amaxrow, (int )table_B.size () };
2742- ao->combosA . insert ( pair <string, indicesA > ( name, indexA) ) ;
2751+ ( ao->combosA )[ name] = indexA;
27432752
27442753 out_selection.clear ();
27452754// NANT's code, to be commented in later
0 commit comments