ATLAS Offline Software
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 "StoreGate/WriteHandle.h"
14 #include <gtest/gtest_prod.h>
15 
16 // STL header
17 #include <string>
18 
19 class G4Step;
20 class G4TouchableHistory;
21 
22 class 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 
30 public:
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 
52 private:
53  int m_nHitID;
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
AFP_SiDSensitiveDetector::EndOfAthenaEvent
void EndOfAthenaEvent()
Definition: AFP_SiDSensitiveDetector.cxx:535
AFP_SiDSensitiveDetector::m_delta_pixel_y
float m_delta_pixel_y
Definition: AFP_SiDSensitiveDetector.h:59
AFP_SiDSensitiveDetector::m_death_edge
float m_death_edge[4][10]
Definition: AFP_SiDSensitiveDetector.h:60
AFP_SiDSensitiveDetector::m_nNOfSIDSimHits
int m_nNOfSIDSimHits[4]
Definition: AFP_SiDSensitiveDetector.h:57
AFP_SiDSensitiveDetector::AFP_SiDSensitiveDetector
AFP_SiDSensitiveDetector(const std::string &name, const std::string &hitCollectionName)
Definition: AFP_SiDSensitiveDetector.cxx:31
AFP_SiDSensitiveDetector::FRIEND_TEST
FRIEND_TEST(AFP_SiDSensitiveDetectortest, StartOfAthenaEvent)
Args
Definition: test_lwtnn_fastgraph.cxx:12
WriteHandle.h
Handle class for recording to StoreGate.
AFP_SiDSensitiveDetector::ProcessHits
G4bool ProcessHits(G4Step *, G4TouchableHistory *) override final
Definition: AFP_SiDSensitiveDetector.cxx:69
AFP_SiDSensitiveDetector::AddHit
void AddHit(Args &&... args)
Templated method to stuff a single hit into the sensitive detector class.
Definition: AFP_SiDSensitiveDetector.h:48
AFP_SiDSensitiveDetector::m_nNumberOfSIDSimHits
int m_nNumberOfSIDSimHits
Definition: AFP_SiDSensitiveDetector.h:55
AFP_SiDSensitiveDetector
Definition: AFP_SiDSensitiveDetector.h:23
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
AFP_SiDSensitiveDetector::m_lower_edge
float m_lower_edge[4][10]
Definition: AFP_SiDSensitiveDetector.h:61
AFP_SiDSensitiveDetector::SiDMaxCnt
static constexpr int SiDMaxCnt
Definition: AFP_SiDSensitiveDetector.h:50
AFP_SiDSensitiveDetector::FRIEND_TEST
FRIEND_TEST(AFP_SiDSensitiveDetectortest, EndOfAthenaEvent)
AFP_SIDSimHitCollection.h
AFP_SiDSensitiveDetector::~AFP_SiDSensitiveDetector
~AFP_SiDSensitiveDetector()
Definition: AFP_SiDSensitiveDetector.h:35
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
AFP_SiDSensitiveDetector::m_HitColl
SG::WriteHandle< AFP_SIDSimHitCollection > m_HitColl
Definition: AFP_SiDSensitiveDetector.h:64
AFP_SiDSensitiveDetector::m_nEventNumber
int m_nEventNumber
Definition: AFP_SiDSensitiveDetector.h:54
AFP_SiDSensitiveDetector::FRIEND_TEST
FRIEND_TEST(AFP_SiDSensitiveDetectortest, ProcessHits)
AFP_SiDSensitiveDetector::m_delta_pixel_x
float m_delta_pixel_x
Definition: AFP_SiDSensitiveDetector.h:59
AFP_SiDSensitiveDetector::StartOfAthenaEvent
void StartOfAthenaEvent()
Definition: AFP_SiDSensitiveDetector.cxx:51
AFP_SiDSensitiveDetector::m_nHitID
int m_nHitID
Definition: AFP_SiDSensitiveDetector.h:53
python.CaloScaleNoiseConfig.args
args
Definition: CaloScaleNoiseConfig.py:80
AFP_SiDSensitiveDetector::FRIEND_TEST
FRIEND_TEST(AFP_SiDSensitiveDetectortest, Initialize)
AFP_SiDSensitiveDetector::Initialize
void Initialize(G4HCofThisEvent *) override final
Definition: AFP_SiDSensitiveDetector.cxx:62
AFP_SiDSensitiveDetector::FRIEND_TEST
FRIEND_TEST(AFP_SiDSensitiveDetectortest, AddHit)