LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ICVNMapper.cxx
Go to the documentation of this file.
2 
3 namespace lcvn {
4 
5  template <class T, class U>
7  : EDProducer{pset}
8  , fHitsModuleLabel(pset.get<std::string>("HitsModuleLabel"))
9  , fClusterPMLabel(pset.get<std::string>("ClusterPMLabel"))
10  , fMinClusterHits(pset.get<unsigned short>("MinClusterHits"))
11  , fProducer(pset.get<fhicl::ParameterSet>("PixelMapProducer"))
12  {
13 
14  produces<std::vector<lcvn::PixelMap>>(fClusterPMLabel);
15  }
16 
17  //......................................................................
18  template <class T, class U>
20  {
21 
22  std::vector<art::Ptr<U>> hitlist;
23  auto hitListHandle = evt.getHandle<std::vector<U>>(fHitsModuleLabel);
24  if (hitListHandle) art::fill_ptr_vector(hitlist, hitListHandle);
25 
26  //Declaring containers for things to be stored in event
27  std::unique_ptr<std::vector<lcvn::PixelMap>> pmCol(new std::vector<lcvn::PixelMap>);
28 
29  auto const detProp =
31  PixelMap pm = fProducer.CreateMap(detProp, hitlist);
32  auto nhits = fProducer.NROI();
33  pm.SetTotHits(nhits);
34 
35  if (nhits > fMinClusterHits) pmCol->push_back(pm);
36 
37  evt.put(std::move(pmCol), fClusterPMLabel);
38  }
39 
40 } //namespace lcvn
void produce(art::Event &evt)
Definition: ICVNMapper.cxx:19
void SetTotHits(unsigned int tothits)
Definition: PixelMap.h:62
PixelMap, basic input to CVN neural net.
Definition: PixelMap.h:20
Utility class for truth labels.
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: Event.h:77
std::string fHitsModuleLabel
Module lablel for input clusters.
Definition: ICVNMapper.h:44
std::string fClusterPMLabel
Instance lablel for cluster pixelmaps.
Definition: ICVNMapper.h:47
Handle< PROD > getHandle(SelectorBase const &) const
unsigned short fMinClusterHits
Minimum number of hits for cluster to be converted to pixel map.
Definition: ICVNMapper.h:50
ICVNMapper(fhicl::ParameterSet const &pset)
Definition: ICVNMapper.cxx:6
TCEvent evt
Definition: DataStructs.cxx:8
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:306
T fProducer
PixelMapProducer does the work for us.
Definition: ICVNMapper.h:53