Energy deposited on a readout channel by simulated tracks. More...
#include <SimChannel.h>
Classes | |
struct | CompareByTDC |
Public Types | |
typedef TDCIDE::first_type | StoredTDC_t |
Type for TDC tick used in the internal representation. More... | |
typedef std::vector< TDCIDE > | TDCIDEs_t |
Type of list of energy deposits for each TDC with signal. More... | |
typedef unsigned int | TDC_t |
typedef IDE::TrackID_t | TrackID_t |
Type of track ID (the value comes from Geant4) More... | |
Public Member Functions | |
SimChannel () | |
SimChannel (raw::ChannelID_t channel) | |
Constructor: immediately sets the channel number. More... | |
void | AddIonizationElectrons (TrackID_t trackID, TDC_t tdc, double numberElectrons, double const *xyz, double energy) |
Add ionization electrons and energy to this channel. More... | |
raw::ChannelID_t | Channel () const |
Returns the readout channel this object describes. More... | |
std::vector< sim::IDE > | TrackIDsAndEnergies (TDC_t startTDC, TDC_t endTDC) const |
Return all the recorded energy deposition within a time interval. More... | |
TDCIDEs_t const & | TDCIDEMap () const |
Returns all the deposited energy information as stored. More... | |
double | Charge (TDC_t tdc) const |
Returns the total number of ionization electrons on this channel in the specified TDC. More... | |
double | Energy (TDC_t tdc) const |
Returns the total energy on this channel in the specified TDC [MeV]. More... | |
std::vector< sim::TrackIDE > | TrackIDEs (TDC_t startTDC, TDC_t endTDC) const |
Returns energies collected for each track within a time interval. More... | |
bool | operator< (const SimChannel &other) const |
Comparison: sorts by channel ID. More... | |
bool | operator== (const SimChannel &other) const |
Comparison: true if SimChannels have the same channel ID. More... | |
std::pair< TrackID_t, TrackID_t > | MergeSimChannel (const SimChannel &channel, int offset) |
Merges the deposits from another channel 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 SimChannel 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 | |
TDCIDEs_t::iterator | findClosestTDCIDE (StoredTDC_t tdc) |
Return the iterator to the first TDCIDE not earlier than tdc. More... | |
TDCIDEs_t::const_iterator | findClosestTDCIDE (StoredTDC_t tdc) const |
Return the (constant) iterator to the first TDCIDE not earlier than tdc. More... | |
Private Attributes | |
raw::ChannelID_t | fChannel |
readout channel where electrons are collected More... | |
TDCIDEs_t | fTDCIDEs |
list of energy deposits for each TDC with signal More... | |
Energy deposited on a readout channel by simulated tracks.
This class stores the list of all energies deposited on a readout channel. The number of electrons is stored as well.
The information is organized by time: it is divided by TDC ticks, and each TDC tick where some energy was deposited appears in a separate entry, while the quiet TDC ticks are omitted. For each TDC, 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::IDE
class).
Note that there can be multiple energy deposit records (that is sim::IDE
) for a single track in a single TDC tick.
Definition at line 140 of file SimChannel.h.
typedef TDCIDE::first_type sim::SimChannel::StoredTDC_t |
Type for TDC tick used in the internal representation.
Definition at line 144 of file SimChannel.h.
typedef unsigned int sim::SimChannel::TDC_t |
Type for TDC tick used in the interface (different type than raw::TDCtick_t! and from internal representation! but same meaning!)
Definition at line 162 of file SimChannel.h.
typedef std::vector<TDCIDE> sim::SimChannel::TDCIDEs_t |
Type of list of energy deposits for each TDC with signal.
Definition at line 147 of file SimChannel.h.
Type of track ID (the value comes from Geant4)
Definition at line 165 of file SimChannel.h.
sim::SimChannel::SimChannel | ( | ) |
Definition at line 44 of file SimChannel.cxx.
|
explicit |
Constructor: immediately sets the channel number.
Definition at line 49 of file SimChannel.cxx.
void sim::SimChannel::AddIonizationElectrons | ( | TrackID_t | trackID, |
TDC_t | tdc, | ||
double | numberElectrons, | ||
double const * | xyz, | ||
double | energy | ||
) |
Add ionization electrons and energy to this channel.
trackID | ID of simulated track depositing this energy (from Geant4) |
tdc | TDC tick when this deposit was collected |
numberElectrons | electrons created at this point by this track |
xyz | coordinates of original location of ionization (3D array) [cm] |
energy | energy deposited at this point by this track [MeV] |
The number of electrons can be fractional because of simulated efficiency and physics effects.
Definition at line 54 of file SimChannel.cxx.
|
inline |
Returns the readout channel this object describes.
Definition at line 329 of file SimChannel.h.
double sim::SimChannel::Charge | ( | TDC_t | tdc | ) | const |
Returns the total number of ionization electrons on this channel in the specified TDC.
Definition at line 134 of file SimChannel.cxx.
void sim::SimChannel::Dump | ( | Stream && | out, |
std::string | indent, | ||
std::string | first_indent | ||
) | const |
Dumps the full content of the SimChannel 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 337 of file SimChannel.h.
|
inline |
Documentation at Dump(Stream&&, std::string, std::string) const
.
Definition at line 304 of file SimChannel.h.
double sim::SimChannel::Energy | ( | TDC_t | tdc | ) | const |
Returns the total energy on this channel in the specified TDC [MeV].
Definition at line 156 of file SimChannel.cxx.
|
private |
Return the iterator to the first TDCIDE not earlier than tdc.
Definition at line 342 of file SimChannel.cxx.
|
private |
Return the (constant) iterator to the first TDCIDE not earlier than tdc.
Definition at line 349 of file SimChannel.cxx.
std::pair< SimChannel::TrackID_t, SimChannel::TrackID_t > sim::SimChannel::MergeSimChannel | ( | const SimChannel & | channel, |
int | offset | ||
) |
Merges the deposits from another channel into this one.
channel | the sim::SimChannel holding information to be merged |
offset | track ID offset for the merge |
The information from the specified simulated channel is added to the current one. This is achieved by appending the energy deposit information (sim::IDE
) at each TDC tick from the merged channel to the list of existing energy deposits for that TDC tick.
In addition, the track IDs of the merged channel 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 channel, equivalent to the lowest and the highest track IDs present in the merged channel, both augmented by the applied offset.
The channel number of the merged channel is ignored.
Definition at line 281 of file SimChannel.cxx.
|
inline |
Comparison: sorts by channel ID.
Definition at line 326 of file SimChannel.h.
|
inline |
Comparison: true if SimChannels have the same channel ID.
Definition at line 327 of file SimChannel.h.
|
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 TDC tick (collection of sim::IDE
), and the number of that tick. The information is sorted by increasing TDC tick.
See the class description for the details of the ionization information content.
Definition at line 328 of file SimChannel.h.
std::vector< sim::TrackIDE > sim::SimChannel::TrackIDEs | ( | TDC_t | startTDC, |
TDC_t | endTDC | ||
) | const |
Returns energies collected for each track within a time interval.
startTDC | TDC tick opening the time window |
endTDC | TDC tick closing the time window (included in the interval) |
This method returns the energy deposited on this channel by each track ID active in the specified TDC 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 channel in the specified time interval, divided by the total of the energy deposited by all tracks on this channel in that same time interval.
Entries are sorted by track ID number.
Definition at line 246 of file SimChannel.cxx.
std::vector< sim::IDE > sim::SimChannel::TrackIDsAndEnergies | ( | TDC_t | startTDC, |
TDC_t | endTDC | ||
) | const |
Return all the recorded energy deposition within a time interval.
startTDC | TDC tick opening the time window |
endTDC | TDC tick closing the time window (included in the interval) |
This method returns the energy deposited on this channel by each track ID active in the specified TDC 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 180 of file SimChannel.cxx.
|
private |
readout channel where electrons are collected
Definition at line 150 of file SimChannel.h.
|
private |
list of energy deposits for each TDC with signal
Definition at line 151 of file SimChannel.h.