Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
larsim
larsim
ElectronDrift
SimDriftedElectronClusterAna_module.cc
Go to the documentation of this file.
1
////////////////////////////////////////////////////////////////////////
2
// Class: SimDriftedElectronClusterAna
3
// Plugin Type: analyzer (art v2_05_00)
4
// File: DriftedElectronsClustersSAna_module.cc
5
//
6
////////////////////////////////////////////////////////////////////////
7
8
#include "
art/Framework/Core/EDAnalyzer.h
"
9
#include "
art/Framework/Core/ModuleMacros.h
"
10
#include "
art/Framework/Principal/Event.h
"
11
#include "
art/Framework/Principal/Handle.h
"
12
#include "
canvas/Utilities/InputTag.h
"
13
#include "
fhiclcpp/ParameterSet.h
"
14
15
#include "art_root_io/TFileService.h"
16
#include "TNtuple.h"
17
18
19
#include "
lardataobj/Simulation/SimDriftedElectronCluster.h
"
20
21
22
23
namespace
detsim
{
24
25
class
SimDriftedElectronClusterAna
:
public
art::EDAnalyzer
{
26
public
:
27
explicit
SimDriftedElectronClusterAna
(
fhicl::ParameterSet
const
&
p
);
28
// The compiler-generated destructor is fine for non-base
29
// classes without bare pointers or other resource use.
30
31
// Plugins should not be copied or assigned.
32
SimDriftedElectronClusterAna
(
SimDriftedElectronClusterAna
const
&) =
delete
;
33
SimDriftedElectronClusterAna
(
SimDriftedElectronClusterAna
&&) =
delete
;
34
SimDriftedElectronClusterAna
&
operator =
(
SimDriftedElectronClusterAna
const
&) =
delete
;
35
SimDriftedElectronClusterAna
&
operator =
(
SimDriftedElectronClusterAna
&&) =
delete
;
36
37
// Required functions.
38
void
analyze
(
art::Event
const
&
e
)
override
;
39
40
// Selected optional functions.
41
void
beginJob
()
override
;
42
43
private
:
44
45
46
art::InputTag
fEDepTag
;
47
48
TNtuple*
fNtuple
;
49
};
50
51
52
SimDriftedElectronClusterAna:: SimDriftedElectronClusterAna
(
fhicl::ParameterSet
const
&
p
)
53
:
EDAnalyzer
(p)
54
,
fEDepTag
{p.
get
<
art::InputTag
>(
"EDepModuleLabel"
)}
55
{}
56
57
void
SimDriftedElectronClusterAna::analyze
(
art::Event
const
&
e
)
58
{
59
auto
const
& edep_handle = e.
getValidHandle
< std::vector<sim::SimDriftedElectronCluster> >(
fEDepTag
);
60
auto
const
& edep_vec(*edep_handle);
61
std::cout<<
"=====================edep"
<<edep_vec.size()<<
std::endl
;
62
for
(
auto
const
& edep : edep_vec){
63
fNtuple
->Fill(e.
run
(),e.
event
(),
64
edep.NumberOfElectrons(),
65
edep.Time());
66
}
67
}
68
69
void
SimDriftedElectronClusterAna::beginJob
()
70
{
71
art::ServiceHandle<art::TFileService const>
tfs;
72
fNtuple
= tfs->make<TNtuple>(
"nt_is"
,
"EDep IS Calc Ntuple"
,
"run:event:ne:t"
);
73
}
74
}
// namespace detsim
75
76
DEFINE_ART_MODULE
(
detsim::SimDriftedElectronClusterAna
)
art::ServiceHandle< art::TFileService const >
art::DataViewImpl::event
EventNumber_t event() const
Definition:
DataViewImpl.cc:85
detsim::SimDriftedElectronClusterAna
Definition:
SimDriftedElectronClusterAna_module.cc:25
SimDriftedElectronCluster.h
contains objects relating to SimDriftedElectronCluster
Handle.h
detsim
Detector simulation of raw signals on wires.
Definition:
SimWireDUNE10kt_module.cc:60
art::EDAnalyzer::EDAnalyzer
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition:
EDAnalyzer.h:25
detsim::SimDriftedElectronClusterAna::fEDepTag
art::InputTag fEDepTag
Definition:
SimDriftedElectronClusterAna_module.cc:46
ParameterSet.h
detsim::SimDriftedElectronClusterAna::operator=
SimDriftedElectronClusterAna & operator=(SimDriftedElectronClusterAna const &)=delete
e
const double e
Definition:
gUpMuFluxGen.cxx:165
DEFINE_ART_MODULE
#define DEFINE_ART_MODULE(klass)
Definition:
ModuleMacros.h:67
detsim::SimDriftedElectronClusterAna::SimDriftedElectronClusterAna
SimDriftedElectronClusterAna(fhicl::ParameterSet const &p)
Definition:
SimDriftedElectronClusterAna_module.cc:52
fhicl::ParameterSet::get
T get(std::string const &key) const
Definition:
ParameterSet.h:271
detsim::SimDriftedElectronClusterAna::beginJob
void beginJob() override
Definition:
SimDriftedElectronClusterAna_module.cc:69
art::InputTag
Definition:
InputTag.h:12
art::DataViewImpl::getValidHandle
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Definition:
DataViewImpl.h:441
test.p
p
Definition:
test.py:223
art::DataViewImpl::run
RunNumber_t run() const
Definition:
DataViewImpl.cc:71
EDAnalyzer.h
ModuleMacros.h
detsim::SimDriftedElectronClusterAna::analyze
void analyze(art::Event const &e) override
Definition:
SimDriftedElectronClusterAna_module.cc:57
detsim::SimDriftedElectronClusterAna::fNtuple
TNtuple * fNtuple
Definition:
SimDriftedElectronClusterAna_module.cc:48
art::Event
Definition:
Event.h:22
art::EDAnalyzer
Definition:
EDAnalyzer.h:20
InputTag.h
Event.h
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
fhicl::ParameterSet
Definition:
ParameterSet.h:36
Generated by
1.8.11