Jpp  18.2.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 | 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...
 

Detailed Description

Implementation of event weighing for DAQ data.

Definition at line 32 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 38 of file JEvtWeightDAQ.hh.

39  {}
JAANET::JEvtWeightDAQ::JEvtWeightDAQ ( const JHead header)
inline

Constructor.

Parameters
headerheader

Definition at line 47 of file JEvtWeightDAQ.hh.

48  {
49  configure(header);
50  }
void configure(const JHead &header) override
Configuration.

Member Function Documentation

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

Configuration.

Parameters
headerheader

Definition at line 58 of file JEvtWeightDAQ.hh.

59  {
60  using namespace JPP;
61 
62  if (check(header)) {
63 
64  norm = 1.0 / header.DAQ.livetime_s;
65 
66  } else {
67 
68  THROW(JValueOutOfRange, "JEvtWeightDAQ::configure(): Provided header is inconsistent with a DAQ-header.");
69  }
70  }
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:712
double livetime_s
Live time [s].
Definition: JHead.hh:1053
JAANET::DAQ DAQ
Definition: JHead.hh:1604
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 79 of file JEvtWeightDAQ.hh.

80  {
81  return is_daq(header);
82  }
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 91 of file JEvtWeightDAQ.hh.

92  {
93  if (evt.w.size() > WEIGHTLIST_RESCALED_EVENT_RATE) {
95  } else {
96  return getNormalisation(evt);
97  }
98  }
static const int WEIGHTLIST_RESCALED_EVENT_RATE
Rescaled event rate [s-1].
Definition: weightlist.hh:17
std::vector< double > w
MC: Weights w[0]=w1, w[1]=w2, w[2]=w3 (see e.g. Tag list or km3net-dataformat/definitions) ...
Definition: Evt.hh:42
template<class JClonable_t, class JDerived_t = JNullType>
virtual clone_type JLANG::JClonable< JClonable_t, JDerived_t >::clone ( ) const
inlineoverridevirtualinherited

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