LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
Track3Dreco_module.cc
Go to the documentation of this file.
1 //
3 // \file Track3Dreco.cxx
4 //
5 // maddalena.antonello@lngs.infn.it
6 // ornella.palamara@lngs.infn.it
7 // ART port and edits: soderber,echurch@fnal.gov
8 // This algorithm is designed to reconstruct 3D tracks through a simple
9 // 2D-track matching algorithm
12 
13 #include <vector>
14 #include <string>
15 #include <iomanip>
16 
17 // C++ includes
18 #include <math.h>
19 #include <algorithm>
20 #include <iostream>
21 #include <fstream>
22 
23 // Framework includes
27 #include "fhiclcpp/ParameterSet.h"
35 
36 // LArSoft includes
47 
48 // ROOT includes
49 #include "TVectorD.h"
50 #include "TF1.h"
51 #include "TGraph.h"
52 #include "TMath.h"
53 
54 namespace trkf {
55 
56  class Track3Dreco : public art::EDProducer {
57 
58  public:
59 
60  explicit Track3Dreco(fhicl::ParameterSet const& pset);
61  ~Track3Dreco();
62 
64  void reconfigure(fhicl::ParameterSet const& p);
65  void produce(art::Event& evt);
66  void beginJob();
67  void endJob();
68 
69  private:
70 
71  int ftmatch;
72  double fchi2dof;
73  std::string fClusterModuleLabel;
74 
75 
76  }; // class Track3Dreco
77 
78 }
79 
80 namespace trkf {
81 
82 //-------------------------------------------------
84 {
85  this->reconfigure(pset);
86  produces< std::vector<recob::Track> >();
87  produces< std::vector<recob::SpacePoint> >();
88  produces< art::Assns<recob::Track, recob::Cluster> >();
89  produces< art::Assns<recob::Track, recob::SpacePoint> >();
90  produces< art::Assns<recob::SpacePoint, recob::Hit> >();
91  produces< art::Assns<recob::Track, recob::Hit> >();
92 }
93 
94 //-------------------------------------------------
96 {
97 }
98 
100 {
101  fClusterModuleLabel = pset.get< std::string >("ClusterModuleLabel");
102  ftmatch = pset.get< int >("TMatch");
103  fchi2dof = pset.get< double >("Chi2DOFmax");
104 }
105 
106 //-------------------------------------------------
108 {
109 
110 
111 }
112 
114 {
115 }
116 
117 //------------------------------------------------------------------------------------//
119 {
120  // get services
122  const detinfo::DetectorProperties* detprop = lar::providerFrom<detinfo::DetectorPropertiesService>();
123 
124  std::unique_ptr<std::vector<recob::Track> > tcol(new std::vector<recob::Track>);
125  std::unique_ptr<std::vector<recob::SpacePoint> > spacepoints(new std::vector<recob::SpacePoint>);
126  std::unique_ptr< art::Assns<recob::Track, recob::Cluster> > cassn (new art::Assns<recob::Track, recob::Cluster>);
127  std::unique_ptr< art::Assns<recob::Track, recob::SpacePoint> > sassn (new art::Assns<recob::Track, recob::SpacePoint>);
128  std::unique_ptr< art::Assns<recob::SpacePoint, recob::Hit> > shassn(new art::Assns<recob::SpacePoint, recob::Hit>);
129  std::unique_ptr< art::Assns<recob::Track, recob::Hit> > hassn (new art::Assns<recob::Track, recob::Hit>);
130 
131  // define TPC parameters
132  TString tpcName = geom->GetLArTPCVolumeName();
133 
134  // double YC = (m_TPCHalfZ-5.)*2.; // TPC height in cm
135  double YC = (geom->DetHalfHeight())*2.; // *ArgoNeuT* TPC active-volume height in cm
136  double Angle = geom->Plane(1).Wire(0).ThetaZ(false)-TMath::Pi()/2.; // wire angle with respect to the vertical direction
137  // Parameters temporary defined here, but possibly to be retrieved somewhere in the code
138  double timetick = 0.198; //time sample in us
139  double presamplings = 60.;
140  const double wireShift=50.; // half the number of wires from the Induction(Collection) plane intersecting with a wire from the Collection(Induction) plane.
141  double plane_pitch = geom->PlanePitch(0,1); //wire plane pitch in cm
142  double wire_pitch = geom->WirePitch(); //wire pitch in cm
143  double Efield_drift = 0.5; // Electric Field in the drift region in kV/cm
144  double Efield_SI = 0.7; // Electric Field between Shield and Induction planes in kV/cm
145  double Efield_IC = 0.9; // Electric Field between Induction and Collection planes in kV/cm
146  double Temperature = 87.6; // LAr Temperature in K
147 
148  double driftvelocity = detprop->DriftVelocity(Efield_drift,Temperature); //drift velocity in the drift
149  //region (cm/us)
150  double driftvelocity_SI = detprop->DriftVelocity(Efield_SI,Temperature); //drift velocity between shield
151  //and induction (cm/us)
152  double driftvelocity_IC = detprop->DriftVelocity(Efield_IC,Temperature); //drift velocity between induction
153  //and collection (cm/us)
154  double timepitch = driftvelocity*timetick; //time sample (cm)
155  double tSI = plane_pitch/driftvelocity_SI/timetick; //drift time between Shield and
156  //Collection planes (time samples)
157  double tIC = plane_pitch/driftvelocity_IC/timetick; //drift time between Induction and
158  //Collection planes (time samples)
159 
160 
161  // get input Cluster object(s).
162  art::Handle< std::vector<recob::Cluster> > clusterListHandle;
163  evt.getByLabel(fClusterModuleLabel,clusterListHandle);
164 
165 
166  // Declare some vectors..
167  // Induction
168  std::vector<double> Iwirefirsts; // in cm
169  std::vector<double> Iwirelasts; // in cm
170  std::vector<double> Itimefirsts; // in cm
171  std::vector<double> Itimelasts; // in cm
172  std::vector<double> Itimefirsts_line; // in cm
173  std::vector<double> Itimelasts_line; // in cm
174  std::vector < std::vector<art::Ptr<recob::Hit> > > IclusHitlists;
175  std::vector<unsigned int> Icluster_count;
176 
177  // Collection
178  std::vector<double> Cwirefirsts; // in cm
179  std::vector<double> Cwirelasts; // in cm
180  std::vector<double> Ctimefirsts; // in cm
181  std::vector<double> Ctimelasts; // in cm
182  std::vector<double> Ctimefirsts_line; // in cm
183  std::vector<double> Ctimelasts_line; // in cm
184  std::vector< std::vector< art::Ptr<recob::Hit> > > CclusHitlists;
185  std::vector<unsigned int> Ccluster_count;
186 
187  // Some variables for the hit
188  float time; //hit time at maximum
189  unsigned int wire = 0; //hit wire number
190  unsigned int plane = 0; //hit plane number
191 
192  size_t startSPIndex = spacepoints->size(); //index for knowing which spacepoints are with which cluster
193  size_t endSPIndex = spacepoints->size(); //index for knowing which spacepoints are with which cluster
194 
195  art::FindManyP<recob::Hit> fmh(clusterListHandle, evt, fClusterModuleLabel);
196 
197  for(size_t ii = 0; ii < clusterListHandle->size(); ++ii){
198 
199  art::Ptr<recob::Cluster> cl(clusterListHandle, ii);
200 
204 
205  // Gaaaaaah! Change me soon!!! But, for now,
206  // let's just chuck one plane's worth of info. EC, 30-Mar-2011.
208  if (cl->View() == geo::kZ) continue;
209 
210  // Can not be const, cuz we're gonna sort 'em.
211  std::vector< art::Ptr<recob::Hit> > hitlist (fmh.at(ii));
212 
213  if(hitlist.size() == 1) continue;//only one Hit in this Cluster...will cause TGraph fit to fail.
214 
215  // sort the hit list to be sure it is in the correct order
216  // using the Hit < operator
217  std::sort(hitlist.begin(), hitlist.end());
218 
219  TGraph *the2Dtrack = new TGraph(hitlist.size());
220 
221  std::vector<double> wires;
222  std::vector<double> times;
223 
224  int np = 0;
225  //loop over cluster hits
226  for(art::PtrVector<recob::Hit>::const_iterator theHit = hitlist.begin(); theHit != hitlist.end(); theHit++){
227  //recover the Hit
228  // recob::Hit* theHit = (recob::Hit*)(*hitIter);
229  time = (*theHit)->PeakTime() ;
230 
231  time -= presamplings;
232 
233  plane = (*theHit)->WireID().Plane;
234  wire = (*theHit)->WireID().Wire;
235 
236  //correct for the distance between wire planes
237  if(plane == 1) time -= tIC; // Collection
238 
239  //transform hit wire and time into cm
240  double wire_cm;
241  if(plane == 0)
242  wire_cm = (double)((wire+3.95) * wire_pitch);
243  else
244  wire_cm = (double)((wire+1.84) * wire_pitch);
245 
246  double time_cm;
247  if(time > tSI) time_cm = (double)( (time-tSI)*timepitch + tSI*driftvelocity_SI*timetick);
248  else time_cm = time*driftvelocity_SI*timetick;
249 
250  wires.push_back(wire_cm);
251  times.push_back(time_cm);
252 
253  the2Dtrack->SetPoint(np,wire_cm,time_cm);
254  np++;
255  }//end of loop over cluster hits
256 
257  // fit the 2Dtrack and get some info to store
258  try{
259  the2Dtrack->Fit("pol1","Q");
260  }
261  catch(...){
262  mf::LogWarning("Track3Dreco") << "The 2D track fit failed";
263  continue;
264  }
265 
266  TF1 *pol1=(TF1*) the2Dtrack->GetFunction("pol1");
267  double par[2];
268  pol1->GetParameters(par);
269  double intercept = par[0];
270  double slope = par[1];
271 
272  double w0 = wires.front(); // first hit wire (cm)
273  double w1 = wires.back(); // last hit wire (cm)
274  double t0 = times.front(); // first hit time (cm)
275  double t1 = times.back(); // last hit time (cm)
276  double t0_line = intercept + (w0)*slope; // time coordinate at wire w0 on the fit line (cm)
277  double t1_line = intercept + (w1)*slope; // time coordinate at wire w1 on the fit line (cm)
278 
279  // actually store the 2Dtrack info
280  switch(plane){
281  case 0:
282  Iwirefirsts.push_back(w0);
283  Iwirelasts.push_back(w1);
284  Itimefirsts.push_back(t0);
285  Itimelasts.push_back(t1);
286  Itimefirsts_line.push_back(t0_line);
287  Itimelasts_line.push_back(t1_line);
288  IclusHitlists.push_back(hitlist);
289  Icluster_count.push_back(ii);
290  break;
291  case 1:
292  Cwirefirsts.push_back(w0);
293  Cwirelasts.push_back(w1);
294  Ctimefirsts.push_back(t0);
295  Ctimelasts.push_back(t1);
296  Ctimefirsts_line.push_back(t0_line);
297  Ctimelasts_line.push_back(t1_line);
298  CclusHitlists.push_back(hitlist);
299  Ccluster_count.push_back(ii);
300  break;
301  }
302  //delete the2Dtrack;
303  delete pol1;
304  }// end of loop over all input clusters
305 
309 
310  //loop over Collection view 2D tracks
311  for(size_t collectionIter = 0; collectionIter < CclusHitlists.size(); ++collectionIter){
312  // Recover previously stored info
313  double Cw0 = Cwirefirsts[collectionIter];
314  double Cw1 = Cwirelasts[collectionIter];
315  //double Ct0 = Ctimefirsts[collectionIter];
316  //double Ct1 = Ctimelasts[collectionIter];
317  double Ct0_line = Ctimefirsts_line[collectionIter];
318  double Ct1_line = Ctimelasts_line[collectionIter];
319  std::vector< art::Ptr<recob::Hit> > hitsCtrk = CclusHitlists[collectionIter];
320 
321  double collLength = TMath::Sqrt( TMath::Power(Ct1_line - Ct0_line,2) + TMath::Power(Cw1 - Cw0,2));
322 
323  //loop over Induction view 2D tracks
324  for(size_t inductionIter = 0; inductionIter < IclusHitlists.size(); ++inductionIter){
325  // Recover previously stored info
326  double Iw0 = Iwirefirsts[inductionIter];
327  double Iw1 = Iwirelasts[inductionIter];
328  //double It0 = Itimefirsts[inductionIter];
329  //double It1 = Itimelasts[inductionIter];
330  double It0_line = Itimefirsts_line[inductionIter];
331  double It1_line = Itimelasts_line[inductionIter];
332  std::vector< art::Ptr<recob::Hit> > hitsItrk = IclusHitlists[inductionIter];
333 
334  double indLength = TMath::Sqrt( TMath::Power(It1_line - It0_line,2) + TMath::Power(Iw1 - Iw0,2));
335 
336  bool forward_match = ((std::abs(Ct0_line-It0_line)<ftmatch*timepitch) &&
337  (std::abs(Ct1_line-It1_line)<ftmatch*timepitch));
338  bool backward_match = ((std::abs(Ct0_line-It1_line)<ftmatch*timepitch) &&
339  (std::abs(Ct1_line-It0_line)<ftmatch*timepitch));
340 
341 
342 
343  // match 2D tracks
344  if(forward_match || backward_match ){
345 
346  // Reconstruct the 3D track
347  TVector3 XYZ0, XYZ1; // track endpoints
348  if(forward_match){
349  XYZ0.SetXYZ(Ct0_line,(Cw0-Iw0)/(2.*TMath::Sin(Angle)),
350  (Cw0+Iw0)/(2.*TMath::Cos(Angle))-YC/2.*TMath::Tan(Angle));
351  XYZ1.SetXYZ(Ct1_line,(Cw1-Iw1)/(2.*TMath::Sin(Angle)),
352  (Cw1+Iw1)/(2.*TMath::Cos(Angle))-YC/2.*TMath::Tan(Angle));
353  }
354  else{
355  XYZ0.SetXYZ(Ct0_line,(Cw0-Iw1)/(2.*TMath::Sin(Angle)),
356  (Cw0+Iw1)/(2.*TMath::Cos(Angle))-YC/2.*TMath::Tan(Angle));
357  XYZ1.SetXYZ(Ct1_line,(Cw1-Iw0)/(2.*TMath::Sin(Angle)),
358  (Cw1+Iw0)/(2.*TMath::Cos(Angle))-YC/2.*TMath::Tan(Angle));
359  }
360 
361  //compute track direction in Local co-ordinate system
362  //WARNING: There is an ambiguity introduced here for the case of backwards-going tracks.
363  //If available, vertex info. could sort this out.
364  TVector3 startpointVec,endpointVec;
365  TVector2 collVtx, indVtx;
366  if(XYZ0.Z() <= XYZ1.Z()){
367  startpointVec.SetXYZ(XYZ0.X(),XYZ0.Y(),XYZ0.Z());
368  endpointVec.SetXYZ(XYZ1.X(),XYZ1.Y(),XYZ1.Z());
369  if(forward_match){
370  collVtx.Set(Ct0_line,Cw0);
371  indVtx.Set(It0_line,Iw0);
372  }
373  else{
374  collVtx.Set(Ct0_line,Cw0);
375  indVtx.Set(It1_line,Iw1);
376  }
377  }
378  else{
379  startpointVec.SetXYZ(XYZ1.X(),XYZ1.Y(),XYZ1.Z());
380  endpointVec.SetXYZ(XYZ0.X(),XYZ0.Y(),XYZ0.Z());
381  if(forward_match){
382  collVtx.Set(Ct1_line,Cw1);
383  indVtx.Set(It1_line,Iw1);
384  }
385  else{
386  collVtx.Set(Ct1_line,Cw1);
387  indVtx.Set(It0_line,Iw0);
388  }
389  }
390 
391  //compute track (normalized) cosine directions in the TPC co-ordinate system
392  TVector3 DirCos = endpointVec - startpointVec;
393 
394  //SetMag casues a crash if the magnitude of the vector is zero
395  try{
396  DirCos.SetMag(1.0);//normalize vector
397  }
398  catch(...){
399  mf::LogWarning("Track3Dreco") <<"The Spacepoint is infinitely small";
400  continue;
401  }
402 
403  art::Ptr <recob::Cluster> cl1(clusterListHandle,Icluster_count[inductionIter]);
404  art::Ptr <recob::Cluster> cl2(clusterListHandle,Ccluster_count[collectionIter]);
405  art::PtrVector<recob::Cluster> clustersPerTrack;
406  clustersPerTrack.push_back(cl1);
407  clustersPerTrack.push_back(cl2);
408 
409 
411  // Match hits
413 
414  std::vector< art::Ptr<recob::Hit> > minhits = hitsCtrk.size() <= hitsItrk.size() ? hitsCtrk : hitsItrk;
415  std::vector< art::Ptr<recob::Hit> > maxhits = hitsItrk.size() <= hitsCtrk.size() ? hitsCtrk : hitsItrk;
416 
417 
418  std::vector<bool> maxhitsMatch(maxhits.size());
419  for(size_t it = 0; it < maxhits.size(); ++it) maxhitsMatch[it] = false;
420 
421  std::vector<recob::Hit*> hits3Dmatched;
422  // For the matching start from the view where the track projection presents less hits
423  unsigned int imaximum = 0;
424  //loop over hits
425 
426  startSPIndex = spacepoints->size();
427 
428  for(size_t imin = 0; imin < minhits.size(); ++imin){
429  //get wire - time coordinate of the hit
430  unsigned int wire,plane1,plane2;
431  wire = minhits[imin]->WireID().Wire;
432  plane1 = minhits[imin]->WireID().Plane;
433 
434  // get the wire-time co-ordinates of the hit to be matched
435  double w1;
436  if(plane1 == 0)
437  w1 = (double)((wire+3.95)*wire_pitch);
438  else
439  w1 = (double)((wire+1.84) * wire_pitch);
440  double temptime1 = minhits[imin]->PeakTime()-presamplings;
441  if(plane1 == 1) temptime1 -= tIC;
442  double t1;
443  if(temptime1>tSI) t1 = (double)( (temptime1-tSI)*timepitch + tSI*driftvelocity_SI*timetick);
444  else t1 = temptime1*driftvelocity_SI*timetick;
445 
446  //get the track origin co-ordinates in the two views
447  TVector2 minVtx2D;
448  plane1==1 ? minVtx2D.Set(collVtx.X(),collVtx.Y()): minVtx2D.Set(indVtx.X(),indVtx.Y());
449  TVector2 maxVtx2D;
450  plane1==1 ? maxVtx2D.Set(indVtx.X(),indVtx.Y()): maxVtx2D.Set(collVtx.X(),collVtx.Y());
451 
452  double ratio = (collLength>indLength) ? collLength/indLength : indLength/collLength;
453 
454  //compute the distance of the hit (imin) from the relative track origin
455  double minDistance = ratio*TMath::Sqrt(TMath::Power(t1-minVtx2D.X(),2)
456  + TMath::Power(w1-minVtx2D.Y(),2));
457 
458  //core matching algorithm
459  double difference = 9999999.;
460 
461  //loop over hits of the other view
462  for(size_t imax = 0; imax < maxhits.size(); ++imax){
463  if(!maxhitsMatch[imax]){
464  //get wire - time coordinate of the hit
465  wire = maxhits[imax]->WireID().Wire;
466  plane2 = maxhits[imax]->WireID().Plane;
467 
468  double w2;
469  if(plane2 == 0)
470  w2 = (double)((wire+3.95)*wire_pitch);
471  else
472  w2 = (double)((wire+1.84)*wire_pitch);
473  double temptime2 = maxhits[imax]->PeakTime()-presamplings;
474  if(plane2 == 1) temptime2 -= tIC;
475  double t2;
476  if(temptime2 > tSI) t2 = (double)( (temptime2-tSI)*timepitch + tSI*driftvelocity_SI*timetick);
477  else t2 = temptime2*driftvelocity_SI*timetick;
478 
479 
480  bool timematch = (std::abs(t1-t2)<ftmatch*timepitch);
481  bool wirematch = (std::abs(w1-w2)<wireShift*wire_pitch);
482 
483  double maxDistance = TMath::Sqrt(TMath::Power(t2-maxVtx2D.X(),2)+TMath::Power(w2-maxVtx2D.Y(),2));
484  if (wirematch && timematch && std::abs(maxDistance-minDistance)<difference) {
485  difference = std::abs(maxDistance-minDistance);
486  imaximum = imax;
487  }
488  }
489  }// end loop over max hits
490  maxhitsMatch[imaximum]=true;
491 
493  if(difference!= 9999999.){
494  sp_hits.push_back(minhits[imin]);
495  sp_hits.push_back(maxhits[imaximum]);
496  }
497 
498  // Get the time-wire co-ordinates of the matched hit
499  wire = maxhits[imaximum]->WireID().Wire;
500  plane2 = maxhits[imaximum]->WireID().Plane;
501 
502  double w1_match;
503  if(plane2 == 0)
504  w1_match = (double)((wire+3.95)*wire_pitch);
505  else
506  w1_match = (double)((wire+1.84)*wire_pitch);
507  double temptime3 = maxhits[imaximum]->PeakTime()-presamplings;
508  if(plane2 == 1) temptime3 -= tIC;
509  double t1_match;
510  if(temptime3 > tSI) t1_match = (double)( (temptime3-tSI)*timepitch + tSI*driftvelocity_SI*timetick);
511  else t1_match = temptime3*driftvelocity_SI*timetick;
512 
513 
514  // create the 3D hit, compute its co-ordinates and add it to the 3D hits list
515  double Ct = plane1==1?t1:t1_match;
516  double Cw = plane1==1?w1:w1_match;
517  double Iw = plane1==1?w1_match:w1;
518 
519  const TVector3 hit3d(Ct,(Cw-Iw)/(2.*TMath::Sin(Angle)),(Cw+Iw)/(2.*TMath::Cos(Angle))-YC/2.*TMath::Tan(Angle));
520  Double_t hitcoord[3];
521  hitcoord[0] = hit3d.X();
522  hitcoord[1] = hit3d.Y();
523  hitcoord[2] = hit3d.Z();
524 
525  Double_t hitcoord_errs[3];
526  for (int i=0; i<3; i++) hitcoord_errs[i]=-1.000;
527 
528  //3d point at end of track
529  recob::SpacePoint mysp(hitcoord, hitcoord_errs, -1., spacepoints->size());
530 
531  spacepoints->push_back(mysp);
532 
533  // associate the hits to the space point
534  util::CreateAssn(*this, evt, *spacepoints, sp_hits, *shassn);
535 
536  }//loop over min-hits
537 
538  endSPIndex = spacepoints->size();
539 
540  // Add the 3D track to the vector of the reconstructed tracks
541  if(spacepoints->size() > startSPIndex || clustersPerTrack.size()>0){
542 
543  std::vector<TVector3> xyz;
544  xyz.push_back(startpointVec);
545  xyz.push_back(endpointVec);
546  std::vector<TVector3> dir_xyz;
547  dir_xyz.push_back(DirCos);
548  dir_xyz.push_back(DirCos);
549  std::vector< std::vector <double> > dQdx = std::vector< std::vector<double> >(0);
550  std::vector<double> fitMomentum = std::vector<double>(2, util::kBogusD);
551 
552  recob::Track the3DTrack(xyz,dir_xyz,dQdx, fitMomentum,tcol->size());
553  tcol->push_back(the3DTrack);
554 
555  // associate the track with its spacepoints
556  util::CreateAssn(*this, evt, *tcol, *spacepoints, *sassn, startSPIndex, endSPIndex);
557 
558  // associate the track with its clusters
559  util::CreateAssn(*this, evt, *tcol, clustersPerTrack, *cassn);
560 
561  art::FindManyP<recob::Hit> fmhc(clustersPerTrack, evt, fClusterModuleLabel);
562 
563  // get the hits associated with each cluster and associate those with the track
564  for(size_t p = 0; p < clustersPerTrack.size(); ++p){
565  const std::vector< art::Ptr<recob::Hit> >& hits = fmhc.at(p);
566  util::CreateAssn(*this, evt, *tcol, hits, *hassn);
567  }
568 
569  }
570 
571  } //close match 2D tracks
572 
573 
574  }//close loop over Induction view 2D tracks
575 
576  }//close loop over Collection view 2D tracks
577 
578  mf::LogVerbatim("Summary") << std::setfill('-') << std::setw(175) << "-" << std::setfill(' ');
579  mf::LogVerbatim("Summary") << "Track3Dreco Summary:";
580  for(unsigned int i = 0; i<tcol->size(); ++i){
581  mf::LogVerbatim("Summary") << tcol->at(i) ;
582  }
583 
584  evt.put(std::move(tcol));
585  evt.put(std::move(spacepoints));
586  evt.put(std::move(cassn));
587  evt.put(std::move(sassn));
588  evt.put(std::move(hassn));
589  evt.put(std::move(shassn));
590 
591  return;
592 }
593 
595 
596 } // namespace
code to link reconstructed objects back to the MC truth information
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
TTree * t1
Definition: plottest35.C:26
geo::Length_t PlanePitch(geo::TPCID const &tpcid, geo::PlaneID::PlaneID_t p1=0, geo::PlaneID::PlaneID_t p2=1) const
Returns the distance between two planes.
WireGeo const & Wire(unsigned int iwire) const
Definition: PlaneGeo.cxx:506
Declaration of signal hit object.
std::string fClusterModuleLabel
label for input cluster collection
void reconfigure(fhicl::ParameterSet const &p)
Planes which measure Z direction.
Definition: geo_types.h:79
double fchi2dof
tolerance for chi2/dof of cluster fit to function
double ThetaZ() const
Returns angle of wire with respect to z axis in the Y-Z plane in radians.
Definition: WireGeo.h:192
geo::Length_t WirePitch(geo::PlaneID const &planeid) const
Returns the distance between two consecutive wires.
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
void hits()
Definition: readHits.C:15
geo::Length_t DetHalfHeight(geo::TPCID const &tpcid) const
Returns the half height of the active volume of the specified TPC.
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:42
void push_back(Ptr< U > const &p)
Definition: PtrVector.h:441
T get(std::string const &key) const
Definition: ParameterSet.h:231
bool CreateAssn(PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t indx=UINT_MAX)
Creates a single one-to-one association.
Declaration of cluster object.
Provides recob::Track data product.
size_type size() const
Definition: PtrVector.h:308
TTree * t2
Definition: plottest35.C:36
int ftmatch
tolerance for time matching (in time samples)
Encapsulate the geometry of a wire.
data_t::const_iterator const_iterator
Definition: PtrVector.h:61
geo::View_t View() const
Returns the view for this cluster.
Definition: Cluster.h:741
Utility object to perform functions of association.
Encapsulate the construction of a single detector plane.
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
virtual double DriftVelocity(double efield=0., double temperature=0.) const =0
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void produce(art::Event &evt)
constexpr double kBogusD
obviously bogus double value
Track3Dreco(fhicl::ParameterSet const &pset)
art framework interface to geometry description
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
Definition: Track.h:51
std::string GetLArTPCVolumeName(geo::TPCID const &tpcid) const
Return the name of specified LAr TPC volume.