11 #ifndef LARDATAOBJ_SIMULATION_SIMCHANNEL_H
12 #define LARDATAOBJ_SIMULATION_SIMCHANNEL_H
127 typedef std::pair<unsigned short, std::vector<sim::IDE> >
TDCIDE;
189 double numberElectrons,
305 template <
typename Stream>
306 void Dump(
Stream&& out, std::string indent, std::string first_indent)
const;
309 template <
typename Stream>
311 {
Dump(std::forward<Stream>(out), indent, indent); }
341 template <
class Stream>
343 (
Stream&& out, std::string indent, std::string first_indent)
const
345 out << first_indent <<
"channel #" << Channel() <<
" read " << fTDCIDEs.size()
347 double channel_energy = 0., channel_charge = 0.;
348 for (
const auto& TDCinfo: fTDCIDEs) {
349 auto const tdc = TDCinfo.first;
350 out << indent <<
" TDC #" << tdc
351 <<
" with " << TDCinfo.second.size() <<
" IDEs\n";
352 double tdc_energy = 0., tdc_charge = 0.;
353 for (
const sim::IDE& ide: TDCinfo.second) {
355 <<
" (" << ide.
x <<
", " << ide.
y <<
", " << ide.
z <<
") "
361 out << indent <<
" => TDC #" << tdc <<
" CH #" << Channel()
362 <<
" collected " << tdc_charge <<
" electrons and " << tdc_energy
364 channel_energy += tdc_energy;
365 channel_charge += tdc_charge;
367 out << indent <<
" => channel #" << Channel() <<
" collected "
368 << channel_charge <<
" electrons and " << channel_energy <<
" MeV\n";
372 #endif // LARDATAOBJ_SIMULATION_SIMCHANNEL_H
TrackID_t trackID
Geant4 supplied track ID.
std::pair< TrackID_t, TrackID_t > MergeSimChannel(const SimChannel &channel, int offset)
Merges the deposits from another channel into this one.
raw::ChannelID_t fChannel
readout channel where electrons are collected
float z
z position of ionization [cm]
BEGIN_PROLOG TPC Trig offset(g4 rise time) ProjectToHeight
Energy deposited on a readout channel by simulated tracks.
std::pair< unsigned short, std::vector< sim::IDE > > TDCIDE
List of energy deposits at the same time (on this channel)
double Energy(TDC_t tdc) const
Returns the total energy on this channel in the specified TDC [MeV].
void Dump(Stream &&out, std::string indent, std::string first_indent) const
Dumps the full content of the SimChannel into a stream.
float numElectrons
number of electrons from the particle detected on the wires
void Dump(Stream &&out, std::string indent="") const
Documentation at Dump(Stream&&, std::string, std::string) const.
TrackID_t origTrackID
Geant4 supplied track ID (remains true trackID even for shower secondaries/tertiaries etc) ...
constexpr int kBogusI
obviously bogus integer value
float energy
energy from the particle with this trackID [MeV]
std::vector< TDCIDE > TDCIDEs_t
Type of list of energy deposits for each TDC with signal.
float x
x position of ionization [cm]
IDE(TrackID_t tid, float nel, float e, float xpos, float ypos, float zpos, TrackID_t gid=util::kBogusI)
Constructor: sets all data members.
TDCIDEs_t fTDCIDEs
list of energy deposits for each TDC with signal
double Charge(TDC_t tdc) const
Returns the total number of ionization electrons on this channel in the specified TDC...
Ionization at a point of the TPC sensitive volume.
int origTrackID
Geant4 supplied trackID, including no modification for shower secondaries/tertiaries.
float energy
energy deposited by ionization by this track ID and time [MeV]
std::vector< sim::TrackIDE > TrackIDEs(TDC_t startTDC, TDC_t endTDC) const
Returns energies collected for each track within a time interval.
float energyFrac
fraction of hit energy from the particle with this trackID
TrackIDE(int id, float ef, float e, float ne, int gid=util::kBogusI)
TDCIDEs_t::iterator findClosestTDCIDE(StoredTDC_t tdc)
Return the iterator to the first TDCIDE not earlier than tdc.
float y
y position of ionization [cm]
bool operator==(const SimChannel &other) const
Comparison: true if SimChannels have the same channel ID.
raw::ChannelID_t Channel() const
Returns the readout channel this object describes.
int trackID
Geant4 supplied trackID.
bool operator<(const SimChannel &other) const
Comparison: sorts by channel ID.
std::vector< sim::IDE > TrackIDsAndEnergies(TDC_t startTDC, TDC_t endTDC) const
Return all the recorded energy deposition within a time interval.
IDE::TrackID_t TrackID_t
Type of track ID (the value comes from Geant4)
TDCIDEs_t const & TDCIDEMap() const
Returns all the deposited energy information as stored.
IDE()
Default constructor (sets "bogus" values)
void AddIonizationElectrons(TrackID_t trackID, TDC_t tdc, double numberElectrons, double const *xyz, double energy, TrackID_t origTrackID=util::kBogusI)
Add ionization electrons and energy to this channel.
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Collection of Physical constants used in LArSoft.
int TrackID_t
Type of track ID (the value comes from Geant4)
Ionization energy from a Geant4 track.
float numElectrons
number of electrons at the readout for this track ID and time
TDCIDE::first_type StoredTDC_t
Type for TDC tick used in the internal representation.