10 #include "art/Utilities/ToolMacros.h"
17 namespace ShowerRecoTools {
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"))
60 mf::LogError(
"ShowerLengthPercentile") <<
"Start position not set, returning " << std::endl;
64 TVector3 ShowerStartPosition = {-999, -999, -999};
68 auto const pfpHandle = Event.getValidHandle<std::vector<recob::PFParticle>>(
fPFParticleLabel);
71 const art::FindManyP<recob::SpacePoint>& fmspp =
75 std::vector<art::Ptr<recob::SpacePoint>> spacePoints = fmspp.at(pfparticle.key());
76 if (spacePoints.empty()) {
78 mf::LogError(
"ShowerLengthPercentile") <<
"No Spacepoints, returning" << std::endl;
84 mf::LogError(
"ShowerLengthPercentile") <<
"Direction not set, returning " << std::endl;
88 TVector3 ShowerDirection = {-999, -999, -999};
93 spacePoints, ShowerStartPosition, ShowerDirection);
100 spacePoints[lengthIter], ShowerStartPosition, ShowerDirection);
102 spacePoints[spacePoints.size() - 1], ShowerStartPosition, ShowerDirection);
104 double ShowerLengthError = ShowerMaxProjection - ShowerLength;
108 spacePoints, ShowerStartPosition, ShowerDirection);
115 spacePoints[perpIter], ShowerStartPosition, ShowerDirection);
119 double ShowerAngle = std::atan(ShowerWidth / ShowerLength);
120 double ShowerAngleError = -999;
void OrderShowerSpacePointsPerpendicular(std::vector< art::Ptr< recob::SpacePoint >> &showersps, TVector3 const &vertex, TVector3 const &direction) const
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
void OrderShowerSpacePoints(std::vector< art::Ptr< recob::SpacePoint >> &showersps, TVector3 const &vertex, TVector3 const &direction) const
void SetElement(T &dataproduct, const std::string &Name, bool checktag=false)
const art::FindManyP< T1 > & GetFindManyP(const art::ValidHandle< std::vector< T2 > > &handle, const art::Event &evt, const art::InputTag &moduleTag)
bool CheckElement(const std::string &Name) const
double SpacePointProjection(art::Ptr< recob::SpacePoint > const &sp, TVector3 const &vertex, TVector3 const &direction) const
int GetElement(const std::string &Name, T &Element) const
double SpacePointPerpendicular(art::Ptr< recob::SpacePoint > const &sp, TVector3 const &vertex, TVector3 const &direction) const