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 <gtest/gtest_prod.h>
22 
23 class BCMSensorSD : public G4VSensitiveDetector
24 {
25  FRIEND_TEST( BCMSensorSDtest, ProcessHits );
26  FRIEND_TEST( BCMSensorSDtest, AddHit );
27  public:
28  // Constructor
29  BCMSensorSD(const std::string& name, const std::string& hitCollectionName);
30 
31  // Process the hits from G4
32  G4bool ProcessHits(G4Step*, G4TouchableHistory*) override final;
33 
34  // Initialize from G4
35  void Initialize(G4HCofThisEvent *) override final;
36 
40  template <class... Args> void AddHit(Args&&... args){ m_HitColl->Emplace( args... ); }
41  private:
42  std::string m_HitCollName;
44 };
45 
46 #endif
python.CaloAddPedShiftConfig.args
args
Definition: CaloAddPedShiftConfig.py:47
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
AtlasHitsVector< SiHit >
BCMSensorSD::m_HitColl
SiHitCollection * m_HitColl
Pointer to the hit collection.
Definition: BCMSensorSD.h:43
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:40
AtlasHitsVector::Emplace
void Emplace(Args &&... args)
Definition: AtlasHitsVector.h:80
BCMSensorSD::FRIEND_TEST
FRIEND_TEST(BCMSensorSDtest, ProcessHits)
BCMSensorSD::FRIEND_TEST
FRIEND_TEST(BCMSensorSDtest, AddHit)
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
BCMSensorSD
Definition: BCMSensorSD.h:24
BCMSensorSD::m_HitCollName
std::string m_HitCollName
Name of the hit collection.
Definition: BCMSensorSD.h:42
BCMSensorSD::ProcessHits
G4bool ProcessHits(G4Step *, G4TouchableHistory *) override final
Definition: BCMSensorSD.cxx:49
SiHitCollection.h