11 #ifndef LARSIMOBJ_SIMULATION_OPDETBACKTRACKERRECORD_H 12 #define LARSIMOBJ_SIMULATION_OPDETBACKTRACKERRECORD_H 29 TrackSDP(
int id,
float phF,
float ph) : trackID(id), energyFrac(phF), energy(ph) {}
70 SDP(
SDP const& sdp,
int offset);
73 SDP(TrackID_t tid,
float nPh,
float e,
float xpos,
float ypos,
float zpos)
140 void AddScintillationPhotons(TrackID_t
trackID,
141 timePDclock_t timePDclock,
142 double numberPhotons,
147 int OpDetNum()
const;
166 std::vector<sim::SDP> TrackIDsAndEnergies(timePDclock_t startTimePDclock,
167 timePDclock_t endTimePDclock)
const;
181 timePDclockSDPs_t
const& timePDclockSDPsMap()
const;
184 double Photons(timePDclock_t iTimePDclock)
const;
187 double Energy(timePDclock_t iTimePDclock)
const;
211 std::vector<sim::TrackSDP> TrackSDPs(timePDclock_t startTimePDclock,
212 timePDclock_t endTimePDclock)
const;
245 std::pair<TrackID_t, TrackID_t> MergeOpDetBacktrackerRecord(
256 template <
typename Stream>
257 void Dump(Stream&& out, std::string
indent, std::string first_indent)
const;
260 template <
typename Stream>
275 storedTimePDclock_t timePDclock)
const;
282 return iOpDetNum < other.
OpDetNum();
286 return iOpDetNum == other.
OpDetNum();
291 return timePDclockSDPs;
301 template <
class Stream>
304 std::string first_indent)
const 306 out << first_indent <<
"OpDet #" << OpDetNum() <<
" read " << timePDclockSDPs.size()
307 <<
" timePDclocks:\n";
308 double opDet_energy = 0., opDet_photons = 0.;
309 for (
const auto& timePDclockinfo : timePDclockSDPs) {
310 auto const iTimePDclock = timePDclockinfo.first;
311 out << indent <<
" timePDclock #" << iTimePDclock <<
" with " << timePDclockinfo.second.size()
313 double timePDclock_energy = 0., timePDclock_photons = 0.;
314 for (
const sim::SDP& sdp : timePDclockinfo.second) {
315 out << indent <<
" (" << sdp.
x <<
", " << sdp.
y <<
", " << sdp.
z <<
") " << sdp.
numPhotons 316 <<
" photons, " << sdp.
energy <<
"MeV (trkID=" << sdp.
trackID <<
")\n";
317 timePDclock_energy += sdp.
energy;
320 out << indent <<
" => timePDclock #" << iTimePDclock <<
" CH #" << OpDetNum()
321 <<
" collected " << timePDclock_energy <<
" MeV and " << timePDclock_photons
323 opDet_energy += timePDclock_energy;
324 opDet_photons += timePDclock_photons;
326 out << indent <<
" => channel #" << OpDetNum() <<
" collected " << opDet_photons
327 <<
" photons and " << opDet_energy <<
" MeV.\n";
330 #endif // LARSIMOBJ_SIMULATION_OPDETBACKTRACKERRECORD_H
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.
std::pair< double, std::vector< sim::SDP > > timePDclockSDP_t
List of energy deposits at the same time (on this Optical Detector)
void Dump(Stream &&out, std::string indent="") const
Documentation at Dump(Stream&&, std::string, std::string) const.
timePDclockSDP_t::first_type storedTimePDclock_t
Type for timePDclock tick used in the internal representation.
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.
float energyFrac
fraction of OpHit energy from the particle with this trackID
double timePDclock_t
Type for iTimePDclock tick used in the interface.
std::string indent(std::size_t const i)
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)
TrackSDP(int id, float phF, float ph)
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.
float energy
energy from the particle with this trackID [MeV]
float z
z position of ionization [cm]
bool operator==(infinite_endcount_iterator< T > const &, count_iterator< T > const &)
timePDclockSDPs_t const & timePDclockSDPsMap() const
Returns all the deposited energy information as stored.
bool operator<(const BeamGateInfo &lhs, const BeamGateInfo &rhs)