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

Public Member Functions

 TTSpacePointFinder (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)
 
void beginRun (art::Run &run)
 

Private Attributes

std::string fHitModuleLabel
 
std::string fUHitsInstanceLabel
 Input hit module name. More...
 
std::string fVHitsInstanceLabel
 Input U hits instance name. More...
 
std::string fYHitsInstanceLabel
 Input V hits instance name. More...
 
SpacePointAlg_TimeSort fSpptAlg
 Input Y hits instance name. 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 37 of file TTSpacePointFinder_module.cc.

Constructor & Destructor Documentation

sppt::TTSpacePointFinder::TTSpacePointFinder ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 54 of file TTSpacePointFinder_module.cc.

55  : EDProducer{pset}, fSpptAlg(pset.get<fhicl::ParameterSet>("SpacePointAlgParams"))
56  {
57  fHitModuleLabel = pset.get<std::string>("HitModuleLabel", "tthit");
58  fUHitsInstanceLabel = pset.get<std::string>("UHitsInstaceLabel", "uhits");
59  fVHitsInstanceLabel = pset.get<std::string>("VHitsInstaceLabel", "vhits");
60  fYHitsInstanceLabel = pset.get<std::string>("YHitsInstaceLabel", "yhits");
61 
62  produces<std::vector<recob::SpacePoint>>();
63  produces<art::Assns<recob::SpacePoint, recob::Hit>>();
64  }
std::string string
Definition: nybbler.cc:12
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
std::string fYHitsInstanceLabel
Input V hits instance name.
std::string fVHitsInstanceLabel
Input U hits instance name.
std::string fUHitsInstanceLabel
Input hit module name.
SpacePointAlg_TimeSort fSpptAlg
Input Y hits instance name.

Member Function Documentation

void sppt::TTSpacePointFinder::beginRun ( art::Run run)
privatevirtual

Reimplemented from art::EDProducer.

Definition at line 68 of file TTSpacePointFinder_module.cc.

69  {
70  auto const detProp =
72  fSpptAlg.setTimeOffsets(detProp);
74  }
void setTimeOffsets(detinfo::DetectorPropertiesData const &detProp)
SpacePointAlg_TimeSort fSpptAlg
Input Y hits instance name.
void sppt::TTSpacePointFinder::produce ( art::Event evt)
privatevirtual

Implements art::EDProducer.

Definition at line 78 of file TTSpacePointFinder_module.cc.

79  {
80  //initialize our spacepoint collection
81  auto spptCollection = std::make_unique<std::vector<recob::SpacePoint>>();
82  auto spptAssociatedHits = std::make_unique<std::vector<std::vector<art::Ptr<recob::Hit>>>>();
83 
84  // Read in the hits. Note, we will reorder hit vector, so we do in fact need a copy.
87  std::vector<art::Ptr<recob::Hit>> hitVec_U;
88  art::fill_ptr_vector(hitVec_U, hitHandle_U);
89 
92  std::vector<art::Ptr<recob::Hit>> hitVec_V;
93  art::fill_ptr_vector(hitVec_V, hitHandle_V);
94 
97  std::vector<art::Ptr<recob::Hit>> hitVec_Y;
98  art::fill_ptr_vector(hitVec_Y, hitHandle_Y);
99 
100  MF_LOG_DEBUG("TTSpacePointFinder") << "Got handles to hits:\n"
101  << hitVec_U.size() << " u hits, " << hitVec_V.size()
102  << " v hits, " << hitVec_Y.size() << " y hits.";
103 
104  auto const detProp =
107  detProp, hitVec_U, hitVec_V, hitVec_Y, spptCollection, spptAssociatedHits);
108 
109  mf::LogInfo("TTSpacePointFinder")
110  << "Finished spacepoint alg. Created " << spptCollection->size() << " spacepoints.";
111 
112  //check that spptCollection and spptAssociatedHits have same size
113  if (spptCollection->size() != spptAssociatedHits->size()) {
114  mf::LogError("TTSpacePointFinder")
115  << "ERROR in space point alg.\n"
116  << "Spacepoint and associated hit collections have different sizes!\n"
117  << spptCollection->size() << " != " << spptAssociatedHits->size()
118  << "\nWill return with no space points put on event.";
119  return;
120  }
121 
122  //Now, need to fill in the sppt<-->hit associations
123  std::unique_ptr<art::Assns<recob::SpacePoint, recob::Hit>> spptAssns(
125  for (unsigned int isppt = 0; isppt < spptCollection->size(); isppt++) {
126  util::CreateAssn(evt, *spptCollection, spptAssociatedHits->at(isppt), *spptAssns, isppt);
127  }
128 
129  //finally, put things on the event
130  evt.put(std::move(spptCollection));
131  evt.put(std::move(spptAssns));
132 
133  } // End of produce()
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Definition: DataViewImpl.h:633
def move(depos, offset)
Definition: depos.py:107
std::string fYHitsInstanceLabel
Input V hits instance name.
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.
std::string fVHitsInstanceLabel
Input U hits instance name.
#define MF_LOG_DEBUG(id)
std::string fUHitsInstanceLabel
Input hit module name.
void createSpacePoints(detinfo::DetectorPropertiesData const &detProp, std::vector< art::Ptr< recob::Hit >> &hitVec_U, std::vector< art::Ptr< recob::Hit >> &hitVec_V, std::vector< art::Ptr< recob::Hit >> &hitVec_Y, std::unique_ptr< std::vector< recob::SpacePoint >> &spptCollection, std::unique_ptr< std::vector< std::vector< art::Ptr< recob::Hit >>>> &spptAssociatedHits)
SpacePointAlg_TimeSort fSpptAlg
Input Y hits instance name.
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:297

Member Data Documentation

std::string sppt::TTSpacePointFinder::fHitModuleLabel
private

Definition at line 45 of file TTSpacePointFinder_module.cc.

SpacePointAlg_TimeSort sppt::TTSpacePointFinder::fSpptAlg
private

Input Y hits instance name.

Definition at line 50 of file TTSpacePointFinder_module.cc.

std::string sppt::TTSpacePointFinder::fUHitsInstanceLabel
private

Input hit module name.

Definition at line 46 of file TTSpacePointFinder_module.cc.

std::string sppt::TTSpacePointFinder::fVHitsInstanceLabel
private

Input U hits instance name.

Definition at line 47 of file TTSpacePointFinder_module.cc.

std::string sppt::TTSpacePointFinder::fYHitsInstanceLabel
private

Input V hits instance name.

Definition at line 48 of file TTSpacePointFinder_module.cc.


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