ATLAS Offline Software
Loading...
Searching...
No Matches
AFP_TDSensitiveDetector.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 AFP_G4_SD_AFP_TDSensitiveDetector_h
6#define AFP_G4_SD_AFP_TDSensitiveDetector_h
7
8// Base class
9#include "G4VSensitiveDetector.hh"
10
11// use of the hits
15#include <gtest/gtest_prod.h>
16
17// STL header
18#include <string>
19
20class G4Step;
21class G4TouchableHistory;
22
23class AFP_TDSensitiveDetector : public G4VSensitiveDetector
24{
25 FRIEND_TEST( AFP_TDSensitiveDetectortest, Initialize );
26 FRIEND_TEST( AFP_TDSensitiveDetectortest, ProcessHits );
27 FRIEND_TEST( AFP_TDSensitiveDetectortest, StartOfAthenaEvent );
28 FRIEND_TEST( AFP_TDSensitiveDetectortest, EndOfAthenaEvent );
29 FRIEND_TEST( AFP_TDSensitiveDetectortest, AddHit );
30
31public:
32 // Constructor
33 AFP_TDSensitiveDetector(const std::string& name, const std::string& hitCollectionName);
34
35 // Destructor
36 ~AFP_TDSensitiveDetector() { /* I don't own myHitColl if all has gone well */ }
37
38 // Called from AFP_TDSensitiveDetectorTool::SetupEvent
39 void StartOfAthenaEvent ();
40 // Called from G4 at the start of each G4 event
41 void Initialize(G4HCofThisEvent *) override final;
42 G4bool ProcessHits(G4Step*, G4TouchableHistory*) override final;
43 // Called from AFP_TDSensitiveDetectorTool::Gather
44 void EndOfAthenaEvent();
45
49 template <class... Args> void AddHit(Args&&... args){ m_HitColl->Emplace( args... ); }
50
51 static constexpr double TDMaxQEff = 0.15;
52 static constexpr int TDMaxCnt = 4000;
53
54private:
58 int m_nNOfTDSimHits[4][32];
59 // The hits collection
61};
62
63#endif //AFP_G4_SD_AFP_TDSensitiveDetector_h
Handle class for recording to StoreGate.
SG::WriteHandle< AFP_TDSimHitCollection > m_HitColl
FRIEND_TEST(AFP_TDSensitiveDetectortest, AddHit)
FRIEND_TEST(AFP_TDSensitiveDetectortest, Initialize)
G4bool ProcessHits(G4Step *, G4TouchableHistory *) override final
static constexpr double TDMaxQEff
FRIEND_TEST(AFP_TDSensitiveDetectortest, EndOfAthenaEvent)
AFP_TDSensitiveDetector(const std::string &name, const std::string &hitCollectionName)
void Initialize(G4HCofThisEvent *) override final
void AddHit(Args &&... args)
Templated method to stuff a single hit into the sensitive detector class.
FRIEND_TEST(AFP_TDSensitiveDetectortest, ProcessHits)
FRIEND_TEST(AFP_TDSensitiveDetectortest, StartOfAthenaEvent)