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

Public Member Functions

 CVNSparseMapper3D (fhicl::ParameterSet const &pset)
 
 ~CVNSparseMapper3D ()
 
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 fSPModuleLabel
 Module label for reconstructed spacepoints. More...
 
std::string fPixelMapLabel
 Instance label for spacepoint pixelmaps. More...
 
unsigned short fMinSP
 Minimum number of spacepoints to be converted to pixel map. 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 32 of file CVNSparseMapper3D_module.cc.

Constructor & Destructor Documentation

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

Definition at line 54 of file CVNSparseMapper3D_module.cc.

54  : EDProducer{pset},
55  fSPModuleLabel(pset.get<std::string> ("SpacePointModuleLabel")),
56  fPixelMapLabel(pset.get<std::string> ("PixelMapLabel")),
57  fMinSP(pset.get<unsigned short> ("MinSP")),
58  fProducer()
59  {
60  produces< std::vector<cvn::SparsePixelMap> >(fPixelMapLabel);
61  }
std::string string
Definition: nybbler.cc:12
unsigned short fMinSP
Minimum number of spacepoints to be converted to pixel map.
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
PixelMapProducer fProducer
PixelMapProducer does the heavy lifting.
std::string fPixelMapLabel
Instance label for spacepoint pixelmaps.
std::string fSPModuleLabel
Module label for reconstructed spacepoints.
cvn::CVNSparseMapper3D::~CVNSparseMapper3D ( )

Definition at line 64 of file CVNSparseMapper3D_module.cc.

65  {
66  //======================================================================
67  // Clean up any memory allocated by your module
68  //======================================================================
69  }

Member Function Documentation

void cvn::CVNSparseMapper3D::beginJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 72 of file CVNSparseMapper3D_module.cc.

73  {}
void cvn::CVNSparseMapper3D::endJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 76 of file CVNSparseMapper3D_module.cc.

77  {}
void cvn::CVNSparseMapper3D::produce ( art::Event evt)
virtual

Implements art::EDProducer.

Definition at line 80 of file CVNSparseMapper3D_module.cc.

81  {
82  // Get spacepoints from art event record
83  std::vector< art::Ptr< recob::SpacePoint > > splist;
84  auto spListHandle = evt.getHandle< std::vector< recob::SpacePoint > >(fSPModuleLabel);
85  if (spListHandle)
86  art::fill_ptr_vector(splist, spListHandle);
87  unsigned short nsp = splist.size();
88 
89  // Get assocations from spacepoints to hits
90  art::FindManyP<recob::Hit> fmp(spListHandle, evt, fSPModuleLabel);
91  std::vector<std::vector<art::Ptr<recob::Hit>>> sp2Hit(nsp);
92  for (size_t spIdx = 0; spIdx < sp2Hit.size(); ++spIdx) {
93  sp2Hit[spIdx] = fmp.at(spIdx);
94  } // for spacepoint
95 
96  //Declaring containers for things to be stored in event
97  std::unique_ptr< std::vector<cvn::SparsePixelMap> >
98  pmCol(new std::vector<cvn::SparsePixelMap>);
99 
100  if (nsp > fMinSP) {
101  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(evt);
102  SparsePixelMap map = fProducer.CreateSparseMap3D(clockData, splist, sp2Hit);
103  pmCol->push_back(map);
104  mf::LogInfo("CVNSparseMapper3D") << "Created sparse pixel map from "
105  << nsp << " spacepoints and " << map.GetNPixels(0) << " hits.";
106  }
107 
108  evt.put(std::move(pmCol), fPixelMapLabel);
109  }
Handle< PROD > getHandle(SelectorBase const &) const
Definition: DataViewImpl.h:382
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
unsigned short fMinSP
Minimum number of spacepoints to be converted to pixel map.
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.
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:297
SparsePixelMap CreateSparseMap3D(detinfo::DetectorClocksData const &clockData, std::vector< art::Ptr< recob::SpacePoint > > &sp, std::vector< std::vector< art::Ptr< recob::Hit >>> &hit)
std::string fPixelMapLabel
Instance label for spacepoint pixelmaps.
std::string fSPModuleLabel
Module label for reconstructed spacepoints.

Member Data Documentation

unsigned short cvn::CVNSparseMapper3D::fMinSP
private

Minimum number of spacepoints to be converted to pixel map.

Definition at line 46 of file CVNSparseMapper3D_module.cc.

std::string cvn::CVNSparseMapper3D::fPixelMapLabel
private

Instance label for spacepoint pixelmaps.

Definition at line 45 of file CVNSparseMapper3D_module.cc.

PixelMapProducer cvn::CVNSparseMapper3D::fProducer
private

PixelMapProducer does the heavy lifting.

Definition at line 47 of file CVNSparseMapper3D_module.cc.

std::string cvn::CVNSparseMapper3D::fSPModuleLabel
private

Module label for reconstructed spacepoints.

Definition at line 44 of file CVNSparseMapper3D_module.cc.


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