ATLAS Offline Software
AFP_SensitiveDetector.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_SensitiveDetector_h
6 #define AFP_G4_SD_AFP_SensitiveDetector_h
7 
8 // Base class
9 #include "G4VSensitiveDetector.hh"
10 
11 // use of the hits
14 #include "StoreGate/WriteHandle.h"
15 #include <gtest/gtest_prod.h>
16 
17 // STL header
18 #include <string>
19 
20 class G4Step;
21 class G4TouchableHistory;
22 
23 
24 class AFP_SensitiveDetector : public G4VSensitiveDetector
25 {
26  FRIEND_TEST( AFP_SensitiveDetectortest, Initialize );
27  FRIEND_TEST( AFP_SensitiveDetectortest, ProcessHits1 );
28  FRIEND_TEST( AFP_SensitiveDetectortest, ProcessHits2 );
29  FRIEND_TEST( AFP_SensitiveDetectortest, StartOfAthenaEvent);
30  FRIEND_TEST( AFP_SensitiveDetectortest, EndOfAthenaEvent );
31 
32 public:
33  // Constructor
34  AFP_SensitiveDetector(const std::string& name, const std::string& TDhitCollectionName, const std::string& SIDhitCollectionName);
35 
36  // Destructor
37  ~AFP_SensitiveDetector() { /* I don't own myHitColl if all has gone well */ }
38 
39  // Called from AFP_SensitiveDetectorTool::SetupEvent
40  void StartOfAthenaEvent ();
41  // Called from G4 at the start of each G4 event
42  void Initialize(G4HCofThisEvent *) override final;
43  G4bool ProcessHits(G4Step*, G4TouchableHistory*) override final;
44  // Called from AFP_SensitiveDetectorTool::Gather
45  void EndOfAthenaEvent();
46 
50  //template <class... Args> void AddHit(Args&&... args){ m_HitColl->Emplace( args... ); }
51 
52  static constexpr double TDMaxQEff = 0.15;
53  static constexpr int TDMaxCnt = 4000;
54  static constexpr int SiDMaxCnt = 1000;
55 
56 private:
57  int m_nHitID;
61 
62  int m_nNOfTDSimHits[4][32];
64 
66  float m_death_edge[4][10];
67  float m_lower_edge[4][10];
68 
69  // The hits collections
72 
73 };
74 
75 #endif //AFP_G4_SD_AFP_SensitiveDetector_h
AFP_SensitiveDetector::EndOfAthenaEvent
void EndOfAthenaEvent()
Definition: AFP_SensitiveDetector.cxx:774
AFP_SensitiveDetector::ProcessHits
G4bool ProcessHits(G4Step *, G4TouchableHistory *) override final
Definition: AFP_SensitiveDetector.cxx:86
AFP_SensitiveDetector::m_nNOfTDSimHits
int m_nNOfTDSimHits[4][32]
Definition: AFP_SensitiveDetector.h:62
AFP_SensitiveDetector::FRIEND_TEST
FRIEND_TEST(AFP_SensitiveDetectortest, ProcessHits2)
AFP_SensitiveDetector::FRIEND_TEST
FRIEND_TEST(AFP_SensitiveDetectortest, Initialize)
AFP_SensitiveDetector::m_nNumberOfTDSimHits
int m_nNumberOfTDSimHits
Definition: AFP_SensitiveDetector.h:59
AFP_SensitiveDetector::m_delta_pixel_y
float m_delta_pixel_y
Definition: AFP_SensitiveDetector.h:65
AFP_SensitiveDetector::m_pTDSimHitCollection
SG::WriteHandle< AFP_TDSimHitCollection > m_pTDSimHitCollection
Definition: AFP_SensitiveDetector.h:70
AFP_SensitiveDetector::m_nNOfSIDSimHits
int m_nNOfSIDSimHits[4]
Definition: AFP_SensitiveDetector.h:63
AFP_SensitiveDetector::AFP_SensitiveDetector
AFP_SensitiveDetector(const std::string &name, const std::string &TDhitCollectionName, const std::string &SIDhitCollectionName)
Definition: AFP_SensitiveDetector.cxx:31
WriteHandle.h
Handle class for recording to StoreGate.
AFP_SensitiveDetector::m_nHitID
int m_nHitID
Definition: AFP_SensitiveDetector.h:57
AFP_SensitiveDetector::m_nEventNumber
int m_nEventNumber
Definition: AFP_SensitiveDetector.h:58
AFP_SensitiveDetector::TDMaxCnt
static constexpr int TDMaxCnt
Definition: AFP_SensitiveDetector.h:53
AFP_SensitiveDetector::FRIEND_TEST
FRIEND_TEST(AFP_SensitiveDetectortest, StartOfAthenaEvent)
AFP_SensitiveDetector::m_pSIDSimHitCollection
SG::WriteHandle< AFP_SIDSimHitCollection > m_pSIDSimHitCollection
Definition: AFP_SensitiveDetector.h:71
AFP_SensitiveDetector::Initialize
void Initialize(G4HCofThisEvent *) override final
Definition: AFP_SensitiveDetector.cxx:78
AFP_TDSimHitCollection.h
AFP_SensitiveDetector::m_lower_edge
float m_lower_edge[4][10]
Definition: AFP_SensitiveDetector.h:67
AFP_SensitiveDetector::SiDMaxCnt
static constexpr int SiDMaxCnt
Definition: AFP_SensitiveDetector.h:54
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
AFP_SensitiveDetector::m_delta_pixel_x
float m_delta_pixel_x
Definition: AFP_SensitiveDetector.h:65
AFP_SIDSimHitCollection.h
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
AFP_SensitiveDetector
Definition: AFP_SensitiveDetector.h:25
AFP_SensitiveDetector::~AFP_SensitiveDetector
~AFP_SensitiveDetector()
Definition: AFP_SensitiveDetector.h:37
AFP_SensitiveDetector::m_death_edge
float m_death_edge[4][10]
Definition: AFP_SensitiveDetector.h:66
AFP_SensitiveDetector::StartOfAthenaEvent
void StartOfAthenaEvent()
Definition: AFP_SensitiveDetector.cxx:57
AFP_SensitiveDetector::m_nNumberOfSIDSimHits
int m_nNumberOfSIDSimHits
Definition: AFP_SensitiveDetector.h:60
AFP_SensitiveDetector::FRIEND_TEST
FRIEND_TEST(AFP_SensitiveDetectortest, EndOfAthenaEvent)
AFP_SensitiveDetector::TDMaxQEff
static constexpr double TDMaxQEff
Templated method to stuff a single hit into the sensitive detector class.
Definition: AFP_SensitiveDetector.h:52
AFP_SensitiveDetector::FRIEND_TEST
FRIEND_TEST(AFP_SensitiveDetectortest, ProcessHits1)