Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
lardataobj
lardataobj
RecoBase
Event.cxx
Go to the documentation of this file.
1
////////////////////////////////////////////////////////////////////////////
2
//
3
// \brief Definition of event object for LArSoft
4
//
5
// \author brebel@fnal.gov
6
//
7
////////////////////////////////////////////////////////////////////////////
8
#include "
lardataobj/RecoBase/Event.h
"
9
10
#include "
larcoreobj/SimpleTypesAndConstants/PhysicalConstants.h
"
11
#include "
messagefacility/MessageLogger/MessageLogger.h
"
12
13
#include <iomanip>
14
#include <ostream>
15
#include <algorithm>
// for std::sort
16
17
namespace
recob
{
18
19
//----------------------------------------------------------------------
20
Event::Event
()
21
:
22
Event
(
util
::
kBogusI
)
23
{
24
}
25
26
//----------------------------------------------------------------------
27
Event::Event
(
int
id
)
28
:
fID
(id)
29
{
30
}
31
32
//----------------------------------------------------------------------
33
double
Event::Energy
()
const
34
{
35
// loop over all vertex objects and get the
36
mf::LogWarning
(
"Event"
) <<
"Event::Energy() is not yet defined. Need to decide "
37
<<
" how to calculate energy of Vertex"
38
<<
" Return util:kBogusD for now."
;
39
40
return
util::kBogusD
;
41
}
42
43
//----------------------------------------------------------------------
44
double
Event::SigmaEnergy
()
const
45
{
46
// loop over all vertex objects and get the
47
mf::LogWarning
(
"Event"
) <<
"Event::SigmaEnergy() is not yet defined. Need to decide "
48
<<
" how to calculate uncertainty in energy of Prong/Vertex"
49
<<
" Return util:kBogusD for now."
;
50
51
return
util::kBogusD
;
52
}
53
54
//----------------------------------------------------------------------
55
const
recob::Vertex
*
Event::PrimaryVertex
( std::vector<const recob::Vertex*>& vtxs )
const
56
{
57
// sort the vertices, set the first one in z to be the primary
58
std::sort(vtxs.begin(), vtxs.end());
59
return
vtxs.front();
60
}
61
62
//----------------------------------------------------------------------
63
// ostream operator.
64
//
65
std::ostream&
operator<<
(std::ostream& o,
const
Event
&
a
)
66
{
67
68
o <<
std::setprecision
(5);
69
o <<
"Event "
<< a.
fID
<<
std::setw
(5)
70
<<
" Energy = "
<< a.
Energy
() <<
" +/- "
<< a.
SigmaEnergy
() <<
std::endl
;
71
72
return
o;
73
}
74
75
76
//----------------------------------------------------------------------
77
// < operator.
78
//
79
bool
operator <
(
const
Event
&
a
,
const
Event
&
b
)
80
{
81
82
return
a.
Energy
() < b.
Energy
();
83
84
}
85
86
87
}
recob::Event::fID
int fID
id for this event
Definition:
Event.h:28
util
Namespace for general, non-LArSoft-specific utilities.
Definition:
SignalShapingService.h:21
recob
Reconstruction base classes.
Definition:
AdcChannelData.h:91
recob::Event::Energy
double Energy() const
Definition:
Event.cxx:33
util::kBogusI
constexpr int kBogusI
obviously bogus integer value
Definition:
PhysicalConstants.h:72
recob::Vertex
Definition of vertex object for LArSoft.
Definition:
Vertex.h:35
setprecision
Q_EXPORT QTSManip setprecision(int p)
Definition:
qtextstream.h:343
MessageLogger.h
a
const double a
Definition:
gUpMuFluxGen.cxx:164
recob::Event::Event
Event()
Definition:
Event.cxx:20
recob::Event::operator<
friend bool operator<(const Event &a, const Event &b)
Definition:
Event.cxx:79
recob::Event::operator<<
friend std::ostream & operator<<(std::ostream &o, const Event &a)
Definition:
Event.cxx:65
setw
Q_EXPORT QTSManip setw(int w)
Definition:
qtextstream.h:331
recob::Event
Definition:
Event.h:21
mf::LogWarning
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
Definition:
MessageLogger.h:210
b
static bool * b
Definition:
config.cpp:1043
recob::Event::SigmaEnergy
double SigmaEnergy() const
Definition:
Event.cxx:44
Event.h
util::kBogusD
constexpr double kBogusD
obviously bogus double value
Definition:
PhysicalConstants.h:71
recob::Event::PrimaryVertex
const recob::Vertex * PrimaryVertex(std::vector< const recob::Vertex * > &vtxs) const
Definition:
Event.cxx:55
PhysicalConstants.h
Collection of Physical constants used in LArSoft.
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
Generated by
1.8.11