TrajClusterAlg.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 //
4 // TrajClusterAlg
5 //
6 // Bruce Baller
7 //
8 ///////////////////////////////////////////////////////////////////////
9 #ifndef TRAJCLUSTERALG_H
10 #define TRAJCLUSTERALG_H
11 
12 // C/C++ standard libraries
13 #include <string>
14 #include <utility> // std::pair<>
15 #include <vector>
16 
17 // framework libraries
18 #include "fhiclcpp/fwd.h"
19 
20 // LArSoft libraries
27 namespace detinfo {
28  class DetectorClocksData;
29 }
30 
31 // ROOT libraries
32 #include "TMVA/Reader.h"
33 class TTree;
34 
35 namespace tca {
36 
38  public:
39  explicit TrajClusterAlg(fhicl::ParameterSet const& pset);
40 
41  bool SetInputHits(std::vector<recob::Hit> const& inputHits,
42  unsigned int run,
43  unsigned int event);
44  void
45  SetInputSpts(std::vector<recob::SpacePoint> const& sptHandle)
46  {
47  evt.sptHandle = &sptHandle;
48  }
49  void SetSourceHits(std::vector<recob::Hit> const& srcHits);
50  void
52  {
53  evt.expectSlicedHits = true;
54  }
55  void RunTrajClusterAlg(detinfo::DetectorClocksData const& clockData,
56  detinfo::DetectorPropertiesData const& detProp,
57  std::vector<unsigned int>& hitsInSlice,
58  int sliceID);
59  bool CreateSlice(detinfo::DetectorClocksData const& clockData,
60  detinfo::DetectorPropertiesData const& detProp,
61  std::vector<unsigned int>& hitsInSlice,
62  int sliceID);
63  void FinishEvent();
64 
65  void DefineShTree(TTree* t);
66 
67  unsigned short
68  GetSlicesSize() const
69  {
70  return slices.size();
71  }
72  TCSlice const&
73  GetSlice(unsigned short sliceIndex) const
74  {
75  return slices[sliceIndex];
76  }
77  void MergeTPHits(std::vector<unsigned int>& tpHits,
78  std::vector<recob::Hit>& newHitCol,
79  std::vector<unsigned int>& newHitAssns) const;
80 
81  std::vector<unsigned int> const&
83  {
84  return fAlgModCount;
85  }
86  std::vector<std::string> const&
88  {
89  return AlgBitNames;
90  }
91 
92  /// Deletes all the results
93  void
95  {
96  slices.resize(0);
97  evt.sptHits.resize(0);
98  evt.wireHitRange.resize(0);
99  }
100 
101  private:
102  recob::Hit MergeTPHitsOnWire(std::vector<unsigned int>& tpHits) const;
103 
104  // SHOWER VARIABLE TREE
105  TTree* showertree;
106 
108  TMVA::Reader fMVAReader;
109 
110  std::vector<unsigned int> fAlgModCount;
111 
112  void ReconstructAllTraj(detinfo::DetectorPropertiesData const& detProp,
113  TCSlice& slc,
114  CTP_t inCTP);
115  // Finds junk trajectories using unassigned hits
116  void FindJunkTraj(TCSlice& slc, CTP_t inCTP);
117  // Check allTraj -> inTraj associations
118  void ChkInTraj(std::string someText, TCSlice& slc);
119 
120  }; // class TrajClusterAlg
121 
122 } // namespace cluster
123 
124 #endif // ifndef TRAJCLUSTERALG_H
void ClearResults()
Deletes all the results.
const std::vector< std::string > AlgBitNames
Definition: DataStructs.cxx:15
std::string string
Definition: nybbler.cc:12
calo::CalorimetryAlg fCaloAlg
Particle class.
bool expectSlicedHits
info passed from the module - used to (not) define wireHitRange
Definition: DataStructs.h:650
std::vector< std::string > const & GetAlgBitNames() const
std::vector< std::array< unsigned int, 3 > > sptHits
SpacePoint -> Hits assns by plane.
Definition: DataStructs.h:635
std::vector< unsigned int > fAlgModCount
unsigned short GetSlicesSize() const
TMVA::Reader fMVAReader
General LArSoft Utilities.
std::vector< TCSlice > slices
Definition: DataStructs.cxx:12
TCSlice const & GetSlice(unsigned short sliceIndex) const
std::vector< recob::SpacePoint > const * sptHandle
handle to SpacePoints in the event
Definition: DataStructs.h:633
Declaration of signal hit object.
unsigned int CTP_t
Definition: DataStructs.h:49
Contains all timing reference information for the detector.
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:48
TCEvent evt
Definition: DataStructs.cxx:7
void SetInputSpts(std::vector< recob::SpacePoint > const &sptHandle)
std::vector< std::vector< std::pair< unsigned int, unsigned int > > > wireHitRange
Definition: DataStructs.h:628
Event finding and building.
std::vector< unsigned int > const & GetAlgModCount() const