11 #include "art/Framework/Core/ModuleMacros.h"
30 #include "art/Framework/Core/EDProducer.h"
31 #include "canvas/Persistency/Common/PtrVector.h"
32 #include "canvas/Persistency/Common/Ptr.h"
33 #include "art/Framework/Services/Registry/ServiceHandle.h"
50 #include "art/Framework/Principal/Event.h"
51 #include "fhiclcpp/ParameterSet.h"
102 void GetHitList(
unsigned int plane, art::PtrVector <recob::Hit> &ptrhitlist);
140 fGClAlg(pset.get< fhicl::ParameterSet >(
"GraphClusterAlg"))
142 art::ServiceHandle<geo::Geometry const> geo;
145 produces< std::vector<recob::Cluster> >();
146 produces< art::Assns<recob::Cluster, recob::Hit> >();
147 produces< std::vector < art::PtrVector <recob::Cluster> > >();
150 fNPlanes = geo->Nplanes();
151 starthit.resize(fNPlanes);
152 endhit.resize(fNPlanes);
155 startendpoints.resize(fNPlanes);
170 std::unique_ptr<std::vector<recob::Cluster> > Graphcol(
new std::vector<recob::Cluster>);
171 std::unique_ptr< art::Assns<recob::Cluster, recob::Hit> > hassn(
new art::Assns<recob::Cluster, recob::Hit>);
173 std::unique_ptr< std::vector < art::PtrVector < recob::Cluster > > > classn(
new std::vector < art::PtrVector < recob::Cluster > >);
178 art::ServiceHandle<geo::Geometry const> geo;
187 for(
unsigned int ip=0;ip<
fNPlanes;ip++) {
192 std::vector < art::PtrVector < recob::Hit > > hitlist;
193 hitlist.resize(fNPlanes);
195 for(
unsigned int ip=0;ip<
fNPlanes;ip++) {
201 if(hitlist[ip].
size()==0)
213 double swterror=0.,ewterror=0.;
229 for (art::Ptr<recob::Hit>
const&
hit: hitlist[ip]) {
230 integral.
add(
hit->Integral());
231 summedADC.
add(
hit->SummedADC());
235 geo::PlaneID planeID = hitlist[ip].front()->WireID().planeID();
236 Graphcol->emplace_back(
259 geo->Plane(ip,planeID.
TPC,planeID.
Cryostat).View(),
270 art::PtrVector < recob::Cluster > cvec;
271 cvec.reserve(fNPlanes);
273 for(
unsigned int ip=0;ip<
fNPlanes;ip++) {
274 art::ProductID aid = evt.getProductID< std::vector < recob::Cluster > >();
275 art::Ptr< recob::Cluster > aptr(aid, ip, evt.productGetter(aid));
276 cvec.push_back(aptr);
279 classn->push_back(cvec);
289 evt.put(std::move(Graphcol));
290 evt.put(std::move(hassn));
291 evt.put(std::move(classn));
void GetHitList(unsigned int plane, art::PtrVector< recob::Hit > &ptrhitlist)
Declaration of signal hit object.
The data type to uniquely identify a Plane.
CryostatID_t Cryostat
Index of cryostat.
std::size_t size(FixedBins< T, C > const &) noexcept
Classes gathering simple statistics.
Weight_t RMS() const
Returns the root mean square.
std::vector< recob::Hit * > starthit
static const SentryArgument_t Sentry
An instance of the sentry object.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Weight_t Sum() const
Returns the weighted sum of the values.
int CheckValidity(art::Event &evt)
std::vector< util::PxLine > startendpoints
Declaration of cluster object.
Definition of data types for geometry description.
void GetHitListAndEndPoints(unsigned int plane, art::PtrVector< recob::Hit > &ptrhitlist, util::PxLine &startendpoints)
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.
void produce(art::Event &evt)
Encapsulate the construction of a single detector plane.
GraphCluster(fhicl::ParameterSet const &)
std::vector< recob::Hit * > endhit
std::vector< util::PxLine > GetSeedLines()
2D representation of charge deposited in the TDC/wire plane
TPCID_t TPC
Index of the TPC within its cryostat.
void GetStartEndHits(unsigned int plane, recob::Hit *starthit, recob::Hit *endhit)
Collects statistics on a single quantity (weighted)
art framework interface to geometry description
BEGIN_PROLOG could also be cout
void add(Data_t value, Weight_t weight=Weight_t(1.0))
Adds one entry with specified value and weight.