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_MSG_VERBOSE("In initialize");
18  ATH_CHECK( m_inputBCMHits.initialize() );
19  ATH_CHECK( m_inputBLMHits.initialize() );
20  ATH_CHECK( m_inputPixelHits.initialize() );
21  ATH_CHECK( m_inputSCTHits.initialize() );
22  ATH_CHECK( m_inputTRTUncompressedHits.initialize() );
23 
24  ATH_CHECK( m_inputITkPixelHits.initialize() );
25  ATH_CHECK( m_inputITkStripHits.initialize() );
26  ATH_CHECK( m_inputPLRHits.initialize() );
27  ATH_CHECK( m_inputHGTDHits.initialize() );
28 
29  ATH_CHECK( m_inputLArEMBHits.initialize() );
30  ATH_CHECK( m_inputLArEMECHits.initialize() );
31  ATH_CHECK( m_inputLArFCALHits.initialize() );
32  ATH_CHECK( m_inputLArHECHits.initialize() );
33 
34  ATH_CHECK( m_inputTileHits.initialize() );
35  ATH_CHECK( m_inputMBTSHits.initialize() );
36 
37  ATH_CHECK( m_inputCSCHits.initialize() );
38  ATH_CHECK( m_inputMDTHits.initialize() );
39  ATH_CHECK( m_inputRPCHits.initialize() );
40  ATH_CHECK( m_inputTGCHits.initialize() );
41  ATH_CHECK( m_inputsTGCHits.initialize() );
42  ATH_CHECK( m_inputMMHits.initialize() );
43 
44 
45  ATH_CHECK( m_outputBCMHits.initialize(!m_inputBCMHits.empty()) );
46  ATH_CHECK( m_outputBLMHits.initialize(!m_inputBLMHits.empty()) );
47  ATH_CHECK( m_outputPixelHits.initialize(!m_inputPixelHits.empty()) );
48  ATH_CHECK( m_outputSCTHits.initialize(!m_inputSCTHits.empty()) );
49  ATH_CHECK( m_outputTRTUncompressedHits.initialize(!m_inputTRTUncompressedHits.empty()) );
50 
51  ATH_CHECK( m_outputITkPixelHits.initialize(!m_inputITkPixelHits.empty()) );
52  ATH_CHECK( m_outputITkStripHits.initialize(!m_inputITkStripHits.empty()) );
53  ATH_CHECK( m_outputPLRHits.initialize(!m_inputPLRHits.empty()) );
54  ATH_CHECK( m_outputHGTDHits.initialize(!m_inputHGTDHits.empty()) );
55 
56  ATH_CHECK( m_outputLArEMBHits.initialize(!m_inputLArEMBHits.empty()) );
57  ATH_CHECK( m_outputLArEMECHits.initialize(!m_inputLArEMECHits.empty()) );
58  ATH_CHECK( m_outputLArFCALHits.initialize(!m_inputLArFCALHits.empty()) );
59  ATH_CHECK( m_outputLArHECHits.initialize(!m_inputLArHECHits.empty()) );
60 
61  ATH_CHECK( m_outputTileHits.initialize(!m_inputTileHits.empty()) );
62  ATH_CHECK( m_outputMBTSHits.initialize(!m_inputMBTSHits.empty()) );
63 
64  ATH_CHECK( m_outputCSCHits.initialize(!m_inputCSCHits.empty()) );
65  ATH_CHECK( m_outputMDTHits.initialize(!m_inputMDTHits.empty()) );
66  ATH_CHECK( m_outputRPCHits.initialize(!m_inputRPCHits.empty()) );
67  ATH_CHECK( m_outputTGCHits.initialize(!m_inputTGCHits.empty()) );
68  ATH_CHECK( m_outputsTGCHits.initialize(!m_inputsTGCHits.empty()) );
69  ATH_CHECK( m_outputMMHits.initialize(!m_inputMMHits.empty()) );
70 
71  return StatusCode::SUCCESS;
72 }
73 
74 
76 StatusCode ISF::CollectionMerger::execute(const EventContext& ctx) const
77 {
78  ATH_MSG_VERBOSE("in execute()");
79  ATH_CHECK(mergeCollections( m_inputBCMHits, m_outputBCMHits, ctx ));
80  ATH_CHECK(mergeCollections( m_inputBLMHits, m_outputBLMHits, ctx ));
81  ATH_CHECK(mergeCollections( m_inputPixelHits, m_outputPixelHits, ctx ));
82  ATH_CHECK(mergeCollections( m_inputSCTHits, m_outputSCTHits, ctx ));
83  ATH_CHECK(mergeCollections( m_inputTRTUncompressedHits, m_outputTRTUncompressedHits, ctx ));
84 
85  ATH_CHECK(mergeCollections( m_inputITkPixelHits, m_outputITkPixelHits, ctx ));
86  ATH_CHECK(mergeCollections( m_inputITkStripHits, m_outputITkStripHits, ctx ));
87  ATH_CHECK(mergeCollections( m_inputPLRHits, m_outputPLRHits, ctx ));
88  ATH_CHECK(mergeCollections( m_inputHGTDHits, m_outputHGTDHits, ctx ));
89 
90  ATH_CHECK(mergeCollections( m_inputLArEMBHits, m_outputLArEMBHits, ctx ));
91  ATH_CHECK(mergeCollections( m_inputLArEMECHits, m_outputLArEMECHits, ctx ));
92  ATH_CHECK(mergeCollections( m_inputLArFCALHits, m_outputLArFCALHits, ctx ));
93  ATH_CHECK(mergeCollections( m_inputLArHECHits, m_outputLArHECHits, ctx ));
94 
95  ATH_CHECK(mergeCollections( m_inputTileHits, m_outputTileHits, ctx ));
96  ATH_CHECK(mergeCollections( m_inputMBTSHits, m_outputMBTSHits, ctx ));
97 
98  ATH_CHECK(mergeCollections( m_inputCSCHits, m_outputCSCHits, ctx ));
99  ATH_CHECK(mergeCollections( m_inputMDTHits, m_outputMDTHits, ctx ));
100  ATH_CHECK(mergeCollections( m_inputRPCHits, m_outputRPCHits, ctx ));
101  ATH_CHECK(mergeCollections( m_inputTGCHits, m_outputTGCHits, ctx ));
102  ATH_CHECK(mergeCollections( m_inputsTGCHits, m_outputsTGCHits, ctx ));
103  ATH_CHECK(mergeCollections( m_inputMMHits, m_outputMMHits, ctx ));
104 
105  return StatusCode::SUCCESS;
106 }
ISF::CollectionMerger::CollectionMerger
CollectionMerger(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition: CollectionMerger.cxx:8
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
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:76
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:221
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
CollectionMerger.h