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
14#include <gtest/gtest_prod.h>
15
16// STL header
17#include <string>
18
19class G4Step;
20class G4TouchableHistory;
21
22class AFP_SiDSensitiveDetector : public G4VSensitiveDetector
23{
24 FRIEND_TEST( AFP_SiDSensitiveDetectortest, Initialize );
25 FRIEND_TEST( AFP_SiDSensitiveDetectortest, ProcessHits );
26 FRIEND_TEST( AFP_SiDSensitiveDetectortest, StartOfAthenaEvent );
27 FRIEND_TEST( AFP_SiDSensitiveDetectortest, EndOfAthenaEvent );
28 FRIEND_TEST( AFP_SiDSensitiveDetectortest, AddHit );
29
30public:
31 // Constructor
32 AFP_SiDSensitiveDetector(const std::string& name, const std::string& hitCollectionName);
33
34 // Destructor
35 ~AFP_SiDSensitiveDetector() { /* I don't own myHitColl if all has gone well */ }
36
37 // Called from AFP_SiDSensitiveDetectorTool::SetupEvent
38 void StartOfAthenaEvent ();
39 // Called from G4 at the start of each G4 event
40 void Initialize(G4HCofThisEvent *) override final;
41 G4bool ProcessHits(G4Step*, G4TouchableHistory*) override final;
42 // Called from AFP_SiDSensitiveDetectorTool::Gather
43 void EndOfAthenaEvent();
44
48 template <class... Args> void AddHit(Args&&... args){ m_HitColl->Emplace( args... ); }
49
50 static constexpr int SiDMaxCnt = 1000;
51
52private:
56
58
60 float m_death_edge[4][10];
61 float m_lower_edge[4][10];
62
63 // The hits collections
65
66};
67
68#endif //AFP_G4_SD_AFP_SiDSensitiveDetector_h
Handle class for recording to StoreGate.
AFP_SiDSensitiveDetector(const std::string &name, const std::string &hitCollectionName)
FRIEND_TEST(AFP_SiDSensitiveDetectortest, StartOfAthenaEvent)
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, Initialize)
FRIEND_TEST(AFP_SiDSensitiveDetectortest, AddHit)
SG::WriteHandle< AFP_SIDSimHitCollection > m_HitColl
FRIEND_TEST(AFP_SiDSensitiveDetectortest, EndOfAthenaEvent)
void Initialize(G4HCofThisEvent *) override final