LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
shower::ReconTrack Class Reference

#include "TrackShowerSeparationAlg.h"

Public Member Functions

 ReconTrack (int id)
 
void SetVertex (TVector3 vertex)
 
void SetEnd (TVector3 end)
 
void SetLength (double length)
 
void SetVertexDir (TVector3 vertexDir)
 
void SetDirection (TVector3 direction)
 
void SetHits (std::vector< art::Ptr< recob::Hit >> hits)
 
void SetSpacePoints (std::vector< art::Ptr< recob::SpacePoint >> spacePoints)
 
void AddForwardTrack (int track)
 
void AddBackwardTrack (int track)
 
void AddShowerTrack (int track)
 
void AddForwardSpacePoint (int spacePoint)
 
void AddBackwardSpacePoint (int spacePoint)
 
void AddCylinderSpacePoint (int spacePoint)
 
void AddSphereSpacePoint (int spacePoint)
 
void AddIsolationSpacePoint (int spacePoint, double distance)
 
int ID () const
 
TVector3 Vertex () const
 
TVector3 End () const
 
double Length () const
 
TVector3 VertexDirection () const
 
TVector3 Direction () const
 
const std::vector< art::Ptr< recob::Hit > > & Hits () const
 
const std::vector< art::Ptr< recob::SpacePoint > > & SpacePoints () const
 
void FlipTrack ()
 
void MakeShower ()
 
void MakeShowerTrack ()
 
void MakeShowerCone ()
 
void MakeTrack ()
 
bool IsShower () const
 
bool IsShowerTrack () const
 
bool IsShowerCone () const
 
bool IsTrack () const
 
bool IsUndetermined () const
 
int TrackConeSize () const
 
bool ShowerTrackCandidate () const
 
const std::vector< int > & ShowerTracks () const
 
const std::vector< int > & ForwardConeTracks () const
 
int ConeSize () const
 
int ForwardSpacePoints () const
 
int NumCylinderSpacePoints () const
 
double CylinderSpacePointRatio () const
 
int NumSphereSpacePoints () const
 
double SphereSpacePointDensity (double scale) const
 
double IsolationSpacePointDistance () const
 

Private Attributes

int fID
 
TVector3 fVertex
 
TVector3 fEnd
 
double fLength
 
TVector3 fVertexDir
 
TVector3 fDirection
 
std::vector< art::Ptr< recob::Hit > > fHits
 
std::vector< art::Ptr< recob::SpacePoint > > fSpacePoints
 
std::vector< int > fForwardConeTracks
 
std::vector< int > fBackwardConeTracks
 
std::vector< int > fShowerTracks
 
std::vector< int > fForwardSpacePoints
 
std::vector< int > fBackwardSpacePoints
 
std::vector< int > fCylinderSpacePoints
 
std::vector< int > fSphereSpacePoints
 
std::map< int, double > fIsolationSpacePoints
 
bool fShower
 
bool fShowerTrack
 
bool fShowerCone
 
bool fTrack
 

Detailed Description

Definition at line 41 of file TrackShowerSeparationAlg.h.

Constructor & Destructor Documentation

shower::ReconTrack::ReconTrack ( int  id)
inline

Definition at line 43 of file TrackShowerSeparationAlg.h.

Member Function Documentation

void shower::ReconTrack::AddBackwardSpacePoint ( int  spacePoint)
inline

Definition at line 79 of file TrackShowerSeparationAlg.h.

79 { fBackwardSpacePoints.push_back(spacePoint); }
std::vector< int > fBackwardSpacePoints
void shower::ReconTrack::AddBackwardTrack ( int  track)
inline

Definition at line 70 of file TrackShowerSeparationAlg.h.

References track.

71  {
72  if (std::find(fBackwardConeTracks.begin(), fBackwardConeTracks.end(), track) ==
73  fBackwardConeTracks.end())
74  fBackwardConeTracks.push_back(track);
75  }
Float_t track
Definition: plot.C:35
std::vector< int > fBackwardConeTracks
void shower::ReconTrack::AddCylinderSpacePoint ( int  spacePoint)
inline

Definition at line 80 of file TrackShowerSeparationAlg.h.

80 { fCylinderSpacePoints.push_back(spacePoint); }
std::vector< int > fCylinderSpacePoints
void shower::ReconTrack::AddForwardSpacePoint ( int  spacePoint)
inline

