LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
ems::ShowerInfo Class Reference

Public Member Functions

 ShowerInfo (int key, int gid, bool hasvtx, std::vector< double > vensum, recob::Track const &trk)
 
double Pointsto (ems::ShowerInfo const &s1) const
 
double Angleto (TVector3 const &pmapoint) const
 
bool HasConPoint (void) const
 
int GetKey (void) const
 
int GetGid (void) const
 
int GetPlaneId (void) const
 
double GetAdcSum (void) const
 
std::vector< double > GetEnTot (void) const
 
TVector3 GetFront (void) const
 
TVector3 GetEnd (void) const
 
TVector3 GetDir (void) const
 
std::vector< double > GetDedx (void) const
 
double GetP0Dist (void) const
 
void SetP0Dist (const TVector3 p)
 

Private Attributes

int fKey
 
int fGId
 
int fPlaneId
 
bool fHasVtx
 
double fAdcSum
 
std::vector< double > fVentot
 
double fP0Dist
 
TVector3 fFront
 
TVector3 fEnd
 
TVector3 fDir
 
std::vector< double > fVdqdx
 

Detailed Description

Definition at line 53 of file MergeEMShower3D_module.cc.

Constructor & Destructor Documentation

ems::ShowerInfo::ShowerInfo ( int  key,
int  gid,
bool  hasvtx,
std::vector< double >  vensum,
recob::Track const &  trk 
)

Definition at line 96 of file MergeEMShower3D_module.cc.

References recob::Track::End(), fDir, fEnd, fFront, fHasVtx, recob::Track::Vertex(), and recob::Track::VertexDirection().

96  :
97 fKey(key),
98 fGId(gid),
99 fVentot(vensum),
100 fP0Dist(0)
101 {
102  fDir = trk.VertexDirection<TVector3>();
103  fFront = trk.Vertex<TVector3>();
104  fEnd = trk.End<TVector3>();
105  fHasVtx = hasvtx;
106 
108  /*fVdqdx.push_back(trk.DQdxAtPoint(0, geo::kU));
109  fVdqdx.push_back(trk.DQdxAtPoint(0, geo::kV));
110  fVdqdx.push_back(trk.DQdxAtPoint(0, geo::kZ));*/
111 
112 
113  /*************************************************************/
114  /* WARNING */
115  /*************************************************************/
116  /* The dQdx information in recob::Track has been deprecated */
117  /* since 2016 and in 11/2018 the recob::Track interface was */
118  /* changed and DQdxAtPoint and NumberdQdx were removed. */
119  /* Therefore the code below is now commented out */
120  /* (note that it was most likely not functional anyways). */
121  /* For any issue please contact: larsoft-team@fnal.gov */
122  /*************************************************************/
123  /*
124  bool isplane = false;
125  unsigned int nplanes = geom->Nplanes();
126  for (unsigned int p = 0; p < nplanes; ++p)
127  {
128  geo::View_t view = geom->View(p);
129  fVdqdx.push_back(trk.DQdxAtPoint(0, view));
130  if (trk.DQdxAtPoint(1, view) > 0)
131  {fPlaneId = int(p); isplane = true;}
132  }
133  if (!isplane) fPlaneId = -1;
134  */
135  /*************************************************************/
136 
137  /*if (trk.DQdxAtPoint(1, geo::kU) > 0) fPlaneId = geo::kU;
138  else if (trk.DQdxAtPoint(1, geo::kV) > 0) fPlaneId = geo::kV;
139  else if (trk.DQdxAtPoint(1, geo::kZ) > 0) fPlaneId = geo::kZ;
140  else fPlaneId = -1;*/
141 }
std::vector< double > fVentot

Member Function Documentation

double ems::ShowerInfo::Angleto ( TVector3 const &  pmapoint) const

Definition at line 164 of file MergeEMShower3D_module.cc.

References fDir, and fFront.

165 {
166  double cosine = (pmapoint - this->fFront) * (1.0 / (pmapoint - this->fFront).Mag()) * this->fDir;
167  double th = 180.0F * (std::acos(cosine)) / TMath::Pi();
168 
169  return th;
170 }
double ems::ShowerInfo::GetAdcSum ( void  ) const
inline

Definition at line 64 of file MergeEMShower3D_module.cc.

References fAdcSum.

64 {return fAdcSum;}
std::vector<double> ems::ShowerInfo::GetDedx ( void  ) const
inline

Definition at line 70 of file MergeEMShower3D_module.cc.

References fVdqdx.

70 { return fVdqdx; }
std::vector< double > fVdqdx
TVector3 ems::ShowerInfo::GetDir ( void  ) const
inline

Definition at line 69 of file MergeEMShower3D_module.cc.

References fDir.

69 {return fDir;}
TVector3 ems::ShowerInfo::GetEnd ( void  ) const
inline

Definition at line 68 of file MergeEMShower3D_module.cc.

References fEnd.

68 {return fEnd;}
std::vector<double> ems::ShowerInfo::GetEnTot ( void  ) const
inline

Definition at line 65 of file MergeEMShower3D_module.cc.

References fVentot.

65 {return fVentot; }
std::vector< double > fVentot
TVector3 ems::ShowerInfo::GetFront ( void  ) const
inline

