43 const fhicl::ParameterSet& pset)
44 :
IShowerTool(pset.get<fhicl::ParameterSet>(
"BaseTools"))
45 , fPFParticleLabel(pset.get<
art::InputTag>(
"PFParticleLabel"))
46 , fVerbose(pset.get<int>(
"Verbose"))
47 , fShowerStartPositionOutputLabel(pset.get<std::string>(
"ShowerStartPositionOutputLabel"))
48 , fShowerCentreInputLabel(pset.get<std::string>(
"ShowerCentreInputLabel"))
49 , fShowerDirectionInputLabel(pset.get<std::string>(
"ShowerDirectionInputLabel"))
50 , fShowerStartPositionInputLabel(pset.get<std::string>(
"ShowerStartPositionInputLabel"))
54 const art::Ptr<recob::PFParticle>& pfparticle,
59 geo::Point_t ShowerCentre = {-999, -999, -999};
64 mf::LogError(
"ShowerPCAPropergationStartPosition")
65 <<
"Start position not set, returning " << std::endl;
70 mf::LogError(
"ShowerPCAPropergationStartPosition")
71 <<
"Direction not set, returning " << std::endl;
76 auto const clockData =
77 art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(Event);
79 art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(Event, clockData);
82 auto const pfpHandle = Event.getValidHandle<std::vector<recob::PFParticle>>(
fPFParticleLabel);
84 const art::FindManyP<recob::SpacePoint>& fmspp =
88 auto const spHandle = Event.getValidHandle<std::vector<recob::SpacePoint>>(
fPFParticleLabel);
90 const art::FindManyP<recob::Hit>& fmh =
94 std::vector<art::Ptr<recob::SpacePoint>> spacePoints_pfp = fmspp.at(pfparticle.key());
97 if (spacePoints_pfp.empty())
return 1;
101 clockData, detProp, spacePoints_pfp, fmh);
107 geo::Point_t ShowerStartPosition = {-999, -999, -999};
110 geo::Vector_t ShowerDirection = {-999, -999, -999};
114 double projection = ShowerDirection.Dot(ShowerStartPosition - ShowerCentre);
117 auto ShowerNewStartPosition = projection * ShowerDirection + ShowerCentre;
118 geo::Point_t ShowerNewStartPositionErr = {-999, -999, -999};