ATLAS Offline Software
Loading...
Searching...
No Matches
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
15#include <gtest/gtest_prod.h>
16
17// STL header
18#include <string>
19
20class G4Step;
21class G4TouchableHistory;
22
23class 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
32public:
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
51private:
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
Handle class for recording to StoreGate.
FRIEND_TEST(ALFA_SensitiveDetectortest, ProcessHits3)
SG::WriteHandle< ALFA_ODHitCollection > m_ODHitCollection
FRIEND_TEST(ALFA_SensitiveDetectortest, StartOfAthenaEvent)
void Initialize(G4HCofThisEvent *) override final
FRIEND_TEST(ALFA_SensitiveDetectortest, ProcessHits2)
FRIEND_TEST(ALFA_SensitiveDetectortest, ProcessHits1)
int m_hitID
Templated method to stuff a single hit into the sensitive detector class.
G4bool ProcessHits(G4Step *, G4TouchableHistory *) override final
FRIEND_TEST(ALFA_SensitiveDetectortest, Initialize)
FRIEND_TEST(ALFA_SensitiveDetectortest, EndOfAthenaEvent)
ALFA_SensitiveDetector(const std::string &name, const std::string &hitCollectionName, const std::string &ODhitCollectionName)
SG::WriteHandle< ALFA_HitCollection > m_HitCollection