|
ATLAS Offline Software
|
Go to the documentation of this file.
9 #ifndef JETRECTOOLS_JETCONSTITUENTMODSEQUENCE_H
10 #define JETRECTOOLS_JETCONSTITUENTMODSEQUENCE_H
60 Gaudi::Property<std::string>
m_inputContainer {
this,
"InputContainer",
"",
"The input container for the sequence"};
61 Gaudi::Property<std::string>
m_outputContainer = {
this,
"OutputContainer",
"",
"The output container for the sequence"};
62 Gaudi::Property<bool>
m_byVertex = {
this,
"DoByVertex",
false,
"True if we should match to each primary vertex, not just PV0"};
71 ToolHandleArray<IJetConstituentModifier>
m_modifiers{this ,
"Modifiers" , {} ,
"List of constit modifier tools."};
74 ToolHandle<GenericMonitoringTool>
m_monTool{
this,
"MonTool",
"",
"Monitoring tool"};
114 template<
class T,
class U>
130 if(!inHandle.isValid()){
132 return StatusCode::FAILURE;
135 std::pair< T*, xAOD::ShallowAuxContainer* > newconstit =
142 ATH_CHECK(handle.record(std::unique_ptr<T>(newconstit.first),
143 std::unique_ptr<xAOD::ShallowAuxContainer>(newconstit.second)));
147 return StatusCode::SUCCESS;
166 if(!inNeutralHandle.
isValid()){
168 << inNeutralKey.
key() <<
"\" and \""
169 << inChargedKey.
key() <<
"\"");
170 return StatusCode::FAILURE;
173 unsigned numNeutralCopies = 1;
177 if (!handle.isValid()){
179 return StatusCode::FAILURE;
183 if(vertices->
empty()){
184 ATH_MSG_WARNING(
" Failed to retrieve valid primary vertex container" );
185 return StatusCode::FAILURE;
187 numNeutralCopies =
static_cast<unsigned>(vertices->
size());
198 ATH_CHECK(outChargedHandle.
record(std::unique_ptr<T>(chargedCopy.first),
199 std::unique_ptr<xAOD::ShallowAuxContainer>(chargedCopy.second)));
208 chargedCopy.second->setShallowIO(
true);
211 ATH_CHECK(outNeutralHandle.
record(std::unique_ptr<T>(neutralCopy.first),
212 std::unique_ptr<xAOD::ShallowAuxContainer>(neutralCopy.second)));
221 auto neutralCopies = std::make_unique<T>();
222 auto neutralCopiesAux = std::make_unique<xAOD::AuxContainerBase>();
223 neutralCopies->setStore(neutralCopiesAux.get());
227 for (
unsigned i = 0;
i < numNeutralCopies;
i++){
228 for (
const U* fe : *inNeutralHandle) {
230 neutralCopies->push_back(
copy);
232 copyIndex(*
copy) =
i;
238 std::move(neutralCopiesAux))
246 (*outAllHandle).assign((*outNeutralHandle).begin(), (*outNeutralHandle).end());
247 (*outAllHandle).insert((*outAllHandle).end(),
248 (*outChargedHandle).begin(),
249 (*outChargedHandle).end());
253 return StatusCode::SUCCESS;
SG::ReadHandleKey< xAOD::TrackCaloClusterContainer > m_inTCCKey
ToolHandle< GenericMonitoringTool > m_monTool
ToolHandleArray< IJetConstituentModifier > m_modifiers
Gaudi::Property< bool > m_byVertex
Helper class to provide type-safe access to aux data.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
SG::ReadHandle< T > makeHandle(const SG::View *view, const SG::ReadHandleKey< T > &rhKey, const EventContext &context)
navigate from the TrigComposite to nearest view and fetch object from it
Gaudi::Property< std::string > m_outputContainer
SG::WriteHandleKey< xAOD::FlowElementContainer > m_outChargedFEKey
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_inClusterKey
SG::ReadHandleKey< xAOD::FlowElementContainer > m_inNeutralFEKey
const std::string & key() const
Return the StoreGate ID for the referenced object.
Property holding a SG store/key/clid from which a ReadHandle is made.
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainerKey
StatusCode initialize()
Dummy implementation of the initialisation function.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
SG::WriteHandleKey< xAOD::CaloClusterContainer > m_outClusterKey
SG::WriteHandleKey< xAOD::PFOContainer > m_outChargedPFOKey
JetConstituentModSequence(const std::string &name)
unsigned short m_inputType
SG::WriteHandleKey< xAOD::PFOContainer > m_outAllPFOKey
SG::WriteHandleKey< xAOD::PFOContainer > m_outNeutralPFOKey
::StatusCode StatusCode
StatusCode definition for legacy code.
SG::ReadDecorHandleKeyArray< xAOD::FlowElementContainer > m_inNeutralFEDecorKeys
SG::ReadHandleKey< xAOD::PFOContainer > m_inNeutralPFOKey
SG::WriteHandleKey< xAOD::FlowElementContainer > m_outNeutralFEKey
virtual bool isValid() override final
Can the handle be successfully dereferenced?
StatusCode copyModRecordFlowLike(const SG::ReadHandleKey< T > &, const SG::ReadHandleKey< T > &, const SG::WriteHandleKey< T > &, const SG::WriteHandleKey< T > &, const SG::WriteHandleKey< T > &) const
StatusCode copyModRecord(const SG::ReadHandleKey< T > &, const SG::WriteHandleKey< T > &) const
helper function to cast, shallow copy and record a container.
int execute() const
Method to be called for each event.
std::pair< std::unique_ptr< T >, std::unique_ptr< ShallowAuxContainer > > shallowCopyContainer(const T &cont, [[maybe_unused]] const EventContext &ctx)
Function making a shallow copy of a constant container.
SG::ReadHandleKey< xAOD::PFOContainer > m_inChargedPFOKey
SG::ReadHandleKey< xAOD::FlowElementContainer > m_inChargedFEKey
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
#define ATH_MSG_WARNING(x)
bool setOriginalObjectLink(const IParticle &original, IParticle ©)
This function should be used by CP tools when they make a deep copy of an object in their correctedCo...
SG::WriteHandleKey< xAOD::FlowElementContainer > m_outAllFEKey
SG::WriteHandleKey< xAOD::TrackCaloClusterContainer > m_outTCCKey
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
SG::ReadDecorHandleKeyArray< xAOD::FlowElementContainer > m_inChargedFEDecorKeys
Gaudi::Property< std::string > m_inputContainer