All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 namespace fhicl { class ParameterSet; }
19 
20 // LArSoft libraries
25 namespace detinfo {
26  class DetectorClocksData;
27 }
28 
29 // ROOT libraries
30 #include "TMVA/Reader.h"
31 class TTree;
32 
33 namespace tca {
34 
36  public:
37  explicit TrajClusterAlg(fhicl::ParameterSet const& pset);
38 
39  bool SetInputHits(std::vector<recob::Hit> const& inputHits,
40  unsigned int run,
41  unsigned int event);
42  void
43  SetInputSpts(std::vector<recob::SpacePoint> const& sptHandle)
44  {
45  evt.sptHandle = &sptHandle;
46  }
47  void SetSourceHits(std::vector<recob::Hit> const& srcHits);
48  void
50  {
51  evt.expectSlicedHits = true;
52  }
53  void RunTrajClusterAlg(detinfo::DetectorClocksData const& clockData,
55  std::vector<unsigned int>& hitsInSlice,
56  int sliceID);
57  bool CreateSlice(detinfo::DetectorClocksData const& clockData,
59  std::vector<unsigned int>& hitsInSlice,
60  int sliceID);
61  void FinishEvent();
62 
63  void DefineShTree(TTree* t);
64 
65  unsigned short
66  GetSlicesSize() const
67  {
68  return slices.size();
69  }
70  TCSlice const&
71  GetSlice(unsigned short sliceIndex) const
72  {
73  return slices[sliceIndex];
74  }
75  void MergeTPHits(std::vector<unsigned int>& tpHits,
76  std::vector<recob::Hit>& newHitCol,
77  std::vector<unsigned int>& newHitAssns) const;
78 
79  std::vector<unsigned int> const&
81  {
82  return fAlgModCount;
83  }
84  std::vector<std::string> const&
86  {
87  return AlgBitNames;
88  }
89 
90  /// Deletes all the results
91  void
93  {
94  slices.resize(0);
95  evt.sptHits.resize(0);
96  evt.wireHitRange.resize(0);
97  }
98 
99  private:
100  recob::Hit MergeTPHitsOnWire(std::vector<unsigned int>& tpHits) const;
101 
102  // SHOWER VARIABLE TREE
103  TTree* showertree;
104 
106  TMVA::Reader fMVAReader;
107 
108  std::vector<unsigned int> fAlgModCount;
109 
111  TCSlice& slc,
112  CTP_t inCTP);
113  // Finds junk trajectories using unassigned hits
114  void FindJunkTraj(TCSlice& slc, CTP_t inCTP);
115  // Check allTraj -> inTraj associations
116  void ChkInTraj(std::string someText, TCSlice& slc);
117 
118  }; // class TrajClusterAlg
119 
120 } // namespace cluster
121 
122 #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.
void RunTrajClusterAlg(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, std::vector< unsigned int > &hitsInSlice, int sliceID)
calo::CalorimetryAlg fCaloAlg
bool CreateSlice(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, std::vector< unsigned int > &hitsInSlice, int sliceID)
bool expectSlicedHits
info passed from the module - used to (not) define wireHitRange
Definition: DataStructs.h:648
std::vector< std::string > const & GetAlgBitNames() const
std::vector< std::array< unsigned int, 3 > > sptHits
SpacePoint -&gt; Hits assns by plane.
Definition: DataStructs.h:633
bool SetInputHits(std::vector< recob::Hit > const &inputHits, unsigned int run, unsigned int event)
std::vector< unsigned int > fAlgModCount
void DefineShTree(TTree *t)
recob::Hit MergeTPHitsOnWire(std::vector< unsigned int > &tpHits) const
unsigned short GetSlicesSize() const
TMVA::Reader fMVAReader
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:631
unsigned int CTP_t
Definition: DataStructs.h:47
Contains all timing reference information for the detector.
TrajClusterAlg(fhicl::ParameterSet const &pset)
void MergeTPHits(std::vector< unsigned int > &tpHits, std::vector< recob::Hit > &newHitCol, std::vector< unsigned int > &newHitAssns) const
void SetSourceHits(std::vector< recob::Hit > const &srcHits)
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:48
void ChkInTraj(std::string someText, TCSlice &slc)
void ReconstructAllTraj(detinfo::DetectorPropertiesData const &detProp, TCSlice &slc, CTP_t inCTP)
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:626
auto const detProp
void FindJunkTraj(TCSlice &slc, CTP_t inCTP)
std::vector< unsigned int > const & GetAlgModCount() const