70 const EventContext& ctx = Gaudi::Hive::currentContext();
81 unsigned int nJets(importedJets->size());
82 std::vector<const xAOD::Jet*> jetToCheck; jetToCheck.clear();
85 unsigned int nTracks = importedTrackParticles->size();
87 const size_t nPFONeutral = importedPFONeutral->size();
88 const size_t nPFOCharged = importedPFOCharged->size() ;
89 unsigned int nPFOs = nPFOCharged + nPFONeutral;
90 if (nPFOs==0 && nTracks==0)
return StatusCode::SUCCESS;
93 std::vector<bool> maskTracks;
94 maskTracks.assign(nTracks,
false);
97 std::vector< bool > pfomaskNeutral( nPFONeutral,
false );
98 std::vector< bool > pfomaskCharged( nPFOCharged,
false );
103 unsigned int nUFOs(importedUFOs->size());
106 std::vector<bool> maskUFOs;
107 maskUFOs.assign(nUFOs,
false);
111 std::vector<int>
entries = m_parser->evaluateAsVector();
115 ATH_MSG_ERROR(
"Sizes incompatible! Are you sure your selection string used jets??");
116 return StatusCode::FAILURE;
119 for (
unsigned int i=0;
i<nJets; ++
i)
if (
entries[
i]==1) jetToCheck.push_back((*importedJets)[
i]);
124 for(
const auto *
jet : *importedJets){
125 for(
size_t j = 0; j <
jet->numConstituents(); ++j ) {
126 auto ufo =
jet->constituentLinks().at(j);
127 int index = ufo.index();
128 maskUFOs[
index] =
true;
136 maskTracks[index_trk] =
true;
143 if(index_pfo<0)
continue;
147 if(fe->
signalType()==xAOD::FlowElement::SignalType::ChargedPFlow){
148 pfomaskCharged.at( index_pfo ) =
true;
150 else if(fe->
signalType()==xAOD::FlowElement::SignalType::NeutralPFlow){
151 pfomaskNeutral.at( index_pfo ) =
true;
159 for (
auto & jetIt : jetToCheck) {
160 for(
size_t j = 0; j < jetIt->numConstituents(); ++j ) {
161 auto ufo = jetIt->constituentLinks().at(j);
162 int index = ufo.index();
163 maskUFOs[
index] =
true;
171 maskTracks[index_trk] =
true;
177 if(index_pfo<0)
continue;
181 if(fe->
signalType()==xAOD::FlowElement::SignalType::ChargedPFlow){
182 pfomaskCharged.at( index_pfo ) =
true;
184 else if(fe->
signalType()==xAOD::FlowElement::SignalType::NeutralPFlow){
185 pfomaskNeutral.at( index_pfo ) =
true;
194 importedTrackParticles.keep (maskTracks);
196 importedPFONeutral.keep (pfomaskNeutral);
197 importedPFOCharged.keep (pfomaskCharged);
198 importedUFOs.keep (maskUFOs);
204 tempPFOCharged.keep(pfomaskCharged);
205 tempPFONeutral.keep(pfomaskNeutral);
208 return StatusCode::SUCCESS;