Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
duneana
duneana
DAQSimAna
WaveformDump_module.cc
Go to the documentation of this file.
1
////////////////////////////////////////////////////////////////////////
2
// Class: WaveformDump
3
// Plugin Type: producer (art v2_10_03)
4
// File: WaveformDump_module.cc
5
////////////////////////////////////////////////////////////////////////
6
7
#include "
art/Framework/Core/EDAnalyzer.h
"
8
#include "
art/Framework/Core/ModuleMacros.h
"
9
#include "
art/Framework/Principal/Event.h
"
10
#include "
art/Framework/Principal/Handle.h
"
11
#include "
art/Framework/Principal/Run.h
"
12
#include "
art/Framework/Principal/SubRun.h
"
13
#include "
art/Utilities/make_tool.h
"
14
#include "
canvas/Utilities/InputTag.h
"
15
#include "
fhiclcpp/ParameterSet.h
"
16
#include "
messagefacility/MessageLogger/MessageLogger.h
"
17
18
#include "
larcore/Geometry/Geometry.h
"
19
#include "
lardataobj/RawData/RawDigit.h
"
20
21
#include <memory>
22
#include <fstream>
23
24
class
WaveformDump
;
25
26
27
class
WaveformDump
:
public
art::EDAnalyzer
{
28
public
:
29
explicit
WaveformDump
(
fhicl::ParameterSet
const
&
p
);
30
// The compiler-generated destructor is fine for non-base
31
// classes without bare pointers or other resource use.
32
33
// Plugins should not be copied or assigned.
34
WaveformDump
(
WaveformDump
const
&) =
delete
;
35
WaveformDump
(
WaveformDump
&&) =
delete
;
36
WaveformDump
&
operator =
(
WaveformDump
const
&) =
delete
;
37
WaveformDump
&
operator =
(
WaveformDump
&&) =
delete
;
38
39
// Required functions.
40
void
analyze
(
art::Event
const
&
e
)
override
;
41
42
private
:
43
// The module name of the raw digits we're reading in
44
std::string
m_inputTag
;
45
std::string
m_outputFilename
;
46
std::ofstream
m_outputFile
;
47
};
48
49
50
WaveformDump::WaveformDump
(
fhicl::ParameterSet
const
&
p
)
51
:
EDAnalyzer
(p),
52
m_inputTag
(p.
get
<
std
::
string
>(
"InputTag"
,
"daq"
)),
53
m_outputFilename
(p.
get
<
std
::
string
>(
"OutputFile"
)),
54
m_outputFile
(
m_outputFilename
)
55
{
56
}
57
58
void
WaveformDump::analyze
(
art::Event
const
&
e
)
59
{
60
auto
const
& digits_handle=e.
getValidHandle
<std::vector<raw::RawDigit>>(
m_inputTag
);
61
auto
& digits_in =*digits_handle;
62
63
art::ServiceHandle<geo::Geometry>
geo
;
64
for
(
auto
&& digit: digits_in){
65
bool
isCollection=geo->
SignalType
(digit.Channel())==
geo::kCollection
;
66
m_outputFile
<< e.
event
() <<
" "
67
<< digit.Channel() <<
" "
68
<< isCollection <<
" "
;
69
for
(
auto
const
&
adc
: digit.ADCs()){
70
m_outputFile
<<
adc
<<
" "
;
71
}
72
m_outputFile
<<
std::endl
;
73
}
74
}
75
76
DEFINE_ART_MODULE
(
WaveformDump
)
art::ServiceHandle< geo::Geometry >
art::DataViewImpl::event
EventNumber_t event() const
Definition:
DataViewImpl.cc:85
Handle.h
WaveformDump::analyze
void analyze(art::Event const &e) override
Definition:
WaveformDump_module.cc:58
string
std::string string
Definition:
nybbler.cc:12
WaveformDump::m_inputTag
std::string m_inputTag
Definition:
WaveformDump_module.cc:44
adc
int16_t adc
Definition:
CRTFragment.hh:202
std
STL namespace.
geo::GeometryCore::SignalType
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
Definition:
GeometryCore.cxx:578
art::EDAnalyzer::EDAnalyzer
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition:
EDAnalyzer.h:25
Geometry.h
art framework interface to geometry description
MessageLogger.h
ParameterSet.h
e
const double e
Definition:
gUpMuFluxGen.cxx:165
DEFINE_ART_MODULE
#define DEFINE_ART_MODULE(klass)
Definition:
ModuleMacros.h:67
art::DataViewImpl::getValidHandle
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Definition:
DataViewImpl.h:441
test.p
p
Definition:
test.py:223
SubRun.h
EDAnalyzer.h
ModuleMacros.h
make_tool.h
art::Event
Definition:
Event.h:22
WaveformDump::operator=
WaveformDump & operator=(WaveformDump const &)=delete
art::EDAnalyzer
Definition:
EDAnalyzer.h:20
WaveformDump::m_outputFile
std::ofstream m_outputFile
Definition:
WaveformDump_module.cc:46
InputTag.h
WaveformDump::WaveformDump
WaveformDump(fhicl::ParameterSet const &p)
Definition:
WaveformDump_module.cc:50
RawDigit.h
Event.h
art::get
auto const & get(AssnsNode< L, R, D > const &r)
Definition:
AssnsNode.h:115
geo
LArSoft geometry interface.
Definition:
ChannelGeo.h:16
Run.h
WaveformDump
Definition:
WaveformDump_module.cc:27
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
WaveformDump::m_outputFilename
std::string m_outputFilename
Definition:
WaveformDump_module.cc:45
geo::kCollection
Signal from collection planes.
Definition:
geo_types.h:146
fhicl::ParameterSet
Definition:
ParameterSet.h:36
Generated by
1.8.11