5#ifndef ISF_ALGORITHMS_RENAMEHITCOLLECTIONSALG_H
6#define ISF_ALGORITHMS_RENAMEHITCOLLECTIONSALG_H 1
40 class RenameHitCollectionsAlg_test;
65 virtual StatusCode
initialize() override final;
75 const SG::WriteHandleKey<T>& outputWriteHandleKey,
const EventContext &ctx)
const;
78 template <typename HitType_t, typename OutputType_t>
83 template <typename HitType_t, typename OutputType_t>
170 template <
typename T>
174 if ( inputReadHandleKey.
key().empty() ) {
175 return StatusCode::SUCCESS;
183 for (
const auto& hit: *inputHandle ) {
187 return StatusCode::SUCCESS;
195 if ( inputReadHandleKey.
key().empty() ) {
196 return StatusCode::SUCCESS;
204 for (
const LArHit* hit: *inputHandle ) {
207 outputHandle->setName(inputHandle->Name());
209 return StatusCode::SUCCESS;
217 if ( inputReadHandleKey.
key().empty() ) {
218 return StatusCode::SUCCESS;
226 for (
const auto& hit: *inputHandle ) {
229 outputHandle->setName(inputHandle->Name());
231 return StatusCode::SUCCESS;
239 if ( inputReadHandleKey.
key().empty() ) {
240 return StatusCode::SUCCESS;
245 ATH_CHECK( outputHandle.
record(std::make_unique<TrackRecordCollection>()) );
248 for (
const auto& hit: *inputHandle ) {
251 outputHandle->setName(inputHandle->Name());
253 return StatusCode::SUCCESS;
258 template <
typename HitType_t,
typename OutputType_t>
260 OutputType_t& outputHandle)
const {
261 static_assert(!std::is_pointer<HitType_t>::value,
262 "The hit provided to ISF::RenameHitCollectionsAlg::insertCopy(..) must not be a pointer!");
263 outputHandle->Emplace( hit );
268 template <
typename HitType_t,
typename OutputType_t>
270 OutputType_t& outputHandle)
const {
271 auto&& hitCopy = std::make_unique<std::remove_const_t<HitType_t> >(*hit);
272 outputHandle->push_back( hitCopy.release() );
#define ATH_CHECK
Evaluate an expression and check for errors.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
An algorithm that can be simultaneously executed in multiple threads.
SG::WriteHandleKey< CSCSimHitCollection > m_outputCSCHits
SG::WriteHandleKey< CaloCalibrationHitContainer > m_outputTileActiveCalibHits
SG::ReadHandleKey< MDTSimHitCollection > m_inputMDTHits
SG::WriteHandleKey< CaloCalibrationHitContainer > m_outputTileDeadCalibHits
SG::WriteHandleKey< SiHitCollection > m_outputSCTHits
SG::WriteHandleKey< TrackRecordCollection > m_outputMuonEntryLayer
SG::WriteHandleKey< CaloCalibrationHitContainer > m_outputTileInactiveCalibHits
SG::ReadHandleKey< TrackRecordCollection > m_inputMuonExitLayer
SG::ReadHandleKey< SiHitCollection > m_inputITkStripHits
SG::ReadHandleKey< CaloCalibrationHitContainer > m_inputTileActiveCalibHits
SG::ReadHandleKey< SiHitCollection > m_inputITkPixelHits
SG::WriteHandleKey< LArHitContainer > m_outputLArFCALHits
virtual StatusCode initialize() override final
Athena algorithm's interface methods.
RenameHitCollectionsAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
SG::ReadHandleKey< CaloCalibrationHitContainer > m_inputTileInactiveCalibHits
SG::WriteHandleKey< TGCSimHitCollection > m_outputTGCHits
SG::WriteHandleKey< SiHitCollection > m_outputBLMHits
SG::WriteHandleKey< SiHitCollection > m_outputITkStripHits
SG::ReadHandleKey< CaloCalibrationHitContainer > m_inputTileDeadCalibHits
SG::ReadHandleKey< TRTUncompressedHitCollection > m_inputTRTUncompressedHits
SG::WriteHandleKey< TileHitVector > m_outputMBTSHits
void insertCopy(const HitType_t &hit, OutputType_t &outputHandle) const
Copy the given hit into the given output collection, container or DataHandle.
SG::WriteHandleKey< MMSimHitCollection > m_outputMMHits
SG::ReadHandleKey< LArHitContainer > m_inputLArEMECHits
SG::ReadHandleKey< SiHitCollection > m_inputPixelHits
SG::WriteHandleKey< TrackRecordCollection > m_outputCaloEntryLayer
SG::ReadHandleKey< sTGCSimHitCollection > m_inputsTGCHits
SG::ReadHandleKey< TrackRecordCollection > m_inputCaloEntryLayer
SG::ReadHandleKey< RPCSimHitCollection > m_inputRPCHits
SG::ReadHandleKey< TrackRecordCollection > m_inputMuonEntryLayer
SG::WriteHandleKey< SiHitCollection > m_outputPixelHits
SG::WriteHandleKey< RPCSimHitCollection > m_outputRPCHits
SG::WriteHandleKey< McEventCollection > m_outputMcEventCollection
Output collection WriteHandleKeys.
SG::ReadHandleKey< TileHitVector > m_inputTileHits
SG::ReadHandleKey< CaloCalibrationHitContainer > m_inputLArDeadCalibHits
SG::WriteHandleKey< CaloCalibrationHitContainer > m_outputLArActiveCalibHits
SG::ReadHandleKey< TileHitVector > m_inputMBTSHits
SG::WriteHandleKey< LArHitContainer > m_outputLArEMECHits
SG::ReadHandleKey< McEventCollection > m_inputMcEventCollection
Input collection ReadHandleKeys.
virtual StatusCode execute(const EventContext &ctx) const override final
Athena Algorithm execute.
SG::ReadHandleKey< CSCSimHitCollection > m_inputCSCHits
SG::WriteHandleKey< CaloCalibrationHitContainer > m_outputLArInactiveCalibHits
SG::ReadHandleKey< SiHitCollection > m_inputSCTHits
SG::ReadHandleKey< MMSimHitCollection > m_inputMMHits
SG::ReadHandleKey< TGCSimHitCollection > m_inputTGCHits
SG::WriteHandleKey< TRTUncompressedHitCollection > m_outputTRTUncompressedHits
SG::ReadHandleKey< SiHitCollection > m_inputBLMHits
SG::WriteHandleKey< TileHitVector > m_outputTileHits
SG::ReadHandleKey< CaloCalibrationHitContainer > m_inputLArInactiveCalibHits
SG::WriteHandleKey< sTGCSimHitCollection > m_outputsTGCHits
SG::WriteHandleKey< LArHitContainer > m_outputLArHECHits
SG::ReadHandleKey< SiHitCollection > m_inputBCMHits
StatusCode initializeVarHandleKey(SG::VarHandleKey &varHandleKey) const
Initialize the given VarHandleKey.
SG::WriteHandleKey< LArHitContainer > m_outputLArEMBHits
SG::ReadHandleKey< LArHitContainer > m_inputLArHECHits
SG::WriteHandleKey< CaloCalibrationHitContainer > m_outputLArDeadCalibHits
SG::ReadHandleKey< LArHitContainer > m_inputLArEMBHits
friend class ISFTesting::RenameHitCollectionsAlg_test
Allow the test class access to all methods.
StatusCode copyCollections(const SG::ReadHandleKey< T > &inputReadHandleKeys, const SG::WriteHandleKey< T > &outputWriteHandleKey, const EventContext &ctx) const
Merge all hits of inputReadHandleKeys's collections into outputWriteHandleKey.
virtual ~RenameHitCollectionsAlg()=default
Destructor.
SG::ReadHandleKey< CaloCalibrationHitContainer > m_inputLArActiveCalibHits
SG::ReadHandleKey< LArHitContainer > m_inputLArFCALHits
SG::WriteHandleKey< SiHitCollection > m_outputBCMHits
SG::ReadHandleKey< SiHitCollection > m_inputHGTDHits
SG::WriteHandleKey< MDTSimHitCollection > m_outputMDTHits
SG::WriteHandleKey< SiHitCollection > m_outputHGTDHits
SG::WriteHandleKey< TrackRecordCollection > m_outputMuonExitLayer
SG::WriteHandleKey< SiHitCollection > m_outputITkPixelHits
Class to store hit energy and time in LAr cell from G4 simulation.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
Property holding a SG store/key/clid from which a ReadHandle is made.
const std::string & key() const
Return the StoreGate ID for the referenced object.
Property holding a SG store/key/clid from which a WriteHandle is made.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
Core Athena algorithm for the Integrated Simulation Framework.