41 :
IShowerTool(pset.get<fhicl::ParameterSet>(
"BaseTools"))
42 , fPercentile(pset.get<float>(
"Percentile"))
43 , fPFParticleLabel(pset.get<
art::InputTag>(
"PFParticleLabel"))
44 , fVerbose(pset.get<int>(
"Verbose"))
45 , fShowerStartPositionInputLabel(pset.get<std::string>(
"ShowerStartPositionInputLabel"))
46 , fShowerDirectionInputLabel(pset.get<std::string>(
"ShowerDirectionInputLabel"))
47 , fShowerLengthOutputLabel(pset.get<std::string>(
"ShowerLengthOutputLabel"))
48 , fShowerOpeningAngleOutputLabel(pset.get<std::string>(
"ShowerOpeningAngleOutputLabel"))
59 mf::LogError(
"ShowerLengthPercentile") <<
"Start position not set, returning " << std::endl;
63 geo::Point_t ShowerStartPosition = {-999, -999, -999};
67 auto const pfpHandle = Event.getValidHandle<std::vector<recob::PFParticle>>(
fPFParticleLabel);
70 const art::FindManyP<recob::SpacePoint>& fmspp =
74 std::vector<art::Ptr<recob::SpacePoint>> spacePoints = fmspp.at(pfparticle.key());
75 if (spacePoints.empty()) {
77 mf::LogError(
"ShowerLengthPercentile") <<
"No Spacepoints, returning" << std::endl;
83 mf::LogError(
"ShowerLengthPercentile") <<
"Direction not set, returning " << std::endl;
87 geo::Vector_t ShowerDirection = {-999, -999, -999};
92 spacePoints, ShowerStartPosition, ShowerDirection);
99 spacePoints[lengthIter], ShowerStartPosition, ShowerDirection);
101 spacePoints[spacePoints.size() - 1], ShowerStartPosition, ShowerDirection);
103 double ShowerLengthError = ShowerMaxProjection - ShowerLength;
107 spacePoints, ShowerStartPosition, ShowerDirection);
114 spacePoints[perpIter], ShowerStartPosition, ShowerDirection);
118 double ShowerAngle = std::atan(ShowerWidth / ShowerLength);
119 double ShowerAngleError = -999;