Energy deposited on a readout Optical Detector by simulated tracks. More...
#include <OpDetBacktrackerRecord.h>
Classes | |
struct | CompareByTimePDclock |
Public Types | |
typedef timePDclockSDP_t::first_type | storedTimePDclock_t |
Type for timePDclock tick used in the internal representation. More... | |
typedef std::vector < timePDclockSDP_t > | timePDclockSDPs_t |
Type of list of energy deposits for each timePDclock with signal. More... | |
typedef double | timePDclock_t |
Type for iTimePDclock tick used in the interface. More... | |
typedef SDP::TrackID_t | TrackID_t |
Type of track ID (the value comes from Geant4) More... | |
Public Member Functions | |
OpDetBacktrackerRecord () | |
OpDetBacktrackerRecord (int detNum) | |
Constructor: immediately sets the Optical Detector number. More... | |
void | AddScintillationPhotons (TrackID_t trackID, timePDclock_t timePDclock, double numberPhotons, double const *xyz, double energy) |
Add scintillation photons and energy to this OpticalDetector. More... | |
int | OpDetNum () const |
Returns the readout Optical Detector this object describes. More... | |
std::vector< sim::SDP > | TrackIDsAndEnergies (timePDclock_t startTimePDclock, timePDclock_t endTimePDclock) const |
Return all the recorded energy deposition within a time interval. More... | |
timePDclockSDPs_t const & | timePDclockSDPsMap () const |
Returns all the deposited energy information as stored. More... | |
double | Photons (timePDclock_t iTimePDclock) const |
Returns the total number of scintillation photons on this Optical Detector in the specified timePDclock. More... | |
double | Energy (timePDclock_t iTimePDclock) const |
Returns the total energy on this Optical Detector in the specified iTimePDclock [MeV]. More... | |
std::vector< sim::TrackSDP > | TrackSDPs (timePDclock_t startTimePDclock, timePDclock_t endTimePDclock) const |
Returns energies collected for each track within a time interval. More... | |
bool | operator< (const OpDetBacktrackerRecord &other) const |
Comparison: sorts by Optical Detector ID. More... | |
bool | operator== (const OpDetBacktrackerRecord &other) const |
Comparison: true if OpDetBacktrackerRecords have the same Optical Detector ID. More... | |
std::pair< TrackID_t, TrackID_t > | MergeOpDetBacktrackerRecord (const OpDetBacktrackerRecord &opDetNum, int offset) |
Merges the deposits from another Optical Detector into this one. More... | |
template<typename Stream > | |
void | Dump (Stream &&out, std::string indent, std::string first_indent) const |
Dumps the full content of the OpDetBacktrackerRecord into a stream. More... | |
template<typename Stream > | |
void | Dump (Stream &&out, std::string indent="") const |
Documentation at Dump(Stream&&, std::string, std::string) const . More... | |
Private Member Functions | |
timePDclockSDPs_t::iterator | findClosestTimePDclockSDP (storedTimePDclock_t timePDclock) |
Return the iterator to the first timePDclockSDP not earlier than timePDclock. More... | |
timePDclockSDPs_t::const_iterator | findClosestTimePDclockSDP (storedTimePDclock_t timePDclock) const |
Return the (constant) iterator to the first timePDclockSDP not earlier than timePDclock. More... | |
Private Attributes | |
int | iOpDetNum |
OpticalDetector where the photons were detected. More... | |
timePDclockSDPs_t | timePDclockSDPs |
list of energy deposits for each timePDclock with signal More... | |
Energy deposited on a readout Optical Detector by simulated tracks.
This class stores a time organized list of scintillation photons detected connected to the G4 tracks they originated from. This class also tracks the energy deposited by those tracks, and what fraction of the energy deposited is realted to the photons detected by this OpDet.
The information is organized by time: it is divided by timePDclock ticks (units of ns), and each timePDclock tick where some energy was deposited appears in a separate entry, while the quiet timePDclock ticks are omitted. For each timePDclock, the information is stored as a list of energy deposits; each deposit comes from a single Geant4 track and stores the location where the ionization happened according to the simulation (see sim::SDP
class).
Note that there can be multiple energy deposit records (that is sim::SDP
) for a single track in a single timePDclock tick.
Definition at line 123 of file OpDetBacktrackerRecord.h.
typedef timePDclockSDP_t::first_type sim::OpDetBacktrackerRecord::storedTimePDclock_t |
Type for timePDclock tick used in the internal representation.
Definition at line 127 of file OpDetBacktrackerRecord.h.
typedef double sim::OpDetBacktrackerRecord::timePDclock_t |
Type for iTimePDclock tick used in the interface.
Definition at line 144 of file OpDetBacktrackerRecord.h.
typedef std::vector<timePDclockSDP_t> sim::OpDetBacktrackerRecord::timePDclockSDPs_t |
Type of list of energy deposits for each timePDclock with signal.
Definition at line 130 of file OpDetBacktrackerRecord.h.
Type of track ID (the value comes from Geant4)
Definition at line 147 of file OpDetBacktrackerRecord.h.
sim::OpDetBacktrackerRecord::OpDetBacktrackerRecord | ( | ) |
Definition at line 44 of file OpDetBacktrackerRecord.cxx.
|
explicit |
Constructor: immediately sets the Optical Detector number.
Definition at line 50 of file OpDetBacktrackerRecord.cxx.
void sim::OpDetBacktrackerRecord::AddScintillationPhotons | ( | TrackID_t | trackID, |
timePDclock_t | timePDclock, | ||
double | numberPhotons, | ||
double const * | xyz, | ||
double | energy | ||
) |
Add scintillation photons and energy to this OpticalDetector.
trackID | ID of simulated track depositing this energy (from Geant4) |
timePDclock | tick when this deposit was collected (ns) |
numberPhotons | detected at the OpticalDetector at this time from this track |
xyz | coordinates of original location of ionization/scintillation (3D array) [cm] |
energy | energy deposited at this point by this track [MeV] |
The iTimePDclock from OpFastScintillation (where OpDetBacktrackerRecords originate) is done with CLHEP::ns (units of nanoseconds).
Definition at line 55 of file OpDetBacktrackerRecord.cxx.
void sim::OpDetBacktrackerRecord::Dump | ( | Stream && | out, |
std::string | indent, | ||
std::string | first_indent | ||
) | const |
Dumps the full content of the OpDetBacktrackerRecord into a stream.
Stream | an ostream-like stream object |
out | the stream to send the information into |
indent | indentation of the lines (default: none) |
first_indent | indentation for the first line (default: as indent) |
Definition at line 316 of file OpDetBacktrackerRecord.h.
|
inline |
Documentation at Dump(Stream&&, std::string, std::string) const
.
Definition at line 284 of file OpDetBacktrackerRecord.h.
double sim::OpDetBacktrackerRecord::Energy | ( | timePDclock_t | iTimePDclock | ) | const |
Returns the total energy on this Optical Detector in the specified iTimePDclock [MeV].
Definition at line 162 of file OpDetBacktrackerRecord.cxx.
|
private |
Return the iterator to the first timePDclockSDP not earlier than timePDclock.
Definition at line 342 of file OpDetBacktrackerRecord.cxx.
|
private |
Return the (constant) iterator to the first timePDclockSDP not earlier than timePDclock.
Definition at line 349 of file OpDetBacktrackerRecord.cxx.
std::pair< OpDetBacktrackerRecord::TrackID_t, OpDetBacktrackerRecord::TrackID_t > sim::OpDetBacktrackerRecord::MergeOpDetBacktrackerRecord | ( | const OpDetBacktrackerRecord & | opDetNum, |
int | offset | ||
) |
Merges the deposits from another Optical Detector into this one.
opDetNum | the sim::OpDetBacktrackerRecord holding information to be merged |
offset | track ID offset for the merge |
The information from the specified simulated opDetRecord is added to the current one. This is achieved by appending the energy deposit information (sim::SDP
) at each iTimePDclock tick from the merged opDetRecord to the list of existing energy deposits for that iTimePDclock tick.
In addition, the track IDs of the merged opDetRecord are added an offset, so that they can be distinguished from the existing ones. This is useful when simulating tracks with multiple Geant4 runs. Geant4 will reuse track IDs on each run, and using the highest number of track ID from one run as the offset for the next avoids track ID collisions. Note however that this function does not perform any collision check, and it is caller's duty to ensure that the offset is properly large. The return value is a pair including the lowest and the largest track IDs added to this opDetRecord, equivalent to the lowest and the highest track IDs present in the merged opDetRecord, both augmented by the applied offset.
The opDetNum number of the merged opDetRecord is ignored.
Definition at line 282 of file OpDetBacktrackerRecord.cxx.
|
inline |
Returns the readout Optical Detector this object describes.
Definition at line 308 of file OpDetBacktrackerRecord.h.
|
inline |
Comparison: sorts by Optical Detector ID.
Definition at line 305 of file OpDetBacktrackerRecord.h.
|
inline |
Comparison: true if OpDetBacktrackerRecords have the same Optical Detector ID.
Definition at line 306 of file OpDetBacktrackerRecord.h.
double sim::OpDetBacktrackerRecord::Photons | ( | timePDclock_t | iTimePDclock | ) | const |
Returns the total number of scintillation photons on this Optical Detector in the specified timePDclock.
Definition at line 139 of file OpDetBacktrackerRecord.cxx.
|
inline |
Returns all the deposited energy information as stored.
The returned list is organized in pairs. Each pair contains all ionization information in a single iTimePDclock tick (collection of sim::SDP
), and the number of that tick. The information is sorted by increasing timePDclock tick.
See the class description for the details of the ionization information content.
Definition at line 307 of file OpDetBacktrackerRecord.h.
std::vector< sim::SDP > sim::OpDetBacktrackerRecord::TrackIDsAndEnergies | ( | timePDclock_t | startTimePDclock, |
timePDclock_t | endTimePDclock | ||
) | const |
Return all the recorded energy deposition within a time interval.
startTimePDclock | iTimePDclock tick opening the time window |
endTimePDclock | iTimePDclock tick closing the time window (included in the interval) |
This method returns the energy deposited on this Optical Detector by each track ID active in the specified iTimePDclock time interval.
Each entry pertains a single track ID. For each entry, all energy deposit information is merged into a single record. It includes:
Entries are sorted by track ID number.
Definition at line 185 of file OpDetBacktrackerRecord.cxx.
std::vector< sim::TrackSDP > sim::OpDetBacktrackerRecord::TrackSDPs | ( | timePDclock_t | startTimePDclock, |
timePDclock_t | endTimePDclock | ||
) | const |
Returns energies collected for each track within a time interval.
startTimePDclock | iTimePDclock tick opening the time window |
endTimePDclock | iTimePDclock tick closing the time window (included in the interval) |
This method returns the energy deposited on this Optical Detector by each track ID active in the specified iTimePDclock time interval.
Each entry pertains a single track ID. For each entry, all energy deposit information is merged into a single record. It includes:
The energy fraction is the energy deposited by the track on this Optical Detector in the specified time interval, divided by the total of the energy deposited by all tracks on this Optical Detector in that same time interval.
Entries are sorted by track ID number.
Definition at line 247 of file OpDetBacktrackerRecord.cxx.
|
private |
OpticalDetector where the photons were detected.
Definition at line 133 of file OpDetBacktrackerRecord.h.
|
private |
list of energy deposits for each timePDclock with signal
Definition at line 134 of file OpDetBacktrackerRecord.h.