Jpp  16.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Private Attributes | List of all members
JAANET::JEvtWeightDAQ Struct Reference

Implementation of event weighing for DAQ data. More...

#include <JEvtWeightDAQ.hh>

Inheritance diagram for JAANET::JEvtWeightDAQ:
JLANG::JClonable< JClonable_t, JDerived_t >

Public Types

typedef JClonable< JClonable_t >
::clone_type 
clone_type
 

Public Member Functions

 JEvtWeightDAQ ()
 Default constructor. More...
 
 JEvtWeightDAQ (const JHead &header)
 Constructor. More...
 
void configure (const JHead &header) override
 Configuration. More...
 
bool check (const JHead &header) const override
 Check whether header is consistent with this event weighter. More...
 
double getWeight (const Evt &evt) const override
 Get weight of given event. More...
 
virtual clone_type clone () const override
 Get clone of this object. More...
 

Private Attributes

double W
 

Detailed Description

Implementation of event weighing for DAQ data.

Definition at line 27 of file JEvtWeightDAQ.hh.

Member Typedef Documentation

template<class JClonable_t, class JDerived_t = JNullType>
typedef JClonable<JClonable_t>::clone_type JLANG::JClonable< JClonable_t, JDerived_t >::clone_type
inherited

Definition at line 61 of file JClonable.hh.

Constructor & Destructor Documentation

JAANET::JEvtWeightDAQ::JEvtWeightDAQ ( )
inline

Default constructor.

Definition at line 33 of file JEvtWeightDAQ.hh.

33  : W(0.0)
34  {}
JAANET::JEvtWeightDAQ::JEvtWeightDAQ ( const JHead header)
inline

Constructor.

Parameters
headerheader

Definition at line 42 of file JEvtWeightDAQ.hh.

43  {
44  configure(header);
45  }
void configure(const JHead &header) override
Configuration.

Member Function Documentation

void JAANET::JEvtWeightDAQ::configure ( const JHead header)
inlineoverride

Configuration.

Parameters
headerheader
Returns
true if okay; else false

Definition at line 54 of file JEvtWeightDAQ.hh.

55  {
56  if (check(header) && header.DAQ.livetime_s > 0.0) {
57 
58  W = 1.0 / header.DAQ.livetime_s;
59 
60  } else {
61 
62  THROW(JValueOutOfRange, "JEvtWeightDAQ::configure(): Provided header is inconsistent with a DAQ-header.");
63  }
64  }
bool check(const JHead &header) const override
Check whether header is consistent with this event weighter.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:696
bool JAANET::JEvtWeightDAQ::check ( const JHead header) const
inlineoverride

Check whether header is consistent with this event weighter.

Parameters
headerheader
Returns
true if consistent; else false

Definition at line 73 of file JEvtWeightDAQ.hh.

74  {
75  return is_daq(header);
76  }
bool is_daq(const JHead &header)
Check for real data.
double JAANET::JEvtWeightDAQ::getWeight ( const Evt evt) const
inlineoverride

Get weight of given event.

Parameters
evtevent
Returns
weight [1/s]

Definition at line 85 of file JEvtWeightDAQ.hh.

86  {
87  return W;
88  }
template<class JClonable_t, class JDerived_t = JNullType>
virtual clone_type JLANG::JClonable< JClonable_t, JDerived_t >::clone ( ) const
inlineoverridevirtualinherited

Member Data Documentation

double JAANET::JEvtWeightDAQ::W
private

Definition at line 91 of file JEvtWeightDAQ.hh.


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