33 template<
typename Type> StatusCode AsgViewFromSelectionAlg ::
36 const Type *input =
nullptr;
39 for (
const auto particle : *input)
44 if ((accessor.first->getBits (*particle) | accessor.second) !=
selectionAccept())
52 viewCopy->push_back (particle);
77 return StatusCode::SUCCESS;
81 auto deepCopy = std::make_unique<Type> ();
82 auto aux = std::make_unique<xAOD::AuxContainerBase> ();
83 deepCopy->setStore (
aux.get());
84 deepCopy->reserve (viewCopy->size());
85 for (
auto particle : *viewCopy)
87 typename Type::value_type pcopy =
new typename Type::base_value_type();
88 deepCopy->push_back (pcopy);
98 return StatusCode::SUCCESS;
104 StatusCode AsgViewFromSelectionAlg ::
111 return StatusCode::SUCCESS;
159 ANA_MSG_ERROR (
"unknown type contained in AsgViewFromSelectionAlg, please extend it");
160 return StatusCode::FAILURE;
168 StatusCode AsgViewFromSelectionAlg ::
171 return StatusCode::SUCCESS;
177 StatusCode AsgViewFromSelectionAlg ::
187 ANA_MSG_ERROR (
"ignore property can't have more properties than selection property");
188 return StatusCode::FAILURE;
190 for (std::size_t iter = 0, end =
m_selection.size(); iter != end; ++ iter)
195 std::unique_ptr<ISelectionReadAccessor> accessor;
197 m_accessors.push_back (std::make_pair (std::move (accessor), ignore));
200 return StatusCode::SUCCESS;
205 StatusCode AsgViewFromSelectionAlg ::
212 return StatusCode::SUCCESS;
DataVector adapter that acts like it holds const pointers.
ServiceHandle< StoreGateSvc > & evtStore()
Gaudi::Property< std::vector< std::string > > m_selection
StatusCode executeTemplate(const CP::SystematicSet &sys)
the templated version of execute for a single systematic
Gaudi::Property< bool > m_sortPt
Sort the output (view) container by pT.
Gaudi::Property< std::size_t > m_sizeLimit
StatusCode(AsgViewFromSelectionAlg::* m_function)(const CP::SystematicSet &sys)
SysReadHandle< xAOD::IParticleContainer > m_inputHandle
the input collection we run on
Gaudi::Property< bool > m_allowMissing
Allow the input container to be missing.
StatusCode executeMissing(const CP::SystematicSet &sys)
The version of execute for missing input containers.
SysWriteHandle< xAOD::IParticleContainer > m_outputHandle
the output view container we produce
Gaudi::Property< std::vector< SelectionType > > m_ignore
Gaudi::Property< bool > m_deepCopy
Perform a deep copy for creating the output container.
std::vector< std::pair< std::unique_ptr< ISelectionReadAccessor >, SelectionType > > m_accessors
the list of accessors and cut ignore list
SysListHandle m_systematicsList
the systematics list we run
Class to wrap a set of SystematicVariations.
Class providing the definition of the 4-vector interface.
Workaround x86 precision issues for FP inequality comparisons.
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
Select isolated Photons, Electrons and Muons.
StatusCode makeSelectionReadAccessor(const std::string &expr, std::unique_ptr< ISelectionReadAccessor > &accessor, bool defaultToChar)
make the ISelectionReadAccessor for the given name
uint32_t SelectionType
the type for selection decorations that are meant to hold a asg::AcceptData
constexpr SelectionType selectionAccept()
the selection decoration to apply for objects that are selected
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container version".
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
DiTauJetContainer_v1 DiTauJetContainer
Definition of the current DiTauJet container version.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.