288 std::vector<art::Ptr<recob::Hit> > hitlist;
295 const sim::ParticleList& plist = pi_serv->
ParticleList();
297 std::vector<const simb::MCParticle * > primaries = plist.GetPrimaries();
298 if (primaries.size() != 1)
return false;
301 if ((firstel->
PdgCode() != 11) && (firstel->
PdgCode() != -11) && (firstel->
PdgCode() != 22))
return false;
303 TLorentzVector startingp = primaries[0]->Position();
304 TVector3 primaryvtx(startingp.X(), startingp.Y(), startingp.Z());
311 startingp = primaries[0]->EndPosition();
312 TVector3 startp(startingp.X(), startingp.Y(), startingp.Z());
320 TLorentzVector mom = primaries[0]->Momentum();
321 TVector3 momvec3(mom.Px(), mom.Py(), mom.Pz());
322 TVector3
dir = momvec3 * (1 / momvec3.Mag());
324 TVector3 firstpoint(startingp.X(), startingp.Y(), startingp.Z());
325 TVector3 secondpoint = firstpoint +
dir;
334 double startvtx[3] = {firstpoint.X(), firstpoint.Y(), firstpoint.Z()};
338 if (!tpcid.
isValid)
return false;
341 size_t tpc = tpcid.
TPC;
344 iniseg->
AddNode(detProp, firstpoint, tpc, cryo);
345 iniseg->
AddNode(detProp, secondpoint, tpc, cryo);
347 for (
size_t h = 0;
h < hitlist.size();
h++)
348 if (hitlist[
h]->
WireID().TPC == tpc)
356 while (hi < iniseg->
size())
369 if (iniseg->
size() < 5)
return false;
373 double maxdist = 0.0;
size_t bestview = 0;
375 for (
size_t view = 0; view < tpcgeo.
Nplanes(); ++view)
377 std::map< size_t, std::vector< double > >
ex;
383 if ((dist > maxdist) && (ex.size() > 0))
395 std::map< size_t, std::vector< double > > dedx;
401 if (v.second[7] < rmin) rmin = v.second[7];
403 double rmax = rmin + 3.0;
406 if (((v.second[7] +
fR1) >
fR0) && (v.second[7] < 15))
409 double range = v.second[7] + (
fR0 -
fR1);
414 if ((v.second[5] > 0) && (v.second[6] > 0))
416 fDedx = v.second[5] / v.second[6];
419 if (v.second[7] < rmax)
422 sumdx += v.second[6];
CryostatGeo const & GetElement(geo::CryostatID const &cryoid) const
double Dist2(const TVector2 &v1, const TVector2 &v2)
Handle< PROD > getHandle(SelectorBase const &) const
unsigned int Nplanes() const
Number of planes in this tpc.
bool isValid
Whether this ID points to a valid element.
Geometry information for a single TPC.
geo::TPCID FindTPCAtPosition(double const worldLoc[3]) const
Returns the ID of the TPC at specified location.
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
void AddNode(pma::Node3D *node)
pma::Hit3D * release_at(size_t index)
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
std::string EndProcess() const
void CorrOffset(detinfo::DetectorPropertiesData const &detProp, TVector3 &vec, const simb::MCParticle &particle)
std::vector< pma::Track3D * > fPmatracks
The data type to uniquely identify a TPC.
float GetSegFraction() const noexcept
const sim::ParticleList & ParticleList() const
size_t CompleteMissingWires(detinfo::DetectorPropertiesData const &detProp, unsigned int view)
void push_back(pma::Hit3D *hit)
double GetRawdEdxSequence(std::map< size_t, std::vector< double >> &dedx, unsigned int view=geo::kZ, unsigned int skip=0, bool inclDisabled=false) const
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
TVector2 GetProjectionToPlane(const TVector3 &p, unsigned int plane, unsigned int tpc, unsigned int cryo)
std::string fHitsModuleLabel
double dEdx_AREA(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, recob::Hit const &hit, double pitch, double T0=0) const
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
TPCID_t TPC
Index of the TPC within its cryostat.
geo::CryostatID::CryostatID_t FindCryostatAtPosition(geo::Point_t const &worldLoc) const
Returns the index of the cryostat at specified location.
bool InsideFidVol(TLorentzVector const &pvtx) const
calo::CalorimetryAlg fCalorimetryAlg