Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JAANET::JEvtWeightDAQ Struct Referencefinal

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.
 
 JEvtWeightDAQ (const JHead &header)
 Constructor.
 
const char *const getName () const override final
 Get name.
 
void configure (const JHead &header) override final
 Configuration.
 
bool check (const JHead &header) const override final
 Check whether header is consistent with this event weighter.
 
double getWeight (const Evt &evt) const override final
 Get weight of given event.
 
virtual clone_type clone () const override
 Get clone of this object.
 

Detailed Description

Implementation of event weighing for DAQ data.

Definition at line 32 of file JEvtWeightDAQ.hh.

Member Typedef Documentation

◆ clone_type

template<class JClonable_t , class JDerived_t >
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

◆ JEvtWeightDAQ() [1/2]

JAANET::JEvtWeightDAQ::JEvtWeightDAQ ( )
inline

Default constructor.

Definition at line 38 of file JEvtWeightDAQ.hh.

39 {}

◆ JEvtWeightDAQ() [2/2]

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 final
Configuration.

Member Function Documentation

◆ getName()

const char *const JAANET::JEvtWeightDAQ::getName ( ) const
inlinefinaloverride

Get name.

Returns
name

Definition at line 58 of file JEvtWeightDAQ.hh.

59 {
60 return "DAQ";
61 }

◆ configure()

void JAANET::JEvtWeightDAQ::configure ( const JHead & header)
inlinefinaloverride

Configuration.

Parameters
headerheader

Definition at line 69 of file JEvtWeightDAQ.hh.

70 {
71 using namespace JPP;
72
73 if (check(header)) {
74
75 setNormalisation(1.0 / header.DAQ.livetime_s);
76
77 } else {
78
79 THROW(JValueOutOfRange, "JEvtWeightDAQ::configure(): Provided header is inconsistent with a DAQ-header.");
80 }
81 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Exception for accessing a value in a collection that is outside of its range.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
bool check(const JHead &header) const override final
Check whether header is consistent with this event weighter.

◆ check()

bool JAANET::JEvtWeightDAQ::check ( const JHead & header) const
inlinefinaloverride

Check whether header is consistent with this event weighter.

Parameters
headerheader
Returns
true if consistent; else false

Definition at line 90 of file JEvtWeightDAQ.hh.

91 {
92 return is_daq(header);
93 }
bool is_daq(const JHead &header)
Check for real data.

◆ getWeight()

double JAANET::JEvtWeightDAQ::getWeight ( const Evt & evt) const
inlinefinaloverride

Get weight of given event.

Parameters
evtevent
Returns
weight [1/s]

Definition at line 102 of file JEvtWeightDAQ.hh.

103 {
104 if (evt.w.size() > WEIGHTLIST_RESCALED_EVENT_RATE) {
106 } else {
107 return getNormalisation(evt);
108 }
109 }
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
static const int WEIGHTLIST_RESCALED_EVENT_RATE
Rescaled event rate [s-1].
Definition weightlist.hh:17

◆ clone()

template<class JClonable_t , class JDerived_t >
virtual clone_type JLANG::JClonable< JClonable_t, JDerived_t >::clone ( ) const
inlineoverridevirtualinherited

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