ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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. More...
 

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 }

◆ ~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.

42 { m_HitColl->Emplace( args... ); }

◆ 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 }

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:
LUCID_HitHelper::GetVolNumber
static int GetVolNumber(const G4String &)
Definition: LUCID_HitHelper.cxx:9
LUCID_SensitiveDetector::m_hit
LUCID_HitHelper * m_hit
Definition: LUCID_SensitiveDetector.h:50
LUCID_HitHelper::GetPreStepPoint
G4ThreeVector GetPreStepPoint(G4Step *aStep) const
Definition: LUCID_HitHelper.h:31
LUCID_HitHelper::GetPostStepPoint
G4ThreeVector GetPostStepPoint(G4Step *aStep) const
Definition: LUCID_HitHelper.h:32
TrackHelper
Definition: TrackHelper.h:14
LUCID_HitHelper::GetPostStepTime
float GetPostStepTime(G4Step *aStep) const
Definition: LUCID_HitHelper.h:34
LUCID_SensitiveDetector::m_HitColl
SG::WriteHandle< LUCID_SimHitCollection > m_HitColl
Definition: LUCID_SensitiveDetector.h:49
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
LUCID_HitHelper::GetPreStepTime
float GetPreStepTime(G4Step *aStep) const
Definition: LUCID_HitHelper.h:33
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
python.SystemOfUnits.eV
int eV
Definition: SystemOfUnits.py:155
LUCID_HitHelper::GetWaveLength
double GetWaveLength(double energy) const
Definition: LUCID_HitHelper.h:36
LUCID_HitHelper::GetTubNumber
int GetTubNumber(G4Step *) const
Definition: LUCID_HitHelper.cxx:20
python.CaloScaleNoiseConfig.args
args
Definition: CaloScaleNoiseConfig.py:80
LUCID_HitHelper
Definition: LUCID_HitHelper.h:24