LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
TrajCluster_module.cc
Go to the documentation of this file.
1 
10 // C/C++ standard libraries
11 #include <string>
12 #include <utility> // std::unique_ptr<>
13 
14 // Framework libraries
15 #include "fhiclcpp/ParameterSet.h"
21 
22 //LArSoft includes
27 
28 //root includes
29 #include "TTree.h"
30 
31 // ... more includes in the implementation section
32 
33 namespace cluster {
46  class TrajCluster: public art::EDProducer {
47 
48  public:
49  explicit TrajCluster(fhicl::ParameterSet const & pset);
50 
51  void reconfigure(fhicl::ParameterSet const & pset) ;
52  void produce(art::Event & evt) override;
53  void beginJob() override;
54  void endJob() override;
55 
56  private:
57  std::unique_ptr<tca::TrajClusterAlg> fTCAlg; // define TrajClusterAlg object
58  TTree* showertree;
59  TTree* crtree;
60 
63 
64  }; // class TrajCluster
65 
66 } // namespace cluster
67 
68 //******************************************************************************
69 //*** implementation
70 //***
71 
72 // C/C++ standard libraries
73 #include <vector>
74 #include <memory> // std::move()
75 
76 // Framework libraries
80 
81 //LArSoft includes
84 #include "lardata/ArtDataHelper/HitCreator.h" // recob::HitCollectionAssociator
90 
91 namespace cluster {
92 
93  //----------------------------------------------------------------------------
95  {
96  // this trick avoids double configuration on construction
97  if (fTCAlg)
98  fTCAlg->reconfigure(pset.get< fhicl::ParameterSet >("TrajClusterAlg"));
99  else {
100  fTCAlg.reset(new tca::TrajClusterAlg(pset.get< fhicl::ParameterSet >("TrajClusterAlg")));
101  }
102 
103  fDoWireAssns = pset.get<bool>("DoWireAssns",true);
104  fDoRawDigitAssns = pset.get<bool>("DoRawDigitAssns",true);
105 
106  } // TrajCluster::reconfigure()
107 
108  //----------------------------------------------------------------------------
110 
111  reconfigure(pset);
112 
113  // let HitCollectionAssociator declare that we are going to produce
114  // hits and associations with wires and raw digits
115  // (with no particular product label)
117 
118  produces< std::vector<recob::Cluster> >();
119  produces< std::vector<recob::Vertex> >();
120  produces< std::vector<recob::EndPoint2D> >();
121  produces< std::vector<recob::Shower> >();
122  produces< art::Assns<recob::Cluster, recob::Hit> >();
123  produces< art::Assns<recob::Cluster, recob::Vertex, unsigned short> >();
124  produces< art::Assns<recob::Shower, recob::Hit> >();
125 
126  produces< std::vector<recob::PFParticle> >();
127 // produces< std::vector<recob::SpacePoint> >();
128  produces< art::Assns<recob::PFParticle, recob::Cluster> >();
129  produces< art::Assns<recob::PFParticle, recob::Shower> >();
130  produces< art::Assns<recob::PFParticle, recob::Vertex> >();
131 
132 // produces< art::Assns<recob::PFParticle, recob::SpacePoint> >();
133 // produces< art::Assns<recob::SpacePoint, recob::Hit> >();
134 
135  produces< std::vector<anab::CosmicTag>>();
136  produces< art::Assns<recob::PFParticle, anab::CosmicTag>>();
137  } // TrajCluster::TrajCluster()
138 
139  // NEW FUNCTION
140  //----------------------------------------------------------------------------
142  {
144 
145  showertree = tfs->make<TTree>("showervarstree", "showerVarsTree");
146  fTCAlg->DefineShTree(showertree);
147  crtree = tfs->make<TTree>("crtree", "Cosmic removal variables");
148  fTCAlg->DefineCRTree(crtree);
149  }
150 
151  //----------------------------------------------------------------------------
153  {
154  std::vector<unsigned int> const& fAlgModCount = fTCAlg->GetAlgModCount();
155  std::vector<std::string> const& fAlgBitNames = fTCAlg->GetAlgBitNames();
156  if(fAlgBitNames.size() != fAlgModCount.size()) return;
157  mf::LogVerbatim myprt("TC");
158  myprt<<"TrajCluster algorithm counts\n";
159  unsigned short icol = 0;
160  for(unsigned short ib = 0; ib < fAlgModCount.size(); ++ib) {
161  if(ib == tca::kKilled) continue;
162  myprt<<std::left<<std::setw(16)<<fAlgBitNames[ib]<<std::right<<std::setw(10)<<fAlgModCount[ib]<<" ";
163  ++icol;
164  if(icol == 4) { myprt<<"\n"; icol = 0; }
165  } // ib
166  } // endJob
167 
168  //----------------------------------------------------------------------------
170  {
171 
172  // look for clusters in all planes
173  fTCAlg->RunTrajClusterAlg(evt);
174 
175  std::unique_ptr<std::vector<recob::Hit>> newHits = std::make_unique<std::vector<recob::Hit>>(fTCAlg->YieldHits());
176 
177  std::vector<recob::Cluster> sccol;
178  std::vector<recob::PFParticle> spcol;
179 // std::vector<recob::SpacePoint> ssptcol;
180  std::vector<recob::Vertex> sv3col;
181  std::vector<recob::EndPoint2D> sv2col;
182  std::vector<recob::Shower> sscol;
183  std::vector<anab::CosmicTag> ctcol;
184 
185  std::unique_ptr<art::Assns<recob::Cluster, recob::Hit>>
186  cls_hit_assn(new art::Assns<recob::Cluster, recob::Hit>);
187  std::unique_ptr<art::Assns<recob::Cluster, recob::Vertex, unsigned short>>
189  std::unique_ptr<art::Assns<recob::Shower, recob::Hit>>
190  shwr_hit_assn(new art::Assns<recob::Shower, recob::Hit>);
191 
192  std::unique_ptr<art::Assns<recob::PFParticle, recob::Cluster>>
194  std::unique_ptr<art::Assns<recob::PFParticle, recob::Shower>>
196  std::unique_ptr<art::Assns<recob::PFParticle, recob::Vertex>>
198 /*
199  std::unique_ptr<art::Assns<recob::PFParticle, recob::SpacePoint>>
200  pfp_spt_assn(new art::Assns<recob::PFParticle, recob::SpacePoint>);
201  std::unique_ptr<art::Assns<recob::SpacePoint, recob::Hit>>
202  spt_hit_assn(new art::Assns<recob::SpacePoint, recob::Hit>);
203 */
204  std::unique_ptr<art::Assns<recob::PFParticle, anab::CosmicTag>>
206 
207  std::vector<tca::ClusterStore> const& Clusters = fTCAlg->GetClusters();
208 
209  // make EndPoints (aka 2D vertices)
210  std::vector<tca::VtxStore> const& EndPts = fTCAlg->GetEndPoints();
212  for(tca::VtxStore const& vtx2: EndPts) {
213  if(vtx2.ID == 0) continue;
214  unsigned int vtxID = vtx2.ID;
215  unsigned int wire = std::nearbyint(vtx2.Pos[0]);
216  geo::PlaneID plID = tca::DecodeCTP(vtx2.CTP);
217  geo::WireID wID = geo::WireID(plID.Cryostat, plID.TPC, plID.Plane, wire);
218  geo::View_t view = geom->View(wID);
219  sv2col.emplace_back((double)vtx2.Pos[1], // Time
220  wID, // WireID
221  0, // strength - not relevant
222  vtxID, // ID
223  view, // View
224  0); // total charge - not relevant
225  } // Endpoints
226  // convert 2D Vertex vector to unique_ptrs
227  std::unique_ptr<std::vector<recob::EndPoint2D> > v2col(new std::vector<recob::EndPoint2D>(std::move(sv2col)));
228 
229  // make 3D vertices
230  std::vector<tca::Vtx3Store> const& Vertices = fTCAlg->GetVertices();
231  double xyz[3] = {0, 0, 0};
232  for(tca::Vtx3Store const& vtx3: Vertices) {
233  // ignore incomplete vertices or obsolete
234  if(vtx3.Wire >= 0) continue;
235  if(vtx3.ID == 0) continue;
236  unsigned int vtxID = vtx3.ID;
237  xyz[0] = vtx3.X;
238  xyz[1] = vtx3.Y;
239  xyz[2] = vtx3.Z;
240  sv3col.emplace_back(xyz, vtxID);
241  } // 3D vertices
242  // convert Vertex vector to unique_ptrs
243  std::unique_ptr<std::vector<recob::Vertex> > v3col(new std::vector<recob::Vertex>(std::move(sv3col)));
244 
245  // make the clusters and associations
246  std::vector<art::Ptr<recob::Hit>> clusterHits;
247  float sumChg, sumADC;
248  std::vector<size_t> dtrIndices;
249  unsigned short clsID = 0;
250  for(size_t icl = 0; icl < Clusters.size(); ++icl) {
251  tca::ClusterStore const& clstr = Clusters[icl];
252  ++clsID;
253  geo::PlaneID planeID = tca::DecodeCTP(clstr.CTP);
254  unsigned short plane = planeID.Plane;
255  unsigned short nclhits = clstr.tclhits.size();
256 
257  sumChg = 0;
258  sumADC = 0;
259  for(unsigned short itt = 0; itt < nclhits; ++itt) {
260  unsigned int iht = clstr.tclhits[itt];
261  recob::Hit const& hit = (*newHits)[iht];
262  sumChg += hit.Integral();
263  sumADC += hit.SummedADC();
264  } // itt
265  geo::View_t view = (*newHits)[clstr.tclhits[0]].View();
266 
267  sccol.emplace_back(
268  clstr.BeginWir, // Start wire
269  0, // sigma start wire
270  clstr.BeginTim, // start tick
271  0, // sigma start tick
272  clstr.BeginChg, // start charge
273  clstr.BeginAng, // start angle
274  0, // start opening angle (0 for line-like clusters)
275  clstr.EndWir, // end wire
276  0, // sigma end wire
277  clstr.EndTim, // end tick
278  0, // sigma end tick
279  clstr.EndChg, // end charge
280  clstr.EndAng, // end angle
281  0, // end opening angle (0 for line-like clusters)
282  sumChg, // integral
283  0, // sigma integral
284  sumADC, // summed ADC
285  0, // sigma summed ADC
286  nclhits, // n hits
287  0, // wires over hits
288  0, // width (0 for line-like clusters)
289  clstr.ID, // ID from TrajClusterAlg
290  view, // view
291  planeID, // plane
292  recob::Cluster::Sentry // sentry
293  );
294  // make the cluster - hit association
295  if(!util::CreateAssn(*this, evt, *cls_hit_assn, sccol.size()-1, clstr.tclhits.begin(), clstr.tclhits.end()))
296  {
297  throw art::Exception(art::errors::ProductRegistrationFailure)<<"Failed to associate hits with cluster ID "<<clstr.ID;
298  } // exception
299 
300  // make the cluster - endpoint associations
301  unsigned short end;
302  if(clstr.BeginVtx >= 0) {
303  end = 0;
304  // See if this endpoint is associated with a 3D vertex
305  unsigned short vtxIndex = 0;
306  for(tca::Vtx3Store const& vtx3 : Vertices) {
307  // ignore killed vertices
308  if(vtx3.ID == 0) continue;
309  // ignore incomplete vertices
310  if(vtx3.Wire > 0) continue;
311  if(vtx3.Vx2ID[plane] == 0) continue;
312  if(vtx3.Vx2ID[plane] == clstr.BeginVtx) {
313  if(!util::CreateAssnD(*this, evt, *cls_vtx_assn, clsID - 1, vtxIndex, end))
314  {
315  throw art::Exception(art::errors::ProductRegistrationFailure)<<"Failed to associate cluster "<<icl<<" with vertex";
316  } // exception
317  break;
318  } // vertex match
319  ++vtxIndex;
320  } // 3D vertices
321  } // clstr.BeginVtx >= 0
322  if(clstr.EndVtx >= 0) {
323  end = 1;
324  // See if this endpoint is associated with a 3D vertex
325  unsigned short vtxIndex = 0;
326  for(tca::Vtx3Store const& vtx3 : Vertices) {
327  // ignore killed vertices
328  if(vtx3.ID == 0) continue;
329  // ignore incomplete vertices
330  if(vtx3.Wire >= 0) continue;
331  if(vtx3.Vx2ID[plane] == 0) continue;
332  if(vtx3.Vx2ID[plane] == clstr.EndVtx) {
333  if(!util::CreateAssnD(*this, evt, *cls_vtx_assn, clsID - 1, vtxIndex, end))
334  {
335  throw art::Exception(art::errors::ProductRegistrationFailure)<<"Failed to associate cluster ID "<<clsID<<" with endpoint";
336  } // exception
337  break;
338  } // vertex match
339  ++vtxIndex;
340  } // 3D vertices
341  } // clstr.BeginVtx >= 0
342  } // icl
343 
344  // Get the list of PFParticles. These are a subset of the set of 3D matches of trajectory hits
345  std::vector<tca::PFPStruct> pfpList = fTCAlg->GetPFParticles();
346 
347  // Make showers
348  std::vector<unsigned int> shwrIndices(pfpList.size(),UINT_MAX);
349  unsigned short nshower = fTCAlg->GetShowerStructSize();
350  for(unsigned short ish = 0; ish < nshower; ++ish) {
351  tca::ShowerStruct3D const& ss3 = fTCAlg->GetShowerStruct(ish);
352  if(ss3.ID == 0) continue;
354  shower.set_id(ish + 1);
355  shower.set_total_energy(ss3.Energy);
356  shower.set_total_energy_err(ss3.EnergyErr);
357  shower.set_total_MIPenergy(ss3.MIPEnergy);
359  shower.set_total_best_plane(ss3.BestPlane);
360  TVector3 dir = {ss3.Dir[0], ss3.Dir[1], ss3.Dir[2]};
361  shower.set_direction(dir);
362  TVector3 dirErr = {ss3.DirErr[0], ss3.DirErr[1], ss3.DirErr[2]};
363  shower.set_direction_err(dirErr);
364  TVector3 pos = {ss3.Start[0], ss3.Start[1], ss3.Start[2]};
365  shower.set_start_point(pos);
366  TVector3 posErr = {ss3.StartErr[0], ss3.StartErr[1], ss3.StartErr[2]};
367  shower.set_start_point_err(posErr);
368  shower.set_dedx(ss3.dEdx);
369  shower.set_dedx_err(ss3.dEdxErr);
370  shower.set_length(ss3.Len);
371  shower.set_open_angle(ss3.OpenAngle);
372  sscol.push_back(shower);
373  if(ss3.PFPIndex < shwrIndices.size()) {
374  shwrIndices[ss3.PFPIndex] = ish;
375  } else {
376 // std::cout<<"Invalid PFPIndex "<<ss3.PFPIndex<<" "<<shwrIndices.size()<<"\n";
377  }
378  // make the shower - hit association
379  if(!util::CreateAssn(*this, evt, *shwr_hit_assn, sscol.size()-1, ss3.Hits.begin(), ss3.Hits.end()))
380  {
381  throw art::Exception(art::errors::ProductRegistrationFailure)<<"Failed to associate hits with Shower";
382  } // exception
383  } // ish
384 
385  // get each of the match vector elements and construct the PFParticle
386  for(size_t ipfp = 0; ipfp < pfpList.size(); ++ipfp) {
387  auto& pfp = pfpList[ipfp];
388  if(pfp.ID == 0) continue;
389  // ignore special PFParticles (e.g. truth photons)
390  if(pfp.PDGCode == 22) continue;
391  size_t parentIndex = pfp.ID - 1;
392  std::vector<size_t> dtrIndices(pfp.DtrIDs.size());
393  for(unsigned short idtr = 0; idtr < pfp.DtrIDs.size(); ++idtr) dtrIndices[idtr] = pfp.DtrIDs[idtr] - 1;
394  spcol.emplace_back(pfp.PDGCode, ipfp, parentIndex, dtrIndices);
395  // make a list of clusters that are associated with this PFParticle. Trace the association
396  // through the trajectories that
397  std::vector<unsigned int> clsIndices;
398  for(auto tjid : pfp.TjIDs) {
399  if(tjid == 0) {
400  std::cout<<"TC: Found an invalid tj ID "<<tjid<<" in P"<<pfp.ID;
401  continue;
402  }
403  unsigned int clsIndex = fTCAlg->GetTjClusterIndex(tjid);
404  if(clsIndex > Clusters.size() - 1) {
405  std::cout<<"Retrieved an invalid cluster index for PFParticle "<<pfp.ID<<" TjID "<<tjid<<". Ignoring it...\n";
406  clsIndices.clear();
407  break;
408  }
409  clsIndices.push_back(clsIndex);
410  } // tjid
411  if(pfp.Vx3ID[0] > (int)Vertices.size()) std::cout<<"TC module: Bad Vtx3DIndex = "<<pfp.Vx3ID[0]<<" size "<<Vertices.size()<<"\n";
412 
413  // PFParticle - Cluster associations
414  if(!util::CreateAssn(*this, evt, *pfp_cls_assn, spcol.size()-1, clsIndices.begin(), clsIndices.end()))
415  {
416  throw art::Exception(art::errors::ProductRegistrationFailure)<<"Failed to associate clusters with PFParticle";
417  } // exception
418  // PFParticle - Vertex association
419  std::vector<unsigned int> vtmp(1);
420  // Translate the 3D vertex index into the index of complete 3D vertices that have been put into sv3col
421  unsigned short vtxIndex = 0;
422  for(unsigned short iv = 0; iv < Vertices.size(); ++iv) {
423  if(Vertices[iv].ID == 0) continue;
424  if(Vertices[iv].Wire >= 0) continue;
425  if(pfp.Vx3ID[0] == Vertices[iv].ID) {
426  vtmp[0] = vtxIndex;
427  if(!util::CreateAssn(*this, evt, *pfp_vtx_assn, spcol.size()-1, vtmp.begin(), vtmp.end()))
428  {
429  throw art::Exception(art::errors::ProductRegistrationFailure)<<"Failed to associate vertex with PFParticle";
430  }
431  break;
432  }
433  ++vtxIndex;
434  } // iv
435  // PFParticle - Shower associations
436  if (shwrIndices[ipfp]<UINT_MAX) {
437  if(!util::CreateAssn(*this, evt, *pfp_shwr_assn, spcol.size()-1, shwrIndices.begin()+ipfp, shwrIndices.begin()+ipfp+1))
438  {
439  throw art::Exception(art::errors::ProductRegistrationFailure)<<"Failed to associate showers with PFParticle";
440  } // exception
441  }
442  // PFParticle - CosmicTag association
443  if (fTCAlg->GetTJS().TagCosmics){
444  std::vector<float> tempPt1, tempPt2;
445  tempPt1.push_back(-999);
446  tempPt1.push_back(-999);
447  tempPt1.push_back(-999);
448  tempPt2.push_back(-999);
449  tempPt2.push_back(-999);
450  tempPt2.push_back(-999);
451  ctcol.emplace_back(tempPt1, tempPt2, pfp.CosmicScore, anab::CosmicTagID_t::kNotTagged);
452  if (!util::CreateAssn(*this, evt, spcol, ctcol, *pfp_cos_assn, ctcol.size()-1, ctcol.size())){
453  throw art::Exception(art::errors::ProductRegistrationFailure)<<"Failed to associate CosmicTag with PFParticle";
454  }
455  } // TagCosmics
456 /*
457  // Make a SpacePoint from each Tp3
458  double zeros[6] = {0};
459  double chisq = 0;
460  for(unsigned short ip3 = 0; ip3 < pfp.Tp3s.size(); ++ip3) {
461  int id = ip3 + 1;
462  auto& tp3 = pfp.Tp3s[ip3];
463  if(!tp3.IsValid) continue;
464  double xyz[3];
465  for(unsigned short ixyz = 0; ixyz < 3; ++ixyz) xyz[ixyz] = tp3.Pos[ixyz];
466  // add a space point
467  ssptcol.emplace_back(xyz, zeros, chisq, id);
468  // make a list of the hits from the trajectory points
469  std::vector<unsigned int> spthits;
470  for(auto& tj2pt : tp3.Tj2Pts) {
471  auto& tj = fTCAlg->GetTJS().allTraj[tj2pt.id - 1];
472  auto& tp = tj.Pts[tj2pt.ipt];
473  for(unsigned short ii = 0; ii < tp.Hits.size(); ++ii) {
474  if(tp.UseHit[ii]) spthits.push_back(tp.Hits[ii]);
475  }
476  } // tp2
477  // make the space point - hit association
478  if(!util::CreateAssn(*this, evt, *spt_hit_assn, ssptcol.size()-1, spthits.begin(), spthits.end()))
479  {
480  throw art::Exception(art::errors::ProductRegistrationFailure)<<"Failed to associate hits with space point in pfp "<<pfp.ID;
481  } // exception
482  } // ip3
483  // make the PFParticle - space point association
484  std::vector<unsigned int> stmp(1);
485  stmp[0] = ssptcol.size()-1;
486  if(!util::CreateAssn(*this, evt, *pfp_spt_assn, spcol.size()-1, stmp.begin(), stmp.end()))
487  {
488  throw art::Exception(art::errors::ProductRegistrationFailure)<<"Failed to associate space point with PFParticle "<<pfp.ID;
489  } // exception
490 */
491  } // ipfp
492 
493  // convert cluster vector to unique_ptrs
494  std::unique_ptr<std::vector<recob::Cluster> > ccol(new std::vector<recob::Cluster>(std::move(sccol)));
495  std::unique_ptr<std::vector<recob::PFParticle> > pcol(new std::vector<recob::PFParticle>(std::move(spcol)));
496 // std::unique_ptr<std::vector<recob::SpacePoint> > sptcol(new std::vector<recob::SpacePoint>(std::move(ssptcol)));
497  std::unique_ptr<std::vector<recob::Shower> > scol(new std::vector<recob::Shower>(std::move(sscol)));
498  std::unique_ptr<std::vector<anab::CosmicTag>> ctgcol(new std::vector<anab::CosmicTag>(std::move(ctcol)));
499 
500  // clean up
501  fTCAlg->ClearResults();
502 
503  // move the cluster collection and the associations into the event:
504  art::InputTag hitModuleLabel = fTCAlg->GetHitFinderModuleLabel();
505  recob::HitRefinerAssociator shcol(*this, evt, hitModuleLabel, fDoWireAssns, fDoRawDigitAssns);
506  shcol.use_hits(std::move(newHits));
507  shcol.put_into(evt);
508  evt.put(std::move(ccol));
509  evt.put(std::move(cls_hit_assn));
510  evt.put(std::move(v2col));
511  evt.put(std::move(v3col));
512  evt.put(std::move(scol));
513  evt.put(std::move(shwr_hit_assn));
514  evt.put(std::move(cls_vtx_assn));
515  evt.put(std::move(pcol));
516  evt.put(std::move(pfp_cls_assn));
517  evt.put(std::move(pfp_shwr_assn));
518  evt.put(std::move(pfp_vtx_assn));
519 // evt.put(std::move(sptcol));
520 // evt.put(std::move(pfp_spt_assn));
521 // evt.put(std::move(spt_hit_assn));
522  evt.put(std::move(ctgcol));
523  evt.put(std::move(pfp_cos_assn));
524  } // TrajCluster::produce()
525 
526 
527 
528  //----------------------------------------------------------------------------
530 
531 } // namespace cluster
532 
void set_start_point_err(const TVector3 &xyz_e)
Definition: Shower.h:138
void set_dedx_err(const std::vector< double > &q)
Definition: Shower.h:140
void set_direction_err(const TVector3 &dir_e)
Definition: Shower.h:136
std::vector< unsigned int > tclhits
Definition: DataStructs.h:79
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:112
struct of temporary 2D vertices (end points)
Definition: DataStructs.h:83
std::vector< double > dEdxErr
Definition: DataStructs.h:310
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Declaration of signal hit object.
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
std::vector< double > MIPEnergy
Definition: DataStructs.h:307
void set_total_energy(const std::vector< double > &q)
Definition: Shower.h:129
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:130
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
Definition: Hit.h:225
void set_total_MIPenergy_err(const std::vector< double > &q)
Definition: Shower.h:132
Cluster finding and building.
static void declare_products(ModuleType &producer, std::string instance_name="", bool doWireAssns=true, bool doRawDigitAssns=true)
Declares the hit products we are going to fill.
Definition: HitCreator.h:1117
void set_total_energy_err(const std::vector< double > &q)
Definition: Shower.h:130
static const SentryArgument_t Sentry
An instance of the sentry object.
Definition: Cluster.h:182
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
void set_id(const int id)
Definition: Shower.h:128
Helper functions to create a hit.
struct of temporary 3D vertices
Definition: DataStructs.h:111
void set_direction(const TVector3 &dir)
Definition: Shower.h:135
void use_hits(std::unique_ptr< std::vector< recob::Hit >> &&srchits)
Uses the specified collection as data product.
Definition: HitCreator.cxx:431
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:42
void put_into(art::Event &)
Moves the data into the event.
Definition: HitCreator.h:939
bool CreateAssnD(PRODUCER const &prod, art::Event &evt, art::Assns< T, U, D > &assn, size_t first_index, size_t second_index, typename art::Assns< T, U, D >::data_t &&data)
Creates a single one-to-one association with associated data.
void set_length(const double &l)
Definition: Shower.h:141
T get(std::string const &key) const
Definition: ParameterSet.h:231
void set_open_angle(const double &a)
Definition: Shower.h:142
A class handling a collection of hits and its associations.
Definition: HitCreator.h:865
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.
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:258
Declaration of cluster object.
void set_total_best_plane(const int q)
Definition: Shower.h:133
View_t View(geo::PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
Definition of data types for geometry description.
std::vector< unsigned int > Hits
Definition: DataStructs.h:313
std::unique_ptr< tca::TrajClusterAlg > fTCAlg
void set_total_MIPenergy(const std::vector< double > &q)
Definition: Shower.h:131
Detector simulation of raw signals on wires.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:104
std::vector< double > EnergyErr
Definition: DataStructs.h:306
std::vector< double > MIPEnergyErr
Definition: DataStructs.h:308
T * make(ARGS...args) const
Utility object to perform functions of association.
TDirectory * dir
Definition: macro.C:5
std::vector< double > Energy
Definition: DataStructs.h:305
geo::PlaneID DecodeCTP(CTP_t CTP)
Definition: DataStructs.cxx:89
Produces clusters by the TrajCluster algorithm.
void produce(art::Event &evt) override
float SummedADC() const
The sum of calibrated ADC counts of the hit (0. by default)
Definition: Hit.h:224
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:49
unsigned short PFPIndex
Definition: DataStructs.h:318
void set_start_point(const TVector3 &xyz)
Definition: Shower.h:137
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:203
std::vector< double > dEdx
Definition: DataStructs.h:309
void reconfigure(fhicl::ParameterSet const &pset)
struct of temporary clusters
Definition: DataStructs.h:65
void set_dedx(const std::vector< double > &q)
Definition: Shower.h:139
TrajCluster(fhicl::ParameterSet const &pset)