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

Constructor & Destructor Documentation

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

Definition at line 39 of file DirOfGamma.cxx.

39 : fCenter2D(center), fTotCharge(0.0), fSize(0) {}
unsigned int fSize
Definition: DirOfGamma.h:99
const TVector2 & fCenter2D
Definition: DirOfGamma.h:96
double fTotCharge
Definition: DirOfGamma.h:98
def center(depos, point)
Definition: depos.py:117

Member Function Documentation

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

Definition at line 42 of file DirOfGamma.cxx.

43 {
44  fHits2D.push_back(hit);
45  fTotCharge += hit->GetCharge();
46  fSize = fHits2D.size();
47  SortLess();
48 }
void SortLess()
Definition: DirOfGamma.cxx:57
std::vector< Hit2D * > fHits2D
Definition: DirOfGamma.h:97
unsigned int fSize
Definition: DirOfGamma.h:99
double fTotCharge
Definition: DirOfGamma.h:98
Detector simulation of raw signals on wires.
const TVector2& ems::Bin2D::GetCenter ( ) const
inline

Definition at line 87 of file DirOfGamma.h.

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

Definition at line 81 of file DirOfGamma.h.

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

Definition at line 63 of file DirOfGamma.cxx.

64 {
65 
66  std::vector<art::Ptr<recob::Hit>> vec;
67  for (unsigned int i = 0; i < fHits2D.size(); i++) {
68  if (pma::Dist2(fHits2D[i]->GetPointCm(), fCenter2D) < radius * radius) {
69  vec.push_back(fHits2D[i]->GetHitPtr());
70  if (vec.size() == nhits) break;
71  }
72  }
73 
74  return vec;
75 }
double Dist2(const TVector2 &v1, const TVector2 &v2)
Definition: Utilities.cxx:37
std::vector< Hit2D * > fHits2D
Definition: DirOfGamma.h:97
const TVector2 & fCenter2D
Definition: DirOfGamma.h:96
double ems::Bin2D::GetTotCharge ( ) const
inline

Definition at line 69 of file DirOfGamma.h.

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

Definition at line 75 of file DirOfGamma.h.

76  {
77  return fSize;
78  }
unsigned int fSize
Definition: DirOfGamma.h:99
void ems::Bin2D::Sort ( )

Definition at line 51 of file DirOfGamma.cxx.

52 {
53  return std::sort(fHits2D.begin(), fHits2D.end(), bDistCentMore2D(fCenter2D));
54 }
std::vector< Hit2D * > fHits2D
Definition: DirOfGamma.h:97
const TVector2 & fCenter2D
Definition: DirOfGamma.h:96
void ems::Bin2D::SortLess ( )

Definition at line 57 of file DirOfGamma.cxx.

58 {
59  return std::sort(fHits2D.begin(), fHits2D.end(), bDistCentLess2D(fCenter2D));
60 }
std::vector< Hit2D * > fHits2D
Definition: DirOfGamma.h:97
const TVector2 & fCenter2D
Definition: DirOfGamma.h:96

Member Data Documentation

const TVector2& ems::Bin2D::fCenter2D
private

Definition at line 96 of file DirOfGamma.h.

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

Definition at line 97 of file DirOfGamma.h.

unsigned int ems::Bin2D::fSize
private

Definition at line 99 of file DirOfGamma.h.

double ems::Bin2D::fTotCharge
private

Definition at line 98 of file DirOfGamma.h.


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