Definition at line 67 of file MergeEMShower3D_module.cc.

References fFront.

67 {return fFront;}
int ems::ShowerInfo::GetGid ( void  ) const
inline
int ems::ShowerInfo::GetKey ( void  ) const
inline

Definition at line 61 of file MergeEMShower3D_module.cc.

References fKey.

61 {return fKey;}
double ems::ShowerInfo::GetP0Dist ( void  ) const
inline

Definition at line 72 of file MergeEMShower3D_module.cc.

References fP0Dist.

Referenced by ems::bDistLess::operator()().

72 { return fP0Dist; }
int ems::ShowerInfo::GetPlaneId ( void  ) const
inline

Definition at line 63 of file MergeEMShower3D_module.cc.

References fPlaneId.

bool ems::ShowerInfo::HasConPoint ( void  ) const
inline

Definition at line 60 of file MergeEMShower3D_module.cc.

References fHasVtx.

60 {return fHasVtx;}
double ems::ShowerInfo::Pointsto ( ems::ShowerInfo const &  s1) const

Definition at line 143 of file MergeEMShower3D_module.cc.

References fDir, fFront, pma::GetProjectionToSegment(), and pma::SolveLeastSquares3D().

Referenced by ems::ShowersCollection::MinAngle().

144 {
145  double cosine0 = (this->fFront - s1.fFront) * (1.0 / (this->fFront - s1.fFront).Mag()) * s1.fDir;
146  double th0 = 180.0F * (std::acos(cosine0)) / TMath::Pi();
147 
148  std::vector< std::pair<TVector3, TVector3> > lines;
149  lines.push_back(std::pair<TVector3, TVector3>(this->fFront, this->fFront + this->fDir));
150  lines.push_back(std::pair<TVector3, TVector3>(s1.fFront, s1.fFront + s1.fDir));
151 
152  TVector3 isect, pm;
153  pma::SolveLeastSquares3D(lines, isect);
154  pm = pma::GetProjectionToSegment(isect, this->fFront, this->fFront + this->fDir);
155  double cosine1 = (pm - s1.fFront) * (1.0/(pm - s1.fFront).Mag()) * s1.fDir;
156  double th1 = 180.0F * (std::acos(cosine1)) / TMath::Pi();
157 
158  double thmin = th0;
159  if (th1 < th0) thmin = th1;
160 
161  return thmin;
162 }
TVector2 GetProjectionToSegment(const TVector2 &p, const TVector2 &p0, const TVector2 &p1)
Definition: Utilities.cxx:156
double SolveLeastSquares3D(const std::vector< std::pair< TVector3, TVector3 > > &lines, TVector3 &result)
Definition: Utilities.cxx:176
void ems::ShowerInfo::SetP0Dist ( const TVector3  p)
inline

Definition at line 73 of file MergeEMShower3D_module.cc.

References pma::Dist2(), fEnd, fFront, fHasVtx, and fP0Dist.

74  {
75  if (fHasVtx) fP0Dist = std::sqrt( pma::Dist2(p, fFront) );
76  else fP0Dist = std::sqrt( pma::Dist2(p, 0.5 * (fFront + fEnd)) );
77  }
double Dist2(const TVector2 &v1, const TVector2 &v2)
Definition: Utilities.cxx:19

Member Data Documentation

double ems::ShowerInfo::fAdcSum
private

Definition at line 84 of file MergeEMShower3D_module.cc.

Referenced by GetAdcSum().

TVector3 ems::ShowerInfo::fDir
private

Definition at line 90 of file MergeEMShower3D_module.cc.

Referenced by Angleto(), GetDir(), Pointsto(), and ShowerInfo().

TVector3 ems::ShowerInfo::fEnd
private

Definition at line 89 of file MergeEMShower3D_module.cc.

Referenced by GetEnd(), SetP0Dist(), and ShowerInfo().

TVector3 ems::ShowerInfo::fFront
private

Definition at line 88 of file MergeEMShower3D_module.cc.

Referenced by Angleto(), GetFront(), Pointsto(), SetP0Dist(), and ShowerInfo().

int ems::ShowerInfo::fGId
private

Definition at line 81 of file MergeEMShower3D_module.cc.

Referenced by GetGid().

bool ems::ShowerInfo::fHasVtx
private

Definition at line 83 of file MergeEMShower3D_module.cc.

Referenced by HasConPoint(), SetP0Dist(), and ShowerInfo().

int ems::ShowerInfo::fKey
private

Definition at line 80 of file MergeEMShower3D_module.cc.

Referenced by GetKey().

double ems::ShowerInfo::fP0Dist
private

Definition at line 86 of file MergeEMShower3D_module.cc.

Referenced by GetP0Dist(), and SetP0Dist().

int ems::ShowerInfo::fPlaneId
private

Definition at line 82 of file MergeEMShower3D_module.cc.

Referenced by GetPlaneId().

std::vector<double> ems::ShowerInfo::fVdqdx
private

Definition at line 92 of file MergeEMShower3D_module.cc.

Referenced by GetDedx().

std::vector<double> ems::ShowerInfo::fVentot
private

Definition at line 85 of file MergeEMShower3D_module.cc.

Referenced by GetEnTot().


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