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

Public Member Functions

 TCTrack (fhicl::ParameterSet const &pset)
 
- 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 Member Functions

void produce (art::Event &evt) override
 

Private Attributes

SpacePointAlg fSptalg
 
art::InputTag fPFPtag
 

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 TCTrack_module.cc.

Constructor & Destructor Documentation

trkf::TCTrack::TCTrack ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 46 of file TCTrack_module.cc.

47  : EDProducer{pset}
48  , fSptalg{pset.get<fhicl::ParameterSet>("SpacePointAlg")}
49  , fPFPtag{pset.get<std::string>("PFPModuleLabel")}
50  {
51  produces<std::vector<recob::SpacePoint>>();
52  produces<art::Assns<recob::SpacePoint, recob::Hit>>();
53  }
SpacePointAlg fSptalg
std::string string
Definition: nybbler.cc:12
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
art::InputTag fPFPtag

Member Function Documentation

void trkf::TCTrack::produce ( art::Event evt)
overrideprivatevirtual

Implements art::EDProducer.

Definition at line 57 of file TCTrack_module.cc.

58  {
59  // all data products are assumed to be produced by the same module that produced the PFParticles -> TrajCluster_module
60  auto pfpHandle = evt.getValidHandle<std::vector<recob::PFParticle>>(fPFPtag);
61  auto clsHandle = evt.getValidHandle<std::vector<recob::Cluster>>(fPFPtag);
62 
63  art::FindManyP<recob::Cluster> pfp_cls(pfpHandle, evt, fPFPtag);
64  art::FindManyP<recob::Hit> cls_hit(clsHandle, evt, fPFPtag);
65 
66  auto sphitassn = std::make_unique<art::Assns<recob::SpacePoint, recob::Hit>>();
67  auto spts = std::make_unique<std::vector<recob::SpacePoint>>();
68 
69  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(evt);
70  auto const detProp =
72 
74  for (unsigned short ipfp = 0; ipfp < pfpHandle->size(); ++ipfp) {
75  // Get the clusters associated with this PFParticle - there should be one in each plane
76  std::vector<art::Ptr<recob::Cluster>> clsList;
77  pfp_cls.get(ipfp, clsList);
78  hits.clear();
79  std::cout << "PFP " << ipfp << "\n";
80  for (unsigned short icl = 0; icl < clsList.size(); ++icl) {
81  std::vector<art::Ptr<recob::Hit>> hitList;
82  unsigned int clsIndex = clsList[icl]->ID() - 1;
83  cls_hit.get(clsIndex, hitList);
84  std::cout << " cls index " << clsIndex << " hits size " << hitList.size() << " "
85  << (int)clsList[icl]->StartWire() << ":" << (int)clsList[icl]->StartTick()
86  << " EndWire " << (int)clsList[icl]->EndWire() << ":"
87  << (int)clsList[icl]->EndTick() << "\n";
88  hits.reserve(hits.size() + hitList.size());
89  hits.insert(hits.end(), hitList.begin(), hitList.end());
90  } // icl
91  // make new space points using these hits
92  std::vector<recob::SpacePoint> new_spts;
93  fSptalg.makeSpacePoints(clockData, detProp, hits, new_spts);
94  if (new_spts.empty()) continue;
95 
96  int nspt = spts->size();
97  spts->insert(spts->end(), new_spts.begin(), new_spts.end());
98  // associate the hits with the spacepoints
100  for (unsigned int ispt = nspt; ispt < spts->size(); ++ispt) {
101  const recob::SpacePoint& spt = (*spts)[ispt];
103  util::CreateAssn(evt, *spts, hits, *sphitassn, ispt);
104  } // ispt
105  } // ipfp
106 
107  evt.put(std::move(spts));
108  evt.put(std::move(sphitassn));
109 
110  } // TCTrack::produce()
void reserve(size_type n)
Definition: PtrVector.h:337
SpacePointAlg fSptalg
const art::PtrVector< recob::Hit > & getAssociatedHits(const recob::SpacePoint &spt) const
void makeSpacePoints(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const art::PtrVector< recob::Hit > &hits, std::vector< recob::SpacePoint > &spts) const
def move(depos, offset)
Definition: depos.py:107
iterator end()
Definition: PtrVector.h:231
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Definition: DataViewImpl.h:441
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: DataViewImpl.h:686
bool CreateAssn(PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t indx=UINT_MAX)
Creates a single one-to-one association.
size_type size() const
Definition: PtrVector.h:302
iterator insert(iterator position, Ptr< U > const &p)
art::InputTag fPFPtag
void clear()
Definition: PtrVector.h:533

Member Data Documentation

art::InputTag trkf::TCTrack::fPFPtag
private

Definition at line 42 of file TCTrack_module.cc.

SpacePointAlg trkf::TCTrack::fSptalg
private

Definition at line 40 of file TCTrack_module.cc.


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