103 std::vector<art::Ptr<recob::Hit>> hits_to_save;
114 double x = xin * gser.WireToCm();
115 double x1 = x1in * gser.WireToCm();
116 double y = yin * gser.TimeToCm();
117 double y1 = y1in * gser.TimeToCm();
121 if ((x - x1) != 0) lslope = (y - y1) / (x - x1);
123 for (
size_t imod = 0; imod < recoOpt->
fHitLabels.size(); ++imod) {
126 std::vector<art::Ptr<recob::Hit>> hitlist;
130 for (
unsigned int ii = 0; ii < HitListHandle->size(); ++ii) {
132 if (
hit->WireID().Plane == plane) hitlist.push_back(
hit);
137 std::vector<util::PxHit> pxhitlist;
139 std::vector<unsigned int> pxhitlist_local_index;
140 std::vector<util::PxHit> pxhitlist_local;
141 pxhitlist_local.clear();
144 startHit.
plane = pxhitlist.at(0).plane;
145 startHit.
w = (x +
x1) / 2;
146 startHit.
t = (y + y1) / 2;
148 double orttemp =
std::hypot(y1 - y, x1 - x) / 2;
150 gser.SelectLocalHitlistIndex(
151 pxhitlist, pxhitlist_local_index, startHit, orttemp,
distance, lslope);
153 for (
unsigned int idx = 0; idx < pxhitlist_local_index.size(); idx++) {
154 hits_to_save.push_back(hitlist.at(pxhitlist_local_index.at(idx)));
155 pxhitlist_local.push_back(pxhitlist.at(pxhitlist_local_index.at(idx)));
158 auto const hit_index = gser.FindClosestHitIndex(pxhitlist_local, x, y);
void SetTestFlag(int value)
geo::WireID WireID() const
WireID_t Wire
Index of the wire within its plane.
void SetStartHitCoords(unsigned int plane, std::vector< double > starthitin)
std::enable_if_t< std::is_arithmetic_v< T >, T > hypot(T x, T y)
std::vector< std::vector< double > > starthitout
void GeneratePxHit(const std::vector< unsigned int > &hit_index, const std::vector< art::Ptr< recob::Hit >> hits, std::vector< PxHit > &pxhits) const
Generate: from 1 set of hits => 1 set of PxHits using indexes (association)
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
void SetHitList(unsigned int p, std::vector< art::Ptr< recob::Hit > > hits_to_save)
double distance(double x1, double y1, double z1, double x2, double y2, double z2)
Detector simulation of raw signals on wires.
void SetEvtNumber(int value)
float PeakTime() const
Time of the signal peak, in tick units.
EventNumber_t event() const
void SetEndHitCoords(unsigned int plane, std::vector< double > endhitin)
2D representation of charge deposited in the TDC/wire plane
std::vector< art::InputTag > fHitLabels
module labels that produced hits
std::vector< std::vector< double > > endhitout
LArSoft geometry interface.