|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef ISF_ALGORITHMS_RENAMEHITCOLLECTIONSALG_H
6 #define ISF_ALGORITHMS_RENAMEHITCOLLECTIONSALG_H 1
11 #include <type_traits>
40 class RenameHitCollectionsAlg_test;
75 const SG::WriteHandleKey<T>& outputWriteHandleKey,
const EventContext &ctx)
const;
170 template <
typename T>
174 if ( inputReadHandleKey.
key().empty() ) {
175 return StatusCode::SUCCESS;
180 ATH_CHECK( outputHandle.record(std::make_unique<T>()) );
183 for (
const auto& hit: *inputHandle ) {
184 this->insertCopy(hit, outputHandle);
187 return StatusCode::SUCCESS;
195 if ( inputReadHandleKey.
key().empty() ) {
196 return StatusCode::SUCCESS;
201 ATH_CHECK( outputHandle.record(std::make_unique<LArHitContainer>()) );
204 for (
const LArHit* hit: *inputHandle ) {
205 this->insertCopy(hit, outputHandle);
207 outputHandle->setName(inputHandle->Name());
209 return StatusCode::SUCCESS;
217 if ( inputReadHandleKey.
key().empty() ) {
218 return StatusCode::SUCCESS;
223 ATH_CHECK( outputHandle.record(std::make_unique<TileHitVector>()) );
226 for (
const auto& hit: *inputHandle ) {
227 this->insertCopy(hit, outputHandle);
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 ) {
249 this->insertCopy(hit, outputHandle);
251 outputHandle->setName(inputHandle->Name());
253 return StatusCode::SUCCESS;
258 template <
typename HitType_t,
typename OutputType_t>
260 OutputType_t& outputHandle)
const {
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() );
278 #endif //> !ISF_ALGORITHMS_RENAMEHITCOLLECTIONSALG_H
SG::WriteHandleKey< SiHitCollection > m_outputBLMHits
SG::ReadHandleKey< LArHitContainer > m_inputLArFCALHits
Property holding a SG store/key/clid from which a ReadHandle is made.
SG::ReadHandleKey< CaloCalibrationHitContainer > m_inputLArActiveCalibHits
SG::ReadHandleKey< TileHitVector > m_inputTileHits
SG::WriteHandleKey< LArHitContainer > m_outputLArEMECHits
friend class ISFTesting::RenameHitCollectionsAlg_test
Allow the test class access to all methods.
SG::WriteHandleKey< TileHitVector > m_outputMBTSHits
SG::WriteHandleKey< TrackRecordCollection > m_outputMuonExitLayer
SG::ReadHandleKey< CaloCalibrationHitContainer > m_inputTileActiveCalibHits
SG::WriteHandleKey< CaloCalibrationHitContainer > m_outputTileInactiveCalibHits
SG::WriteHandleKey< CaloCalibrationHitContainer > m_outputTileActiveCalibHits
SG::ReadHandleKey< CaloCalibrationHitContainer > m_inputLArDeadCalibHits
SG::WriteHandleKey< CSCSimHitCollection > m_outputCSCHits
SG::WriteHandleKey< TGCSimHitCollection > m_outputTGCHits
SG::ReadHandleKey< CSCSimHitCollection > m_inputCSCHits
SG::WriteHandleKey< SiHitCollection > m_outputITkPixelHits
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.
SG::ReadHandleKey< TileHitVector > m_inputMBTSHits
const std::string & key() const
Return the StoreGate ID for the referenced object.
bool const RAWDATA *ch2 const
Property holding a SG store/key/clid from which a ReadHandle is made.
SG::ReadHandleKey< MMSimHitCollection > m_inputMMHits
SG::ReadHandleKey< TrackRecordCollection > m_inputMuonEntryLayer
SG::ReadHandleKey< LArHitContainer > m_inputLArEMECHits
An algorithm that can be simultaneously executed in multiple threads.
SG::WriteHandleKey< TrackRecordCollection > m_outputCaloEntryLayer
SG::ReadHandleKey< TrackRecordCollection > m_inputMuonExitLayer
SG::WriteHandleKey< MMSimHitCollection > m_outputMMHits
RenameHitCollectionsAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
SG::WriteHandleKey< sTGCSimHitCollection > m_outputsTGCHits
SG::WriteHandleKey< LArHitContainer > m_outputLArFCALHits
virtual ~RenameHitCollectionsAlg()=default
Destructor.
SG::WriteHandleKey< LArHitContainer > m_outputLArEMBHits
SG::WriteHandleKey< CaloCalibrationHitContainer > m_outputTileDeadCalibHits
::StatusCode StatusCode
StatusCode definition for legacy code.
SG::ReadHandleKey< SiHitCollection > m_inputPixelHits
Athena Algorithm that makes copies of existing collections in StoreGate and stores them under new key...
SG::WriteHandleKey< SiHitCollection > m_outputITkStripHits
SG::ReadHandleKey< SiHitCollection > m_inputBCMHits
SG::WriteHandleKey< McEventCollection > m_outputMcEventCollection
Output collection WriteHandleKeys.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
SG::WriteHandleKey< TrackRecordCollection > m_outputMuonEntryLayer
SG::ReadHandleKey< CaloCalibrationHitContainer > m_inputTileDeadCalibHits
SG::WriteHandleKey< SiHitCollection > m_outputHGTDHits
SG::ReadHandleKey< SiHitCollection > m_inputITkStripHits
Property holding a SG store/key/clid from which a WriteHandle is made.
SG::WriteHandleKey< MDTSimHitCollection > m_outputMDTHits
SG::WriteHandleKey< CaloCalibrationHitContainer > m_outputLArActiveCalibHits
virtual StatusCode execute(const EventContext &ctx) const override final
Athena Algorithm execute.
SG::ReadHandleKey< RPCSimHitCollection > m_inputRPCHits
SG::ReadHandleKey< TGCSimHitCollection > m_inputTGCHits
Class to store hit energy and time in LAr cell from G4 simulation.
StatusCode initializeVarHandleKey(SG::VarHandleKey &varHandleKey) const
Initialize the given VarHandleKey.
SG::ReadHandleKey< MDTSimHitCollection > m_inputMDTHits
SG::ReadHandleKey< LArHitContainer > m_inputLArHECHits
SG::ReadHandleKey< TrackRecordCollection > m_inputCaloEntryLayer
SG::WriteHandleKey< CaloCalibrationHitContainer > m_outputLArInactiveCalibHits
void insertCopy(const HitType_t &hit, OutputType_t &outputHandle) const
Copy the given hit into the given output collection, container or DataHandle.
SG::ReadHandleKey< LArHitContainer > m_inputLArEMBHits
SG::ReadHandleKey< SiHitCollection > m_inputHGTDHits
SG::WriteHandleKey< SiHitCollection > m_outputPixelHits
SG::WriteHandleKey< RPCSimHitCollection > m_outputRPCHits
SG::WriteHandleKey< CaloCalibrationHitContainer > m_outputLArDeadCalibHits
SG::WriteHandleKey< TRTUncompressedHitCollection > m_outputTRTUncompressedHits
SG::ReadHandleKey< CaloCalibrationHitContainer > m_inputLArInactiveCalibHits
SG::ReadHandleKey< sTGCSimHitCollection > m_inputsTGCHits
Core Athena algorithm for the Integrated Simulation Framework.
SG::ReadHandleKey< SiHitCollection > m_inputITkPixelHits
SG::ReadHandleKey< McEventCollection > m_inputMcEventCollection
Input collection ReadHandleKeys.
SG::ReadHandleKey< SiHitCollection > m_inputSCTHits
SG::WriteHandleKey< TileHitVector > m_outputTileHits
SG::WriteHandleKey< LArHitContainer > m_outputLArHECHits
SG::ReadHandleKey< CaloCalibrationHitContainer > m_inputTileInactiveCalibHits
SG::ReadHandleKey< TRTUncompressedHitCollection > m_inputTRTUncompressedHits
SG::ReadHandleKey< SiHitCollection > m_inputBLMHits
SG::WriteHandleKey< SiHitCollection > m_outputBCMHits
SG::WriteHandleKey< SiHitCollection > m_outputSCTHits
virtual StatusCode initialize() override final
Athena algorithm's interface methods.