LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
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 7 of file Weight_t.h.

Constructor & Destructor Documentation

evwgh::Weight_t::Weight_t ( )
inline

Definition at line 9 of file Weight_t.h.

9  :
12  fAvgWeight(0),
13  fNcalls(0)
14  {}
Int_t max
Definition: plot.C:27
double fMaxWeight
Definition: Weight_t.h:34
Int_t min
Definition: plot.C:26
double fMinWeight
Definition: Weight_t.h:33
double fAvgWeight
Definition: Weight_t.h:35

Member Function Documentation

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

Definition at line 16 of file Weight_t.h.

References evd::details::begin(), evd::details::end(), fAvgWeight, fMaxWeight, fMinWeight, fNcalls, fWeightCalc, evwgh::WeightCalc::GetWeight(), max, and min.

16  {
17  std::vector<std::vector<double> >wgh=fWeightCalc->GetWeight(e);
18  for (unsigned int inu=0;inu<wgh.size();inu++) {
19  double avgwgh=std::accumulate(wgh[inu].begin(),wgh[inu].end(),0.0)/wgh[inu].size();
20  fAvgWeight=(fAvgWeight*fNcalls+avgwgh)/float(fNcalls+1);
22  *std::min_element(wgh[inu].begin(),wgh[inu].end()));
24  *std::max_element(wgh[inu].begin(),wgh[inu].end()));
25  fNcalls++;
26  }
27 
28  return wgh;
29  }
WeightCalc * fWeightCalc
Definition: Weight_t.h:31
Int_t max
Definition: plot.C:27
std::vector< evd::details::RawDigitInfo_t >::const_iterator begin(RawDigitCacheDataClass const &cache)
double fMaxWeight
Definition: Weight_t.h:34
Int_t min
Definition: plot.C:26
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
virtual std::vector< std::vector< double > > GetWeight(art::Event &e)=0
double fMinWeight
Definition: Weight_t.h:33
double fAvgWeight
Definition: Weight_t.h:35

Member Data Documentation

double evwgh::Weight_t::fAvgWeight

Definition at line 35 of file Weight_t.h.

Referenced by GetWeight().

double evwgh::Weight_t::fMaxWeight

Definition at line 34 of file Weight_t.h.

Referenced by GetWeight().

double evwgh::Weight_t::fMinWeight

Definition at line 33 of file Weight_t.h.

Referenced by GetWeight().

std::string evwgh::Weight_t::fName

Definition at line 30 of file Weight_t.h.

long evwgh::Weight_t::fNcalls

Definition at line 36 of file Weight_t.h.

Referenced by GetWeight().

int evwgh::Weight_t::fNmultisims

Definition at line 37 of file Weight_t.h.

Referenced by evwgh::WeightManager::Configure().

WeightCalc* evwgh::Weight_t::fWeightCalc

Definition at line 31 of file Weight_t.h.

Referenced by evwgh::WeightManager::Configure(), and GetWeight().

std::string evwgh::Weight_t::fWeightCalcType

Definition at line 32 of file Weight_t.h.

Referenced by evwgh::WeightManager::Configure().


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