All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 60 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:101
const TVector2 & fCenter2D
Definition: DirOfGamma.h:98
double fTotCharge
Definition: DirOfGamma.h:100

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
process_name hit
Definition: cheaterreco.fcl:51
std::vector< Hit2D * > fHits2D
Definition: DirOfGamma.h:99
unsigned int fSize
Definition: DirOfGamma.h:101
double fTotCharge
Definition: DirOfGamma.h:100
const TVector2& ems::Bin2D::GetCenter ( ) const
inline

Definition at line 89 of file DirOfGamma.h.

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

Definition at line 83 of file DirOfGamma.h.

84  {
85  return fHits2D;
86  }
std::vector< Hit2D * > fHits2D
Definition: DirOfGamma.h:99
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)
std::vector< Hit2D * > fHits2D
Definition: DirOfGamma.h:99
const TVector2 & fCenter2D
Definition: DirOfGamma.h:98
double ems::Bin2D::GetTotCharge ( ) const
inline

Definition at line 71 of file DirOfGamma.h.

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

Definition at line 77 of file DirOfGamma.h.

78  {
79  return fSize;
80  }
unsigned int fSize
Definition: DirOfGamma.h:101
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:99
const TVector2 & fCenter2D
Definition: DirOfGamma.h:98
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:99
const TVector2 & fCenter2D
Definition: DirOfGamma.h:98

Member Data Documentation

const TVector2& ems::Bin2D::fCenter2D
private

Definition at line 98 of file DirOfGamma.h.

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

Definition at line 99 of file DirOfGamma.h.

unsigned int ems::Bin2D::fSize
private

Definition at line 101 of file DirOfGamma.h.

double ems::Bin2D::fTotCharge
private

Definition at line 100 of file DirOfGamma.h.


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