76 fMinHits = pset.get<
unsigned int>(
"MinHits");
79 produces<std::vector<art::PtrVector<recob::SpacePoint>>>();
80 produces<std::vector<recob::SpacePoint>>();
81 produces<art::Assns<recob::SpacePoint, recob::Hit>>();
82 if (fClusterAssns) produces<art::Assns<recob::SpacePoint, recob::Cluster>>();
85 <<
"SpacePointCheater configured with the following parameters:\n" 87 <<
" Minimum Hits per Cluster = " << fMinHits <<
"\n" 117 auto sptvecs = std::make_unique<std::vector<art::PtrVector<recob::SpacePoint>>>();
118 auto spts = std::make_unique<std::vector<recob::SpacePoint>>();
119 auto sphitassn = std::make_unique<art::Assns<recob::SpacePoint, recob::Hit>>();
120 auto spclassn = std::make_unique<art::Assns<recob::SpacePoint, recob::Cluster>>();
130 auto const clockData =
135 int nclus = clusterh->size();
136 for (
int iclus = 0; iclus < nclus; ++iclus) {
140 std::vector<art::Ptr<recob::Hit>> ihits = fm.at(iclus);
150 unsigned int nihits = ihits.size();
152 hits.reserve(nihits);
160 for (
int jclus = 0; jclus < iclus; ++jclus) {
164 std::vector<art::Ptr<recob::Hit>> jhits = fm.at(jclus);
176 unsigned int njhits = jhits.size();
177 assert(hits.size() >= nihits);
179 while (hits.size() > nihits)
181 assert(hits.size() == nihits);
182 hits.reserve(nihits + njhits);
191 std::vector<recob::SpacePoint> new_spts;
196 if (new_spts.size() > 0) {
205 int nspt = spts->size();
206 spts->insert(spts->end(), new_spts.begin(), new_spts.end());
211 for (
unsigned int ispt = nspt; ispt < spts->size(); ++ispt) {
224 sptvecs->push_back(sptvec);
230 for (
int kclus = 0; kclus < jclus; ++kclus) {
234 std::vector<art::Ptr<recob::Hit>> khits = fm.at(kclus);
242 kview != iview && kview != jview) {
246 unsigned int nkhits = khits.size();
247 assert(hits.size() >= nihits + njhits);
249 while (hits.size() > nihits + njhits)
251 assert(hits.size() == nihits + njhits);
252 hits.reserve(nihits + njhits + nkhits);
260 std::vector<recob::SpacePoint> new_spts;
265 if (new_spts.size() > 0) {
275 int nspt = spts->size();
276 spts->insert(spts->end(), new_spts.begin(), new_spts.end());
281 for (
unsigned int ispt = nspt; ispt < spts->size(); ++ispt) {
294 sptvecs->push_back(sptvec);
305 evt.
put(std::move(spts));
306 evt.
put(std::move(sptvecs));
307 evt.
put(std::move(sphitassn));
319 <<
"SpacePointCheater statistics:\n" 320 <<
" Number of events = " <<
fNumEvent <<
"\n" 321 <<
" Number of 2-view space points created = " <<
fNumSpt2 <<
"\n" 322 <<
" Number of 3-view space points created = " <<
fNumSpt3;
void reserve(size_type n)
bool enableW() const noexcept
bool enableV() const noexcept
std::string fClusterModuleLabel
ProductID getProductID(std::string const &instance_name="") const
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
Declaration of signal hit object.
EDProducer(fhicl::ParameterSet const &pset)
Planes which measure Z direction.
int minViews() const noexcept
const art::PtrVector< recob::Hit > & getAssociatedHits(const recob::SpacePoint &spt) const
void makeMCTruthSpacePoints(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const art::PtrVector< recob::Hit > &hits, std::vector< recob::SpacePoint > &spts) const
bool isValid() const noexcept
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
EDProductGetter const * productGetter(ProductID const pid) const
#define DEFINE_ART_MODULE(klass)
void push_back(Ptr< U > const &p)
Declaration of cluster object.
bool CreateAssn(art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t index=UINT_MAX)
Creates a single one-to-one association.
geo::View_t View() const
Returns the view for this cluster.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Utility object to perform functions of association.
bool enableU() const noexcept
SpacePointCheater(fhicl::ParameterSet const &pset)
Algorithm for generating space points from hits.
art framework interface to geometry description
void produce(art::Event &evt) override