52 ATH_MSG_ERROR(
"Wrong user setup! You need to give a valid name for both the Input, Output, and SelectedViewContainers!");
53 return StatusCode::FAILURE;
60 const std::size_t totSize = 1 +
m_suffixes.value().size();
66 for ( std::size_t
i=1;
i<totSize; ++
i ) {
67 const std::string& currentSuffix =
m_suffixes.value()[
i-1];
68 ATH_MSG_VERBOSE(
"Using current suffix " << currentSuffix <<
" to search for matching containers");
69 if ( currentSuffix.rfind(
m_separator.value(),0 ) == 0 ) {
96 for ( std::size_t
i=0;
i<totSize; ++
i ) {
100 std::vector<std::string> inViewNames;
101 std::vector<std::string> outViewNames;
103 ATH_MSG_VERBOSE(
"Looking at input view container name: " << inViewName);
105 if (
pos == std::string::npos ){
107 inViewNames.push_back(inViewName);
108 outViewNames.push_back(
m_outPrefix.value() + inViewName );
109 ATH_MSG_VERBOSE(
"Added input name " << inViewNames.back() <<
" and output name " << outViewNames.back());
113 const std::string foundSuffix = inViewName.substr(
pos, std::string::npos);
117 inViewNames.push_back(inViewName);
118 outViewNames.push_back(
m_outPrefix.value() + inViewName );
119 ATH_MSG_VERBOSE(
"Added2 input name " << inViewNames.back() <<
" and output name " << outViewNames.back());
127 const std::string& currentSuffix =
m_suffixes.value()[
i-1];
129 std::vector<std::string> inViewNames;
130 std::vector<std::string> outViewNames;
132 ATH_MSG_VERBOSE(
"Looking at current input view container name: " << inViewName);
133 if ( inViewName.find(
m_separator.value()+currentSuffix) != std::string::npos ){
134 inViewNames.push_back(inViewName);
135 outViewNames.push_back(
m_outPrefix.value() + inViewName );
136 ATH_MSG_VERBOSE(
"Added3 input name " << inViewNames.back() <<
" and output name " << outViewNames.back());
151 ATH_MSG_VERBOSE(
" Have " << inViewNameList.size() <<
" in view elements and " << outViewNameList.size() <<
" out view elements");
152 for ( std::size_t j=0; j<inViewNameList.size(); ++j ){
154 const std::string& inName = inViewNameList[j];
155 const std::string&
outName = outViewNameList[j];
161 return StatusCode::SUCCESS;
170 return StatusCode::SUCCESS;
199 ATH_MSG_FATAL(
"We couldn't determine the type of the container... abort!");
200 return StatusCode::FAILURE;
211 if ( inContSize != inCont->size() ){
212 ATH_MSG_FATAL(
"The input container and its shallow copies don't have the same size! Aborting...");
213 return StatusCode::FAILURE;
220 std::vector<bool> keepParticleVec (inContSize,
false);
227 if ( inViewCont->
size() > inContSize ){
228 ATH_MSG_FATAL(
"One of the input view containers is larger than the input container... aborting.");
229 return StatusCode::FAILURE;
232 const std::size_t
idx =
part->index();
233 keepParticleVec[
idx] =
true;
239 ATH_CHECK( this->removeParticles<xAOD::PhotonContainer>(keepParticleVec) );
242 ATH_CHECK( this->removeParticles<xAOD::ElectronContainer>(keepParticleVec) );
245 ATH_CHECK( this->removeParticles<xAOD::MuonContainer>(keepParticleVec) );
248 ATH_CHECK( this->removeParticles<xAOD::TauJetContainer>(keepParticleVec) );
251 ATH_CHECK( this->removeParticles<xAOD::JetContainer>(keepParticleVec) );
254 ATH_CHECK( this->removeParticles<xAOD::TruthParticleContainer>(keepParticleVec) );
257 ATH_CHECK( this->removeParticles<xAOD::CompositeParticleContainer>(keepParticleVec) );
260 ATH_CHECK( this->removeParticles<xAOD::PFOContainer>(keepParticleVec) );
263 ATH_CHECK( this->removeParticles<xAOD::NeutralParticleContainer>(keepParticleVec) );
266 ATH_CHECK( this->removeParticles<xAOD::TrackParticleContainer>(keepParticleVec) );
269 ATH_CHECK( this->removeParticles<xAOD::ParticleContainer>(keepParticleVec) );
272 ATH_CHECK( this->removeParticles<xAOD::CaloClusterContainer>(keepParticleVec) );
275 return StatusCode::SUCCESS;