13#include "G4PhysicalVolumeStore.hh"
15#include "G4TransportationManager.hh"
16#include "G4VPhysicalVolume.hh"
36 if (possibleParent->IsDaughter(thePhysicalVolume))
42 const G4int nDaughters(possibleParent->GetNoDaughters());
43 for(G4int daughter(0); daughter<nDaughters; ++daughter)
45 const G4VPhysicalVolume* daughterPhysVol = possibleParent->GetDaughter(daughter);
46 const G4LogicalVolume* daughterLogVol = daughterPhysVol->GetLogicalVolume();
57 const G4VPhysicalVolume *thePhysicalVolume = G4PhysicalVolumeStore::GetInstance()->GetVolume(
m_envelopeVolumeName,
false);
59 const G4LogicalVolume * logicalWorld = G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume()->GetLogicalVolume();
70 const std::string pname = aStep->GetTrack()->GetDefinition()->GetParticleName();
71 const int pdgcode = (pname==
"geantino") ? 999 : aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
77 G4StepPoint *postStep=aStep->GetPostStepPoint();
78 G4ThreeVector pos=postStep->GetPosition();
79 G4ThreeVector mom=postStep->GetMomentum();
80 const double ener=postStep->GetTotalEnergy();
81 const double time=postStep->GetGlobalTime();
83 G4StepPoint *preStep=aStep->GetPreStepPoint();
84 G4VPhysicalVolume *preVol=preStep->GetPhysicalVolume();
AtlasHitsVector< TrackRecord > TrackRecordCollection
G4LogicalVolume * m_logicalVolume
Pointer to the G4LogicalVolume used by this recording envelope.
int m_level
The number of levels beneath the world that the G4LogicalVolume called m_envelopeVolumeName lies.
const std::string m_envelopeVolumeName
Name of the G4LogicalVolume used by this recording envelope.
TrackRecordCollection * m_trackRecordCollection
TrackRecordCollection used by this envelope.
std::string m_trackRecordCollectionName
void AddTrackRecord(const G4Step *aStep)
Add a TrackRecord to the TrackRecordCollection owned by this recording envelope based on the informat...
bool checkDaughters(const G4LogicalVolume *possibleParent, const G4VPhysicalVolume *thePhysicalVolume, int &level) const
Recursively called method used to hunt for the G4LogicalVolume associated with this recording envelop...
RecordingEnvelope(const std::string &envelopeVolumeName, const std::string &trackRecordCollectionName)
Constructor.
bool Initialize()
Finds the pointer to the G4LogicalVolume called m_envelopeVolumeName and the number of levels beneath...
~RecordingEnvelope()
Destructor.
void BeginOfEvent(TrackRecordCollection *)
Called at the start of each G4 event.