ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
ForwardDetectors
ALFA
ALFA_G4_SD
src
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
12
#include "
ALFA_SimEv/ALFA_HitCollection.h
"
13
#include "
ALFA_SimEv/ALFA_ODHitCollection.h
"
14
#include <gtest/gtest_prod.h>
15
16
// STL header
17
#include <string>
18
19
class
G4Step;
20
class
G4TouchableHistory;
21
22
class
ALFA_SensitiveDetector
:
public
G4VSensitiveDetector
23
{
24
FRIEND_TEST
( ALFA_SensitiveDetectortest, ProcessHits1 );
25
FRIEND_TEST
( ALFA_SensitiveDetectortest, ProcessHits2 );
26
FRIEND_TEST
( ALFA_SensitiveDetectortest, ProcessHits3 );
27
28
public
:
29
// Constructor
30
ALFA_SensitiveDetector
(
const
std::string& name,
const
std::string& hitCollectionName,
const
std::string& ODhitCollectionName);
31
// Destructor
32
~ALFA_SensitiveDetector
() {}
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
43
private
:
44
ALFA_HitCollection
*
getHitCollection
()
const
;
45
ALFA_ODHitCollection
*
getODHitCollection
()
const
;
46
47
int
m_hitID
{};
48
49
// The hits collections
50
std::string
m_hitCollectionName
;
51
std::string
m_ODHitCollectionName
;
52
// Non-owning caches set by Initialize; HitCollectionMap owns the collections.
53
ALFA_HitCollection
*
m_HitCollection
{};
54
ALFA_ODHitCollection
*
m_ODHitCollection
{};
55
56
int
m_pos1
{},
m_pos2
{};
57
58
int
m_num
[3]{};
59
};
60
61
#endif
//ALFA_G4_SD_ALFA_SensitiveDetector_h
ALFA_HitCollection.h
ALFA_HitCollection
AtlasHitsVector< ALFA_Hit > ALFA_HitCollection
Definition
ALFA_HitCollection.h:13
ALFA_ODHitCollection.h
ALFA_ODHitCollection
AtlasHitsVector< ALFA_ODHit > ALFA_ODHitCollection
Definition
ALFA_ODHitCollection.h:13
ALFA_SensitiveDetector::FRIEND_TEST
FRIEND_TEST(ALFA_SensitiveDetectortest, ProcessHits3)
ALFA_SensitiveDetector::m_ODHitCollectionName
std::string m_ODHitCollectionName
Definition
ALFA_SensitiveDetector.h:51
ALFA_SensitiveDetector::Initialize
void Initialize(G4HCofThisEvent *) override final
Definition
ALFA_SensitiveDetector.cxx:45
ALFA_SensitiveDetector::m_pos2
int m_pos2
Definition
ALFA_SensitiveDetector.h:56
ALFA_SensitiveDetector::FRIEND_TEST
FRIEND_TEST(ALFA_SensitiveDetectortest, ProcessHits2)
ALFA_SensitiveDetector::getODHitCollection
ALFA_ODHitCollection * getODHitCollection() const
Definition
ALFA_SensitiveDetector.cxx:266
ALFA_SensitiveDetector::m_hitCollectionName
std::string m_hitCollectionName
Definition
ALFA_SensitiveDetector.h:50
ALFA_SensitiveDetector::FRIEND_TEST
FRIEND_TEST(ALFA_SensitiveDetectortest, ProcessHits1)
ALFA_SensitiveDetector::m_hitID
int m_hitID
Definition
ALFA_SensitiveDetector.h:47
ALFA_SensitiveDetector::ProcessHits
G4bool ProcessHits(G4Step *, G4TouchableHistory *) override final
Definition
ALFA_SensitiveDetector.cxx:51
ALFA_SensitiveDetector::m_HitCollection
ALFA_HitCollection * m_HitCollection
Definition
ALFA_SensitiveDetector.h:53
ALFA_SensitiveDetector::ALFA_SensitiveDetector
ALFA_SensitiveDetector(const std::string &name, const std::string &hitCollectionName, const std::string &ODhitCollectionName)
Definition
ALFA_SensitiveDetector.cxx:27
ALFA_SensitiveDetector::m_ODHitCollection
ALFA_ODHitCollection * m_ODHitCollection
Definition
ALFA_SensitiveDetector.h:54
ALFA_SensitiveDetector::m_num
int m_num[3]
Definition
ALFA_SensitiveDetector.h:58
ALFA_SensitiveDetector::getHitCollection
ALFA_HitCollection * getHitCollection() const
Templated method to stuff a single hit into the sensitive detector class.
Definition
ALFA_SensitiveDetector.cxx:256
ALFA_SensitiveDetector::~ALFA_SensitiveDetector
~ALFA_SensitiveDetector()
Definition
ALFA_SensitiveDetector.h:32
ALFA_SensitiveDetector::m_pos1
int m_pos1
Definition
ALFA_SensitiveDetector.h:56
Generated on
for ATLAS Offline Software by
1.17.0