LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
|
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 143 of file SimChannel.h.
typedef TDCIDE::first_type sim::SimChannel::StoredTDC_t |
Type for TDC tick used in the internal representation.
Definition at line 147 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 165 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 150 of file SimChannel.h.
Type of track ID (the value comes from Geant4)
Definition at line 168 of file SimChannel.h.
sim::SimChannel::SimChannel | ( | ) |
Definition at line 42 of file SimChannel.cxx.
|
explicit |
Constructor: immediately sets the channel number.
Definition at line 47 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 52 of file SimChannel.cxx.
References energy, findClosestTDCIDE(), fTDCIDEs, LOG_ERROR, and weight.
Referenced by larg4::LArVoxelReadout::DriftIonizationElectrons(), and detsim::SimDriftElectrons::produce().
|
inline |
Returns the readout channel this object describes.
Definition at line 332 of file SimChannel.h.
References Dump().
Referenced by lar_pandora::LArPandoraHelper::BuildMCParticleHitMaps(), hit::HitCheater::FindHitsOnChannel(), MergeSimChannel(), operator<(), operator==(), hit::MCHitFinder::produce(), larg4::LArG4::produce(), and shower::TCShowerTemplateMaker::showerProfileTrue().
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 132 of file SimChannel.cxx.
References findClosestTDCIDE(), and fTDCIDEs.
Referenced by detsim::SimWire::produce().
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 340 of file SimChannel.h.
References sim::IDE::energy, sim::IDE::numElectrons, sim::IDE::trackID, sim::IDE::x, sim::IDE::y, and sim::IDE::z.
Referenced by Channel(), and sim::DumpSimChannels::DumpSimChannel().
|
inline |
Documentation at Dump(Stream&&, std::string, std::string) const
.
Definition at line 307 of file SimChannel.h.
References art::detail::indent().
double sim::SimChannel::Energy | ( | TDC_t | tdc | ) | const |
Returns the total energy on this channel in the specified TDC [MeV].
Definition at line 154 of file SimChannel.cxx.
References energy, findClosestTDCIDE(), and fTDCIDEs.
|
private |
Return the iterator to the first TDCIDE not earlier than tdc.
Definition at line 339 of file SimChannel.cxx.
References fTDCIDEs.
Referenced by AddIonizationElectrons(), Charge(), Energy(), MergeSimChannel(), and TrackIDsAndEnergies().
|
private |
Return the (constant) iterator to the first TDCIDE not earlier than tdc.
Definition at line 346 of file SimChannel.cxx.
References fTDCIDEs.
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 279 of file SimChannel.cxx.
References Channel(), findClosestTDCIDE(), fTDCIDEs, max, min, and TDCIDEMap().
|
inline |
Comparison: sorts by channel ID.
Definition at line 329 of file SimChannel.h.
References Channel().
|
inline |
Comparison: true if SimChannels have the same channel ID.
Definition at line 330 of file SimChannel.h.
References Channel().
|
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 331 of file SimChannel.h.
Referenced by hit::HitCheater::FindHitsOnChannel(), MergeSimChannel(), hit::MCHitFinder::produce(), larg4::LArG4::produce(), and shower::TCShowerTemplateMaker::showerProfileTrue().
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 244 of file SimChannel.cxx.
References e, sim::NoParticleId, and TrackIDsAndEnergies().
Referenced by lar_pandora::LArPandoraHelper::BuildMCParticleHitMaps().
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 178 of file SimChannel.cxx.
References energy, sim::IDE::energy, findClosestTDCIDE(), fTDCIDEs, sim::IDE::numElectrons, weight, sim::IDE::x, sim::IDE::y, and sim::IDE::z.
Referenced by cheat::BackTracker::ChannelToTrackIDEs(), and TrackIDEs().
|
private |
readout channel where electrons are collected
Definition at line 153 of file SimChannel.h.
|
private |
list of energy deposits for each TDC with signal
Definition at line 154 of file SimChannel.h.
Referenced by AddIonizationElectrons(), Charge(), Energy(), findClosestTDCIDE(), MergeSimChannel(), and TrackIDsAndEnergies().