Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
protoduneana
protoduneana
Utilities
ProtoDUNEBeamTPCRecoEfficiency_module.cc
Go to the documentation of this file.
1
// leigh.howard.whitehead@cern.ch
2
// A simple module to determine the efficiency of reconstructing
3
// a beam particle using Pandora in events with a beam trigger
4
5
#include <iostream>
6
#include <utility>
7
#include <set>
8
9
#include "
art/Framework/Core/EDAnalyzer.h
"
10
#include "
art/Framework/Core/ModuleMacros.h
"
11
#include "
art/Framework/Principal/Event.h
"
12
13
#include "dune/Protodune/singlephase/DataUtils/ProtoDUNEDataUtils.h"
14
#include "
protoduneana/Utilities/ProtoDUNEPFParticleUtils.h
"
15
#include "
lardataobj/RawData/RDTimeStamp.h
"
16
#include "dune/Protodune/singlephase/CTB/data/pdspctb.h"
17
18
namespace
protoana
{
19
20
class
ProtoDUNEBeamTPCRecoEfficiency
:
public
art::EDAnalyzer
{
21
public
:
22
explicit
ProtoDUNEBeamTPCRecoEfficiency
(
fhicl::ParameterSet
const
& pset);
23
virtual
~ProtoDUNEBeamTPCRecoEfficiency
() {};
24
void
analyze
(
art::Event
const
&
evt
)
override
;
25
virtual
void
endJob
()
override
;
26
private
:
27
std::string
fParticleLabel
;
28
unsigned
int
fBeamTriggers
;
29
unsigned
int
fBeamParticles
;
30
31
ProtoDUNEDataUtils
fDataUtils
;
32
};
33
34
ProtoDUNEBeamTPCRecoEfficiency::ProtoDUNEBeamTPCRecoEfficiency
(
fhicl::ParameterSet
const
& pset):
35
EDAnalyzer
(pset),
36
fDataUtils
(pset.
get
<
fhicl
::ParameterSet>(
"DataUtils"
))
37
{
38
fParticleLabel
= pset.
get
<
std::string
>(
"ParticleLabel"
);
39
fBeamTriggers
= 0;
40
fBeamParticles
= 0;
41
}
42
43
void
ProtoDUNEBeamTPCRecoEfficiency::analyze
(
art::Event
const
&
evt
) {
44
45
ProtoDUNEPFParticleUtils
pfpUtil;
46
47
// Is this event from a beam trigger?
48
if
(
fDataUtils
.
IsBeamTrigger
(evt)){
49
++
fBeamTriggers
;
50
}
51
52
// Do we have a reconstructed beam slice from Pandora?
53
if
(pfpUtil.
GetBeamSlice
(evt,
fParticleLabel
) != 9999){
54
++
fBeamParticles
;
55
}
56
57
}
58
59
void
ProtoDUNEBeamTPCRecoEfficiency::endJob
(){
60
std::cout <<
"Beam triggered particle reconstruction efficiency = "
<<
fBeamParticles
/
static_cast<
float
>
(
fBeamTriggers
)
61
<<
" ("
<<
fBeamParticles
<<
"/"
<<
fBeamTriggers
<<
")"
<<
std::endl
;
62
}
63
64
DEFINE_ART_MODULE
(
ProtoDUNEBeamTPCRecoEfficiency
)
65
66
}
protoana::ProtoDUNEDataUtils
Definition:
ProtoDUNEDataUtils.h:21
RDTimeStamp.h
protoana::ProtoDUNEBeamTPCRecoEfficiency::endJob
virtual void endJob() override
Definition:
ProtoDUNEBeamTPCRecoEfficiency_module.cc:59
string
std::string string
Definition:
nybbler.cc:12
protoana::ProtoDUNEBeamTPCRecoEfficiency::fBeamTriggers
unsigned int fBeamTriggers
Definition:
ProtoDUNEBeamTPCRecoEfficiency_module.cc:28
protoana::ProtoDUNEBeamTPCRecoEfficiency::fBeamParticles
unsigned int fBeamParticles
Definition:
ProtoDUNEBeamTPCRecoEfficiency_module.cc:29
protoana::ProtoDUNEBeamTPCRecoEfficiency
Definition:
ProtoDUNEBeamTPCRecoEfficiency_module.cc:20
protoana::ProtoDUNEBeamTPCRecoEfficiency::fParticleLabel
std::string fParticleLabel
Definition:
ProtoDUNEBeamTPCRecoEfficiency_module.cc:27
art::EDAnalyzer::EDAnalyzer
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition:
EDAnalyzer.h:25
DEFINE_ART_MODULE
#define DEFINE_ART_MODULE(klass)
Definition:
ModuleMacros.h:67
protoana
Definition:
ProtoDUNEDataUtils.h:19
protoana::ProtoDUNEBeamTPCRecoEfficiency::ProtoDUNEBeamTPCRecoEfficiency
ProtoDUNEBeamTPCRecoEfficiency(fhicl::ParameterSet const &pset)
Definition:
ProtoDUNEBeamTPCRecoEfficiency_module.cc:34
protoana::ProtoDUNEPFParticleUtils::GetBeamSlice
unsigned short GetBeamSlice(art::Event const &evt, const std::string particleLabel) const
Try to get the slice tagged as beam. Returns 9999 if no beam slice was found.
Definition:
ProtoDUNEPFParticleUtils.cxx:130
fhicl
Definition:
InputSourceFactory.h:7
fhicl::ParameterSet::get
T get(std::string const &key) const
Definition:
ParameterSet.h:271
ProtoDUNEPFParticleUtils.h
protoana::ProtoDUNEPFParticleUtils
Definition:
ProtoDUNEPFParticleUtils.h:30
EDAnalyzer.h
ModuleMacros.h
protoana::ProtoDUNEBeamTPCRecoEfficiency::analyze
void analyze(art::Event const &evt) override
Definition:
ProtoDUNEBeamTPCRecoEfficiency_module.cc:43
art::Event
Definition:
Event.h:22
protoana::ProtoDUNEBeamTPCRecoEfficiency::fDataUtils
ProtoDUNEDataUtils fDataUtils
Definition:
ProtoDUNEBeamTPCRecoEfficiency_module.cc:31
art::EDAnalyzer
Definition:
EDAnalyzer.h:20
tca::evt
TCEvent evt
Definition:
DataStructs.cxx:7
Event.h
art::get
auto const & get(AssnsNode< L, R, D > const &r)
Definition:
AssnsNode.h:115
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
protoana::ProtoDUNEDataUtils::IsBeamTrigger
bool IsBeamTrigger(art::Event const &evt) const
Definition:
ProtoDUNEDataUtils.cxx:27
fhicl::ParameterSet
Definition:
ParameterSet.h:36
protoana::ProtoDUNEBeamTPCRecoEfficiency::~ProtoDUNEBeamTPCRecoEfficiency
virtual ~ProtoDUNEBeamTPCRecoEfficiency()
Definition:
ProtoDUNEBeamTPCRecoEfficiency_module.cc:23
Generated by
1.8.11