LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
larg4::OpDetSensitiveDetector Class Reference

#include "OpDetSensitiveDetector.h"

Inheritance diagram for larg4::OpDetSensitiveDetector:

Public Member Functions

 OpDetSensitiveDetector (G4String name)
 
virtual ~OpDetSensitiveDetector ()
 
virtual void Initialize (G4HCofThisEvent *)
 
virtual void EndOfEvent (G4HCofThisEvent *)
 
virtual void clear ()
 
virtual G4bool ProcessHits (G4Step *, G4TouchableHistory *)
 
virtual void DrawAll ()
 
virtual void PrintAll ()
 

Private Attributes

OpDetLookupfTheOpDetLookup
 
OpDetPhotonTablefThePhotonTable
 

Detailed Description

Definition at line 42 of file OpDetSensitiveDetector.h.

Constructor & Destructor Documentation

larg4::OpDetSensitiveDetector::OpDetSensitiveDetector ( G4String  name)

Definition at line 24 of file OpDetSensitiveDetector.cxx.

References fTheOpDetLookup, fThePhotonTable, larg4::OpDetLookup::Instance(), and larg4::OpDetPhotonTable::Instance().

25  : G4VSensitiveDetector(DetectorUniqueName)
26  {
27  // Register self with sensitive detector manager
28  G4SDManager::GetSDMpointer()->AddNewDetector(this);
29 
30  // Get instances of singleton classes
33 
34  }
static OpDetLookup * Instance()
Definition: OpDetLookup.cxx:31
static OpDetPhotonTable * Instance(bool LitePhotons=false)
virtual larg4::OpDetSensitiveDetector::~OpDetSensitiveDetector ( )
inlinevirtual

Definition at line 48 of file OpDetSensitiveDetector.h.

References Initialize().

48 {}

Member Function Documentation

virtual void larg4::OpDetSensitiveDetector::clear ( void  )
inlinevirtual

Definition at line 56 of file OpDetSensitiveDetector.h.

56 {}
virtual void larg4::OpDetSensitiveDetector::DrawAll ( )
inlinevirtual

Definition at line 63 of file OpDetSensitiveDetector.h.

63 {}
virtual void larg4::OpDetSensitiveDetector::EndOfEvent ( G4HCofThisEvent )
inlinevirtual

Definition at line 53 of file OpDetSensitiveDetector.h.

53 {}
void larg4::OpDetSensitiveDetector::Initialize ( G4HCofThisEvent )
virtual

Definition at line 84 of file OpDetSensitiveDetector.cxx.

85  {
86 
87  }
virtual void larg4::OpDetSensitiveDetector::PrintAll ( )
inlinevirtual

Definition at line 64 of file OpDetSensitiveDetector.h.

64 {}
G4bool larg4::OpDetSensitiveDetector::ProcessHits ( G4Step *  aStep,
G4TouchableHistory *   
)
virtual

Definition at line 39 of file OpDetSensitiveDetector.cxx.

References larg4::OpDetPhotonTable::AddPhoton(), sim::OnePhoton::Energy, sim::OnePhoton::FinalLocalPosition, fTheOpDetLookup, fThePhotonTable, larg4::OpDetLookup::GetOpDet(), sim::OnePhoton::InitialPosition, sim::OnePhoton::SetInSD, and sim::OnePhoton::Time.

40  {
41  sim::OnePhoton ThePhoton;
42 
43 
44  // Get photon data to store in the hit
45 
46  ThePhoton.SetInSD = true;
47 
48  ThePhoton.InitialPosition = TVector3(
49  aStep->GetTrack()->GetVertexPosition().x(),
50  aStep->GetTrack()->GetVertexPosition().y(),
51  aStep->GetTrack()->GetVertexPosition().z()
52  );
53 
54  //ThePhoton.Time = aStep->GetTrack()->GetGlobalTime() - fGlobalTimeOffset;
55  ThePhoton.Time = aStep->GetTrack()->GetGlobalTime();
56 
57 
58  ThePhoton.Energy = aStep->GetTrack()->GetVertexKineticEnergy();
59 
60  // Lookup which OpDet we are in
61  G4StepPoint *preStepPoint = aStep->GetPreStepPoint();
62 
63  int OpDet = fTheOpDetLookup->GetOpDet(preStepPoint->GetPhysicalVolume());
64 
65  // Store relative position on the photon detector
66  G4ThreeVector worldPosition = preStepPoint->GetPosition();
67  G4ThreeVector localPosition = preStepPoint->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(worldPosition);
68  ThePhoton.FinalLocalPosition = TVector3(localPosition.x()/CLHEP::cm, localPosition.y()/CLHEP::cm, localPosition.z()/CLHEP::cm);
69 
70 
71  // Add this photon to the detected photons table
72  fThePhotonTable->AddPhoton(OpDet, std::move(ThePhoton));
73 
74  // Kill this photon track
75  aStep->GetTrack()->SetTrackStatus(fStopAndKill);
76 
77  return true;
78 
79 
80  }
void AddPhoton(size_t opchannel, sim::OnePhoton &&photon, bool Reflected=false)
int GetOpDet(G4VPhysicalVolume *)
Definition: OpDetLookup.cxx:46
TVector3 InitialPosition
Definition: SimPhotons.h:49
TVector3 FinalLocalPosition
Definition: SimPhotons.h:50

Member Data Documentation

OpDetLookup* larg4::OpDetSensitiveDetector::fTheOpDetLookup
private

Definition at line 67 of file OpDetSensitiveDetector.h.

Referenced by OpDetSensitiveDetector(), and ProcessHits().

OpDetPhotonTable* larg4::OpDetSensitiveDetector::fThePhotonTable
private

Definition at line 68 of file OpDetSensitiveDetector.h.

Referenced by OpDetSensitiveDetector(), and ProcessHits().


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