93 produces<std::vector<recob::Cluster>>();
94 produces<std::vector<recob::Vertex>>();
95 produces<std::vector<recob::EndPoint2D>>();
96 produces<art::Assns<recob::Cluster, recob::Hit>>();
97 produces<art::Assns<recob::Cluster, recob::Vertex, unsigned short>>();
98 produces<art::Assns<recob::Cluster, recob::EndPoint2D, unsigned short>>();
111 auto const clock_data =
113 auto const det_prop =
123 std::vector<recob::Cluster> sccol;
124 std::vector<recob::Vertex> sv3col;
125 std::vector<recob::EndPoint2D> sv2col;
127 std::unique_ptr<art::Assns<recob::Cluster, recob::Hit>> hc_assn(
129 std::unique_ptr<art::Assns<recob::Cluster, recob::Vertex, unsigned short>> cv_assn(
131 std::unique_ptr<art::Assns<recob::Cluster, recob::EndPoint2D, unsigned short>> cep_assn(
134 std::vector<ClusterCrawlerAlg::ClusterStore>
const& Clusters =
fCCAlg.
GetClusters();
162 std::vector<unsigned int> indxToIndx(EndPts.size());
164 unsigned short vtxID = 0,
end, wire, ivx;
165 for (ivx = 0; ivx < EndPts.size(); ++ivx) {
166 if (EndPts[ivx].NClusters == 0)
continue;
167 indxToIndx[ivx] = vtxID;
170 wire = (0.5 + EndPts[ivx].Wire);
174 sv2col.emplace_back((
double)EndPts[ivx].Time,
182 std::unique_ptr<std::vector<recob::EndPoint2D>> v2col(
183 new std::vector<recob::EndPoint2D>(
std::move(sv2col)));
186 std::vector<ClusterCrawlerAlg::Vtx3Store>
const& Vertices =
fCCAlg.
GetVertices();
187 double xyz[3] = {0, 0, 0};
191 if (vtx3.Ptr2D[0] < 0)
continue;
192 if (vtx3.Ptr2D[1] < 0)
continue;
193 if (vtx3.Ptr2D[2] < 0)
continue;
198 sv3col.emplace_back(xyz, vtxID);
201 std::unique_ptr<std::vector<recob::Vertex>> v3col(
202 new std::vector<recob::Vertex>(
std::move(sv3col)));
205 float sumChg, sumADC;
206 unsigned int clsID = 0, nclhits;
207 for (
unsigned int icl = 0; icl < Clusters.size(); ++icl) {
209 if (clstr.
ID < 0)
continue;
214 unsigned short plane = planeID.
Plane;
215 nclhits = clstr.
tclhits.size();
216 std::vector<unsigned int> clsHitIndices;
218 for (
unsigned int itt = 0; itt < nclhits; ++itt) {
219 unsigned int iht = clstr.
tclhits[itt];
225 unsigned int iht = clstr.
tclhits[0];
228 sccol.emplace_back((
float)clstr.
BeginWir,
256 *
this, evt, *hc_assn, sccol.size() - 1, clstr.
tclhits.begin(), clstr.
tclhits.end())) {
258 <<
"Failed to associate hit " << iht <<
" with cluster " << icl;
266 <<
"Failed to associate cluster " << clsID <<
" with EndPoint2D " << clstr.
BeginVtx;
269 unsigned short vtxIndex = 0;
272 if (vtx3.Ptr2D[0] < 0)
continue;
273 if (vtx3.Ptr2D[1] < 0)
continue;
274 if (vtx3.Ptr2D[2] < 0)
continue;
275 if (vtx3.Ptr2D[plane] == clstr.
BeginVtx) {
278 <<
"Failed to associate cluster " << icl <<
" with vertex";
290 <<
"Failed to associate cluster " << clsID <<
" with EndPoint2D " << clstr.
BeginVtx;
293 unsigned short vtxIndex = 0;
296 if (vtx3.Ptr2D[0] < 0)
continue;
297 if (vtx3.Ptr2D[1] < 0)
continue;
298 if (vtx3.Ptr2D[2] < 0)
continue;
299 if (vtx3.Ptr2D[plane] == clstr.
EndVtx) {
302 <<
"Failed to associate cluster " << icl <<
" with endpoint";
312 std::unique_ptr<std::vector<recob::Cluster>> ccol(
313 new std::vector<recob::Cluster>(
std::move(sccol)));
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
void produce(art::Event &evt) override
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
EDProducer(fhicl::ParameterSet const &pset)
The data type to uniquely identify a Plane.
std::vector< ClusterStore > const & GetClusters() const
Returns a constant reference to the clusters found.
CryostatID_t Cryostat
Index of cryostat.
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.
struct of temporary 3D vertices
static void declare_products(art::ProducesCollector &collector, 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)
Helper functions to create a hit.
std::vector< recob::Hit > && YieldHits()
Returns (and loses) the collection of reconstructed hits.
std::vector< VtxStore > const & GetEndPoints() const
Returns a constant reference to the 2D end points found.
void use_hits(std::unique_ptr< std::vector< recob::Hit >> &&srchits)
Uses the specified collection as data product.
#define DEFINE_ART_MODULE(klass)
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
void put_into(art::Event &)
Moves the data into the event.
bool CreateAssnD(PRODUCER const &prod, art::Event &evt, art::Assns< T, U, D > &assn, size_t first_index, size_t second_index, typename art::Assns< T, U, D >::data_t &&data)
Creates a single one-to-one association with associated data.
art::InputTag fHitFinderLabel
label of module producing input hits
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
A class handling a collection of hits and its associations.
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
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.
PlaneID_t Plane
Index of the plane within its TPC.
Definition of data types for geometry description.
Detector simulation of raw signals on wires.
ProducesCollector & producesCollector() noexcept
Produces clusters by ClusterCrawler algorithm.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Declaration of signal hit object.
std::vector< Vtx3Store > const & GetVertices() const
Returns a constant reference to the 3D vertices found.
std::vector< unsigned int > tclhits
void RunCrawler(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, std::vector< recob::Hit > const &srchits)
float SummedADC() const
The sum of calibrated ADC counts of the hit (0. by default)
LineCluster(fhicl::ParameterSet const &pset)
2D representation of charge deposited in the TDC/wire plane
TPCID_t TPC
Index of the TPC within its cryostat.