ATLAS Offline Software
ALFA_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 ALFA_G4_SD_ALFA_SensitiveDetector_h
6 #define ALFA_G4_SD_ALFA_SensitiveDetector_h
7 
8 // Base class header file
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 ALFA_SensitiveDetector : public G4VSensitiveDetector
24 {
25  FRIEND_TEST( ALFA_SensitiveDetectortest, Initialize );
26  FRIEND_TEST( ALFA_SensitiveDetectortest, ProcessHits1 );
27  FRIEND_TEST( ALFA_SensitiveDetectortest, ProcessHits2 );
28  FRIEND_TEST( ALFA_SensitiveDetectortest, ProcessHits3 );
29  FRIEND_TEST( ALFA_SensitiveDetectortest, StartOfAthenaEvent );
30  FRIEND_TEST( ALFA_SensitiveDetectortest, EndOfAthenaEvent );
31 
32 public:
33  // Constructor
34  ALFA_SensitiveDetector(const std::string& name, const std::string& hitCollectionName, const std::string& ODhitCollectionName);
35  // Destructor
37 
38  // Called from G4 at the start of each G4 event
39  void Initialize(G4HCofThisEvent *) override final;
40  // Called from ALFA_SensitiveDetectorTool::SetupEvent
41  void StartOfAthenaEvent ();
42  G4bool ProcessHits(G4Step*, G4TouchableHistory*) override final;
43  // Called from ALFA_SensitiveDetectorTool::Gather
44  void EndOfAthenaEvent();
45 
49  //template <class... Args> void AddHit(Args&&... args){ m_HitColl->Emplace( args... ); }
50 
51 private:
52  int m_hitID;
53 
57 
58  // The hits collections
61 
62  int m_pos1, m_pos2;
63 
64  int m_num[3];
65 };
66 
67 #endif //ALFA_G4_SD_ALFA_SensitiveDetector_h
ALFA_SensitiveDetector::m_HitCollection
SG::WriteHandle< ALFA_HitCollection > m_HitCollection
Definition: ALFA_SensitiveDetector.h:59
ALFA_SensitiveDetector::m_ODHitCollection
SG::WriteHandle< ALFA_ODHitCollection > m_ODHitCollection
Definition: ALFA_SensitiveDetector.h:60
ALFA_ODHitCollection.h
ALFA_SensitiveDetector::m_numberOfODHits
int m_numberOfODHits
Definition: ALFA_SensitiveDetector.h:56
WriteHandle.h
Handle class for recording to StoreGate.
ALFA_SensitiveDetector::FRIEND_TEST
FRIEND_TEST(ALFA_SensitiveDetectortest, ProcessHits3)
ALFA_SensitiveDetector::m_num
int m_num[3]
Definition: ALFA_SensitiveDetector.h:64
ALFA_SensitiveDetector::FRIEND_TEST
FRIEND_TEST(ALFA_SensitiveDetectortest, ProcessHits2)
ALFA_SensitiveDetector::m_eventNumber
int m_eventNumber
Definition: ALFA_SensitiveDetector.h:54
ALFA_SensitiveDetector::FRIEND_TEST
FRIEND_TEST(ALFA_SensitiveDetectortest, Initialize)
ALFA_SensitiveDetector::FRIEND_TEST
FRIEND_TEST(ALFA_SensitiveDetectortest, ProcessHits1)
ALFA_SensitiveDetector::Initialize
void Initialize(G4HCofThisEvent *) override final
Definition: ALFA_SensitiveDetector.cxx:50
ALFA_SensitiveDetector::FRIEND_TEST
FRIEND_TEST(ALFA_SensitiveDetectortest, EndOfAthenaEvent)
ALFA_SensitiveDetector::m_hitID
int m_hitID
Templated method to stuff a single hit into the sensitive detector class.
Definition: ALFA_SensitiveDetector.h:52
ALFA_SensitiveDetector::m_numberOfHits
int m_numberOfHits
Definition: ALFA_SensitiveDetector.h:55
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ALFA_SensitiveDetector::FRIEND_TEST
FRIEND_TEST(ALFA_SensitiveDetectortest, StartOfAthenaEvent)
ALFA_SensitiveDetector::ProcessHits
G4bool ProcessHits(G4Step *, G4TouchableHistory *) override final
Definition: ALFA_SensitiveDetector.cxx:56
ALFA_SensitiveDetector::EndOfAthenaEvent
void EndOfAthenaEvent()
Definition: ALFA_SensitiveDetector.cxx:284
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
ALFA_SensitiveDetector::ALFA_SensitiveDetector
ALFA_SensitiveDetector(const std::string &name, const std::string &hitCollectionName, const std::string &ODhitCollectionName)
Definition: ALFA_SensitiveDetector.cxx:22
ALFA_HitCollection.h
ALFA_SensitiveDetector::~ALFA_SensitiveDetector
~ALFA_SensitiveDetector()
Definition: ALFA_SensitiveDetector.h:36
ALFA_SensitiveDetector::m_pos2
int m_pos2
Definition: ALFA_SensitiveDetector.h:62
ALFA_SensitiveDetector::StartOfAthenaEvent
void StartOfAthenaEvent()
Definition: ALFA_SensitiveDetector.cxx:43
ALFA_SensitiveDetector::m_pos1
int m_pos1
Definition: ALFA_SensitiveDetector.h:62
ALFA_SensitiveDetector
Definition: ALFA_SensitiveDetector.h:24