|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef ISF_ALGS_COLLECTIONMERGER_H
6 #define ISF_ALGS_COLLECTIONMERGER_H 1
10 #include <type_traits>
38 class CollectionMerger_test;
71 const SG::WriteHandleKey<T>& outputWriteHandleKey,
144 template <
typename T>
147 const EventContext& ctx )
const {
149 if ( inputReadHandleKeys.empty() ) {
150 return StatusCode::SUCCESS;
154 ATH_MSG_VERBOSE(
"Create new output container "<<outputWriteHandleKey.fullKey());
156 ATH_CHECK( outputHandle.record(std::make_unique<T>()) );
158 for (
const auto& collKey: inputReadHandleKeys ) {
162 for (
const auto& hit: *inputHandle ) {
163 this->insertCopy(hit, outputHandle);
167 return StatusCode::SUCCESS;
172 template <
typename HitType_t,
typename OutputType_t>
174 OutputType_t& outputHandle)
const {
176 "The hit provided to ISF::CollectionMerger::insertCopy(..) must not be a pointer!");
177 outputHandle->Emplace( hit );
182 template <
typename HitType_t,
typename OutputType_t>
184 OutputType_t& outputHandle)
const {
185 auto&& hitCopy = std::make_unique<std::remove_const_t<HitType_t> >(*hit);
186 outputHandle->push_back( hitCopy.release() );
192 #endif //> !ISF_ALGS_COLLECTIONMERGER_H
SG::ReadHandleKeyArray< SiHitCollection > m_inputBCMHits
Input collection ReadHandleKeys.
CollectionMerger(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
SG::WriteHandleKey< TRTUncompressedHitCollection > m_outputTRTUncompressedHits
SG::ReadHandleKeyArray< LArHitContainer > m_inputLArEMECHits
SG::ReadHandleKeyArray< LArHitContainer > m_inputLArFCALHits
SG::ReadHandleKeyArray< TileHitVector > m_inputTileHits
SG::ReadHandleKeyArray< TRTUncompressedHitCollection > m_inputTRTUncompressedHits
SG::WriteHandleKey< sTGCSimHitCollection > m_outputsTGCHits
#define ATH_MSG_VERBOSE(x)
bool const RAWDATA *ch2 const
SG::ReadHandleKeyArray< TileHitVector > m_inputMBTSHits
SG::ReadHandleKeyArray< MDTSimHitCollection > m_inputMDTHits
SG::ReadHandleKeyArray< SiHitCollection > m_inputITkStripHits
SG::WriteHandleKey< TileHitVector > m_outputTileHits
SG::ReadHandleKeyArray< SiHitCollection > m_inputPixelHits
void insertCopy(const HitType_t &hit, OutputType_t &outputHandle) const
Copy the given hit into the given output collection, container or DataHandle.
An algorithm that can be simultaneously executed in multiple threads.
SG::ReadHandleKeyArray< CSCSimHitCollection > m_inputCSCHits
SG::WriteHandleKey< LArHitContainer > m_outputLArFCALHits
SG::WriteHandleKey< SiHitCollection > m_outputSCTHits
SG::WriteHandleKey< SiHitCollection > m_outputBCMHits
Output collection WriteHandleKeys.
friend class ISFTesting::CollectionMerger_test
Allow the test class access to all methods.
SG::WriteHandleKey< SiHitCollection > m_outputITkPixelHits
SG::ReadHandleKeyArray< LArHitContainer > m_inputLArEMBHits
Property holding a SG store/key/clid from which a WriteHandle is made.
SG::WriteHandleKey< SiHitCollection > m_outputBLMHits
SG::ReadHandleKeyArray< TGCSimHitCollection > m_inputTGCHits
::StatusCode StatusCode
StatusCode definition for legacy code.
SG::WriteHandleKey< RPCSimHitCollection > m_outputRPCHits
virtual StatusCode execute(const EventContext &ctx) const override final
Athena Algorithm execute.
SG::WriteHandleKey< TGCSimHitCollection > m_outputTGCHits
HandleKeyArray< ReadHandle< T >, ReadHandleKey< T >, Gaudi::DataHandle::Reader > ReadHandleKeyArray
SG::WriteHandleKey< MDTSimHitCollection > m_outputMDTHits
SG::ReadHandleKeyArray< SiHitCollection > m_inputITkPixelHits
SG::WriteHandleKey< MMSimHitCollection > m_outputMMHits
Athena Algorithm that merges a given set of StoreGate collections in one final collection.
SG::ReadHandleKeyArray< SiHitCollection > m_inputHGTDHits
SG::ReadHandleKeyArray< SiHitCollection > m_inputBLMHits
SG::ReadHandleKeyArray< sTGCSimHitCollection > m_inputsTGCHits
virtual StatusCode initialize() override final
Athena algorithm's interface methods.
Property holding a SG store/key/clid from which a WriteHandle is made.
SG::WriteHandleKey< LArHitContainer > m_outputLArEMECHits
virtual ~CollectionMerger()=default
Destructor.
SG::WriteHandleKey< LArHitContainer > m_outputLArEMBHits
SG::WriteHandleKey< SiHitCollection > m_outputITkStripHits
SG::ReadHandleKeyArray< SiHitCollection > m_inputSCTHits
SG::ReadHandleKeyArray< SiHitCollection > m_inputPLRHits
SG::WriteHandleKey< CSCSimHitCollection > m_outputCSCHits
SG::WriteHandleKey< SiHitCollection > m_outputPixelHits
SG::WriteHandleKey< LArHitContainer > m_outputLArHECHits
SG::WriteHandleKey< SiHitCollection > m_outputHGTDHits
StatusCode mergeCollections(const SG::ReadHandleKeyArray< T > &inputReadHandleKeys, const SG::WriteHandleKey< T > &outputWriteHandleKey, const EventContext &ctx) const
Merge all hits of inputReadHandleKeys's collections into outputWriteHandleKey.
SG::ReadHandleKeyArray< LArHitContainer > m_inputLArHECHits
Core Athena algorithm for the Integrated Simulation Framework.
SG::ReadHandleKeyArray< MMSimHitCollection > m_inputMMHits
SG::ReadHandleKeyArray< RPCSimHitCollection > m_inputRPCHits
SG::WriteHandleKey< TileHitVector > m_outputMBTSHits
SG::WriteHandleKey< SiHitCollection > m_outputPLRHits