11 #ifndef LARDATAOBJ_SIMULATION_SIMCHANNEL_H 12 #define LARDATAOBJ_SIMULATION_SIMCHANNEL_H 34 TrackIDE(
int id,
float ef,
float e,
float ne ) : trackID(id), energyFrac(ef), energy (e), numElectrons (ne) {}
94 IDE(
IDE const& ide,
int offset);
122 typedef std::pair<unsigned short, std::vector<sim::IDE> >
TDCIDE;
182 void AddIonizationElectrons(TrackID_t
trackID,
184 double numberElectrons,
208 std::vector<sim::IDE> TrackIDsAndEnergies(TDC_t startTDC,
223 TDCIDEs_t
const& TDCIDEMap()
const;
227 double Charge(TDC_t tdc)
const;
230 double Energy(TDC_t tdc)
const;
254 std::vector<sim::TrackIDE> TrackIDEs(TDC_t startTDC,
288 std::pair<TrackID_t,TrackID_t> MergeSimChannel
299 template <
typename Stream>
303 template <
typename Stream>
317 (StoredTDC_t tdc)
const;
335 template <
class Stream>
339 out << first_indent <<
"channel #" << Channel() <<
" read " << fTDCIDEs.size()
341 double channel_energy = 0., channel_charge = 0.;
342 for (
const auto& TDCinfo: fTDCIDEs) {
343 auto const tdc = TDCinfo.first;
344 out << indent <<
" TDC #" << tdc
345 <<
" with " << TDCinfo.second.size() <<
" IDEs\n";
346 double tdc_energy = 0., tdc_charge = 0.;
347 for (
const sim::IDE& ide: TDCinfo.second) {
349 <<
" (" << ide.
x <<
", " << ide.
y <<
", " << ide.
z <<
") " 355 out << indent <<
" => TDC #" << tdc <<
" CH #" << Channel()
356 <<
" collected " << tdc_charge <<
" electrons and " << tdc_energy
358 channel_energy += tdc_energy;
359 channel_charge += tdc_charge;
361 out << indent <<
" => channel #" << Channel() <<
" collected " 362 << channel_charge <<
" electrons and " << channel_energy <<
" MeV\n";
366 #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]
float energyFrac
fraction of hit energy from the particle with this trackID
Code to link reconstructed objects back to the MC truth information.
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<(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.
bool operator==(ModuleKeyAndType const &a, ModuleKeyAndType const &b) noexcept