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

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

Inheritance diagram for ana::SystApplier:
ana::RecordMultiSink ana::IRecordSink

Public Member Functions

 SystApplier (const SystShifts &shift)
 
void HandleRecord (caf::SRProxy *sr, double wei) override
 
void AddSink (IRecordSink *s)
 
int NSinks () const override
 

Protected Attributes

SystShifts fShift
 
bool fNominal
 
std::vector< IRecordSink * > fSinks
 

Detailed Description

Definition at line 9 of file SystApplier.h.

Constructor & Destructor Documentation

ana::SystApplier::SystApplier ( const SystShifts shift)
inline

Definition at line 12 of file SystApplier.h.

References HandleRecord(), and sr.

12 : fShift(shift), fNominal(shift.IsNominal()) {}
SystShifts fShift
Definition: SystApplier.h:17

Member Function Documentation

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

Reimplemented from ana::RecordMultiSink.

Definition at line 10 of file SystApplier.cxx.

References caf::SRProxySystController::BeginTransaction(), om::cerr, allTimeWatchdog::endl, fNominal, fShift, ana::RecordMultiSink::HandleRecord(), caf::SRProxySystController::Rollback(), ana::SystShifts::Shift(), and ana::SystShifts::ShortName().

Referenced by SystApplier().

11  {
12  if(fNominal){
14  return;
15  }
16 
18 
19  double systWei = 1;
20  fShift.Shift(sr, systWei);
21 
22  if(systWei < 0){
23  std::cerr << "Negative weight " << systWei
24  << " returned from Syst "
25  << "whole applying\n"
26  << fShift.ShortName()
27  << std::endl;
28  abort();
29  }
30 
31  if(systWei > 0) RecordMultiSink::HandleRecord(sr, wei * systWei);
32 
33  // Return StandardRecord to its unshifted form ready for the next
34  // histogram.
36  }
std::string ShortName() const
Brief description of component shifts, for printing to screen.
Definition: SystShifts.cxx:193
OStream cerr
Definition: OStream.cxx:7
void HandleRecord(caf::SRProxy *sr, double wei) override
SystShifts fShift
Definition: SystApplier.h:17
void Shift(caf::SRProxy *sr, double &weight) const
Definition: SystShifts.cxx:165
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

bool ana::SystApplier::fNominal
protected

Definition at line 18 of file SystApplier.h.

Referenced by HandleRecord().

SystShifts ana::SystApplier::fShift
protected

Definition at line 17 of file SystApplier.h.

Referenced by HandleRecord().

std::vector<IRecordSink*> ana::RecordMultiSink::fSinks
protectedinherited

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