Public Member Functions | Protected Attributes | List of all members
ana::WeightApplier Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-03/CAFAna/Core/WeightApplier.h"

Inheritance diagram for ana::WeightApplier:
ana::RecordMultiSink ana::IRecordSink

Public Member Functions

 WeightApplier (const Var &w)
 
void HandleRecord (caf::SRProxy *sr, double wei) override
 
void AddSink (IRecordSink *s)
 
int NSinks () const override
 

Protected Attributes

Var fWeight
 
std::vector< IRecordSink * > fSinks
 

Detailed Description

Definition at line 9 of file WeightApplier.h.

Constructor & Destructor Documentation

ana::WeightApplier::WeightApplier ( const Var w)
inline

Definition at line 12 of file WeightApplier.h.

References HandleRecord(), and sr.

12 : fWeight(w) {}
Float_t w
Definition: plot.C:20

Member Function Documentation

void ana::RecordMultiSink::AddSink ( IRecordSink s)
inlineinherited
void ana::WeightApplier::HandleRecord ( caf::SRProxy sr,
double  wei 
)
overridevirtual

Reimplemented from ana::RecordMultiSink.

Definition at line 8 of file WeightApplier.cxx.

References om::cerr, allTimeWatchdog::endl, fWeight, and ana::RecordMultiSink::HandleRecord().

Referenced by WeightApplier().

9  {
10  const double w2 = fWeight(sr);
11 
12  if(w2 < 0){
13  std::cerr << "Negative weight " << w2
14  << " returned from Var";
16  abort();
17  }
18 
19  if(wei*w2 > 0) RecordMultiSink::HandleRecord(sr, wei*w2);
20  }
OStream cerr
Definition: OStream.cxx:7
void HandleRecord(caf::SRProxy *sr, double wei) override
int ana::RecordMultiSink::NSinks ( ) const
overridevirtualinherited

Implements ana::IRecordSink.

Definition at line 12 of file RecordMultiSink.cxx.

References ana::RecordMultiSink::fSinks, and runNovaSAM::ret.

Referenced by ana::RecordMultiSink::AddSink(), and ana::SpectrumLoader::Go().

13  {
14  int ret = 0;
15  for(IRecordSink* sink: fSinks) ret += sink->NSinks();
16  return ret;
17  }
std::vector< IRecordSink * > fSinks

Member Data Documentation

std::vector<IRecordSink*> ana::RecordMultiSink::fSinks
protectedinherited
Var ana::WeightApplier::fWeight
protected

Definition at line 17 of file WeightApplier.h.

Referenced by HandleRecord().


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