Jpp - the software that should make you happy
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
software
JAAnet
JWeightEventToolkit.hh
Go to the documentation of this file.
1
#ifndef __JAANET__JWEIGHTEVENTTOOLKIT__
2
#define __JAANET__JWEIGHTEVENTTOOLKIT__
3
4
#include <vector>
5
6
#include "
km3net-dataformat/offline/Head.hh
"
7
#include "
km3net-dataformat/offline/Evt.hh
"
8
9
#include "
JLang/JSharedPointer.hh
"
10
11
#include "
JAAnet/JHead.hh
"
12
#include "
JAAnet/JHeadToolkit.hh
"
13
#include "
JAAnet/JWeightEvent.hh
"
14
#include "
JAAnet/JFlux.hh
"
15
#include "
JAAnet/JFluxHelper.hh
"
16
#include "
JAAnet/JWeightDAQ.hh
"
17
#include "
JAAnet/JWeightMupage.hh
"
18
#include "
JAAnet/JWeightGSeaGen.hh
"
19
#include "
JAAnet/JWeightKM3BUU.hh
"
20
21
/**
22
* \author bjung
23
*/
24
25
namespace
JAANET {
26
27
using
JLANG::JSharedPointer
;
28
using
JLANG::JValueOutOfRange
;
29
30
31
/**
32
* Look-up table for event weighters.
33
*/
34
struct
JEventWeighter
:
35
public
std::vector
< JSharedPointer<JWeightEvent> >
36
{
37
/*
38
* Constructor
39
*/
40
JEventWeighter
()
41
{
42
this->push_back(
new
JWeightGSeaGen
());
43
this->push_back(
new
JWeightKM3BUU
());
44
this->push_back(
new
JWeightMupage
());
45
this->push_back(
new
JWeightDAQ
());
46
}
47
48
49
/**
50
* Get event weighter corresponding to given header.
51
*
52
* \param header header
53
* \return event weighter
54
*/
55
const
JWeightEvent
&
operator()
(
const
JHead
& header)
const
56
{
57
for
(const_iterator i = this->begin(); i != this->end(); ++i) {
58
59
if
((*i)->check(header)) {
60
61
return
*(*i);
62
}
63
}
64
65
THROW
(
JValueOutOfRange
,
"JEventWeighter::operator(): No event weighter found for given header."
);
66
}
67
};
68
69
70
/**
71
* Check if given event weighter contains a specifiable flux function.
72
*
73
* \param weighter event weighter
74
* \return true if given event weighter contains a specifiable flux function; else false
75
*/
76
inline
bool
hasFlux
(
const
JWeightEvent
& weighter)
77
{
78
return
dynamic_cast<
const
JFluxHelper
*
>
(&weighter) != NULL;
79
}
80
81
82
extern
JEventWeighter
getEventWeighter
;
//!< Function object for mapping header to event weighter.
83
}
84
85
#endif
JAANET::JWeightMupage
Implementation of event weighing for MUPAGE data.
Definition:
JWeightMupage.hh:27
JFlux.hh
JFluxHelper.hh
JAANET::hasFlux
bool hasFlux(const JWeightEvent &weighter)
Check if given event weighter contains a specifiable flux function.
Definition:
JWeightEventToolkit.hh:76
THROW
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition:
JException.hh:670
JWeightGSeaGen.hh
std::vector
Definition:
JSTDTypes.hh:12
JAANET::JEventWeighter
Look-up table for event weighters.
Definition:
JWeightEventToolkit.hh:34
JSharedPointer.hh
JLANG::JSharedPointer
The template JSharedPointer class can be used to share a pointer to an object.
Definition:
JSharedPointer.hh:28
JWeightEvent.hh
JWeightKM3BUU.hh
JAANET::JFluxHelper
Helper class for event weighing.
Definition:
JFluxHelper.hh:23
JAANET::JEventWeighter::operator()
const JWeightEvent & operator()(const JHead &header) const
Get event weighter corresponding to given header.
Definition:
JWeightEventToolkit.hh:55
JAANET::JEventWeighter::JEventWeighter
JEventWeighter()
Definition:
JWeightEventToolkit.hh:40
JAANET::JWeightEvent
Low-level interface for event weighing.
Definition:
JWeightEvent.hh:24
JAANET::JWeightGSeaGen
Implementation of event weighting for GSeaGen data.
Definition:
JWeightGSeaGen.hh:30
JWeightDAQ.hh
JAANET::getEventWeighter
JEventWeighter getEventWeighter
Function object for mapping header to event weighter.
Definition:
JWeightEventToolkit.cc:5
JAANET::JHead
Monte Carlo run header.
Definition:
JHead.hh:1113
JAANET::JWeightKM3BUU
Implementation of event weighting for KM3BUU data.
Definition:
JWeightKM3BUU.hh:30
JWeightMupage.hh
Evt.hh
JHeadToolkit.hh
JLANG::JValueOutOfRange
Exception for accessing a value in a collection that is outside of its range.
Definition:
JException.hh:162
Head.hh
JAANET::JWeightDAQ
Implementation of event weighing for DAQ data.
Definition:
JWeightDAQ.hh:27
JHead.hh
Generated by
1.8.5