LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
FilterNoMCParticles_module.cc
Go to the documentation of this file.
1
9
#include "
art/Framework/Core/ModuleMacros.h
"
10
#include "
art/Framework/Core/SharedFilter.h
"
11
#include "
art/Framework/Principal/Event.h
"
12
#include "
art/Framework/Principal/Handle.h
"
13
#include "
fhiclcpp/ParameterSet.h
"
14
15
// LArSoft Includes
16
#include "
nusimdata/SimulationBase/MCParticle.h
"
17
18
#include <vector>
19
21
namespace
simfilter
{
22
23
class
FilterNoMCParticles
:
public
art::SharedFilter
{
24
public
:
25
explicit
FilterNoMCParticles
(
fhicl::ParameterSet
const
& pset,
art::ProcessingFrame
const
&);
26
27
private
:
28
bool
filter
(
art::Event
&,
art::ProcessingFrame
const
&)
override
;
29
std::string
const
fLArG4ModuleLabel
;
30
};
31
32
}
// namespace simfilter
33
34
namespace
simfilter
{
35
36
//-----------------------------------------------------------------------
37
// Constructor
38
FilterNoMCParticles::FilterNoMCParticles
(
fhicl::ParameterSet
const
& pset,
39
art::ProcessingFrame
const
&)
40
:
SharedFilter
{pset},
fLArG4ModuleLabel
{pset.get<std::string>(
"LArG4ModuleLabel"
,
"NoLabel"
)}
41
{
42
async<art::InEvent>();
43
}
44
45
//-----------------------------------------------------------------------
46
bool
FilterNoMCParticles::filter
(
art::Event
&
evt
,
art::ProcessingFrame
const
&)
47
{
48
auto
const
& mcps = *evt.
getValidHandle
<std::vector<simb::MCParticle>>(
fLArG4ModuleLabel
);
49
return
not mcps.empty();
50
}
51
52
}
// namespace simfilter
53
54
DEFINE_ART_MODULE
(
simfilter::FilterNoMCParticles
)
art::SharedFilter
Definition:
SharedFilter.h:17
SharedFilter.h
art::SharedFilter::SharedFilter
SharedFilter(fhicl::ParameterSet const &pset)
Definition:
SharedFilter.cc:6
MCParticle.h
Particle class.
simfilter::FilterNoMCParticles::fLArG4ModuleLabel
std::string const fLArG4ModuleLabel
Definition:
FilterNoMCParticles_module.cc:29
Handle.h
simfilter::FilterNoMCParticles::filter
bool filter(art::Event &, art::ProcessingFrame const &) override
Definition:
FilterNoMCParticles_module.cc:46
ParameterSet.h
DEFINE_ART_MODULE
#define DEFINE_ART_MODULE(klass)
Definition:
ModuleMacros.h:65
Event.h
art::ProcessingFrame
Definition:
ProcessingFrame.h:8
ModuleMacros.h
simfilter::FilterNoMCParticles::FilterNoMCParticles
FilterNoMCParticles(fhicl::ParameterSet const &pset, art::ProcessingFrame const &)
Definition:
FilterNoMCParticles_module.cc:38
art::Event
Definition:
Event.h:26
art::ProductRetriever::getValidHandle
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Definition:
ProductRetriever.h:268
tca::evt
TCEvent evt
Definition:
DataStructs.cxx:8
simfilter
Framework includes.
Definition:
FilterCryostatNus_module.cc:28
simfilter::FilterNoMCParticles
Definition:
FilterNoMCParticles_module.cc:23
fhicl::ParameterSet
Definition:
ParameterSet.h:36
larsim
v09_43_00
source
larsim
SimFilters
FilterNoMCParticles_module.cc
Generated on Thu May 2 2024 20:59:52 for LArSoft by
1.8.11