ATLAS Offline Software
CollectionMerger.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "CollectionMerger.h"
6 
8 ISF::CollectionMerger::CollectionMerger( const std::string& name, ISvcLocator* pSvcLocator ) :
9  ::AthReentrantAlgorithm( name, pSvcLocator )
10 {
11 }
12 
13 
16 {
17  ATH_CHECK( m_inputBCMHits.initialize(SG::AllowEmpty) );
18  ATH_CHECK( m_inputBLMHits.initialize(SG::AllowEmpty) );
19  ATH_CHECK( m_inputPixelHits.initialize(SG::AllowEmpty) );
20  ATH_CHECK( m_inputSCTHits.initialize(SG::AllowEmpty) );
21  ATH_CHECK( m_inputTRTUncompressedHits.initialize(SG::AllowEmpty) );
22 
23  ATH_CHECK( m_inputITkPixelHits.initialize(SG::AllowEmpty) );
24  ATH_CHECK( m_inputITkStripHits.initialize(SG::AllowEmpty) );
25  ATH_CHECK( m_inputPLRHits.initialize(SG::AllowEmpty) );
26  ATH_CHECK( m_inputHGTDHits.initialize(SG::AllowEmpty) );
27 
28  ATH_CHECK( m_inputLArEMBHits.initialize(SG::AllowEmpty) );
29  ATH_CHECK( m_inputLArEMECHits.initialize(SG::AllowEmpty) );
30  ATH_CHECK( m_inputLArFCALHits.initialize(SG::AllowEmpty) );
31  ATH_CHECK( m_inputLArHECHits.initialize(SG::AllowEmpty) );
32 
33  ATH_CHECK( m_inputTileHits.initialize(SG::AllowEmpty) );
34  ATH_CHECK( m_inputMBTSHits.initialize(SG::AllowEmpty) );
35 
36  ATH_CHECK( m_inputCSCHits.initialize(SG::AllowEmpty) );
37  ATH_CHECK( m_inputMDTHits.initialize(SG::AllowEmpty) );
38  ATH_CHECK( m_inputRPCHits.initialize(SG::AllowEmpty) );
39  ATH_CHECK( m_inputTGCHits.initialize(SG::AllowEmpty) );
40  ATH_CHECK( m_inputsTGCHits.initialize(SG::AllowEmpty) );
41  ATH_CHECK( m_inputMMHits.initialize(SG::AllowEmpty) );
42 
43 
44  ATH_CHECK( m_outputBCMHits.initialize(SG::AllowEmpty) );
45  ATH_CHECK( m_outputBLMHits.initialize(SG::AllowEmpty) );
46  ATH_CHECK( m_outputPixelHits.initialize(SG::AllowEmpty) );
47  ATH_CHECK( m_outputSCTHits.initialize(SG::AllowEmpty) );
48  ATH_CHECK( m_outputTRTUncompressedHits.initialize(SG::AllowEmpty) );
49 
50  ATH_CHECK( m_outputITkPixelHits.initialize(SG::AllowEmpty) );
51  ATH_CHECK( m_outputITkStripHits.initialize(SG::AllowEmpty) );
52  ATH_CHECK( m_outputPLRHits.initialize(SG::AllowEmpty) );
53  ATH_CHECK( m_outputHGTDHits.initialize(SG::AllowEmpty) );
54 
55  ATH_CHECK( m_outputLArEMBHits.initialize(SG::AllowEmpty) );
56  ATH_CHECK( m_outputLArEMECHits.initialize(SG::AllowEmpty) );
57  ATH_CHECK( m_outputLArFCALHits.initialize(SG::AllowEmpty) );
58  ATH_CHECK( m_outputLArHECHits.initialize(SG::AllowEmpty) );
59 
60  ATH_CHECK( m_outputTileHits.initialize(SG::AllowEmpty) );
61  ATH_CHECK( m_outputMBTSHits.initialize(SG::AllowEmpty) );
62 
63  ATH_CHECK( m_outputCSCHits.initialize(SG::AllowEmpty) );
64  ATH_CHECK( m_outputMDTHits.initialize(SG::AllowEmpty) );
65  ATH_CHECK( m_outputRPCHits.initialize(SG::AllowEmpty) );
66  ATH_CHECK( m_outputTGCHits.initialize(SG::AllowEmpty) );
67  ATH_CHECK( m_outputsTGCHits.initialize(SG::AllowEmpty) );
68  ATH_CHECK( m_outputMMHits.initialize(SG::AllowEmpty) );
69 
70  return StatusCode::SUCCESS;
71 }
72 
73 
75 StatusCode ISF::CollectionMerger::execute(const EventContext& ctx) const
76 {
77  ATH_CHECK(mergeCollections( m_inputBCMHits, m_outputBCMHits, ctx ));
78  ATH_CHECK(mergeCollections( m_inputBLMHits, m_outputBLMHits, ctx ));
79  ATH_CHECK(mergeCollections( m_inputPixelHits, m_outputPixelHits, ctx ));
80  ATH_CHECK(mergeCollections( m_inputSCTHits, m_outputSCTHits, ctx ));
81  ATH_CHECK(mergeCollections( m_inputTRTUncompressedHits, m_outputTRTUncompressedHits, ctx ));
82 
83  ATH_CHECK(mergeCollections( m_inputITkPixelHits, m_outputITkPixelHits, ctx ));
84  ATH_CHECK(mergeCollections( m_inputITkStripHits, m_outputITkStripHits, ctx ));
85  ATH_CHECK(mergeCollections( m_inputPLRHits, m_outputPLRHits, ctx ));
86  ATH_CHECK(mergeCollections( m_inputHGTDHits, m_outputHGTDHits, ctx ));
87 
88  ATH_CHECK(mergeCollections( m_inputLArEMBHits, m_outputLArEMBHits, ctx ));
89  ATH_CHECK(mergeCollections( m_inputLArEMECHits, m_outputLArEMECHits, ctx ));
90  ATH_CHECK(mergeCollections( m_inputLArFCALHits, m_outputLArFCALHits, ctx ));
91  ATH_CHECK(mergeCollections( m_inputLArHECHits, m_outputLArHECHits, ctx ));
92 
93  ATH_CHECK(mergeCollections( m_inputTileHits, m_outputTileHits, ctx ));
94  ATH_CHECK(mergeCollections( m_inputMBTSHits, m_outputMBTSHits, ctx ));
95 
96  ATH_CHECK(mergeCollections( m_inputCSCHits, m_outputCSCHits, ctx ));
97  ATH_CHECK(mergeCollections( m_inputMDTHits, m_outputMDTHits, ctx ));
98  ATH_CHECK(mergeCollections( m_inputRPCHits, m_outputRPCHits, ctx ));
99  ATH_CHECK(mergeCollections( m_inputTGCHits, m_outputTGCHits, ctx ));
100  ATH_CHECK(mergeCollections( m_inputsTGCHits, m_outputsTGCHits, ctx ));
101  ATH_CHECK(mergeCollections( m_inputMMHits, m_outputMMHits, ctx ));
102 
103  return StatusCode::SUCCESS;
104 }
ISF::CollectionMerger::CollectionMerger
CollectionMerger(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition: CollectionMerger.cxx:8
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ISF::CollectionMerger::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Athena Algorithm execute.
Definition: CollectionMerger.cxx:75
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ISF::CollectionMerger::initialize
virtual StatusCode initialize() override final
Athena algorithm's interface methods.
Definition: CollectionMerger.cxx:15
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
Overlay::mergeCollections
void mergeCollections(SCT_RDO_Collection *bkgCollection, SCT_RDO_Collection *signalCollection, SCT_RDO_Collection *outputCollection, const IDC_OverlayBase *algorithm, DataPool< SCT3_RawData > &dataItems)
Definition: SCTOverlay.cxx:48
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30
CollectionMerger.h