280 art::ServiceHandle<geo::Geometry const> geom;
281 auto const clock_data =
282 art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(
evt);
284 art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(
evt, clock_data);
287 art::Handle<std::vector<recob::Track>> trackListHandle;
288 std::vector<art::Ptr<recob::Track>> tracklist;
290 art::fill_ptr_vector(tracklist, trackListHandle);
293 art::Handle<std::vector<recob::Shower>> showerListHandle;
294 std::vector<art::Ptr<recob::Shower>> showerlist;
296 art::fill_ptr_vector(showerlist, showerListHandle);
299 art::Handle<std::vector<recob::Hit>> hitListHandle;
300 std::vector<art::Ptr<recob::Hit>> hitlist;
301 if (
evt.getByLabel(
fHitsModuleLabel, hitListHandle)) art::fill_ptr_vector(hitlist, hitListHandle);
304 art::Handle<std::vector<recob::OpFlash>> flashListHandle;
305 std::vector<art::Ptr<recob::OpFlash>> flashlist;
307 art::fill_ptr_vector(flashlist, flashListHandle);
311 std::unique_ptr<std::vector<anab::T0>> T0col(
new std::vector<anab::T0>);
312 std::unique_ptr<art::Assns<recob::Track, anab::T0>> Trackassn(
313 new art::Assns<recob::Track, anab::T0>);
314 std::unique_ptr<art::Assns<recob::Shower, anab::T0>> Showerassn(
315 new art::Assns<recob::Shower, anab::T0>);
317 if (trackListHandle.isValid() && flashListHandle.isValid()) {
322 size_t NTracks = tracklist.size();
323 size_t NFlashes = flashlist.size();
326 std::cout <<
"There were " << NTracks <<
" tracks and " << NFlashes
327 <<
" flashes in this event." << std::endl;
330 for (
size_t iTrk = 0; iTrk < NTracks; ++iTrk) {
335 bool ValidTrack =
false;
339 std::tie(trackStart, trackEnd) = tracklist[iTrk]->Extent();
340 std::vector<art::Ptr<recob::Hit>> allHits = fmtht.at(iTrk);
341 size_t nHits = allHits.size();
343 clock_data.TPCClock().Frequency();
345 allHits[0]->PeakTime() / clock_data.TPCClock().Frequency();
367 << TrackCentre_X <<
"\n"
368 << trackStart.Y() <<
" " << trackEnd.Y() <<
" " <<
TrackLength_Y <<
" "
369 << TrackCentre_Y <<
"\n"
370 << trackStart.Z() <<
" " << trackEnd.Z() <<
" " <<
TrackLength_Z <<
" "
371 << TrackCentre_Z <<
"\n"
372 << trkTimeStart <<
" " << trkTimeEnd <<
" " << trkTimeLengh <<
" "
373 << trkTimeCentre << std::endl;
376 for (
size_t iFlash = 0; iFlash < NFlashes; ++iFlash) {
384 if (TimeSep < 0 || TimeSep > (
fDriftWindowSize / clock_data.TPCClock().Frequency()))
388 if (flashlist[iFlash]->TotalPE() <
fPEThreshold)
continue;
398 for (
size_t Point = 1;
Point < tracklist[iTrk]->NumberTrajectoryPoints(); ++
Point) {
399 auto NewPoint = tracklist[iTrk]->LocationAtPoint(
Point);
400 auto PrevPoint = tracklist[iTrk]->LocationAtPoint(
Point - 1);
405 flashlist[iFlash]->YCenter(),
406 flashlist[iFlash]->ZCenter());
454 if (fmtruth.isValid()) {
455 std::vector<const anab::T0*> T0s = fmtruth.at((
int)iTrk);
456 for (
size_t i = 0; i < T0s.size(); ++i) {
472 evt.put(std::move(T0col));
473 evt.put(std::move(Trackassn));
474 evt.put(std::move(Showerassn));
std::string fShowerModuleLabel
std::string fFlashModuleLabel
double DistFromPoint(double StartY, double EndY, double StartZ, double EndZ, double PointY, double PointZ)
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
double fPredictedXConstant
void TrackProp(double TrackStart_X, double TrackEnd_X, double &TrackLength_X, double &TrackCentre_X, double TrackStart_Y, double TrackEnd_Y, double &TrackLength_Y, double &TrackCentre_Y, double TrackStart_Z, double TrackEnd_Z, double &TrackLength_Z, double &TrackCentre_Z, double trkTimeStart, double trkTimeEnd, double &trkTimeLengh, double &trkTimeCentre, double &TrackLength)
double fPredictedExpGradient
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.
std::string fTruthT0ModuleLabel
tracking::Point_t Point_t
double fPredictedExpConstant
std::string fTrackModuleLabel
BEGIN_PROLOG could also be cout
std::string fHitsModuleLabel