All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
lar::example::tests::DumpCheatTracks Class Reference

Dumps lar::example::CheatTrack data product and associations. More...

Inheritance diagram for lar::example::tests::DumpCheatTracks:

Classes

struct  Config
 

Public Types

using Parameters = art::EDAnalyzer::Table< Config >
 

Public Member Functions

 DumpCheatTracks (Parameters const &config)
 Constructor; see the class documentation for the configuration. More...
 

Private Member Functions

void analyze (art::Event const &event) override
 

Private Attributes

art::InputTag fTrackTag
 Label of the input data product. More...
 
unsigned int fExpectedCount
 Expected number of tracks. More...
 

Detailed Description

Dumps lar::example::CheatTrack data product and associations.

The expectation can be expressed directly as a number of elements in the collection, or indirectly as the requirement that the tested collection has the same size as another one (still of recob::SpacePoint).

Configuration parameters

Definition at line 55 of file DumpCheatTracks_module.cc.

Member Typedef Documentation

Definition at line 75 of file DumpCheatTracks_module.cc.

Constructor & Destructor Documentation

lar::example::tests::DumpCheatTracks::DumpCheatTracks ( Parameters const &  config)
inlineexplicit

Constructor; see the class documentation for the configuration.

Definition at line 78 of file DumpCheatTracks_module.cc.

79  : art::EDAnalyzer(config)
80  , fTrackTag(config().tracks())
81  , fExpectedCount(config().expectedCount())
82  {
83  consumes<std::vector<lar::example::CheatTrack>>(fTrackTag);
84  consumes<art::Assns<lar::example::CheatTrack, simb::MCParticle>>
85  (fTrackTag);
86  }
ClusterModuleLabel join with tracks
unsigned int fExpectedCount
Expected number of tracks.
art::InputTag fTrackTag
Label of the input data product.

Member Function Documentation

void lar::example::tests::DumpCheatTracks::analyze ( art::Event const &  event)
overrideprivate

Definition at line 106 of file DumpCheatTracks_module.cc.

106  {
107 
108  //
109  // read the input
110  //
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 };
115 
116  std::size_t const nTracks = tracks.size();
117  BOOST_TEST(nTracks == fExpectedCount);
118 
119 
120  for (std::size_t iTrack = 0U; iTrack < nTracks; ++iTrack) {
121 
122  lar::example::CheatTrack const& track = tracks[iTrack];
123  art::Ptr<simb::MCParticle> const& partPtr = trackToPart.at(iTrack);
124 
125  mf::LogVerbatim log("DumpCheatTracks");
126  log << "[#" << iTrack << "] " << track;
127  if (partPtr) {
128  log << " associated to particle:\n " << *partPtr;
129  }
130  else {
131  log << " not associated to any particle";
132  }
133 
134  } // for (iTrack)
135 
136 } // lar::example::tests::DumpCheatTracks::analyze()
ClusterModuleLabel join with tracks
process_name use argoneut_mc_hitfinder track
Pseudo-track object for TotallyCheatTracks example.
Definition: CheatTrack.h:52
unsigned int fExpectedCount
Expected number of tracks.
art::InputTag fTrackTag
Label of the input data product.

Member Data Documentation

unsigned int lar::example::tests::DumpCheatTracks::fExpectedCount
private

Expected number of tracks.

Definition at line 92 of file DumpCheatTracks_module.cc.

art::InputTag lar::example::tests::DumpCheatTracks::fTrackTag
private

Label of the input data product.

Definition at line 91 of file DumpCheatTracks_module.cc.


The documentation for this class was generated from the following file: