Jpp
15.0.2
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
JEvtWeightToolkit.hh
Go to the documentation of this file.
1
#ifndef __JAANET__JEVTWEIGHTTOOLKIT__
2
#define __JAANET__JEVTWEIGHTTOOLKIT__
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/JEvtWeight.hh
"
14
#include "
JAAnet/JEvtWeightDAQ.hh
"
15
#include "
JAAnet/JEvtWeightMupage.hh
"
16
#include "
JAAnet/JEvtWeightGSeaGen.hh
"
17
#include "
JAAnet/JEvtWeightKM3BUU.hh
"
18
19
/**
20
* \author bjung
21
*/
22
23
namespace
JAANET {
24
25
using
JLANG::JSharedPointer
;
26
using
JLANG::JValueOutOfRange
;
27
28
29
/**
30
* Look-up table for event weighters.
31
*/
32
struct
JEvtWeighter
:
33
public
std::vector
< JSharedPointer<JEvtWeight> >
34
{
35
/*
36
* Constructor
37
*/
38
JEvtWeighter
()
39
{
40
this->push_back(
new
JEvtWeightGSeaGen
());
41
this->push_back(
new
JEvtWeightKM3BUU
());
42
this->push_back(
new
JEvtWeightMupage
());
43
this->push_back(
new
JEvtWeightDAQ
());
44
}
45
46
47
/**
48
* Get event weighter corresponding to given header.
49
*
50
* \param header header
51
* \return event weighter
52
*/
53
const
JEvtWeight
&
operator()
(
const
JHead
& header)
const
54
{
55
for
(const_iterator i = this->begin(); i != this->end(); ++i) {
56
57
if
((*i)->check(header)) {
58
59
return
*(*i);
60
}
61
}
62
63
THROW
(
JValueOutOfRange
,
"JEvtWeighter::operator(): No event weighter found for given header."
);
64
}
65
};
66
67
68
extern
JEvtWeighter
getEventWeighter
;
//!< Function object for mapping header to event weighter.
69
}
70
71
#endif
JEvtWeightDAQ.hh
JAANET::getEventWeighter
JEvtWeighter getEventWeighter
Function object for mapping header to event weighter.
Definition:
JEvtWeightToolkit.cc:5
JAANET::JEvtWeightDAQ
Implementation of event weighing for DAQ data.
Definition:
JEvtWeightDAQ.hh:27
JEvtWeight.hh
THROW
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition:
JException.hh:670
std::vector
Definition:
JSTDTypes.hh:12
JEvtWeightMupage.hh
JSharedPointer.hh
JLANG::JSharedPointer
The template JSharedPointer class can be used to share a pointer to an object.
Definition:
JSharedPointer.hh:28
JAANET::JEvtWeight
Low-level interface for event weighing.
Definition:
JEvtWeight.hh:24
JEvtWeightKM3BUU.hh
JAANET::JEvtWeightGSeaGen
Implementation of event weighting for GSeaGen data.
Definition:
JEvtWeightGSeaGen.hh:33
JAANET::JHead
Monte Carlo run header.
Definition:
JHead.hh:1113
JAANET::JEvtWeightKM3BUU
Implementation of event weighting for KM3BUU data.
Definition:
JEvtWeightKM3BUU.hh:29
JAANET::JEvtWeightMupage
Implementation of event weighing for MUPAGE data.
Definition:
JEvtWeightMupage.hh:29
JAANET::JEvtWeighter
Look-up table for event weighters.
Definition:
JEvtWeightToolkit.hh:32
Evt.hh
JAANET::JEvtWeighter::JEvtWeighter
JEvtWeighter()
Definition:
JEvtWeightToolkit.hh:38
JHeadToolkit.hh
JEvtWeightGSeaGen.hh
JLANG::JValueOutOfRange
Exception for accessing a value in a collection that is outside of its range.
Definition:
JException.hh:162
Head.hh
JAANET::JEvtWeighter::operator()
const JEvtWeight & operator()(const JHead &header) const
Get event weighter corresponding to given header.
Definition:
JEvtWeightToolkit.hh:53
JHead.hh
Generated by
1.8.5