ATLAS Offline Software
BCMSensorSD.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 //###############################################
6 // BCM Sensitive Detector class
7 // Bostjan Macek 17.may.2007
8 //###############################################
9 
10 #ifndef BCMSENSORSD_H
11 #define BCMSENSORSD_H
12 
13 // Base class
14 #include "G4VSensitiveDetector.hh"
15 
16 // G4 needed classes
17 class G4Step;
18 
19 // use of the hits
21 #include "StoreGate/WriteHandle.h"
22 #include <gtest/gtest_prod.h>
23 
24 class BCMSensorSD : public G4VSensitiveDetector
25 {
26  FRIEND_TEST( BCMSensorSDtest, Initialize );
27  FRIEND_TEST( BCMSensorSDtest, ProcessHits );
28  FRIEND_TEST( BCMSensorSDtest, AddHit );
29  public:
30  // Constructor
31  BCMSensorSD(const std::string& name, const std::string& hitCollectionName);
32 
33  // Destructor
34  ~BCMSensorSD() { /* I don't own myHitColl if all has gone well */ }
35 
36  // Process the hits from G4
37  G4bool ProcessHits(G4Step*, G4TouchableHistory*) override final;
38 
39  // Initialize from G4
40  void Initialize(G4HCofThisEvent *) override final;
41 
45  template <class... Args> void AddHit(Args&&... args){ m_HitColl->Emplace( args... ); }
46 
47  private:
48  // The hits collection
50 };
51 
52 #endif
BCMSensorSD::m_HitColl
SG::WriteHandle< SiHitCollection > m_HitColl
Definition: BCMSensorSD.h:49
BCMSensorSD::Initialize
void Initialize(G4HCofThisEvent *) override final
Definition: BCMSensorSD.cxx:39
BCMSensorSD::BCMSensorSD
BCMSensorSD(const std::string &name, const std::string &hitCollectionName)
Definition: BCMSensorSD.cxx:31
Args
Definition: test_lwtnn_fastgraph.cxx:12
BCMSensorSD::AddHit
void AddHit(Args &&... args)
Templated method to stuff a single hit into the sensitive detector class.
Definition: BCMSensorSD.h:45
WriteHandle.h
Handle class for recording to StoreGate.
BCMSensorSD::FRIEND_TEST
FRIEND_TEST(BCMSensorSDtest, ProcessHits)
BCMSensorSD::FRIEND_TEST
FRIEND_TEST(BCMSensorSDtest, AddHit)
BCMSensorSD::FRIEND_TEST
FRIEND_TEST(BCMSensorSDtest, Initialize)
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
BCMSensorSD::~BCMSensorSD
~BCMSensorSD()
Definition: BCMSensorSD.h:34
BCMSensorSD
Definition: BCMSensorSD.h:25
python.CaloScaleNoiseConfig.args
args
Definition: CaloScaleNoiseConfig.py:80
BCMSensorSD::ProcessHits
G4bool ProcessHits(G4Step *, G4TouchableHistory *) override final
Definition: BCMSensorSD.cxx:44
SiHitCollection.h