ATLAS Offline Software
Loading...
Searching...
No Matches
LUCID_SensitiveDetector Class Reference

#include <LUCID_SensitiveDetector.h>

Inheritance diagram for LUCID_SensitiveDetector:
Collaboration diagram for LUCID_SensitiveDetector:

Public Member Functions

 LUCID_SensitiveDetector (const std::string &name, const std::string &hitCollectionName)
 ~LUCID_SensitiveDetector ()
void Initialize (G4HCofThisEvent *) override final
bool ProcessHits (G4Step *, G4TouchableHistory *) override final
template<class... Args>
void AddHit (Args &&... args)
 Templated method to stuff a single hit into the sensitive detector class.

Private Member Functions

 FRIEND_TEST (LUCID_SensitiveDetectortest, Initialize)
 FRIEND_TEST (LUCID_SensitiveDetectortest, ProcessHits)
 FRIEND_TEST (LUCID_SensitiveDetectortest, AddHit)
 LUCID_SensitiveDetector (const LUCID_SensitiveDetector &)
LUCID_SensitiveDetectoroperator= (const LUCID_SensitiveDetector &)

Private Attributes

SG::WriteHandle< LUCID_SimHitCollectionm_HitColl
LUCID_HitHelperm_hit

Detailed Description

Definition at line 21 of file LUCID_SensitiveDetector.h.

Constructor & Destructor Documentation

◆ LUCID_SensitiveDetector() [1/2]

LUCID_SensitiveDetector::LUCID_SensitiveDetector ( const std::string & name,
const std::string & hitCollectionName )

Definition at line 28 of file LUCID_SensitiveDetector.cxx.

29 : G4VSensitiveDetector( name )
30 , m_HitColl( hitCollectionName )
31{
32 m_hit = new LUCID_HitHelper();
33}
SG::WriteHandle< LUCID_SimHitCollection > m_HitColl

◆ ~LUCID_SensitiveDetector()

LUCID_SensitiveDetector::~LUCID_SensitiveDetector ( )
inline

Definition at line 31 of file LUCID_SensitiveDetector.h.

31{ /* I don't own myHitColl if all has gone well */ }

◆ LUCID_SensitiveDetector() [2/2]

LUCID_SensitiveDetector::LUCID_SensitiveDetector ( const LUCID_SensitiveDetector & )
private

Member Function Documentation

◆ AddHit()

template<class... Args>
void LUCID_SensitiveDetector::AddHit ( Args &&... args)
inline

Templated method to stuff a single hit into the sensitive detector class.

This could get rather tricky, but the idea is to allow fast simulations to use the very same SD classes as the standard simulation.

Definition at line 42 of file LUCID_SensitiveDetector.h.

◆ FRIEND_TEST() [1/3]

LUCID_SensitiveDetector::FRIEND_TEST ( LUCID_SensitiveDetectortest ,
AddHit  )
private

◆ FRIEND_TEST() [2/3]

LUCID_SensitiveDetector::FRIEND_TEST ( LUCID_SensitiveDetectortest ,
Initialize  )
private

◆ FRIEND_TEST() [3/3]

LUCID_SensitiveDetector::FRIEND_TEST ( LUCID_SensitiveDetectortest ,
ProcessHits  )
private

◆ Initialize()

void LUCID_SensitiveDetector::Initialize ( G4HCofThisEvent * )
finaloverride

Definition at line 37 of file LUCID_SensitiveDetector.cxx.

38{
39 if (!m_HitColl.isValid()) m_HitColl = std::make_unique<LUCID_SimHitCollection>(m_HitColl.name());
40}

◆ operator=()

LUCID_SensitiveDetector & LUCID_SensitiveDetector::operator= ( const LUCID_SensitiveDetector & )
private

◆ ProcessHits()

bool LUCID_SensitiveDetector::ProcessHits ( G4Step * aStep,
G4TouchableHistory *  )
finaloverride

Definition at line 44 of file LUCID_SensitiveDetector.cxx.

44 {
45
46 if (verboseLevel>5)
47 {
48 G4cout << "LUCID_SensitiveDetector::ProcessHits - Begin" << G4endl;
49 }
50 G4Track* aTrack = aStep->GetTrack();
51
52 if (aTrack->GetDefinition() != G4OpticalPhoton::OpticalPhotonDefinition()) return false;
53
54 if (verboseLevel>5)
55 {
56 G4cout << "LUCID_SensitiveDetector::ProcessHits(): There is an OpticalPhoton " << G4endl;
57 }
58
59 aTrack->SetTrackStatus(fKillTrackAndSecondaries);
60
61 if (aTrack->GetCreatorProcess()->GetProcessName() != "Cerenkov") return false;
62
63 if (verboseLevel>5)
64 {
65 G4cout << "LUCID_SensitiveDetector::ProcessHits(): It is from a Cerenkov process " << G4endl;
66 }
67
68 TrackHelper trHelp(aTrack);
69 double energy = aTrack->GetKineticEnergy()/CLHEP::eV;
70 double lambda = m_hit->GetWaveLength(energy);
71
72 m_HitColl->Emplace(m_hit->GetTubNumber(aStep),
73 aTrack->GetDefinition()->GetPDGEncoding(),
74 trHelp.GenerateParticleLink(),
75 LUCID_HitHelper::GetVolNumber (aTrack->GetLogicalVolumeAtVertex()->GetName()),
76 m_hit->GetPreStepPoint (aStep).x(),
77 m_hit->GetPreStepPoint (aStep).y(),
78 m_hit->GetPreStepPoint (aStep).z(),
79 m_hit->GetPostStepPoint(aStep).x(),
80 m_hit->GetPostStepPoint(aStep).y(),
81 m_hit->GetPostStepPoint(aStep).z(),
82 m_hit->GetPreStepTime (aStep),
83 m_hit->GetPostStepTime (aStep),
84 lambda,
85 energy);
86 return true;
87}
static int GetVolNumber(const G4String &)

Member Data Documentation

◆ m_hit

LUCID_HitHelper* LUCID_SensitiveDetector::m_hit
private

Definition at line 50 of file LUCID_SensitiveDetector.h.

◆ m_HitColl

SG::WriteHandle<LUCID_SimHitCollection> LUCID_SensitiveDetector::m_HitColl
private

Definition at line 49 of file LUCID_SensitiveDetector.h.


The documentation for this class was generated from the following files: