LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
TrajClusterAlg.h
Go to the documentation of this file.
1 //
3 //
4 // TrajClusterAlg
5 //
6 // Bruce Baller
7 //
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 namespace fhicl {
19  class ParameterSet;
20 }
21 
22 // 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 SetInputSpts(std::vector<recob::SpacePoint> const& sptHandle)
45  {
46  evt.sptHandle = &sptHandle;
47  }
48  void SetSourceHits(std::vector<recob::Hit> const& srcHits);
50  void RunTrajClusterAlg(detinfo::DetectorClocksData const& clockData,
51  detinfo::DetectorPropertiesData const& detProp,
52  std::vector<unsigned int>& hitsInSlice,
53  int sliceID);
54  bool CreateSlice(detinfo::DetectorClocksData const& clockData,
55  detinfo::DetectorPropertiesData const& detProp,
56  std::vector<unsigned int>& hitsInSlice,
57  int sliceID);
58  void FinishEvent();
59 
60  void DefineShTree(TTree* t);
61 
62  unsigned short GetSlicesSize() const { return slices.size(); }
63  TCSlice const& GetSlice(unsigned short sliceIndex) const { return slices[sliceIndex]; }
64  void MergeTPHits(std::vector<unsigned int>& tpHits,
65  std::vector<recob::Hit>& newHitCol,
66  std::vector<unsigned int>& newHitAssns) const;
67 
68  std::vector<unsigned int> const& GetAlgModCount() const { return fAlgModCount; }
69  std::vector<std::string> const& GetAlgBitNames() const { return AlgBitNames; }
70 
72  void ClearResults()
73  {
74  slices.resize(0);
75  evt.sptHits.resize(0);
76  evt.wireHitRange.resize(0);
77  }
78 
79  private:
80  recob::Hit MergeTPHitsOnWire(std::vector<unsigned int>& tpHits) const;
81 
82  // SHOWER VARIABLE TREE
83  TTree* showertree;
84 
86  TMVA::Reader fMVAReader;
87 
88  std::vector<unsigned int> fAlgModCount;
89 
90  void ReconstructAllTraj(detinfo::DetectorPropertiesData const& detProp,
91  TCSlice& slc,
92  CTP_t inCTP);
93  // Finds junk trajectories using unassigned hits
94  void FindJunkTraj(TCSlice& slc, CTP_t inCTP);
95  // Check allTraj -> inTraj associations
96  void ChkInTraj(std::string someText, TCSlice& slc);
97 
98  }; // class TrajClusterAlg
99 
100 } // namespace cluster
101 
102 #endif // ifndef TRAJCLUSTERALG_H
void ClearResults()
Deletes all the results.
const std::vector< std::string > AlgBitNames
Definition: DataStructs.cxx:16
Declaration of signal hit object.
calo::CalorimetryAlg fCaloAlg
bool expectSlicedHits
info passed from the module - used to (not) define wireHitRange
Definition: DataStructs.h:641
std::vector< std::string > const & GetAlgBitNames() const
std::vector< std::array< unsigned int, 3 > > sptHits
SpacePoint -> Hits assns by plane.
Definition: DataStructs.h:626
std::vector< unsigned int > fAlgModCount
parameter set interface
unsigned short GetSlicesSize() const
TMVA::Reader fMVAReader
General LArSoft Utilities.
std::vector< TCSlice > slices
Definition: DataStructs.cxx:13
TCSlice const & GetSlice(unsigned short sliceIndex) const
std::vector< recob::SpacePoint > const * sptHandle
handle to SpacePoints in the event
Definition: DataStructs.h:624
unsigned int CTP_t
Definition: DataStructs.h:47
Contains all timing reference information for the detector.
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:46
TCEvent evt
Definition: DataStructs.cxx:8
void SetInputSpts(std::vector< recob::SpacePoint > const &sptHandle)
std::vector< std::vector< std::pair< unsigned int, unsigned int > > > wireHitRange
Definition: DataStructs.h:619
Event finding and building.
std::vector< unsigned int > const & GetAlgModCount() const