ATLAS Offline Software
Loading...
Searching...
No Matches
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
13#include <gtest/gtest_prod.h>
14
15#include <utility>
16
17class LUCID_HitHelper;
18
19class G4Step;
20class G4TouchableHistory;
21
22class LUCID_SensitiveDetector : public G4VSensitiveDetector
23{
24 FRIEND_TEST( LUCID_SensitiveDetectortest, ProcessHits );
25 FRIEND_TEST( LUCID_SensitiveDetectortest, AddHit );
26public:
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:
51
54
56 // Non-owning cache set by Initialize; HitCollectionMap owns the collection.
59};
60
61#endif //LUCID_G4_SD_LUCID_SensitiveDetector_h
AtlasHitsVector< LUCID_SimHit > LUCID_SimHitCollection
LUCID_SensitiveDetector(const std::string &name, const std::string &hitCollectionName)
FRIEND_TEST(LUCID_SensitiveDetectortest, ProcessHits)
void AddHit(Args &&... args)
Templated method to stuff a single hit into the sensitive detector class.
LUCID_SimHitCollection * m_HitColl
bool ProcessHits(G4Step *, G4TouchableHistory *) override final
LUCID_SimHitCollection * getHitCollection() const
LUCID_SensitiveDetector(const LUCID_SensitiveDetector &)
void Initialize(G4HCofThisEvent *) override final
FRIEND_TEST(LUCID_SensitiveDetectortest, AddHit)
LUCID_SensitiveDetector & operator=(const LUCID_SensitiveDetector &)