Public Types | Public Member Functions | Public Attributes | List of all members
sim::OpDet_Time_Chans Struct Reference

#include <OpDetDivRec.h>

Public Types

typedef double stored_time_t
 

Public Member Functions

 OpDet_Time_Chans ()
 
 OpDet_Time_Chans (stored_time_t &timeIn)
 
 OpDet_Time_Chans (stored_time_t &timeIn, std::vector< Chan_Phot > photIn)
 
std::vector< std::pair< int, double > > GetFracs (int tid) const
 
std::vector< std::pair< int, double > > GetFracs () const
 
double GetFrac (int opChanIn, int tid) const
 
double GetFrac (int opChanIn) const
 

Public Attributes

stored_time_t time
 
std::vector< Chan_Photphots
 

Detailed Description

Definition at line 39 of file OpDetDivRec.h.

Member Typedef Documentation

Definition at line 41 of file OpDetDivRec.h.

Constructor & Destructor Documentation

sim::OpDet_Time_Chans::OpDet_Time_Chans ( )
inline

Definition at line 43 of file OpDetDivRec.h.

44  {}
sim::OpDet_Time_Chans::OpDet_Time_Chans ( stored_time_t timeIn)

Definition at line 95 of file OpDetDivRec.cxx.

95  :
96  time(timeIn)
97  {}
stored_time_t time
Definition: OpDetDivRec.h:42
sim::OpDet_Time_Chans::OpDet_Time_Chans ( stored_time_t timeIn,
std::vector< Chan_Phot photIn 
)

Definition at line 98 of file OpDetDivRec.cxx.

98  :
99  time(timeIn),
100  phots(inVec)
101  {}
stored_time_t time
Definition: OpDetDivRec.h:42
std::vector< Chan_Phot > phots
Definition: OpDetDivRec.h:47

Member Function Documentation

double sim::OpDet_Time_Chans::GetFrac ( int  opChanIn,
int  tid 
) const
inline

Definition at line 63 of file OpDetDivRec.h.

63  {
64  double ret=0.0;
65  std::vector<std::pair<int, double>> fracs = GetFracs(tid);
66  for(auto pair : fracs){
67  if(pair.first==opChanIn){
68  ret=pair.second;
69  break;
70  }
71  }
72  return ret;
73  }
std::vector< std::pair< int, double > > GetFracs() const
Definition: OpDetDivRec.h:56
double sim::OpDet_Time_Chans::GetFrac ( int  opChanIn) const
inline

Definition at line 74 of file OpDetDivRec.h.

74  {
75  double ret=0.0;
76  std::vector<std::pair<int, double>> fracs = GetFracs();
77  for(auto pair : fracs){
78  if(pair.first==opChanIn){
79  ret=pair.second;
80  break;
81  }
82  }
83  return ret;
84  }
std::vector< std::pair< int, double > > GetFracs() const
Definition: OpDetDivRec.h:56
std::vector<std::pair<int, double> > sim::OpDet_Time_Chans::GetFracs ( int  tid) const
inline

Definition at line 49 of file OpDetDivRec.h.

49  {
50  double total=0.0;
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));}
54  return ret;
55  }
std::vector< Chan_Phot > phots
Definition: OpDetDivRec.h:47
const double a
std::vector<std::pair<int, double> > sim::OpDet_Time_Chans::GetFracs ( ) const
inline

Definition at line 56 of file OpDetDivRec.h.

56  {
57  double total=0.0;
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));}
61  return ret;
62  }
std::vector< Chan_Phot > phots
Definition: OpDetDivRec.h:47
const double a

Member Data Documentation

std::vector<Chan_Phot> sim::OpDet_Time_Chans::phots

Definition at line 47 of file OpDetDivRec.h.

stored_time_t sim::OpDet_Time_Chans::time

Definition at line 42 of file OpDetDivRec.h.


The documentation for this struct was generated from the following files: