LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
GraphClusterAlg.cxx
Go to the documentation of this file.
1 //
3 // GraphClusterAlg class
4 //
5 // andrzej.szelc@yale.edu
6 // ellen.klein@yale.edu
7 //
8 // Methods to use by a dummy producer
10 
15 
21 
22 //-------------------------------------------------
24 {
26 }
27 
28 //-------------------------------------------------
30  art::PtrVector<recob::Hit>& ptrhitlist,
31  util::PxLine& startendpoints)
32 {
33  GetHitList(plane, ptrhitlist);
34  GetStartEndHits(plane, startendpoints);
35 }
36 
37 void evd::GraphClusterAlg::GetStartEndHits(unsigned int plane, util::PxLine& startendpoints)
38 {
39  std::vector<double> starthit;
40  std::vector<double> endhit;
42  starthit = intr->GetStartHitCoords(plane);
43  endhit = intr->GetEndHitCoords(plane);
44 
45  startendpoints.w0 = starthit[0];
46  startendpoints.t0 = starthit[1];
47  startendpoints.w1 = endhit[0];
48  startendpoints.t1 = endhit[1];
49  startendpoints.plane = plane;
50 }
51 
52 //----------------------------------------------------------------------------
53 void evd::GraphClusterAlg::GetHitList(unsigned int plane, art::PtrVector<recob::Hit>& ptrhitlist)
54 {
56 
57  std::vector<art::Ptr<recob::Hit>> ptlist = intr->GetHitList(plane);
58 
59  if (ptlist.size() == 0) {
60  mf::LogVerbatim("GraphClusterAlg") << ("hit list of zero size, please select some hits");
61  return;
62  }
63 
64  for (art::PtrVector<recob::Hit>::const_iterator hitIter = ptlist.begin(); hitIter != ptlist.end();
65  hitIter++) {
66  ptrhitlist.push_back((*hitIter));
67  }
68 
69  return;
70 }
71 
72 //----------------------------------------------------------------------------
73 std::vector<util::PxLine> evd::GraphClusterAlg::GetSeedLines()
74 {
75 
78  //this is where you could create Bezier Tracks if you wanted to do it inside a producer
80  std::vector<util::PxLine> plines = intr->GetSeedList();
81 
82  std::cout << " Received Seed List of Size: " << plines.size() << std::endl;
83 
84  return plines;
85 }
86 
88 {
90  TestFlag = intr->GetTestFlag();
91 
92  fEvent = intr->GetEvtNumber();
93  fRun = intr->GetRunNumber();
94  fSubRun = intr->GetSubRunNumber();
95 
96  if (TestFlag == -1) return -1;
97 
98  if (fEvent != (int)evt.id().event() || fRun != (int)evt.id().run() ||
99  fSubRun != (int)evt.id().subRun()) {
100  mf::LogVerbatim("GraphClusterAlg") << (" old event ");
101  return -1;
102  }
103 
104  return TestFlag;
105 }
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
GraphClusterAlg(fhicl::ParameterSet const &)
double t1
defined to be the ending t-position (of line or seed depending)
Definition: PxUtils.h:67
std::vector< double > const & GetEndHitCoords(unsigned int plane) const
Definition: InfoTransfer.h:107
std::vector< util::PxLine > GetSeedLines()
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Definition: AddMC.C:8
std::vector< art::Ptr< recob::Hit > > const & GetHitList(unsigned int plane) const
Definition: InfoTransfer.h:70
double w0
defined to be the vertex w-position
Definition: PxUtils.h:64
RunNumber_t run() const
Definition: EventID.h:98
double w1
defined to be the ending w-position (of line or seed depending)
Definition: PxUtils.h:66
typename data_t::const_iterator const_iterator
Definition: PtrVector.h:55
void push_back(Ptr< U > const &p)
Definition: PtrVector.h:435
int CheckValidity(art::Event &evt)
int GetRunNumber() const
Definition: InfoTransfer.h:58
int GetSubRunNumber() const
Definition: InfoTransfer.h:60
int GetTestFlag() const
Definition: InfoTransfer.h:56
void GetHitListAndEndPoints(unsigned int plane, art::PtrVector< recob::Hit > &ptrhitlist, util::PxLine &startendpoints)
void GetStartEndHits(unsigned int plane, util::PxLine &startendpoints)
EventNumber_t event() const
Definition: EventID.h:116
std::vector< util::PxLine > const & GetSeedList() const
void GetHitList(unsigned int plane, art::PtrVector< recob::Hit > &ptrhitlist)
TCEvent evt
Definition: DataStructs.cxx:8
unsigned int plane
Definition: PxUtils.h:68
double t0
defined to be the vertex t-position
Definition: PxUtils.h:65
SubRunNumber_t subRun() const
Definition: EventID.h:110
EventID id() const
Definition: Event.cc:23
int GetEvtNumber() const
Definition: InfoTransfer.h:62
std::vector< double > const & GetStartHitCoords(unsigned int plane) const
Definition: InfoTransfer.h:102