Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
larreco
larreco
Calorimetry
PrintCalorimetry_module.cc
Go to the documentation of this file.
1
////////////////////////////////////////////////////////////////////////
2
// Class: PrintCalorimetry
3
// Module Type: analyzer
4
// File: PrintCalorimetry_module.cc
5
//
6
// Generated at Wed Oct 29 10:26:38 2014 by Wesley Ketchum using artmod
7
// from cetpkgsupport v1_07_01.
8
////////////////////////////////////////////////////////////////////////
9
10
#include "
art/Framework/Core/EDAnalyzer.h
"
11
#include "
art/Framework/Core/ModuleMacros.h
"
12
#include "
art/Framework/Principal/Event.h
"
13
#include "
art/Framework/Principal/Handle.h
"
14
#include "canvas/Persistency/Common/FindManyP.h"
15
#include "
fhiclcpp/ParameterSet.h
"
16
17
#include "
lardataobj/RecoBase/Track.h
"
18
#include "
lardataobj/AnalysisBase/Calorimetry.h
"
19
20
namespace
calo
{
21
class
PrintCalorimetry;
22
}
23
24
class
calo::PrintCalorimetry
:
public
art::EDAnalyzer
{
25
public
:
26
explicit
PrintCalorimetry
(
fhicl::ParameterSet
const
&
p
);
27
// The destructor generated by the compiler is fine for classes
28
// without bare pointers or other resource use.
29
30
// Plugins should not be copied or assigned.
31
PrintCalorimetry
(
PrintCalorimetry
const
&) =
delete
;
32
PrintCalorimetry
(
PrintCalorimetry
&&) =
delete
;
33
PrintCalorimetry
&
operator =
(
PrintCalorimetry
const
&) =
delete
;
34
PrintCalorimetry
&
operator =
(
PrintCalorimetry
&&) =
delete
;
35
36
private
:
37
38
// Required functions.
39
void
analyze
(
art::Event
const
&
e
)
override
;
40
41
std::string
fTrackModuleLabel
;
42
std::vector<std::string>
fCaloModuleLabels
;
43
44
};
45
46
47
calo::PrintCalorimetry::PrintCalorimetry
(
fhicl::ParameterSet
const
&
p
)
48
:
49
EDAnalyzer
(p),
50
fTrackModuleLabel
(p.
get
<
std
::
string
>(
"TrackModuleLabel"
)),
51
fCaloModuleLabels
(p.
get
<
std
::
vector
<
std
::
string
> >(
"CaloModuleLabels"
))
52
{}
53
54
void
calo::PrintCalorimetry::analyze
(
art::Event
const
&
e
)
55
{
56
art::Handle< std::vector<recob::Track>
> trackHandle;
57
e.
getByLabel
(
fTrackModuleLabel
,trackHandle);
58
59
std::vector< art::FindManyP<anab::Calorimetry> > caloAssnVector;
//(fCaloModuleLabels.size());
60
61
for
(
size_t
i_cm=0; i_cm<
fCaloModuleLabels
.size(); i_cm++)
62
caloAssnVector.emplace_back(trackHandle,e,
fCaloModuleLabels
[i_cm]);
63
64
for
(
size_t
i_trk=0; i_trk<trackHandle->size(); i_trk++){
65
std::cout <<
"(Run,Event,Track) = ("
<< e.
run
() <<
","
<< e.
event
() <<
","
<< i_trk <<
")"
<<
std::endl
;
66
std::cout <<
"-------------------"
<<
std::endl
;
67
68
for
(
size_t
i_cm=0; i_cm<caloAssnVector.size(); i_cm++){
69
std::cout <<
"Calorimetry module "
<< i_cm <<
std::endl
;
70
for
(
auto
const
& caloptr : caloAssnVector[i_cm].at(i_trk))
71
std::cout << *caloptr << std::endl;
72
}
73
74
}
75
76
}
77
78
DEFINE_ART_MODULE
(
calo::PrintCalorimetry
)
vector
Definition:
lodepng.cpp:52
art::DataViewImpl::event
EventNumber_t event() const
Definition:
DataViewImpl.cc:85
Handle.h
string
std::string string
Definition:
nybbler.cc:12
std
STL namespace.
art::Handle
Definition:
fwd.h:19
art::EDAnalyzer::EDAnalyzer
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition:
EDAnalyzer.h:25
calo::PrintCalorimetry::fTrackModuleLabel
std::string fTrackModuleLabel
Definition:
PrintCalorimetry_module.cc:41
ParameterSet.h
art::DataViewImpl::getByLabel
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Definition:
DataViewImpl.h:633
e
const double e
Definition:
gUpMuFluxGen.cxx:165
DEFINE_ART_MODULE
#define DEFINE_ART_MODULE(klass)
Definition:
ModuleMacros.h:67
test.p
p
Definition:
test.py:223
Calorimetry.h
art::DataViewImpl::run
RunNumber_t run() const
Definition:
DataViewImpl.cc:71
EDAnalyzer.h
ModuleMacros.h
calo::PrintCalorimetry::analyze
void analyze(art::Event const &e) override
Definition:
PrintCalorimetry_module.cc:54
calo::PrintCalorimetry
Definition:
PrintCalorimetry_module.cc:24
calo::PrintCalorimetry::PrintCalorimetry
PrintCalorimetry(fhicl::ParameterSet const &p)
Definition:
PrintCalorimetry_module.cc:47
art::Event
Definition:
Event.h:22
calo::PrintCalorimetry::fCaloModuleLabels
std::vector< std::string > fCaloModuleLabels
Definition:
PrintCalorimetry_module.cc:42
calo::PrintCalorimetry::operator=
PrintCalorimetry & operator=(PrintCalorimetry const &)=delete
art::EDAnalyzer
Definition:
EDAnalyzer.h:20
Track.h
Provides recob::Track data product.
Event.h
art::get
auto const & get(AssnsNode< L, R, D > const &r)
Definition:
AssnsNode.h:115
calo
calorimetry
Definition:
CaloChecker_module.cc:43
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
fhicl::ParameterSet
Definition:
ParameterSet.h:36
Generated by
1.8.11