Public Member Functions | Private Attributes | List of all members
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 34 of file TrackShowerSeparationAlg.h.

Constructor & Destructor Documentation

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

Definition at line 37 of file TrackShowerSeparationAlg.h.

Member Function Documentation

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

Definition at line 59 of file TrackShowerSeparationAlg.h.

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

Definition at line 55 of file TrackShowerSeparationAlg.h.

55 { if (std::find(fBackwardConeTracks.begin(), fBackwardConeTracks.end(), track) == fBackwardConeTracks.end()) fBackwardConeTracks.push_back(track); }
std::vector< int > fBackwardConeTracks
void shower::ReconTrack::AddCylinderSpacePoint ( int  spacePoint)
inline

Definition at line 60 of file TrackShowerSeparationAlg.h.

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

Definition at line 58 of file TrackShowerSeparationAlg.h.

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

Definition at line 54 of file TrackShowerSeparationAlg.h.

54 { if (std::find(fForwardConeTracks.begin(), fForwardConeTracks.end(), track) == fForwardConeTracks.end()) fForwardConeTracks.push_back(track); }
std::vector< int > fForwardConeTracks
void shower::ReconTrack::AddIsolationSpacePoint ( int  spacePoint,
double  distance 
)
inline

Definition at line 62 of file TrackShowerSeparationAlg.h.

62 { fIsolationSpacePoints[spacePoint] = distance; }
std::map< int, double > fIsolationSpacePoints
double distance(double x1, double y1, double z1, double x2, double y2, double z2)
void shower::ReconTrack::AddShowerTrack ( int  track)
inline

Definition at line 56 of file TrackShowerSeparationAlg.h.

56 { fShowerTracks.push_back(track); }
std::vector< int > fShowerTracks
void shower::ReconTrack::AddSphereSpacePoint ( int  spacePoint)
inline

Definition at line 61 of file TrackShowerSeparationAlg.h.

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

Definition at line 117 of file TrackShowerSeparationAlg.h.

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

Definition at line 120 of file TrackShowerSeparationAlg.h.

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

Definition at line 70 of file TrackShowerSeparationAlg.h.

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

Definition at line 67 of file TrackShowerSeparationAlg.h.

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

Definition at line 74 of file TrackShowerSeparationAlg.h.

74  {
75  TVector3 tmp = fEnd;
76  fEnd = fVertex;
77  fVertex = tmp;
78  fDirection *= -1;
79  }
string tmp
Definition: languages.py:63
const std::vector<int>& shower::ReconTrack::ForwardConeTracks ( ) const
inline

Definition at line 115 of file TrackShowerSeparationAlg.h.

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

Definition at line 118 of file TrackShowerSeparationAlg.h.

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

Definition at line 71 of file TrackShowerSeparationAlg.h.

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

Definition at line 65 of file TrackShowerSeparationAlg.h.

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

Definition at line 123 of file TrackShowerSeparationAlg.h.

123  { std::vector<double> distances;
124  std::transform(fIsolationSpacePoints.begin(), fIsolationSpacePoints.end(), std::back_inserter(distances), [](const std::pair<int,double>& p){return p.second;});
125  return TMath::Mean(distances.begin(), distances.end()); }
std::map< int, double > fIsolationSpacePoints
p
Definition: test.py:223
bool shower::ReconTrack::IsShower ( ) const
inline

Definition at line 106 of file TrackShowerSeparationAlg.h.

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

Definition at line 108 of file TrackShowerSeparationAlg.h.

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

Definition at line 107 of file TrackShowerSeparationAlg.h.

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

Definition at line 109 of file TrackShowerSeparationAlg.h.

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

Definition at line 110 of file TrackShowerSeparationAlg.h.

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

Definition at line 68 of file TrackShowerSeparationAlg.h.

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

Definition at line 81 of file TrackShowerSeparationAlg.h.

81  {
82  if (fTrack)
83  this->MakeShowerTrack();
84  else
85  this->MakeShowerCone();
86  }
void shower::ReconTrack::MakeShowerCone ( )
inline

Definition at line 93 of file TrackShowerSeparationAlg.h.

