Jpp
17.1.0
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/JEvtWeightCorsika.hh
"
17
#include "
JAAnet/JEvtWeightGSeaGen.hh
"
18
#include "
JAAnet/JEvtWeightKM3BUU.hh
"
19
20
/**
21
* \author bjung
22
*/
23
24
namespace
JAANET {
25
26
using
JLANG::JSharedPointer
;
27
using
JLANG::JValueOutOfRange
;
28
29
30
/**
31
* Look-up table for event weighters.
32
*/
33
struct
JEvtWeighter
:
34
public
std::vector
< JSharedPointer<JEvtWeight> >
35
{
36
/*
37
* Constructor
38
*/
39
JEvtWeighter
()
40
{
41
this->push_back(
new
JEvtWeightGSeaGen
());
42
this->push_back(
new
JEvtWeightKM3BUU
());
43
this->push_back(
new
JEvtWeightCorsika
());
44
this->push_back(
new
JEvtWeightMupage
());
45
this->push_back(
new
JEvtWeightDAQ
());
46
}
47
48
49
/**
50
* Get event weighter corresponding to given header.
51
*
52
* \param header header
53
* \return event weighter
54
*/
55
const
JEvtWeight
&
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
,
"JEvtWeighter::operator(): No event weighter found for given header."
);
66
}
67
};
68
69
70
extern
JEvtWeighter
getEventWeighter
;
//!< Function object for mapping header to event weighter.
71
}
72
73
#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:696
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
Abstract base class for event weighing.
Definition:
JEvtWeight.hh:21
JEvtWeightKM3BUU.hh
JAANET::JEvtWeightGSeaGen
Implementation of event weighting for GSeaGen data.
Definition:
JEvtWeightGSeaGen.hh:31
JAANET::JHead
Monte Carlo run header.
Definition:
JHead.hh:1167
JAANET::JEvtWeightKM3BUU
Implementation of event weighting for KM3BUU data.
Definition:
JEvtWeightKM3BUU.hh:31
JAANET::JEvtWeightMupage
Implementation of event weighing for MUPAGE data.
Definition:
JEvtWeightMupage.hh:29
JEvtWeightCorsika.hh
JAANET::JEvtWeighter
Look-up table for event weighters.
Definition:
JEvtWeightToolkit.hh:33
Evt.hh
JAANET::JEvtWeighter::JEvtWeighter
JEvtWeighter()
Definition:
JEvtWeightToolkit.hh:39
JAANET::JEvtWeightCorsika
Implementation of event weighting for Corsika data.
Definition:
JEvtWeightCorsika.hh:32
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:55
JHead.hh
Generated by
1.8.5