src/modules/DepositionGeant4/TrackInfoG4.hpp
Defines a concrete implementation of a G4VUserTrackInformation to carry unique track and parent track IDs as well as create and dispatch MCTracks which are the AP2 representation of a Monte-Carlo trajectory. More…
Namespaces
Name |
---|
allpix Helper class to hold support layers for a detector model. |
Classes
Name | |
---|---|
class | allpix::TrackInfoG4 Allpix implementation of G4VUserTrackInformation to handle unique track IDs and the creation of MCTracks. |
Detailed Description
Defines a concrete implementation of a G4VUserTrackInformation to carry unique track and parent track IDs as well as create and dispatch MCTracks which are the AP2 representation of a Monte-Carlo trajectory.
Copyright: Copyright (c) 2018-2024 CERN and the Allpix Squared authors. This software is distributed under the terms of the MIT License, copied verbatim in the file “LICENSE.md”. In applying this license, CERN does not waive the privileges and immunities granted to it by virtue of its status as an Intergovernmental Organization or submit itself to any jurisdiction. SPDX-License-Identifier: MIT
Source code
#ifndef TrackInfoG4_H
#define TrackInfoG4_H 1
#include <map>
#include "G4Track.hh"
#include "G4VUserTrackInformation.hh"
#include "core/messenger/Messenger.hpp"
#include "objects/MCTrack.hpp"
namespace allpix {
class TrackInfoG4 : public G4VUserTrackInformation {
public:
TrackInfoG4(int custom_track_id, int parent_track_id, const G4Track* const aTrack);
int getID() const { return custom_track_id_; }
int getParentID() const { return parent_track_id_; }
void finalizeInfo(const G4Track* const aTrack);
const ROOT::Math::XYZPoint& getStartPoint() const { return start_point_; }
const ROOT::Math::XYZPoint& getEndPoint() const { return end_point_; }
int getParticleID() const { return particle_id_; }
double getStartTime() const { return start_time_; }
double getEndTime() const { return end_time_; }
int getCreationProcessType() const { return origin_g4_process_type_; }
double getKineticEnergyInitial() const { return initial_kin_E_; }
double getTotalEnergyInitial() const { return initial_tot_E_; }
double getKineticEnergyFinal() const { return final_kin_E_; }
double getTotalEnergyFinal() const { return final_tot_E_; }
const std::string& getOriginatingVolumeName() const { return initial_g4_vol_name_; }
const std::string& getTerminatingVolumeName() const { return final_g4_vol_name_; }
const std::string& getCreationProcessName() const { return origin_g4_process_name_; }
private:
// Assigned track id to track
int custom_track_id_{};
// Parent's track id
int parent_track_id_{};
// Geant4 Type of the process which created this track
int origin_g4_process_type_{};
// PDG particle id
int particle_id_{};
// Start point of track (in mm)
ROOT::Math::XYZPoint start_point_{};
// End point of track (in mm)
ROOT::Math::XYZPoint end_point_{};
// Starting time (in ns)
double start_time_{};
// Ending time (in ns)
double end_time_{};
// Geant4 volume in which the track was created
std::string initial_g4_vol_name_{};
// Geant4 volume in which the track was terminated
std::string final_g4_vol_name_{};
// Name of Geant4 process which created this track
std::string origin_g4_process_name_{};
// Initial kinetic energy (MeV)
double initial_kin_E_{};
// Initial total energy (MeV)
double initial_tot_E_{};
// Final kinetic energy (MeV)
double final_kin_E_{};
// Final total energy (MeV)
double final_tot_E_{};
};
} // namespace allpix
#endif /* TrackInfoG4_H */
Updated on 2024-12-13 at 08:31:37 +0000