ATLAS Offline Software
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
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 class 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 
31 public:
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 
54 private:
55  int m_nHitID;
58  int m_nNOfTDSimHits[4][32];
59  // The hits collection
61 };
62 
63 #endif //AFP_G4_SD_AFP_TDSensitiveDetector_h
AFP_TDSensitiveDetector::ProcessHits
G4bool ProcessHits(G4Step *, G4TouchableHistory *) override final
Definition: AFP_TDSensitiveDetector.cxx:65
AFP_TDSensitiveDetector::EndOfAthenaEvent
void EndOfAthenaEvent()
Definition: AFP_TDSensitiveDetector.cxx:439
AFP_TDSensitiveDetector::FRIEND_TEST
FRIEND_TEST(AFP_TDSensitiveDetectortest, ProcessHits)
AFP_TDSensitiveDetector::m_nNOfTDSimHits
int m_nNOfTDSimHits[4][32]
Definition: AFP_TDSensitiveDetector.h:58
AFP_TDSensitiveDetector::TDMaxCnt
static constexpr int TDMaxCnt
Definition: AFP_TDSensitiveDetector.h:52
AFP_TDSensitiveDetector::TDMaxQEff
static constexpr double TDMaxQEff
Definition: AFP_TDSensitiveDetector.h:51
AFP_TDSensitiveDetector::StartOfAthenaEvent
void StartOfAthenaEvent()
Definition: AFP_TDSensitiveDetector.cxx:44
AFP_TDSensitiveDetector::m_nNumberOfTDSimHits
int m_nNumberOfTDSimHits
Definition: AFP_TDSensitiveDetector.h:57
Args
Definition: test_lwtnn_fastgraph.cxx:12
AFP_TDSensitiveDetector::m_HitColl
SG::WriteHandle< AFP_TDSimHitCollection > m_HitColl
Definition: AFP_TDSensitiveDetector.h:60
AFP_TDSensitiveDetector::Initialize
void Initialize(G4HCofThisEvent *) override final
Definition: AFP_TDSensitiveDetector.cxx:58
AFP_TDSensitiveDetector::~AFP_TDSensitiveDetector
~AFP_TDSensitiveDetector()
Definition: AFP_TDSensitiveDetector.h:36
AFP_TDSensitiveDetector::FRIEND_TEST
FRIEND_TEST(AFP_TDSensitiveDetectortest, AddHit)
AFP_TDSensitiveDetector::FRIEND_TEST
FRIEND_TEST(AFP_TDSensitiveDetectortest, Initialize)
WriteHandle.h
Handle class for recording to StoreGate.
AFP_TDSensitiveDetector::AddHit
void AddHit(Args &&... args)
Templated method to stuff a single hit into the sensitive detector class.
Definition: AFP_TDSensitiveDetector.h:49
AFP_TDSensitiveDetector::m_nEventNumber
int m_nEventNumber
Definition: AFP_TDSensitiveDetector.h:56
AFP_TDSimHitCollection.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
AFP_TDSensitiveDetector::FRIEND_TEST
FRIEND_TEST(AFP_TDSensitiveDetectortest, StartOfAthenaEvent)
AFP_SIDSimHitCollection.h
AFP_TDSensitiveDetector::m_nHitID
int m_nHitID
Definition: AFP_TDSensitiveDetector.h:55
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
AFP_TDSensitiveDetector::AFP_TDSensitiveDetector
AFP_TDSensitiveDetector(const std::string &name, const std::string &hitCollectionName)
Definition: AFP_TDSensitiveDetector.cxx:28
AFP_TDSensitiveDetector
Definition: AFP_TDSensitiveDetector.h:24
AFP_TDSensitiveDetector::FRIEND_TEST
FRIEND_TEST(AFP_TDSensitiveDetectortest, EndOfAthenaEvent)
python.CaloScaleNoiseConfig.args
args
Definition: CaloScaleNoiseConfig.py:80