Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
protoduneana
protoduneana
Utilities
FakePedestal_module.cc
Go to the documentation of this file.
1
////////////////////////////////////////////////////////////////////////
2
// Class: FakePedestal
3
// Plugin Type: analyzer (art v2_10_03)
4
// File: FakePedestal_module.cc
5
//
6
// Produce fake pedestal values to test database interface
7
//
8
// Generated at Fri Mar 9 22:58:52 2018 by Tingjun Yang using cetskelgen
9
// from cetlib version v3_02_00.
10
////////////////////////////////////////////////////////////////////////
11
12
#include "
art/Framework/Core/EDAnalyzer.h
"
13
#include "
art/Framework/Core/ModuleMacros.h
"
14
#include "
art/Framework/Principal/Event.h
"
15
#include "
art/Framework/Principal/Handle.h
"
16
#include "
art/Framework/Principal/Run.h
"
17
#include "
art/Framework/Principal/SubRun.h
"
18
#include "
canvas/Utilities/InputTag.h
"
19
#include "
fhiclcpp/ParameterSet.h
"
20
#include "
messagefacility/MessageLogger/MessageLogger.h
"
21
22
#include "
larcore/Geometry/Geometry.h
"
23
#include "
larevt/CalibrationDBI/Interface/DetPedestalService.h
"
24
#include "
larevt/CalibrationDBI/Interface/DetPedestalProvider.h
"
25
26
#include <fstream>
27
28
namespace
pdune
{
29
class
FakePedestal;
30
}
31
32
33
class
pdune::FakePedestal
:
public
art::EDAnalyzer
{
34
public
:
35
explicit
FakePedestal
(
fhicl::ParameterSet
const
&
p
);
36
// The compiler-generated destructor is fine for non-base
37
// classes without bare pointers or other resource use.
38
39
// Plugins should not be copied or assigned.
40
FakePedestal
(
FakePedestal
const
&) =
delete
;
41
FakePedestal
(
FakePedestal
&&) =
delete
;
42
FakePedestal
&
operator =
(
FakePedestal
const
&) =
delete
;
43
FakePedestal
&
operator =
(
FakePedestal
&&) =
delete
;
44
45
// Required functions.
46
void
analyze
(
art::Event
const
&
e
)
override
;
47
48
private
:
49
50
// Declare member data here.
51
const
lariov::DetPedestalProvider
&
m_PedestalProvider
;
52
};
53
54
55
pdune::FakePedestal::FakePedestal
(
fhicl::ParameterSet
const
&
p
)
56
:
57
EDAnalyzer
(p),
58
m_PedestalProvider
(
art
::ServiceHandle<
lariov
::DetPedestalService>()->GetPedestalProvider())
59
{}
60
61
void
pdune::FakePedestal::analyze
(
art::Event
const
&
e
)
62
{
63
std::ofstream
outfile
(
"pdune_fakeped.txt"
);
64
auto
const
* geom = lar::providerFrom<geo::Geometry>();
65
for
(
size_t
chan = 0; chan < geom->Nchannels(); ++chan){
66
float
ped_mean =
m_PedestalProvider
.
PedMean
(chan);
67
float
ped_rms =
m_PedestalProvider
.
PedRms
(chan);
68
float
ped_meanerr =
m_PedestalProvider
.
PedMeanErr
(chan);
69
float
ped_rmserr =
m_PedestalProvider
.
PedRmsErr
(chan);
70
outfile<<chan<<
" "
<<ped_mean<<
" "
<<ped_rms<<
" "
<<ped_meanerr<<
" "
<<ped_rmserr<<
std::endl
;
71
}
72
outfile.close();
73
}
74
75
DEFINE_ART_MODULE
(
pdune::FakePedestal
)
lariov::DetPedestalProvider::PedRms
virtual float PedRms(raw::ChannelID_t ch) const =0
pdune
Definition:
DataDump_module.cc:31
Handle.h
DetPedestalProvider.h
art::EDAnalyzer::EDAnalyzer
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition:
EDAnalyzer.h:25
make_norm_csv.outfile
outfile
Definition:
make_norm_csv.py:55
Geometry.h
art framework interface to geometry description
DetPedestalService.h
MessageLogger.h
ParameterSet.h
lariov::DetPedestalProvider::PedMeanErr
virtual float PedMeanErr(raw::ChannelID_t ch) const =0
e
const double e
Definition:
gUpMuFluxGen.cxx:165
DEFINE_ART_MODULE
#define DEFINE_ART_MODULE(klass)
Definition:
ModuleMacros.h:67
pdune::FakePedestal
Definition:
FakePedestal_module.cc:33
test.p
p
Definition:
test.py:223
SubRun.h
EDAnalyzer.h
ModuleMacros.h
lariov
Filters for channels, events, etc.
Definition:
ChannelStatusServiceTool.h:19
pdune::FakePedestal::FakePedestal
FakePedestal(fhicl::ParameterSet const &p)
Definition:
FakePedestal_module.cc:55
art::Event
Definition:
Event.h:22
art::EDAnalyzer
Definition:
EDAnalyzer.h:20
lariov::DetPedestalProvider::PedMean
virtual float PedMean(raw::ChannelID_t ch) const =0
Retrieve pedestal information.
art
Definition:
BasicOptionsHandler.h:9
InputTag.h
lariov::DetPedestalProvider
Definition:
DetPedestalProvider.h:25
Event.h
pdune::FakePedestal::operator=
FakePedestal & operator=(FakePedestal const &)=delete
lariov::DetPedestalProvider::PedRmsErr
virtual float PedRmsErr(raw::ChannelID_t ch) const =0
Run.h
pdune::FakePedestal::m_PedestalProvider
const lariov::DetPedestalProvider & m_PedestalProvider
Definition:
FakePedestal_module.cc:51
pdune::FakePedestal::analyze
void analyze(art::Event const &e) override
Definition:
FakePedestal_module.cc:61
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
fhicl::ParameterSet
Definition:
ParameterSet.h:36
Generated by
1.8.11