11 #ifndef LARSIMOBJ_SIMULATION_OPDETBACKTRACKERRECORD_H
12 #define LARSIMOBJ_SIMULATION_OPDETBACKTRACKERRECORD_H
164 double numberPhotons,
279 template <
typename Stream>
280 void Dump(
Stream&& out, std::string indent, std::string first_indent)
const;
283 template <
typename Stream>
285 {
Dump(std::forward<Stream>(out), indent, indent); }
290 struct CompareByTimePDclock;
314 template <
class Stream>
316 (
Stream&& out, std::string indent, std::string first_indent)
const
318 out << first_indent <<
"OpDet #" << OpDetNum() <<
" read " << timePDclockSDPs.size()
319 <<
" timePDclocks:\n";
320 double opDet_energy = 0., opDet_photons = 0.;
321 for (
const auto& timePDclockinfo: timePDclockSDPs) {
322 auto const iTimePDclock = timePDclockinfo.first;
323 out << indent <<
" timePDclock #" << iTimePDclock
324 <<
" with " << timePDclockinfo.second.size() <<
" SDPs\n";
325 double timePDclock_energy = 0., timePDclock_photons = 0.;
326 for (
const sim::SDP& sdp: timePDclockinfo.second) {
328 <<
" (" << sdp.
x <<
", " << sdp.
y <<
", " << sdp.
z <<
") "
331 timePDclock_energy += sdp.
energy;
334 out << indent <<
" => timePDclock #" << iTimePDclock <<
" CH #" << OpDetNum()
335 <<
" collected " << timePDclock_energy <<
" MeV and "
336 << timePDclock_photons <<
" photons. \n";
337 opDet_energy += timePDclock_energy;
338 opDet_photons += timePDclock_photons;
340 out << indent <<
" => channel #" << OpDetNum() <<
" collected "
341 << opDet_photons <<
" photons and "<< opDet_energy <<
" MeV.\n" ;
345 #endif // LARSIMOBJ_SIMULATION_OPDETBACKTRACKERRECORD_H
BEGIN_PROLOG TPC Trig offset(g4 rise time) ProjectToHeight
int iOpDetNum
OpticalDetector where the photons were detected.
float x
x position of ionization [cm]
bool operator<(const OpDetBacktrackerRecord &other) const
Comparison: sorts by Optical Detector ID.
SDP(TrackID_t tid, float nPh, float e, float xpos, float ypos, float zpos)
Constructor: sets all data members.
std::vector< timePDclockSDP_t > timePDclockSDPs_t
Type of list of energy deposits for each timePDclock with signal.
double Photons(timePDclock_t iTimePDclock) const
Returns the total number of scintillation photons on this Optical Detector in the specified timePDclo...
void Dump(Stream &&out, std::string indent="") const
Documentation at Dump(Stream&&, std::string, std::string) const.
std::pair< TrackID_t, TrackID_t > MergeOpDetBacktrackerRecord(const OpDetBacktrackerRecord &opDetNum, int offset)
Merges the deposits from another Optical Detector into this one.
SDP()
Default constructor (sets "bogus" values)
timePDclockSDP_t::first_type storedTimePDclock_t
Type for timePDclock tick used in the internal representation.
std::vector< sim::TrackSDP > TrackSDPs(timePDclock_t startTimePDclock, timePDclock_t endTimePDclock) const
Returns energies collected for each track within a time interval.
Energy deposited on a readout Optical Detector by simulated tracks.
timePDclockSDPs_t timePDclockSDPs
list of energy deposits for each timePDclock with signal
int OpDetNum() const
Returns the readout Optical Detector this object describes.
int trackID
Geant4 supplied trackID.
TrackID_t trackID
Geant4 supplied track ID.
SDP::TrackID_t TrackID_t
Type of track ID (the value comes from Geant4)
void Dump(Stream &&out, std::string indent, std::string first_indent) const
Dumps the full content of the OpDetBacktrackerRecord into a stream.
timePDclockSDPs_t::iterator findClosestTimePDclockSDP(storedTimePDclock_t timePDclock)
Return the iterator to the first timePDclockSDP not earlier than timePDclock.
float energyFrac
fraction of OpHit energy from the particle with this trackID
double timePDclock_t
Type for iTimePDclock tick used in the interface.
void AddScintillationPhotons(TrackID_t trackID, timePDclock_t timePDclock, double numberPhotons, double const *xyz, double energy)
Add scintillation photons and energy to this OpticalDetector.
Ionization photons from a Geant4 track.
float y
y position of ionization [cm]
int TrackID_t
Type of track ID (the value comes from Geant4)
double Energy(timePDclock_t iTimePDclock) const
Returns the total energy on this Optical Detector in the specified iTimePDclock [MeV].
TrackSDP(int id, float phF, float ph)
std::pair< double, std::vector< sim::SDP > > timePDclockSDP_t
List of energy deposits at the same time (on this Optical Detector)
float numPhotons
number of photons at the optical detector for this track ID and time
float energy
energy deposited by ionization
bool operator==(const OpDetBacktrackerRecord &other) const
Comparison: true if OpDetBacktrackerRecords have the same Optical Detector ID.
std::vector< sim::SDP > TrackIDsAndEnergies(timePDclock_t startTimePDclock, timePDclock_t endTimePDclock) const
Return all the recorded energy deposition within a time interval.
float energy
energy from the particle with this trackID [MeV]
float z
z position of ionization [cm]
timePDclockSDPs_t const & timePDclockSDPsMap() const
Returns all the deposited energy information as stored.