void shower::ReconTrack::MakeShowerTrack ( )
inline

Definition at line 87 of file TrackShowerSeparationAlg.h.

void shower::ReconTrack::MakeTrack ( )
inline

Definition at line 99 of file TrackShowerSeparationAlg.h.

99  {
100  fTrack = true;
101  fShower = false;
102  fShowerTrack = false;
103  fShowerCone = false;
104  }
int shower::ReconTrack::NumCylinderSpacePoints ( ) const
inline

Definition at line 119 of file TrackShowerSeparationAlg.h.

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

Definition at line 121 of file TrackShowerSeparationAlg.h.

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

Definition at line 47 of file TrackShowerSeparationAlg.h.

47 { fEnd = end; }
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
void shower::ReconTrack::SetHits ( std::vector< art::Ptr< recob::Hit > >  hits)
inline

Definition at line 51 of file TrackShowerSeparationAlg.h.

51 { fHits = hits; }
std::vector< art::Ptr< recob::Hit > > fHits
void shower::ReconTrack::SetLength ( double  length)
inline

Definition at line 48 of file TrackShowerSeparationAlg.h.

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

Definition at line 52 of file TrackShowerSeparationAlg.h.

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

Definition at line 46 of file TrackShowerSeparationAlg.h.

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

Definition at line 49 of file TrackShowerSeparationAlg.h.

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

Definition at line 113 of file TrackShowerSeparationAlg.h.

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

Definition at line 114 of file TrackShowerSeparationAlg.h.

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

Definition at line 72 of file TrackShowerSeparationAlg.h.

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

Definition at line 122 of file TrackShowerSeparationAlg.h.

122 { return (double)fSphereSpacePoints.size()/(4*TMath::Pi()*TMath::Power((scale*fLength/2.),3)/3.); }
std::vector< int > fSphereSpacePoints
int shower::ReconTrack::TrackConeSize ( ) const
inline

Definition at line 112 of file TrackShowerSeparationAlg.h.

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

Definition at line 66 of file TrackShowerSeparationAlg.h.

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

Definition at line 69 of file TrackShowerSeparationAlg.h.

69 { return fVertexDir; }

Member Data Documentation

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

Definition at line 139 of file TrackShowerSeparationAlg.h.

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

Definition at line 143 of file TrackShowerSeparationAlg.h.

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

Definition at line 144 of file TrackShowerSeparationAlg.h.

TVector3 shower::ReconTrack::fDirection
private

Definition at line 134 of file TrackShowerSeparationAlg.h.

TVector3 shower::ReconTrack::fEnd
private

Definition at line 131 of file TrackShowerSeparationAlg.h.

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

Definition at line 138 of file TrackShowerSeparationAlg.h.

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

Definition at line 142 of file TrackShowerSeparationAlg.h.

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

Definition at line 135 of file TrackShowerSeparationAlg.h.

int shower::ReconTrack::fID
private

Definition at line 129 of file TrackShowerSeparationAlg.h.

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

Definition at line 146 of file TrackShowerSeparationAlg.h.

double shower::ReconTrack::fLength
private

Definition at line 132 of file TrackShowerSeparationAlg.h.

bool shower::ReconTrack::fShower
private

Definition at line 148 of file TrackShowerSeparationAlg.h.

bool shower::ReconTrack::fShowerCone
private

Definition at line 150 of file TrackShowerSeparationAlg.h.

bool shower::ReconTrack::fShowerTrack
private

Definition at line 149 of file TrackShowerSeparationAlg.h.

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

Definition at line 140 of file TrackShowerSeparationAlg.h.

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

Definition at line 136 of file TrackShowerSeparationAlg.h.

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

Definition at line 145 of file TrackShowerSeparationAlg.h.

bool shower::ReconTrack::fTrack
private

Definition at line 151 of file TrackShowerSeparationAlg.h.

TVector3 shower::ReconTrack::fVertex
private

Definition at line 130 of file TrackShowerSeparationAlg.h.

TVector3 shower::ReconTrack::fVertexDir
private

Definition at line 133 of file TrackShowerSeparationAlg.h.


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