Public Member Functions | Private Attributes | List of all members
cvn::CVNSparseMapper Class Reference
Inheritance diagram for cvn::CVNSparseMapper:
art::EDProducer art::detail::Producer art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Public Member Functions

 CVNSparseMapper (fhicl::ParameterSet const &pset)
 
 ~CVNSparseMapper ()
 
void produce (art::Event &evt)
 
void beginJob ()
 
void endJob ()
 
- Public Member Functions inherited from art::EDProducer
 EDProducer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDProducer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Producer
virtual ~Producer () noexcept
 
 Producer (fhicl::ParameterSet const &)
 
 Producer (Producer const &)=delete
 
 Producer (Producer &&)=delete
 
Produceroperator= (Producer const &)=delete
 
Produceroperator= (Producer &&)=delete
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
- Public Member Functions inherited from art::Modifier
 ~Modifier () noexcept
 
 Modifier ()
 
 Modifier (Modifier const &)=delete
 
 Modifier (Modifier &&)=delete
 
Modifieroperator= (Modifier const &)=delete
 
Modifieroperator= (Modifier &&)=delete
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Private Attributes

std::string fHitsModuleLabel
 Module label for input clusters. More...
 
std::string fClusterPMLabel
 Instance label for cluster pixelmaps. More...
 
unsigned short fMinClusterHits
 Minimum number of hits for cluster to be converted to pixel map. More...
 
bool fIncludePixelTruth
 Whether to include per-pixel ground truth for segmentation. More...
 
PixelMapProducer fProducer
 PixelMapProducer does the heavy lifting. More...
 

Additional Inherited Members

- Public Types inherited from art::EDProducer
using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
- Public Types inherited from art::detail::Producer
template<typename UserConfig , typename KeysToIgnore = void>
using Table = Modifier::Table< UserConfig, KeysToIgnore >
 
- Public Types inherited from art::Modifier
template<typename UserConfig , typename UserKeysToIgnore = void>
using Table = ProducerTable< UserConfig, detail::ModuleConfig, UserKeysToIgnore >
 
- Static Public Member Functions inherited from art::EDProducer
static void commitEvent (EventPrincipal &ep, Event &e)
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Detailed Description

Definition at line 31 of file CVNSparseMapper_module.cc.

Constructor & Destructor Documentation

cvn::CVNSparseMapper::CVNSparseMapper ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 54 of file CVNSparseMapper_module.cc.

54  : EDProducer{pset},
55  fHitsModuleLabel(pset.get<std::string> ("HitsModuleLabel")),
56  fClusterPMLabel(pset.get<std::string> ("ClusterPMLabel")),
57  fMinClusterHits(pset.get<unsigned short> ("MinClusterHits")),
58  fIncludePixelTruth(pset.get<bool> ("IncludePixelTruth")),
59  fProducer()
60  {
61 
62  produces< std::vector<cvn::SparsePixelMap> >(fClusterPMLabel);
63 
64  }
unsigned short fMinClusterHits
Minimum number of hits for cluster to be converted to pixel map.
std::string string
Definition: nybbler.cc:12
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
std::string fClusterPMLabel
Instance label for cluster pixelmaps.
PixelMapProducer fProducer
PixelMapProducer does the heavy lifting.
std::string fHitsModuleLabel
Module label for input clusters.
bool fIncludePixelTruth
Whether to include per-pixel ground truth for segmentation.
cvn::CVNSparseMapper::~CVNSparseMapper ( )

Definition at line 67 of file CVNSparseMapper_module.cc.

68  {
69  //======================================================================
70  // Clean up any memory allocated by your module
71  //======================================================================
72  }

Member Function Documentation

void cvn::CVNSparseMapper::beginJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 75 of file CVNSparseMapper_module.cc.

76  {}
void cvn::CVNSparseMapper::endJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 79 of file CVNSparseMapper_module.cc.

80  {}
void cvn::CVNSparseMapper::produce ( art::Event evt)
virtual

Implements art::EDProducer.

Definition at line 83 of file CVNSparseMapper_module.cc.

84  {
85  std::vector< art::Ptr< recob::Hit > > hitlist;
86  auto hitListHandle = evt.getHandle< std::vector< recob::Hit > >(fHitsModuleLabel);
87  if (hitListHandle)
88  art::fill_ptr_vector(hitlist, hitListHandle);
89  unsigned short nhits = hitlist.size();
90 
91  //Declaring containers for things to be stored in event
92  std::unique_ptr< std::vector<cvn::SparsePixelMap> >
93  pmCol(new std::vector<cvn::SparsePixelMap>);
94 
95  if (nhits > fMinClusterHits) {
96  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(evt);
97  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(evt, clockData);
98  SparsePixelMap map = fProducer.CreateSparseMap2D(clockData, detProp, hitlist, fIncludePixelTruth);
99  mf::LogInfo("CVNSparseMapper") << "Created sparse pixel map with "
100  << map.GetNPixels(0) << ", " << map.GetNPixels(1) << ", "
101  << map.GetNPixels(2) << " pixels.";
102  pmCol->push_back(map);
103  }
104 
105  evt.put(std::move(pmCol), fClusterPMLabel);
106  }
unsigned short fMinClusterHits
Minimum number of hits for cluster to be converted to pixel map.
Handle< PROD > getHandle(SelectorBase const &) const
Definition: DataViewImpl.h:382
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
std::string fClusterPMLabel
Instance label for cluster pixelmaps.
def move(depos, offset)
Definition: depos.py:107
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: DataViewImpl.h:686
PixelMapProducer fProducer
PixelMapProducer does the heavy lifting.
SparsePixelMap CreateSparseMap2D(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, std::vector< art::Ptr< recob::Hit > > &cluster, bool usePixelTruth=false)
std::string fHitsModuleLabel
Module label for input clusters.
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:297
bool fIncludePixelTruth
Whether to include per-pixel ground truth for segmentation.

Member Data Documentation

std::string cvn::CVNSparseMapper::fClusterPMLabel
private

Instance label for cluster pixelmaps.

Definition at line 44 of file CVNSparseMapper_module.cc.

std::string cvn::CVNSparseMapper::fHitsModuleLabel
private

Module label for input clusters.

Definition at line 43 of file CVNSparseMapper_module.cc.

bool cvn::CVNSparseMapper::fIncludePixelTruth
private

Whether to include per-pixel ground truth for segmentation.

Definition at line 46 of file CVNSparseMapper_module.cc.

unsigned short cvn::CVNSparseMapper::fMinClusterHits
private

Minimum number of hits for cluster to be converted to pixel map.

Definition at line 45 of file CVNSparseMapper_module.cc.

PixelMapProducer cvn::CVNSparseMapper::fProducer
private

PixelMapProducer does the heavy lifting.

Definition at line 47 of file CVNSparseMapper_module.cc.


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