25 void WriteMsg(
const char* fcn)
50 std::vector<util::PxLine> seedlines,
56 std::map<int, std::vector<art::Ptr<recob::Hit>>> hits_to_save;
58 double KineticEnergy = 0;
61 for (
size_t imod = 0; imod < recoOpt->
fHitLabels.size(); ++imod) {
68 it != hits_to_save.end();
102 std::vector<art::Ptr<recob::Hit>> hits_to_save;
113 double x = xin * gser.WireToCm();
114 double x1 = x1in * gser.WireToCm();
115 double y = yin * gser.TimeToCm();
116 double y1 = y1in * gser.TimeToCm();
120 if ((x - x1) != 0) lslope = (y -
y1) / (x - x1);
122 for (
size_t imod = 0; imod < recoOpt->
fHitLabels.size(); ++imod) {
125 std::vector<art::Ptr<recob::Hit>> hitlist;
129 for (
unsigned int ii = 0; ii < HitListHandle->size(); ++ii) {
131 if (hit->
WireID().
Plane == plane) hitlist.push_back(hit);
136 std::vector<util::PxHit> pxhitlist;
138 std::vector<unsigned int> pxhitlist_local_index;
139 std::vector<util::PxHit> pxhitlist_local;
140 pxhitlist_local.clear();
143 startHit.
plane = pxhitlist.at(0).plane;
144 startHit.
w = (x +
x1) / 2;
145 startHit.
t = (y +
y1) / 2;
147 double orttemp = std::hypot(y1 - y, x1 - x) / 2;
149 gser.SelectLocalHitlistIndex(
150 pxhitlist, pxhitlist_local_index, startHit, orttemp, distance, lslope);
152 for (
unsigned int idx = 0; idx < pxhitlist_local_index.size(); idx++) {
153 hits_to_save.push_back(hitlist.at(pxhitlist_local_index.at(idx)));
154 pxhitlist_local.push_back(pxhitlist.at(pxhitlist_local_index.at(idx)));
157 auto const hit_index = gser.FindClosestHitIndex(pxhitlist_local, x, y);
197 std::vector<art::Ptr<recob::Hit>> hits_saved;
198 std::vector<art::Ptr<recob::Hit>> hitlist;
200 double x = xin * gser.WireToCm();
201 double y = yin * gser.TimeToCm();
205 for (
size_t imod = 0; imod < recoOpt->
fHitLabels.size(); ++imod) {
209 for (
unsigned int ii = 0; ii < HitListHandle->size(); ++ii) {
211 if (hit->
WireID().
Plane == plane) hitlist.push_back(hit);
215 std::vector<util::PxHit> pxhitlist;
218 unsigned int hitindex = gser.FindClosestHitIndex(pxhitlist, x, y);
219 if (hitlist[hitindex].isNull() || (hitindex > hitlist.size())) {
220 WriteMsg(
"no luck finding hit in evd, please try again");
227 for (
unsigned int jj = 0; jj < hits_saved.size(); ++jj) {
228 if (hitlist[hitindex]->PeakTime() == hits_saved[jj]->PeakTime()) {
229 if (hitlist[hitindex]->Channel() == hits_saved[jj]->Channel()) {
231 hits_saved.erase(hits_saved.begin() + jj);
237 if (found_it != 1) { hits_saved.push_back(hitlist[hitindex]); }
262 std::vector<art::Ptr<recob::Hit>> hits_saved;
263 std::vector<const recob::Hit*> hits_to_draw;
268 for (
unsigned int i = 0; i < hits_saved.size(); i++)
269 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)
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
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
art framework interface to geometry description
std::vector< recob::Seed > & SeedVector()