ATLAS Offline Software
Loading...
Searching...
No Matches
TrackFastSimSD.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRACKWRITEFASTSIM_TRACKFASTSIMSD_H
6#define TRACKWRITEFASTSIM_TRACKFASTSIMSD_H
7
8// Base class header
9#include "G4VSensitiveDetector.hh"
10
11// Athena headers
13
14// STL headers
15#include <string>
16#include <utility>
17
18// G4 needed classes
19class G4Step;
20class G4TouchableHistory;
21class G4Track;
22
23class TrackFastSimSD : public G4VSensitiveDetector
24{
25public:
26 TrackFastSimSD(const std::string& name, const std::string& outputCollectionName, const int SD_type=0);
28
29 // Initialize from G4
30 void Initialize(G4HCofThisEvent *) override final;
31
32 G4bool ProcessHits(G4Step*, G4TouchableHistory*) override final;
33 void WriteTrack(const G4Track*, const bool, const bool);
34
38 template <class... Args> bool AddHit(Args&&... args)
39 {
41 m_trackRecordCollection->Emplace(std::forward<Args>(args)...);
42 return true;
43 }
44 return false;
45 }
46
47private:
49
51 // Non-owning cache set by Initialize; HitCollectionMap owns the collection.
53 int m_SD_type; //TrackRecorderSD=1, CosmicTRSD=2
54};
55
56#endif // TRACKWRITEFASTSIM_TRACKFASTSIMSD_H
AtlasHitsVector< TrackRecord > TrackRecordCollection
G4bool ProcessHits(G4Step *, G4TouchableHistory *) override final
bool AddHit(Args &&... args)
Templated method to stuff a single hit into the sensitive detector class.
TrackRecordCollection * m_trackRecordCollection
TrackFastSimSD(const std::string &name, const std::string &outputCollectionName, const int SD_type=0)
TrackRecordCollection * getTrackRecordCollection() const
void Initialize(G4HCofThisEvent *) override final
std::string m_outputCollectionName
void WriteTrack(const G4Track *, const bool, const bool)