19 #include "canvas/Persistency/Common/FindOneP.h" 25 #include "cetlib_except/exception.h" 28 #include <boost/test/test_tools.hpp> 65 Comment(
"label of the data product with the cheat tracks")
69 Name(
"expectedCount"),
70 Comment(
"number of expected tracks in the data product")
83 consumes<std::vector<lar::example::CheatTrack>>(
fTrackTag);
84 consumes<art::Assns<lar::example::CheatTrack, simb::MCParticle>>
111 auto const& trackHandle
112 =
event.getValidHandle<std::vector<lar::example::CheatTrack>>(
fTrackTag);
113 auto const&
tracks = *trackHandle;
114 art::FindOneP<simb::MCParticle> trackToPart{ trackHandle,
event,
fTrackTag };
116 std::size_t
const nTracks = tracks.size();
120 for (std::size_t iTrack = 0U; iTrack < nTracks; ++iTrack) {
126 log <<
"[#" << iTrack <<
"] " << track;
128 log <<
" associated to particle:\n " << *partPtr;
131 log <<
" not associated to any particle";
ChannelGroupService::Name Name
DumpCheatTracks(Parameters const &config)
Constructor; see the class documentation for the configuration.
fhicl::Atom< unsigned int > expectedCount
void analyze(art::Event const &event) override
EDAnalyzer(fhicl::ParameterSet const &pset)
Pseudo-track data product for TotallyCheatTracks example.
Pseudo-track object for TotallyCheatTracks example.
#define DEFINE_ART_MODULE(klass)
unsigned int fExpectedCount
Expected number of tracks.
Dumps lar::example::CheatTrack data product and associations.
art::InputTag fTrackTag
Label of the input data product.
Tests for LArSoft examples.
Event finding and building.