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)
97 void AddScintillationPhotonsToMap(
100 timePDclock_t iTimePDclock,
101 double numberPhotons,
165 void AddScintillationPhotons(TrackID_t
trackID,
166 timePDclock_t timePDclock,
167 double numberPhotons,
172 int OpDetNum()
const;
191 std::vector<sim::SDP> TrackIDsAndEnergies(timePDclock_t startTimePDclock,
192 timePDclock_t endTimePDclock)
const;
206 timePDclockSDPs_t
const& timePDclockSDPsMap()
const;
209 double Photons(timePDclock_t iTimePDclock)
const;
212 double Energy(timePDclock_t iTimePDclock)
const;
239 std::vector<sim::TrackSDP> TrackSDPs(timePDclock_t startTimePDclock,
240 timePDclock_t endTimePDclock)
const;
273 std::pair<TrackID_t, TrackID_t> MergeOpDetBacktrackerRecord(
284 template <
typename Stream>
285 void Dump(Stream&& out, std::string
indent, std::string first_indent)
const;
288 template <
typename Stream>
303 storedTimePDclock_t timePDclock)
const;
310 return iOpDetNum < other.
OpDetNum();
314 return iOpDetNum == other.
OpDetNum();
319 return timePDclockSDPs;
329 template <
class Stream>
332 std::string first_indent)
const 334 out << first_indent <<
"OpDet #" << OpDetNum() <<
" read " << timePDclockSDPs.size()
335 <<
" timePDclocks:\n";
336 double opDet_energy = 0., opDet_photons = 0.;
337 for (
const auto& timePDclockinfo : timePDclockSDPs) {
338 auto const iTimePDclock = timePDclockinfo.first;
339 out << indent <<
" timePDclock #" << iTimePDclock <<
" with " << timePDclockinfo.second.size()
341 double timePDclock_energy = 0., timePDclock_photons = 0.;
342 for (
const sim::SDP& sdp : timePDclockinfo.second) {
343 out << indent <<
" (" << sdp.
x <<
", " << sdp.
y <<
", " << sdp.
z <<
") " << sdp.
numPhotons 344 <<
" photons, " << sdp.
energy <<
"MeV (trkID=" << sdp.
trackID <<
")\n";
345 timePDclock_energy += sdp.
energy;
348 out << indent <<
" => timePDclock #" << iTimePDclock <<
" CH #" << OpDetNum()
349 <<
" collected " << timePDclock_energy <<
" MeV and " << timePDclock_photons
351 opDet_energy += timePDclock_energy;
352 opDet_photons += timePDclock_photons;
354 out << indent <<
" => channel #" << OpDetNum() <<
" collected " << opDet_photons
355 <<
" photons and " << opDet_energy <<
" MeV.\n";
358 #endif // LARSIMOBJ_SIMULATION_OPDETBACKTRACKERRECORD_H
int iOpDetNum
OpticalDetector where the photons were detected.
OBTRHelper(TrackID_t trackID)
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)
std::map< timePDclock_t, std::vector< sim::SDP > > fTimePDclockSDPs
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)