Definition at line 78 of file TrackShowerSeparationAlg.h.

78 { fForwardSpacePoints.push_back(spacePoint); }
std::vector< int > fForwardSpacePoints
void shower::ReconTrack::AddForwardTrack ( int  track)
inline

Definition at line 64 of file TrackShowerSeparationAlg.h.

References track.

65  {
66  if (std::find(fForwardConeTracks.begin(), fForwardConeTracks.end(), track) ==
67  fForwardConeTracks.end())
68  fForwardConeTracks.push_back(track);
69  }
std::vector< int > fForwardConeTracks
Float_t track
Definition: plot.C:35
void shower::ReconTrack::AddIsolationSpacePoint ( int  spacePoint,
double  distance 
)
inline

Definition at line 82 of file TrackShowerSeparationAlg.h.

83  {
84  fIsolationSpacePoints[spacePoint] = distance;
85  }
std::map< int, double > fIsolationSpacePoints
void shower::ReconTrack::AddShowerTrack ( int  track)
inline

Definition at line 76 of file TrackShowerSeparationAlg.h.

76 { fShowerTracks.push_back(track); }
std::vector< int > fShowerTracks
Float_t track
Definition: plot.C:35
void shower::ReconTrack::AddSphereSpacePoint ( int  spacePoint)
inline

Definition at line 81 of file TrackShowerSeparationAlg.h.

81 { fSphereSpacePoints.push_back(spacePoint); }
std::vector< int > fSphereSpacePoints
int shower::ReconTrack::ConeSize ( ) const
inline

Definition at line 148 of file TrackShowerSeparationAlg.h.

149  {
150  return (int)fForwardSpacePoints.size() - (int)fBackwardSpacePoints.size();
151  }
std::vector< int > fBackwardSpacePoints
std::vector< int > fForwardSpacePoints
double shower::ReconTrack::CylinderSpacePointRatio ( ) const
inline

Definition at line 154 of file TrackShowerSeparationAlg.h.

155  {
156  return (double)fCylinderSpacePoints.size() / (double)fSpacePoints.size();
157  }
std::vector< art::Ptr< recob::SpacePoint > > fSpacePoints
std::vector< int > fCylinderSpacePoints
TVector3 shower::ReconTrack::Direction ( ) const
inline

Definition at line 93 of file TrackShowerSeparationAlg.h.

93 { return fDirection; }
TVector3 shower::ReconTrack::End ( void  ) const
inline

Definition at line 90 of file TrackShowerSeparationAlg.h.

90 { return fEnd; }
void shower::ReconTrack::FlipTrack ( )
inline

Definition at line 97 of file TrackShowerSeparationAlg.h.

References tmp.

98  {
99  TVector3 tmp = fEnd;
100  fEnd = fVertex;
101  fVertex = tmp;
102  fDirection *= -1;
103  }
Float_t tmp
Definition: plot.C:35
const std::vector<int>& shower::ReconTrack::ForwardConeTracks ( ) const
inline

Definition at line 146 of file TrackShowerSeparationAlg.h.

146 { return fForwardConeTracks; }
std::vector< int > fForwardConeTracks
int shower::ReconTrack::ForwardSpacePoints ( ) const
inline

Definition at line 152 of file TrackShowerSeparationAlg.h.

152 { return fForwardSpacePoints.size(); }
std::vector< int > fForwardSpacePoints
const std::vector<art::Ptr<recob::Hit> >& shower::ReconTrack::Hits ( void  ) const
inline

Definition at line 94 of file TrackShowerSeparationAlg.h.

94 { return fHits; }
std::vector< art::Ptr< recob::Hit > > fHits
int shower::ReconTrack::ID ( ) const
inline

Definition at line 88 of file TrackShowerSeparationAlg.h.

double shower::ReconTrack::IsolationSpacePointDistance ( ) const
inline

Definition at line 164 of file TrackShowerSeparationAlg.h.

165  {
166  std::vector<double> distances;
167  std::transform(fIsolationSpacePoints.begin(),
168  fIsolationSpacePoints.end(),
169  std::back_inserter(distances),
170  [](const std::pair<int, double>& p) { return p.second; });
171  return TMath::Mean(distances.begin(), distances.end());
172  }
std::map< int, double > fIsolationSpacePoints
bool shower::ReconTrack::IsShower ( ) const
inline

Definition at line 134 of file TrackShowerSeparationAlg.h.

134 { return fShower; }
bool shower::ReconTrack::IsShowerCone ( ) const
inline

Definition at line 136 of file TrackShowerSeparationAlg.h.

bool shower::ReconTrack::IsShowerTrack ( ) const
inline

Definition at line 135 of file TrackShowerSeparationAlg.h.

bool shower::ReconTrack::IsTrack ( ) const
inline

Definition at line 137 of file TrackShowerSeparationAlg.h.

137 { return fTrack; }
bool shower::ReconTrack::IsUndetermined ( ) const
inline

Definition at line 138 of file TrackShowerSeparationAlg.h.

double shower::ReconTrack::Length ( void  ) const
inline

Definition at line 91 of file TrackShowerSeparationAlg.h.

91 { return fLength; }
void shower::ReconTrack::MakeShower ( )
inline

Definition at line 105 of file TrackShowerSeparationAlg.h.

106  {
107  if (fTrack)
108  this->MakeShowerTrack();
109  else
110  this->MakeShowerCone();
111  }
void shower::ReconTrack::MakeShowerCone ( )
inline

Definition at line 119 of file TrackShowerSeparationAlg.h.

120  {
121  fShower = true;
122  fShowerCone = true;
123  fShowerTrack = false;
124  fTrack = false;
125  }
void shower::ReconTrack::MakeShowerTrack ( )
inline

Definition at line 112 of file TrackShowerSeparationAlg.h.

113  {
114  fShower = true;
115  fShowerTrack = true;
116  fShowerCone = false;
117  fTrack = false;
118  }
void shower::ReconTrack::MakeTrack ( )
inline

Definition at line 126 of file TrackShowerSeparationAlg.h.

127  {
128  fTrack = true;
129  fShower = false;
130  fShowerTrack = false;
131  fShowerCone = false;
132  }
int shower::ReconTrack::NumCylinderSpacePoints ( ) const
inline

Definition at line 153 of file TrackShowerSeparationAlg.h.

153 { return fCylinderSpacePoints.size(); }
std::vector< int > fCylinderSpacePoints
int shower::ReconTrack::NumSphereSpacePoints ( ) const
inline

Definition at line 158 of file TrackShowerSeparationAlg.h.

158 { return fSphereSpacePoints.size(); }
std::vector< int > fSphereSpacePoints
void shower::ReconTrack::SetDirection ( TVector3  direction)
inline

Definition at line 57 of file TrackShowerSeparationAlg.h.

57 { fDirection = direction; }
void shower::ReconTrack::SetEnd ( TVector3  end)
inline

Definition at line 54 of file TrackShowerSeparationAlg.h.

References util::end().

54 { fEnd = end; }
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
void shower::ReconTrack::SetHits ( std::vector< art::Ptr< recob::Hit >>  hits)
inline

Definition at line 58 of file TrackShowerSeparationAlg.h.

References hits().

58 { fHits = hits; }
void hits()
Definition: readHits.C:15
std::vector< art::Ptr< recob::Hit > > fHits
void shower::ReconTrack::SetLength ( double  length)
inline

Definition at line 55 of file TrackShowerSeparationAlg.h.

55 { fLength = length; }
void shower::ReconTrack::SetSpacePoints ( std::vector< art::Ptr< recob::SpacePoint >>  spacePoints)
inline

Definition at line 59 of file TrackShowerSeparationAlg.h.

60  {
61  fSpacePoints = spacePoints;
62  }
std::vector< art::Ptr< recob::SpacePoint > > fSpacePoints
void shower::ReconTrack::SetVertex ( TVector3  vertex)
inline

Definition at line 53 of file TrackShowerSeparationAlg.h.

53 { fVertex = vertex; }
vertex reconstruction
void shower::ReconTrack::SetVertexDir ( TVector3  vertexDir)
inline

Definition at line 56 of file TrackShowerSeparationAlg.h.

56 { fVertexDir = vertexDir; }
bool shower::ReconTrack::ShowerTrackCandidate ( ) const
inline

Definition at line 144 of file TrackShowerSeparationAlg.h.

144 { return TrackConeSize() > 5; }
const std::vector<int>& shower::ReconTrack::ShowerTracks ( ) const
inline

