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
14#include <gtest/gtest_prod.h>
15
16// STL header
17#include <string>
18
19class G4Step;
20class G4TouchableHistory;
21
22class ALFA_SensitiveDetector : public G4VSensitiveDetector
23{
24 FRIEND_TEST( ALFA_SensitiveDetectortest, ProcessHits1 );
25 FRIEND_TEST( ALFA_SensitiveDetectortest, ProcessHits2 );
26 FRIEND_TEST( ALFA_SensitiveDetectortest, ProcessHits3 );
27
28public:
29 // Constructor
30 ALFA_SensitiveDetector(const std::string& name, const std::string& hitCollectionName, const std::string& ODhitCollectionName);
31 // Destructor
33
34 // Called from G4 at the start of each G4 event
35 void Initialize(G4HCofThisEvent *) override final;
36 G4bool ProcessHits(G4Step*, G4TouchableHistory*) override final;
37
41 //template <class... Args> void AddHit(Args&&... args){ m_HitColl->Emplace( args... ); }
42
43private:
46
47 int m_hitID{};
48
49 // The hits collections
52 // Non-owning caches set by Initialize; HitCollectionMap owns the collections.
55
56 int m_pos1{}, m_pos2{};
57
58 int m_num[3]{};
59};
60
61#endif //ALFA_G4_SD_ALFA_SensitiveDetector_h
AtlasHitsVector< ALFA_Hit > ALFA_HitCollection
AtlasHitsVector< ALFA_ODHit > ALFA_ODHitCollection
FRIEND_TEST(ALFA_SensitiveDetectortest, ProcessHits3)
void Initialize(G4HCofThisEvent *) override final
FRIEND_TEST(ALFA_SensitiveDetectortest, ProcessHits2)
ALFA_ODHitCollection * getODHitCollection() const
FRIEND_TEST(ALFA_SensitiveDetectortest, ProcessHits1)
G4bool ProcessHits(G4Step *, G4TouchableHistory *) override final
ALFA_HitCollection * m_HitCollection
ALFA_SensitiveDetector(const std::string &name, const std::string &hitCollectionName, const std::string &ODhitCollectionName)
ALFA_ODHitCollection * m_ODHitCollection
ALFA_HitCollection * getHitCollection() const
Templated method to stuff a single hit into the sensitive detector class.