32 class SimpleLineCluster;
53 std::unique_ptr<ClusterCrawlerAlg>
fCCAlg;
74 produces< std::vector<recob::Cluster> >();
75 produces< art::Assns<recob::Cluster, recob::Hit> >();
86 std::vector< art::Ptr<recob::Hit> >
hits;
90 std::vector< art::Ptr<recob::PFParticle> > pfps;
101 std::vector<recob::Hit> allHits;
102 std::vector<ClusterCrawlerAlg::ClusterStore> allClusters;
103 std::vector<unsigned int> clusterhitindex;
105 for (
size_t i = 0; i < pfps.size(); ++i){
106 std::vector<recob::Hit> pfphits;
107 auto& clus_in_pfp = cluFromPfp.at(i);
108 for (
auto& clu : clus_in_pfp){
109 auto& hits_in_clu = hitFromClu.at(clu.key());
110 for (
auto&
hit : hits_in_clu) pfphits.push_back(*
hit);
112 fCCAlg->RunCrawler(pfphits);
115 size_t nhits = allHits.size();
117 allHits.push_back(
hit);
120 auto & Clusters =
fCCAlg->GetClusters();
121 for(
auto &clstr : Clusters){
122 allClusters.push_back(clstr);
123 clusterhitindex.push_back(nhits);
130 std::vector<recob::Cluster> sccol;
132 std::unique_ptr<art::Assns<recob::Cluster, recob::Hit> >
136 float sumChg, sumADC;
137 unsigned int clsID = 0, nclhits;
138 for(
unsigned int icl = 0; icl < allClusters.size(); ++icl) {
140 if(clstr.
ID < 0)
continue;
146 nclhits = clstr.
tclhits.size();
147 std::vector<unsigned int> clsHitIndices;
149 for(
unsigned int itt = 0; itt < nclhits; ++itt) {
150 unsigned int iht = clstr.
tclhits[itt];
156 unsigned int iht = clstr.
tclhits[0];
188 for (
auto & ih : clstr.
tclhits){
189 indices.push_back(ih+clusterhitindex[icl]);
192 *
this, evt, sccol, allHits, *hc_assn, indices)
196 <<
"Failed to associate hit "<<iht<<
" with cluster "<<icl;
201 std::unique_ptr<std::vector<recob::Cluster> > ccol(
new std::vector<recob::Cluster>(std::move(sccol)));
203 std::unique_ptr<std::vector<recob::Hit>> FinalHits
204 (
new std::vector<recob::Hit>(std::move(allHits)));
207 channelHitWires.isValid(),
208 channelHitRawDigits.isValid());
210 shcol.
use_hits(std::move(FinalHits));
214 evt.
put(std::move(ccol));
215 evt.
put(std::move(hc_assn));
art::InputTag fPFParticleLabel
label of module producing input pfparticles
SimpleLineCluster(fhicl::ParameterSet const &p)
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Declaration of signal hit object.
The data type to uniquely identify a Plane.
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
struct of temporary clusters
Cluster finding and building.
static void declare_products(ModuleType &producer, std::string instance_name="", bool doWireAssns=true, bool doRawDigitAssns=true)
Declares the hit products we are going to fill.
static const SentryArgument_t Sentry
An instance of the sentry object.
static geo::PlaneID DecodeCTP(CTP_t CTP)
std::unique_ptr< ClusterCrawlerAlg > fCCAlg
ProductID put(std::unique_ptr< PROD > &&product)
Helper functions to create a hit.
void use_hits(std::unique_ptr< std::vector< recob::Hit >> &&srchits)
Uses the specified collection as data product.
#define DEFINE_ART_MODULE(klass)
SimpleLineCluster & operator=(SimpleLineCluster const &)=delete
T get(std::string const &key) const
constexpr std::array< std::size_t, geo::vect::dimension< Vector >)> indices()
Returns a sequence of indices valid for a vector of the specified type.
A class handling a collection of hits and its associations.
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.
Declaration of cluster object.
Detector simulation of raw signals on wires.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Utility object to perform functions of association.
art::InputTag fHitFinderLabel
label of module producing input hits
std::vector< unsigned int > tclhits
float SummedADC() const
The sum of calibrated ADC counts of the hit (0. by default)
2D representation of charge deposited in the TDC/wire plane
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
void produce(art::Event &e) override