12 #ifndef LARDATAOBJ_SIMULATION_SIMCHANNEL_H 13 #define LARDATAOBJ_SIMULATION_SIMCHANNEL_H 37 TrackIDE(
int id,
float ef,
float e,
float ne ) : trackID(id), energyFrac(ef), energy (e), numElectrons (ne) {}
97 IDE(
IDE const& ide,
int offset);
125 typedef std::pair<unsigned short, std::vector<sim::IDE> >
TDCIDE;
185 void AddIonizationElectrons(TrackID_t
trackID,
187 double numberElectrons,
211 std::vector<sim::IDE> TrackIDsAndEnergies(TDC_t startTDC,
226 TDCIDEs_t
const& TDCIDEMap()
const;
230 double Charge(TDC_t tdc)
const;
233 double Energy(TDC_t tdc)
const;
257 std::vector<sim::TrackIDE> TrackIDEs(TDC_t startTDC,
291 std::pair<TrackID_t,TrackID_t> MergeSimChannel
302 template <
typename Stream>
303 void Dump(Stream&& out, std::string
indent, std::string first_indent)
const;
306 template <
typename Stream>
320 (StoredTDC_t tdc)
const;
338 template <
class Stream>
340 (Stream&& out, std::string
indent, std::string first_indent)
const 342 out << first_indent <<
"channel #" << Channel() <<
" read " << fTDCIDEs.size()
344 double channel_energy = 0., channel_charge = 0.;
345 for (
const auto& TDCinfo: fTDCIDEs) {
346 auto const tdc = TDCinfo.first;
347 out << indent <<
" TDC #" << tdc
348 <<
" with " << TDCinfo.second.size() <<
" IDEs\n";
349 double tdc_energy = 0., tdc_charge = 0.;
350 for (
const sim::IDE& ide: TDCinfo.second) {
352 <<
" (" << ide.
x <<
", " << ide.
y <<
", " << ide.
z <<
") " 358 out << indent <<
" => TDC #" << tdc <<
" CH #" << Channel()
359 <<
" collected " << tdc_charge <<
" electrons and " << tdc_energy
361 channel_energy += tdc_energy;
362 channel_charge += tdc_charge;
364 out << indent <<
" => channel #" << Channel() <<
" collected " 365 << channel_charge <<
" electrons and " << channel_energy <<
" MeV\n";
369 #endif // LARDATAOBJ_SIMULATION_SIMCHANNEL_H
TrackID_t trackID
Geant4 supplied track ID.
raw::ChannelID_t fChannel
readout channel where electrons are collected
float z
z position of ionization [cm]
Energy deposited on a readout channel by simulated tracks.
IDE(TrackID_t tid, float nel, float e, float xpos, float ypos, float zpos)
Constructor: sets all data members.
std::pair< unsigned short, std::vector< sim::IDE > > TDCIDE
List of energy deposits at the same time (on this channel)
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.
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]
TDCIDEs_t fTDCIDEs
list of energy deposits for each TDC with signal
TrackIDE(int id, float ef, float e, float ne)
Ionization at a point of the TPC sensitive volume.
float energy
energy deposited by ionization by this track ID and time [MeV]
std::string indent(std::size_t const i)
float energyFrac
fraction of hit energy from the particle with this trackID
Definition of data types for geometry description.
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.
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.
unsigned int ChannelID_t
Type representing the ID of a readout channel.
int TrackID_t
Type of track ID (the value comes from Geant4)
Ionization energy from a Geant4 track.
bool operator==(geometry_element_iterator< GEOIDITER > const &iter, GEOIDITER const &id_iter)
Comparison operator: geometry ID and element point to the same ID.
bool operator<(const BeamGateInfo &lhs, const BeamGateInfo &rhs)
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.