Jpp - 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::JWeightMupage Struct Reference

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

#include <JWeightMupage.hh>

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

Public Types

typedef JClonable< JClonable_t >
::clone_type 
clone_type
 

Public Member Functions

 JWeightMupage ()
 Default Constructor. More...
 
 JWeightMupage (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 MUPAGE data.

Definition at line 27 of file JWeightMupage.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::JWeightMupage::JWeightMupage ( )
inline

Default Constructor.

Definition at line 33 of file JWeightMupage.hh.

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

Constructor.

Parameters
headerheader

Definition at line 41 of file JWeightMupage.hh.

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

Member Function Documentation

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

Configuration.

Parameters
headerheader

Definition at line 52 of file JWeightMupage.hh.

53  {
54  if (check(header) && header.livetime.numberOfSeconds > 0.0) {
55 
56  W = 1.0 / header.livetime.numberOfSeconds;
57 
58  } else {
59 
60  THROW(JValueOutOfRange, "JWeightMupage::configure(): Provided header is inconsistent with MUPAGE.");
61  }
62  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
bool check(const JHead &header) const override
Check whether header is consistent with this event weighter.
bool JAANET::JWeightMupage::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 71 of file JWeightMupage.hh.

72  {
73  return is_mupage(header);
74  }
bool is_mupage(const JHead &header)
Check for generator.
Definition: JHeadToolkit.hh:78
double JAANET::JWeightMupage::getWeight ( const Evt evt) const
inlineoverride

Get weight of given event.

Parameters
evtevent
Returns
weight [1/s]

Definition at line 83 of file JWeightMupage.hh.

84  {
85  return W;
86  }
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::JWeightMupage::W
private

Definition at line 89 of file JWeightMupage.hh.


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