39 produces< std::vector<recob::Event> >();
40 produces< art::Assns<recob::Event, recob::Vertex> >();
41 produces< art::Assns<recob::Event, recob::Hit> >();
55 std::unique_ptr< std::vector<recob::Event> > eventcol(
new std::vector<recob::Event>);
66 std::vector< art::Ptr<recob::Vertex> > vtxs;
74 eventcol->push_back(evt);
80 std::vector< art::Ptr<recob::Hit> >
hits = fmhv.at(0);
83 e.
put(std::move(eventcol));
84 e.
put(std::move(ehassn));
85 e.
put(std::move(evassn));
96 std::vector< art::Ptr<recob::Vertex> >
::iterator itr = vtxs.begin();
97 std::vector< art::Ptr<recob::Vertex> >
::iterator itr2 = vtxs.begin();
100 std::map<art::Ptr<recob::Vertex>,
size_t> ptrToIdx;
101 for(
size_t v = 0; v < vtxs.size(); ++v) ptrToIdx[ vtxs[v] ] = v;
103 while( itr != vtxs.end() ){
111 double curxyz[3] = {0.};
116 itr2 = vtxs.erase(itr);
117 while( itr2 != vtxs.end() ){
121 double nextxyz[3] = {0.};
122 nexvtx->
XYZ(nextxyz);
123 if( std::sqrt((curxyz[0]-nextxyz[0])*(curxyz[0]-nextxyz[0]) +
124 (curxyz[1]-nextxyz[1])*(curxyz[1]-nextxyz[1]) +
125 (curxyz[2]-nextxyz[2])*(curxyz[2]-nextxyz[2]) ) <=
fProximity){
129 itr2 = vtxs.erase(itr2);
136 eventcol->push_back(evt);
142 for(
size_t p = 0; p < vtxVec.
size(); ++p){
143 std::vector< art::Ptr<recob::Hit> >
hits = fmhv.at( ptrToIdx[ vtxVec[p] ] );
153 e.
put(std::move(eventcol));
154 e.
put(std::move(ehassn));
155 e.
put(std::move(evassn));
void XYZ(double *xyz) const
Legacy method to access vertex position, preserved to avoid breaking code. Please try to use Vertex::...
double fProximity
how close a vertex needs to be to another to be from the same event
Declaration of signal hit object.
virtual void reconfigure(fhicl::ParameterSet const &p)
ProductID put(std::unique_ptr< PROD > &&product)
std::string fVertexModuleLabel
label of the module making the recob::Vertex objects
#define DEFINE_ART_MODULE(klass)
void push_back(Ptr< U > const &p)
T get(std::string const &key) const
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.
virtual void produce(art::Event &e)
Utility object to perform functions of association.
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Event finding and building.
EventMaker(fhicl::ParameterSet const &p)