ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
ForwardDetectors
LUCID
LUCID_G4_SD
src
LUCID_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 LUCID_G4_SD_LUCID_SensitiveDetector_h
6
#define LUCID_G4_SD_LUCID_SensitiveDetector_h
7
8
// Base class
9
#include "G4VSensitiveDetector.hh"
10
11
// Athena headers
12
#include "
LUCID_SimEvent/LUCID_SimHitCollection.h
"
13
#include <gtest/gtest_prod.h>
14
15
#include <utility>
16
17
class
LUCID_HitHelper
;
18
19
class
G4Step;
20
class
G4TouchableHistory;
21
22
class
LUCID_SensitiveDetector
:
public
G4VSensitiveDetector
23
{
24
FRIEND_TEST
( LUCID_SensitiveDetectortest,
ProcessHits
);
25
FRIEND_TEST
( LUCID_SensitiveDetectortest,
AddHit
);
26
public
:
27
// Constructor
28
LUCID_SensitiveDetector
(
const
std::string& name,
const
std::string& hitCollectionName);
29
30
// Destructor
31
~LUCID_SensitiveDetector
() {
/* I don't own myHitColl if all has gone well */
}
32
33
// Initialize from G4
34
void
Initialize
(G4HCofThisEvent *)
override
final
;
35
36
// Process the hits from G4
37
bool
ProcessHits
(G4Step*, G4TouchableHistory*)
override
final
;
38
42
template
<
class
...
Args
>
void
AddHit
(
Args
&&... args)
43
{
44
if
(
m_HitColl
) {
45
m_HitColl
->Emplace(std::forward<Args>(args)...);
46
}
47
}
48
49
private
:
50
LUCID_SimHitCollection
*
getHitCollection
()
const
;
51
52
LUCID_SensitiveDetector
(
const
LUCID_SensitiveDetector
&);
53
LUCID_SensitiveDetector
&
operator=
(
const
LUCID_SensitiveDetector
&);
54
55
std::string
m_hitCollectionName
;
56
// Non-owning cache set by Initialize; HitCollectionMap owns the collection.
57
LUCID_SimHitCollection
*
m_HitColl
{};
58
LUCID_HitHelper
*
m_hit
;
59
};
60
61
#endif
//LUCID_G4_SD_LUCID_SensitiveDetector_h
LUCID_SimHitCollection.h
LUCID_SimHitCollection
AtlasHitsVector< LUCID_SimHit > LUCID_SimHitCollection
Definition
LUCID_SimHitCollection.h:12
LUCID_HitHelper
Definition
LUCID_HitHelper.h:24
LUCID_SensitiveDetector::LUCID_SensitiveDetector
LUCID_SensitiveDetector(const std::string &name, const std::string &hitCollectionName)
Definition
LUCID_SensitiveDetector.cxx:30
LUCID_SensitiveDetector::FRIEND_TEST
FRIEND_TEST(LUCID_SensitiveDetectortest, ProcessHits)
LUCID_SensitiveDetector::m_hit
LUCID_HitHelper * m_hit
Definition
LUCID_SensitiveDetector.h:58
LUCID_SensitiveDetector::AddHit
void AddHit(Args &&... args)
Templated method to stuff a single hit into the sensitive detector class.
Definition
LUCID_SensitiveDetector.h:42
LUCID_SensitiveDetector::m_HitColl
LUCID_SimHitCollection * m_HitColl
Definition
LUCID_SensitiveDetector.h:57
LUCID_SensitiveDetector::ProcessHits
bool ProcessHits(G4Step *, G4TouchableHistory *) override final
Definition
LUCID_SensitiveDetector.cxx:46
LUCID_SensitiveDetector::~LUCID_SensitiveDetector
~LUCID_SensitiveDetector()
Definition
LUCID_SensitiveDetector.h:31
LUCID_SensitiveDetector::getHitCollection
LUCID_SimHitCollection * getHitCollection() const
Definition
LUCID_SensitiveDetector.cxx:97
LUCID_SensitiveDetector::LUCID_SensitiveDetector
LUCID_SensitiveDetector(const LUCID_SensitiveDetector &)
LUCID_SensitiveDetector::m_hitCollectionName
std::string m_hitCollectionName
Definition
LUCID_SensitiveDetector.h:55
LUCID_SensitiveDetector::Initialize
void Initialize(G4HCofThisEvent *) override final
Definition
LUCID_SensitiveDetector.cxx:39
LUCID_SensitiveDetector::FRIEND_TEST
FRIEND_TEST(LUCID_SensitiveDetectortest, AddHit)
LUCID_SensitiveDetector::operator=
LUCID_SensitiveDetector & operator=(const LUCID_SensitiveDetector &)
Args
Definition
test_lwtnn_fastgraph.cxx:12
Generated on
for ATLAS Offline Software by
1.17.0