11 #ifndef DUNE_DUNEOBJBASE_SIM_H 12 #define DUNE_DUNEOBJBASE_SIM_H 49 std::vector<std::pair<int, double>>
GetFracs(
int tid)
const{
51 std::vector<std::pair<int, double>> ret;
52 for(
auto&
a : phots){ total += (
a.trackID==tid)?
a.phot:0;}
53 for(
auto&
a : phots){ ret.emplace_back(
a.opChan, (
a.phot / total));}
56 std::vector<std::pair<int, double>>
GetFracs()
const{
58 std::vector<std::pair<int, double>> ret;
59 for(
auto&
a : phots){ total +=
a.phot;}
60 for(
auto&
a : phots){ ret.emplace_back(
a.opChan, (
a.phot / total));}
63 double GetFrac(
int opChanIn,
int tid)
const{
65 std::vector<std::pair<int, double>> fracs = GetFracs(tid);
66 for(
auto pair : fracs){
67 if(pair.first==opChanIn){
76 std::vector<std::pair<int, double>> fracs = GetFracs();
77 for(
auto pair : fracs){
78 if(pair.first==opChanIn){
112 template <
typename Stream>
116 template <
typename Stream>
118 { Dump(std::forward<Stream>(out), indent, indent); }
125 {
return a.
time<
b.time;}
145 template <
class Stream>
149 out << first_indent <<
"OpDet #" << OpDetNum() <<
" read " << time_chans.size()
151 for (
const auto& tc: time_chans) {
153 out << indent <<
" time " <<
time 154 <<
" with " << tc.phots.size() <<
" Photon deposits\n";
155 for (
const auto& photr: tc.phots) {
157 <<
"OpChan: "<<photr.opChan <<
" with "<<photr.phot<<
" photons from particle with TrackID"<<photr.trackID<<
"\n";
164 #endif //DUNE_DUNEOBJBASE_SIM_H
double GetFrac(int opChanIn) const
Time_Chans_t::const_iterator lower
void Dump(Stream &&out, std::string indent="") const
Documentation at Dump(Stream&&, std::string, std::string) const.
std::vector< Chan_Phot > phots
Chan_Phot(int opChanIn, int tid=-999999)
double GetFrac(int opChanIn, int tid) const
std::vector< OpDet_Time_Chans > Time_Chans_t
Time_Chans_t const & GetTimeChans() const
Code to link reconstructed objects back to the MC truth information.
std::vector< std::pair< int, double > > GetFracs(int tid) const
vector< vector< double > > clear
std::vector< std::pair< int, double > > GetFracs() const
Time_Chans_t::const_iterator upper
void Dump(Stream &&out, std::string indent, std::string first_indent) const