LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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
16 
17 
18  //-------------------------------------------------
20  {
21  this->reconfigure(pset);
23 
24 
25 
26 
27 
28  fNPlanes = geo->Nplanes();
29 // starthit.resize(fNPlanes);
30 // endhit.resize(fNPlanes);
31 
32  /*
33  swire.resize(fNPlanes);
34  ewire.resize(fNPlanes);
35  stime.resize(fNPlanes);
36  etime.resize(fNPlanes);*/
37  }
38 
39 
40 
41  //-------------------------------------------------
43  {
44 
45 
46  return;
47  }
48 
49 
50 
51  void evd::GraphClusterAlg::GetHitListAndEndPoints(unsigned int plane, art::PtrVector <recob::Hit> &ptrhitlist,util::PxLine &startendpoints)
52  {
53  GetHitList(plane,ptrhitlist);
54  GetStartEndHits(plane,startendpoints);
55 
56 
57  }
58 
59 
60 
61  void evd::GraphClusterAlg::GetStartEndHits(unsigned int plane,util::PxLine &startendpoints)
62  {
63  std::vector < double > starthit;
64  std::vector < double > endhit;
66  starthit=intr->GetStartHitCoords(plane);
67  endhit=intr->GetEndHitCoords(plane);
68 
69  startendpoints.w0=starthit[0];
70  startendpoints.t0=starthit[1];
71  startendpoints.w1=endhit[0];
72  startendpoints.t1=endhit[1];
73  startendpoints.plane=plane;
74 
75  }
76 
77 
78 // //----------------------------------------------------------------------------
79 // void evd::GraphClusterAlg::GetStartEndHits(unsigned int plane)
80 // {
81 // std::vector < double > starthit;
82 // std::vector < double > endhit;
83 // art::ServiceHandle<evd::InfoTransfer> intr;
84 // starthit=intr->GetStartHitCoords(plane);
85 // endhit=intr->GetEndHitCoords(plane);
86 //
87 //
88 // swire[plane]=starthit[0];
89 // stime[plane]=starthit[1];
90 // ewire[plane]=endhit[0];
91 // etime[plane]=endhit[1];
92 //
93 // }
94 
95 
96 
97 // //----------------------------------------------------------------------------
98 // void evd::GraphClusterAlg::GetStartEndHits(unsigned int plane,
99 // recob::Hit *starthit,
100 // recob::Hit *endhit)
101 // {
102 //
103 // art::ServiceHandle<evd::InfoTransfer> intr;
104 // art::ServiceHandle<geo::Geometry> geo;
105 //
106 // starthit=intr->GetStartHit(plane);
107 // endhit=intr->GetEndHit(plane);
108 //
109 // // error checking for bogus transfers
110 // if(starthit!=NULL){
111 // stime[plane] = starthit->PeakTime() ;
112 // try{
113 // if(starthit->Wire() != NULL){
114 // swire[plane] = starthit->WireID().Wire;
115 // }
116 // else{
117 // swire[plane]=0;
118 // }
119 // }
120 // catch(cet::exception e) {
121 // mf::LogWarning("GraphClusterAlg") << "caught exception \n"
122 // << e;
123 // swire[plane]=0;
124 // }
125 // }
126 // else{
127 // stime[plane]=0.;
128 // }
129 //
130 // if(endhit!=NULL){
131 // etime[plane] = endhit->PeakTime();
132 // if(endhit->Wire()!=NULL){
133 // ewire[plane] = endhit->WireID().Wire;
134 // }
135 // else{
136 // ewire[plane]=0;
137 // }
138 // }
139 // else{
140 // etime[plane]=0.;
141 // }
142 //
143 // }
144 
145  //----------------------------------------------------------------------------
146  // void evd::GraphClusterAlg::GetHitList(unsigned int plane,std::vector< art::Ptr <recob::Hit> > ptrhitlist)
147  // {
148  // art::ServiceHandle<evd::InfoTransfer> intr;
149  //
150  //
151  // ptrhitlist=intr->GetHitList(plane);
152  // //std::vector <recob::Hit *> hitlist_out;
153  //
154  // if(ptrhitlist.size()==0) {
155  // WriteMsg("hit list of zero size, please select some hits");
156  // return;
157  // }
158  //
159  // for(art::PtrVector<recob::Hit>::const_iterator hitIter = ptrhitlist.begin(); hitIter != ptrhitlist.end(); hitIter++){
160  // // art::Ptr<recob::Hit> theHit = (*hitIter);
161  // // unsigned int plane,cstat,tpc,wire;
162  // // hitlist_out.push_back((*hitIter)->Get());
163  // }
164  //
165  //
166  //
167  //
168  // return;// hitlist_out;
169  // }
170 
171  //----------------------------------------------------------------------------
172  void evd::GraphClusterAlg::GetHitList(unsigned int plane, art::PtrVector <recob::Hit> &ptrhitlist)
173  {
175 
176  std::vector< art::Ptr <recob::Hit> > ptlist=intr->GetHitList(plane);
177 
178 
179  //std::vector <recob::Hit *> hitlist_out;
180 
181  if(ptlist.size()==0) {
182  mf::LogVerbatim("GraphClusterAlg") << ("hit list of zero size, please select some hits");
183  return;
184  }
185 
186  for(art::PtrVector<recob::Hit>::const_iterator hitIter = ptlist.begin(); hitIter != ptlist.end(); hitIter++){
187  // art::Ptr<recob::Hit> theHit = (*hitIter);
188  // unsigned int plane,cstat,tpc,wire;
189  ptrhitlist.push_back((*hitIter));
190  }
191 
192  return;// hitlist_out;
193  }
194 
195 
196  //----------------------------------------------------------------------------
197  std::vector < util::PxLine > evd::GraphClusterAlg::GetSeedLines()
198  {
199 
202  //this is where you could create Bezier Tracks if you wanted to do it inside a producer
204  std::vector < util::PxLine > plines = intr->GetSeedList();
205 
206  std::cout << " Received Seed List of Size: " << plines.size() << std::endl;
207 
208  return plines;
209  }
210 
211 
214  TestFlag=intr->GetTestFlag();
215 
216  fEvent=intr->GetEvtNumber();
217  fRun=intr->GetRunNumber();
218  fSubRun=intr->GetSubRunNumber();
219 
220 
221 
222  if(TestFlag==-1)
223  return -1;
224 
225  if(fEvent!=(int)evt.id().event() || fRun!=(int)evt.id().run() || fSubRun!=(int)evt.id().subRun() ) {
226  mf::LogVerbatim("GraphClusterAlg") << (" old event ");
227  return -1;
228  }
229 
230  return TestFlag;
231  }
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
std::vector< double > GetStartHitCoords(unsigned int plane)
Definition: InfoTransfer.h:92
double t1
defined to be the ending t-position (of line or seed depending)
Definition: PxUtils.h:72
std::vector< util::PxLine > GetSeedList()
GraphClusterAlg(fhicl::ParameterSet const &pset)
std::vector< util::PxLine > GetSeedLines()
double w0
defined to be the vertex w-position
Definition: PxUtils.h:69
RunNumber_t run() const
Definition: EventID.h:99
double w1
defined to be the ending w-position (of line or seed depending)
Definition: PxUtils.h:71
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
void push_back(Ptr< U > const &p)
Definition: PtrVector.h:441
int CheckValidity(art::Event &evt)
std::vector< double > GetEndHitCoords(unsigned int plane)
Definition: InfoTransfer.h:94
data_t::const_iterator const_iterator
Definition: PtrVector.h:61
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:117
void GetHitList(unsigned int plane, art::PtrVector< recob::Hit > &ptrhitlist)
TCEvent evt
Definition: DataStructs.cxx:5
unsigned int plane
Definition: PxUtils.h:73
void reconfigure(fhicl::ParameterSet const &pset)
Namespace collecting geometry-related classes utilities.
double t0
defined to be the vertex t-position
Definition: PxUtils.h:70
SubRunNumber_t subRun() const
Definition: EventID.h:111
EventID id() const
Definition: Event.h:56
std::vector< art::Ptr< recob::Hit > > GetHitList(unsigned int plane)
Definition: InfoTransfer.h:63