51 fG4ModuleLabel = pset.get<std::string>(
"G4ModuleLabel",
"largeant");
53 produces<std::vector<recob::Event>>();
54 produces<art::Assns<recob::Event, recob::Vertex>>();
55 produces<art::Assns<recob::Event, recob::Hit>>();
69 std::map<int, int> trackIDToPColEntry;
70 for (
size_t p = 0; p < pcol.
vals().size(); ++p)
71 trackIDToPColEntry[pcol.
vals().at(p)->TrackId()] = p;
81 std::vector<art::Ptr<recob::Vertex>> vertices;
85 std::vector<art::Ptr<recob::Vertex>>
::iterator vertexitr = vertices.begin();
88 std::map<art::Ptr<simb::MCTruth>, std::vector<art::Ptr<recob::Vertex>>> vertexMap;
89 std::map<art::Ptr<simb::MCTruth>, std::vector<art::Ptr<recob::Vertex>>>
::iterator vertexMapItr =
93 while (vertexitr != vertices.end()) {
95 size_t pcolEntry = trackIDToPColEntry.find((*vertexitr)->ID())->
second;
98 vertexMap[primary].push_back(*vertexitr);
103 std::unique_ptr<std::vector<recob::Event>> eventcol(
new std::vector<recob::Event>);
104 std::unique_ptr<art::Assns<recob::Event, recob::Vertex>> evassn(
106 std::unique_ptr<art::Assns<recob::Event, recob::Hit>> ehassn(
110 for (vertexMapItr = vertexMap.begin(); vertexMapItr != vertexMap.end(); vertexMapItr++) {
114 std::vector<art::Ptr<recob::Vertex>> verts((*vertexMapItr).second);
117 eventcol->push_back(
recob::Event(eventcol->size() - 1));
123 for (
size_t p = 0; p < ptrvs.
size(); ++p) {
124 std::vector<art::Ptr<recob::Hit>>
hits = fm.at(p);
128 mf::LogInfo(
"EventCheater") <<
"adding event: \n" << eventcol->back() <<
"\nto collection";
132 evt.
put(std::move(eventcol));
133 evt.
put(std::move(evassn));
134 evt.
put(std::move(ehassn));
std::string fCheatedVertexLabel
label for module creating recob::Vertex objects
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
Declaration of signal hit object.
EDProducer(fhicl::ParameterSet const &pset)
void produce(art::Event &evt)
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
#define DEFINE_ART_MODULE(klass)
std::string fG4ModuleLabel
label for module running G4 and making particles, etc
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName, std::vector< ELEMENT const * > &result) const
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.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Utility object to perform functions of association.
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
second_as<> second
Type of time stored in seconds, in double precision.
EventCheater(fhicl::ParameterSet const &pset)
Event finding and building.