All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
evwgh::Weight_t Struct Reference

#include <Weight_t.h>

Public Member Functions

 Weight_t ()
 
std::vector< std::vector
< double > > 
GetWeight (art::Event &e)
 

Public Attributes

std::string fName
 
WeightCalcfWeightCalc
 
std::string fWeightCalcType
 
double fMinWeight
 
double fMaxWeight
 
double fAvgWeight
 
long fNcalls
 
int fNmultisims
 

Detailed Description

Definition at line 9 of file Weight_t.h.

Constructor & Destructor Documentation

evwgh::Weight_t::Weight_t ( )
inline

Definition at line 11 of file Weight_t.h.

11  :
12  fMinWeight(std::numeric_limits<double>::max()),
13  fMaxWeight(std::numeric_limits<double>::min()),
14  fAvgWeight(0),
15  fNcalls(0)
16  {}
double fMaxWeight
Definition: Weight_t.h:36
double fMinWeight
Definition: Weight_t.h:35
double fAvgWeight
Definition: Weight_t.h:37

Member Function Documentation

std::vector<std::vector<double> > evwgh::Weight_t::GetWeight ( art::Event &  e)
inline

Definition at line 18 of file Weight_t.h.

18  {
19  std::vector<std::vector<double> >wgh=fWeightCalc->GetWeight(e);
20  for (unsigned int inu=0;inu<wgh.size();inu++) {
21  double avgwgh=std::accumulate(wgh[inu].begin(),wgh[inu].end(),0.0)/wgh[inu].size();
22  fAvgWeight=(fAvgWeight*fNcalls+avgwgh)/float(fNcalls+1);
23  fMinWeight=std::min(fMinWeight,
24  *std::min_element(wgh[inu].begin(),wgh[inu].end()));
25  fMaxWeight=std::max(fMaxWeight,
26  *std::max_element(wgh[inu].begin(),wgh[inu].end()));
27  fNcalls++;
28  }
29 
30  return wgh;
31  }
WeightCalc * fWeightCalc
Definition: Weight_t.h:33
auto end(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:585
auto begin(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:573
double fMaxWeight
Definition: Weight_t.h:36
do i e
virtual std::vector< std::vector< double > > GetWeight(art::Event &e)=0
double fMinWeight
Definition: Weight_t.h:35
double fAvgWeight
Definition: Weight_t.h:37

Member Data Documentation

double evwgh::Weight_t::fAvgWeight

Definition at line 37 of file Weight_t.h.

double evwgh::Weight_t::fMaxWeight

Definition at line 36 of file Weight_t.h.

double evwgh::Weight_t::fMinWeight

Definition at line 35 of file Weight_t.h.

std::string evwgh::Weight_t::fName

Definition at line 32 of file Weight_t.h.

long evwgh::Weight_t::fNcalls

Definition at line 38 of file Weight_t.h.

int evwgh::Weight_t::fNmultisims

Definition at line 39 of file Weight_t.h.

WeightCalc* evwgh::Weight_t::fWeightCalc

Definition at line 33 of file Weight_t.h.

std::string evwgh::Weight_t::fWeightCalcType

Definition at line 34 of file Weight_t.h.


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