LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ems::Bin2D Class Reference

#include "DirOfGamma.h"

Public Member Functions

 Bin2D (const TVector2 &center)
 
void Add (Hit2D *hit)
 
void Sort ()
 
void SortLess ()
 
double GetTotCharge () const
 
unsigned int Size () const
 
std::vector< Hit2D * > const & GetHits2D () const
 
const TVector2 & GetCenter () const
 
std::vector< art::Ptr< recob::Hit > > GetIniHits (const double radius=10.0, const unsigned int nhits=10) const
 

Private Attributes

const TVector2 & fCenter2D
 
std::vector< Hit2D * > fHits2D
 
double fTotCharge
 
unsigned int fSize
 

Detailed Description

Definition at line 48 of file DirOfGamma.h.

Constructor & Destructor Documentation

ems::Bin2D::Bin2D ( const TVector2 &  center)

Definition at line 29 of file DirOfGamma.cxx.

29 : fCenter2D(center), fTotCharge(0.0), fSize(0) {}
unsigned int fSize
Definition: DirOfGamma.h:73
const TVector2 & fCenter2D
Definition: DirOfGamma.h:70
double fTotCharge
Definition: DirOfGamma.h:72

Member Function Documentation

void ems::Bin2D::Add ( Hit2D hit)

Definition at line 31 of file DirOfGamma.cxx.

References fHits2D, fSize, fTotCharge, ems::Hit2D::GetCharge(), and SortLess().

32 {
33  fHits2D.push_back(hit);
34  fTotCharge += hit->GetCharge();
35  fSize = fHits2D.size();
36  SortLess();
37 }
void SortLess()
Definition: DirOfGamma.cxx:44
std::vector< Hit2D * > fHits2D
Definition: DirOfGamma.h:71
unsigned int fSize
Definition: DirOfGamma.h:73
double fTotCharge
Definition: DirOfGamma.h:72
Detector simulation of raw signals on wires.
const TVector2& ems::Bin2D::GetCenter ( ) const
inline

Definition at line 64 of file DirOfGamma.h.

References radius.

64 { return fCenter2D; }
const TVector2 & fCenter2D
Definition: DirOfGamma.h:70
std::vector<Hit2D*> const& ems::Bin2D::GetHits2D ( ) const
inline

Definition at line 62 of file DirOfGamma.h.

62 { return fHits2D; }
std::vector< Hit2D * > fHits2D
Definition: DirOfGamma.h:71
std::vector< art::Ptr< recob::Hit > > ems::Bin2D::GetIniHits ( const double  radius = 10.0,
const unsigned int  nhits = 10 
) const

Definition at line 49 of file DirOfGamma.cxx.

References pma::Dist2(), fCenter2D, fHits2D, and radius.

51 {
52 
53  std::vector<art::Ptr<recob::Hit>> vec;
54  for (unsigned int i = 0; i < fHits2D.size(); i++) {
55  if (pma::Dist2(fHits2D[i]->GetPointCm(), fCenter2D) < radius * radius) {
56  vec.push_back(fHits2D[i]->GetHitPtr());
57  if (vec.size() == nhits) break;
58  }
59  }
60 
61  return vec;
62 }
double Dist2(const TVector2 &v1, const TVector2 &v2)
Definition: Utilities.cxx:39
std::vector< Hit2D * > fHits2D
Definition: DirOfGamma.h:71
Float_t radius
Definition: plot.C:23
const TVector2 & fCenter2D
Definition: DirOfGamma.h:70
double ems::Bin2D::GetTotCharge ( ) const
inline

Definition at line 58 of file DirOfGamma.h.

58 { return fTotCharge; }
double fTotCharge
Definition: DirOfGamma.h:72
unsigned int ems::Bin2D::Size ( ) const
inline

Definition at line 60 of file DirOfGamma.h.

60 { return fSize; }
unsigned int fSize
Definition: DirOfGamma.h:73
void ems::Bin2D::Sort ( )

Definition at line 39 of file DirOfGamma.cxx.

References fCenter2D, and fHits2D.

40 {
41  return std::sort(fHits2D.begin(), fHits2D.end(), bDistCentMore2D(fCenter2D));
42 }
std::vector< Hit2D * > fHits2D
Definition: DirOfGamma.h:71
const TVector2 & fCenter2D
Definition: DirOfGamma.h:70
void ems::Bin2D::SortLess ( )

Definition at line 44 of file DirOfGamma.cxx.

References fCenter2D, and fHits2D.

Referenced by Add().

45 {
46  return std::sort(fHits2D.begin(), fHits2D.end(), bDistCentLess2D(fCenter2D));
47 }
std::vector< Hit2D * > fHits2D
Definition: DirOfGamma.h:71
const TVector2 & fCenter2D
Definition: DirOfGamma.h:70

Member Data Documentation

const TVector2& ems::Bin2D::fCenter2D
private

Definition at line 70 of file DirOfGamma.h.

Referenced by GetIniHits(), Sort(), and SortLess().

std::vector<Hit2D*> ems::Bin2D::fHits2D
private

Definition at line 71 of file DirOfGamma.h.

Referenced by Add(), GetIniHits(), Sort(), and SortLess().

unsigned int ems::Bin2D::fSize
private

Definition at line 73 of file DirOfGamma.h.

Referenced by Add().

double ems::Bin2D::fTotCharge
private

Definition at line 72 of file DirOfGamma.h.

Referenced by Add().


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