ATLAS Offline Software
Loading...
Searching...
No Matches
AFP_SiDSensitiveDetector.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef AFP_G4_SD_AFP_SiDSensitiveDetector_h
6#define AFP_G4_SD_AFP_SiDSensitiveDetector_h
7
8// Base class
9#include "G4VSensitiveDetector.hh"
10
11// use of the hits
13#include <gtest/gtest_prod.h>
14
15// STL header
16#include <string>
17#include <utility>
18
19class G4Step;
20class G4TouchableHistory;
21
22class AFP_SiDSensitiveDetector : public G4VSensitiveDetector
23{
24 FRIEND_TEST( AFP_SiDSensitiveDetectortest, ProcessHits );
25 FRIEND_TEST( AFP_SiDSensitiveDetectortest, AddHit );
26
27public:
28 // Constructor
29 AFP_SiDSensitiveDetector(const std::string& name, const std::string& hitCollectionName);
30
31 // Destructor
32 ~AFP_SiDSensitiveDetector() { /* I don't own myHitColl if all has gone well */ }
33
34 // Called from G4 at the start of each G4 event
35 void Initialize(G4HCofThisEvent *) override final;
36 G4bool ProcessHits(G4Step*, G4TouchableHistory*) override final;
37
41 template <class... Args> void AddHit(Args&&... args)
42 {
43 if (m_HitColl) {
44 m_HitColl->Emplace(std::forward<Args>(args)...);
45 }
46 }
47
48private:
50
52
54 float m_death_edge[4][10];
55 float m_lower_edge[4][10];
56
57 // The hits collections
59 // Non-owning cache set by Initialize; HitCollectionMap owns the collection.
61
62};
63
64#endif //AFP_G4_SD_AFP_SiDSensitiveDetector_h
AFP_SIDSimHitCollectionBuilder * getHitCollection() const
AFP_SiDSensitiveDetector(const std::string &name, const std::string &hitCollectionName)
G4bool ProcessHits(G4Step *, G4TouchableHistory *) override final
void AddHit(Args &&... args)
Templated method to stuff a single hit into the sensitive detector class.
FRIEND_TEST(AFP_SiDSensitiveDetectortest, ProcessHits)
FRIEND_TEST(AFP_SiDSensitiveDetectortest, AddHit)
AFP_SIDSimHitCollectionBuilder * m_HitColl
void Initialize(G4HCofThisEvent *) override final