25 void WriteMsg(
const char* fcn)
58 std::vector< util::PxLine > seedlines,
65 std::map<int, std::vector < art::Ptr < recob::Hit> > > hits_to_save;
67 double KineticEnergy=0;
71 for (
size_t imod = 0; imod < recoOpt->
fHitLabels.size(); ++imod) {
84 for(
unsigned int i=0; i < HitListHandle->size(); ++i)
98 mf::LogVerbatim(
"HitSelector") <<
"One seed defined - splitting in half to make track";
99 double Pt[3], Dir[3], Err[3];
103 double NewPt1[3], NewPt2[3], NewDir[3];
104 for(
int i=0; i!=3; ++i)
106 NewPt1[i] = Pt[i] - Dir[i]/2;
107 NewPt2[i] = Pt[i] + Dir[i]/2;
108 NewDir[i] = Dir[i] / 2;
119 mf::LogWarning(
"HitSelector") <<
"Cannot select hits, no seeds selected!";
128 std::vector<double>
s;
129 std::vector<double>
d;
135 for(
size_t ih=0; ih!=HitVec.
size(); ++ih){
136 if(d.at(ih)<distance){
137 hits_to_save[HitVec.
at(ih)->WireID().Plane].push_back(HitVec.
at(ih));
146 mf::LogVerbatim(
"HitSelector") <<
"Track kinetic energy : " << KineticEnergy;
159 return KineticEnergy;
173 double xin,
double yin,
174 double x1in,
double y1in,
183 std::vector < art::Ptr < recob::Hit> > hits_to_save;
212 lslope=(y-
y1)/(x-x1);
214 for (
size_t imod = 0; imod < recoOpt->
fHitLabels.size(); ++imod) {
217 std::vector<art::Ptr<recob::Hit>> hitlist;
221 for(
unsigned int ii = 0; ii < HitListHandle->size(); ++ii){
224 hitlist.push_back(hit);
230 std::vector <util::PxHit> pxhitlist;
232 std::vector< unsigned int > pxhitlist_local_index;
233 std::vector< util::PxHit > pxhitlist_local;
234 pxhitlist_local.clear();
237 startHit.
plane=pxhitlist.at(0).plane;
243 double orttemp=TMath::Sqrt((y1-y)*(y1-y) + (x1-x)*(x1-x))/2;
251 for(
unsigned int idx=0;idx<pxhitlist_local_index.size();idx++)
253 hits_to_save.push_back(hitlist.at(pxhitlist_local_index.at(idx)));
254 pxhitlist_local.push_back(pxhitlist.at(pxhitlist_local_index.at(idx)));
306 double xin,
double yin
315 std::vector < art::Ptr<recob::Hit> > hits_saved;
316 std::vector < art::Ptr<recob::Hit> > hitlist;
326 for (
size_t imod = 0; imod < recoOpt->
fHitLabels.size(); ++imod) {
330 for(
unsigned int ii = 0; ii < HitListHandle->size(); ++ii){
333 hitlist.push_back(hit);
337 std::vector <util::PxHit> pxhitlist;
361 if(hitlist[hitindex].isNull() || ( hitindex > hitlist.size())){
362 WriteMsg(
"no luck finding hit in evd, please try again");
370 for(
unsigned int jj=0; jj<hits_saved.size(); ++jj){
371 if(hitlist[hitindex]->PeakTime() == hits_saved[jj]->PeakTime()){
372 if(hitlist[hitindex]->Channel() == hits_saved[jj]->Channel()){
374 hits_saved.erase(hits_saved.begin()+jj);
381 hits_saved.push_back(hitlist[hitindex]);
412 std::vector < art::Ptr<recob::Hit> > hits_saved;
416 std::vector< const recob::Hit*> hits_to_draw;
422 for(
unsigned int i=0;i<hits_saved.size();i++)
423 hits_to_draw.push_back(hits_saved[i].get());
void SetTestFlag(int value)
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
Float_t y1[n_points_granero]
std::vector< std::vector< double > > endhitout
void ClearSelectedHitList(int plane)
geo::WireID WireID() const
Initial tdc tick for hit.
Float_t x1[n_points_granero]
Double_t TimeToCm() const
Double_t WireToCm() const
WireID_t Wire
Index of the wire within its plane.
std::vector< std::vector< double > > starthitout
void SetStartHitCoords(unsigned int plane, std::vector< double > starthitin)
std::vector< art::Ptr< recob::Hit > > Hits
int fMakeSeeds
Draw two lines to make clusters if clicked.
void GetClosestApproaches(art::PtrVector< recob::Hit > const &hits, std::vector< double > &s, std::vector< double > &Distances) const
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
void SaveHits(const art::Event &evt, evdb::View2D *view, unsigned int plane, double x, double y, double x1, double y1, double distance, bool good_plane=true)
void ClearHitList(unsigned int plane)
void GeneratePxHit(const std::vector< unsigned int > &hit_index, const std::vector< art::Ptr< recob::Hit >> hits, std::vector< util::PxHit > &pxhits) const
Generate: from 1 set of hits => 1 set of PxHits using indexes (association)
void push_back(Ptr< U > const &p)
Class to perform operations needed to select hits and pass them to a cluster.
void SetHitList(unsigned int p, std::vector< art::Ptr< recob::Hit > > hits_to_save)
std::vector< const recob::Hit * > GetSelectedHits(unsigned int plane)
reference at(size_type n)
PlaneID_t Plane
Index of the plane within its TPC.
std::vector< recob::Seed > fSeedVector
Detector simulation of raw signals on wires.
void SelectLocalHitlistIndex(const std::vector< util::PxHit > &hitlist, std::vector< unsigned int > &hitlistlocal_index, util::PxPoint &startHit, Double_t &linearlimit, Double_t &ortlimit, Double_t &lineslopetest)
double SaveSeedLines(const art::Event &evt, evdb::View2D *view, std::vector< util::PxLine > seedline, double distance)
void SetEvtNumber(int value)
float PeakTime() const
Time of the signal peak, in tick units.
anab::Calorimetry GetCalorimetryObject(std::vector< art::Ptr< recob::Hit > > const &Hits, geo::SigType_t sigtype, calo::CalorimetryAlg const &)
std::vector< art::Ptr< recob::Hit > > GetSelectedHitList(unsigned int plane)
void SetSeedList(std::vector< util::PxLine > seedlines)
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
fhicl::ParameterSet fCaloPSet
const float & KineticEnergy() const
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
Namespace collecting geometry-related classes utilities.
trkf::HitPtrVec GetSelectedHitPtrs(unsigned int plane)
std::vector< recob::Seed > & SeedVector()
Signal from collection planes.
unsigned int FindClosestHitIndex(std::vector< util::PxHit > hitlist, unsigned int wirein, double timein) const
void ChangeHit(const art::Event &evt, evdb::View2D *view, unsigned int plane, double x, double y)