ATLAS Offline Software
LUCID_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 LUCID_G4_SD_LUCID_SensitiveDetector_h
6 #define LUCID_G4_SD_LUCID_SensitiveDetector_h
7 
8 // Base class
10 
11 // Athena headers
13 #include "StoreGate/WriteHandle.h"
14 #include <gtest/gtest_prod.h>
15 
16 class LUCID_HitHelper;
17 
18 class G4Step;
19 class G4TouchableHistory;
20 
21 class LUCID_SensitiveDetector : public G4VSensitiveDetector
22 {
23  FRIEND_TEST( LUCID_SensitiveDetectortest, Initialize );
24  FRIEND_TEST( LUCID_SensitiveDetectortest, ProcessHits );
25  FRIEND_TEST( LUCID_SensitiveDetectortest, AddHit );
26 public:
27  // Constructor
28  LUCID_SensitiveDetector(const std::string& name, const std::string& hitCollectionName);
29 
30  // Destructor
31  ~LUCID_SensitiveDetector() { /* I don't own myHitColl if all has gone well */ }
32 
33  // Initialize from G4
34  void Initialize(G4HCofThisEvent *) override final;
35 
36  // Process the hits from G4
37  bool ProcessHits(G4Step*, G4TouchableHistory*) override final;
38 
42  template <class... Args> void AddHit(Args&&... args){ m_HitColl->Emplace( args... ); }
43 
44  private:
45 
48 
51 };
52 
53 #endif //LUCID_G4_SD_LUCID_SensitiveDetector_h
LUCID_SensitiveDetector::AddHit
void AddHit(Args &&... args)
Templated method to stuff a single hit into the sensitive detector class.
Definition: LUCID_SensitiveDetector.h:42
LUCID_SensitiveDetector::m_hit
LUCID_HitHelper * m_hit
Definition: LUCID_SensitiveDetector.h:50
LUCID_SensitiveDetector::FRIEND_TEST
FRIEND_TEST(LUCID_SensitiveDetectortest, ProcessHits)
LUCID_SensitiveDetector::LUCID_SensitiveDetector
LUCID_SensitiveDetector(const std::string &name, const std::string &hitCollectionName)
Definition: LUCID_SensitiveDetector.cxx:28
LUCID_SensitiveDetector::FRIEND_TEST
FRIEND_TEST(LUCID_SensitiveDetectortest, AddHit)
Args
Definition: test_lwtnn_fastgraph.cxx:12
WriteHandle.h
Handle class for recording to StoreGate.
LUCID_SensitiveDetector
Definition: LUCID_SensitiveDetector.h:22
LUCID_SensitiveDetector::m_HitColl
SG::WriteHandle< LUCID_SimHitCollection > m_HitColl
Definition: LUCID_SensitiveDetector.h:49
LUCID_SensitiveDetector::LUCID_SensitiveDetector
LUCID_SensitiveDetector(const LUCID_SensitiveDetector &)
LUCID_SensitiveDetector::~LUCID_SensitiveDetector
~LUCID_SensitiveDetector()
Definition: LUCID_SensitiveDetector.h:31
LUCID_SensitiveDetector::FRIEND_TEST
FRIEND_TEST(LUCID_SensitiveDetectortest, Initialize)
LUCID_SimHitCollection.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
LUCID_SensitiveDetector::Initialize
void Initialize(G4HCofThisEvent *) override final
Definition: LUCID_SensitiveDetector.cxx:37
SensitiveDetectorBase.h
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
LUCID_SensitiveDetector::operator=
LUCID_SensitiveDetector & operator=(const LUCID_SensitiveDetector &)
LUCID_SensitiveDetector::ProcessHits
bool ProcessHits(G4Step *, G4TouchableHistory *) override final
Definition: LUCID_SensitiveDetector.cxx:44
python.CaloScaleNoiseConfig.args
args
Definition: CaloScaleNoiseConfig.py:80
LUCID_HitHelper
Definition: LUCID_HitHelper.h:24