60 TVector3 ShowerCentre = {-999, -999, -999};
65 mf::LogError(
"ShowerPCAPropergationStartPosition")
66 <<
"Start position not set, returning " << std::endl;
71 mf::LogError(
"ShowerPCAPropergationStartPosition")
72 <<
"Direction not set, returning " << std::endl;
77 auto const clockData =
78 art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(Event);
80 art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(Event, clockData);
83 auto const pfpHandle = Event.getValidHandle<std::vector<recob::PFParticle>>(
fPFParticleLabel);
85 const art::FindManyP<recob::SpacePoint>& fmspp =
89 auto const spHandle = Event.getValidHandle<std::vector<recob::SpacePoint>>(
fPFParticleLabel);
91 const art::FindManyP<recob::Hit>& fmh =
95 std::vector<art::Ptr<recob::SpacePoint>> spacePoints_pfp = fmspp.at(pfparticle.key());
98 if (spacePoints_pfp.empty())
return 1;
102 clockData,
detProp, spacePoints_pfp, fmh);
108 TVector3 ShowerStartPosition = {-999, -999, -999};
111 TVector3 ShowerDirection = {-999, -999, -999};
115 double projection = ShowerDirection.Dot(ShowerStartPosition - ShowerCentre);
118 TVector3 ShowerNewStartPosition = projection * ShowerDirection + ShowerCentre;
119 TVector3 ShowerNewStartPositionErr = {-999, -999, -999};
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
int GetElement(const std::string &Name, T &Element) const
TVector3 ShowerCentre(std::vector< art::Ptr< recob::SpacePoint >> const &showersps) const
2D representation of charge deposited in the TDC/wire plane