Definition at line 145 of file TrackShowerSeparationAlg.h.

145 { return fShowerTracks; }
std::vector< int > fShowerTracks
const std::vector<art::Ptr<recob::SpacePoint> >& shower::ReconTrack::SpacePoints ( ) const
inline

Definition at line 95 of file TrackShowerSeparationAlg.h.

95 { return fSpacePoints; }
std::vector< art::Ptr< recob::SpacePoint > > fSpacePoints
double shower::ReconTrack::SphereSpacePointDensity ( double  scale) const
inline

Definition at line 159 of file TrackShowerSeparationAlg.h.

160  {
161  return (double)fSphereSpacePoints.size() /
162  (4 * TMath::Pi() * TMath::Power((scale * fLength / 2.), 3) / 3.);
163  }
Double_t scale
Definition: plot.C:24
std::vector< int > fSphereSpacePoints
int shower::ReconTrack::TrackConeSize ( ) const
inline

Definition at line 140 of file TrackShowerSeparationAlg.h.

141  {
142  return (int)fForwardConeTracks.size() - (int)fBackwardConeTracks.size();
143  }
std::vector< int > fForwardConeTracks
std::vector< int > fBackwardConeTracks
TVector3 shower::ReconTrack::Vertex ( ) const
inline

Definition at line 89 of file TrackShowerSeparationAlg.h.

89 { return fVertex; }
TVector3 shower::ReconTrack::VertexDirection ( ) const
inline

Definition at line 92 of file TrackShowerSeparationAlg.h.

92 { return fVertexDir; }

Member Data Documentation

std::vector<int> shower::ReconTrack::fBackwardConeTracks
private

Definition at line 185 of file TrackShowerSeparationAlg.h.

std::vector<int> shower::ReconTrack::fBackwardSpacePoints
private

Definition at line 189 of file TrackShowerSeparationAlg.h.

std::vector<int> shower::ReconTrack::fCylinderSpacePoints
private

Definition at line 190 of file TrackShowerSeparationAlg.h.

TVector3 shower::ReconTrack::fDirection
private

Definition at line 180 of file TrackShowerSeparationAlg.h.

TVector3 shower::ReconTrack::fEnd
private

Definition at line 177 of file TrackShowerSeparationAlg.h.

std::vector<int> shower::ReconTrack::fForwardConeTracks
private

Definition at line 184 of file TrackShowerSeparationAlg.h.

std::vector<int> shower::ReconTrack::fForwardSpacePoints
private

Definition at line 188 of file TrackShowerSeparationAlg.h.

std::vector<art::Ptr<recob::Hit> > shower::ReconTrack::fHits
private

Definition at line 181 of file TrackShowerSeparationAlg.h.

int shower::ReconTrack::fID
private

Definition at line 175 of file TrackShowerSeparationAlg.h.

std::map<int, double> shower::ReconTrack::fIsolationSpacePoints
private

Definition at line 192 of file TrackShowerSeparationAlg.h.

double shower::ReconTrack::fLength
private

Definition at line 178 of file TrackShowerSeparationAlg.h.

bool shower::ReconTrack::fShower
private

Definition at line 194 of file TrackShowerSeparationAlg.h.

bool shower::ReconTrack::fShowerCone
private

Definition at line 196 of file TrackShowerSeparationAlg.h.

bool shower::ReconTrack::fShowerTrack
private

Definition at line 195 of file TrackShowerSeparationAlg.h.

std::vector<int> shower::ReconTrack::fShowerTracks
private

Definition at line 186 of file TrackShowerSeparationAlg.h.

std::vector<art::Ptr<recob::SpacePoint> > shower::ReconTrack::fSpacePoints
private

Definition at line 182 of file TrackShowerSeparationAlg.h.

std::vector<int> shower::ReconTrack::fSphereSpacePoints
private

Definition at line 191 of file TrackShowerSeparationAlg.h.

bool shower::ReconTrack::fTrack
private

Definition at line 197 of file TrackShowerSeparationAlg.h.

TVector3 shower::ReconTrack::fVertex
private

Definition at line 176 of file TrackShowerSeparationAlg.h.

TVector3 shower::ReconTrack::fVertexDir
private

Definition at line 179 of file TrackShowerSeparationAlg.h.


The documentation for this class was generated from the following file: