24 void WriteMsg(
const char* fcn)
49 std::vector<util::PxLine> seedlines,
55 std::map<int, std::vector<art::Ptr<recob::Hit>>> hits_to_save;
57 double KineticEnergy = 0;
60 for (
size_t imod = 0; imod < recoOpt->
fHitLabels.size(); ++imod) {
67 it != hits_to_save.end();
100 std::vector<art::Ptr<recob::Hit>> hits_to_save;
111 double x = xin * gser.WireToCm();
112 double x1 = x1in * gser.WireToCm();
113 double y = yin * gser.TimeToCm();
114 double y1 = y1in * gser.TimeToCm();
118 if ((x - x1) != 0) lslope = (y -
y1) / (x - x1);
120 for (
size_t imod = 0; imod < recoOpt->
fHitLabels.size(); ++imod) {
123 std::vector<art::Ptr<recob::Hit>> hitlist;
127 for (
unsigned int ii = 0; ii < HitListHandle->size(); ++ii) {
129 if (hit->
WireID().
Plane == plane) hitlist.push_back(hit);
134 std::vector<util::PxHit> pxhitlist;
136 std::vector<unsigned int> pxhitlist_local_index;
137 std::vector<util::PxHit> pxhitlist_local;
138 pxhitlist_local.clear();
141 startHit.
plane = pxhitlist.at(0).plane;
142 startHit.
w = (x +
x1) / 2;
143 startHit.
t = (y +
y1) / 2;
145 double orttemp = std::hypot(y1 - y, x1 - x) / 2;
147 gser.SelectLocalHitlistIndex(
148 pxhitlist, pxhitlist_local_index, startHit, orttemp, distance, lslope);
150 for (
unsigned int idx = 0; idx < pxhitlist_local_index.size(); idx++) {
151 hits_to_save.push_back(hitlist.at(pxhitlist_local_index.at(idx)));
152 pxhitlist_local.push_back(pxhitlist.at(pxhitlist_local_index.at(idx)));
155 auto const hit_index = gser.FindClosestHitIndex(pxhitlist_local, x, y);
194 std::vector<art::Ptr<recob::Hit>> hits_saved;
195 std::vector<art::Ptr<recob::Hit>> hitlist;
197 double x = xin * gser.WireToCm();
198 double y = yin * gser.TimeToCm();
202 for (
size_t imod = 0; imod < recoOpt->
fHitLabels.size(); ++imod) {
206 for (
unsigned int ii = 0; ii < HitListHandle->size(); ++ii) {
208 if (hit->
WireID().
Plane == plane) hitlist.push_back(hit);
212 std::vector<util::PxHit> pxhitlist;
215 unsigned int hitindex = gser.FindClosestHitIndex(pxhitlist, x, y);
216 if (hitlist[hitindex].isNull() || (hitindex > hitlist.size())) {
217 WriteMsg(
"no luck finding hit in evd, please try again");
224 for (
unsigned int jj = 0; jj < hits_saved.size(); ++jj) {
225 if (hitlist[hitindex]->PeakTime() == hits_saved[jj]->PeakTime()) {
226 if (hitlist[hitindex]->Channel() == hits_saved[jj]->Channel()) {
228 hits_saved.erase(hits_saved.begin() + jj);
234 if (found_it != 1) { hits_saved.push_back(hitlist[hitindex]); }
259 std::vector<art::Ptr<recob::Hit>> hits_saved;
260 std::vector<const recob::Hit*> hits_to_draw;
265 for (
unsigned int i = 0; i < hits_saved.size(); i++)
266 hits_to_draw.push_back(hits_saved[i].get());
void SetTestFlag(int value)
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
std::vector< art::Ptr< recob::Hit > > GetSelectedHitPtrs(unsigned int plane)
void SaveHits(const art::Event &evt, unsigned int plane, double x, double y, double x1, double y1, double distance, bool good_plane=true)
Float_t y1[n_points_granero]
void ClearSelectedHitList(int plane)
Float_t x1[n_points_granero]
void SetHitList(unsigned int p, std::vector< art::Ptr< recob::Hit >> hits_to_save)
WireID_t Wire
Index of the wire within its plane.
geo::WireID const & WireID() const
Initial tdc tick for hit.
void SetStartHitCoords(unsigned int plane, std::vector< double > starthitin)
std::vector< std::vector< double > > starthitout
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
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)
void ClearHitList(unsigned int plane)
Class to perform operations needed to select hits and pass them to a cluster.
std::vector< art::Ptr< recob::Hit > > const & GetSelectedHitList(unsigned int plane) const
std::vector< const recob::Hit * > GetSelectedHits(unsigned int plane)
PlaneID_t Plane
Index of the plane within its TPC.
std::vector< recob::Seed > fSeedVector
Detector simulation of raw signals on wires.
void ChangeHit(const art::Event &evt, unsigned int plane, double x, double y)
void SetEvtNumber(int value)
float PeakTime() const
Time of the signal peak, in tick units.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
void SetSeedList(std::vector< util::PxLine > seedlines)
EventNumber_t event() const
void SetEndHitCoords(unsigned int plane, std::vector< double > endhitin)
double SaveSeedLines(const art::Event &evt, std::vector< util::PxLine > seedline, double distance)
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
Namespace collecting geometry-related classes utilities.
art framework interface to geometry description
std::vector< recob::Seed > & SeedVector()