LArSoft  v06_85_00
Liquid Argon Software toolkit - http://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 (void) const
 
unsigned int Size () const
 
std::vector< Hit2D * > const & GetHits2D (void) const
 
const TVector2 & GetCenter (void) 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 46 of file DirOfGamma.h.

Constructor & Destructor Documentation

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

Definition at line 48 of file DirOfGamma.cxx.

48  :
49 fCenter2D(center),
50 fTotCharge(0.0),
51 fSize(0)
52 {
53 }
unsigned int fSize
Definition: DirOfGamma.h:71
const TVector2 & fCenter2D
Definition: DirOfGamma.h:68
double fTotCharge
Definition: DirOfGamma.h:70

Member Function Documentation

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

Definition at line 55 of file DirOfGamma.cxx.

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

56 {
57  fHits2D.push_back(hit);
58  fTotCharge += hit->GetCharge();
59  fSize = fHits2D.size();
60  SortLess();
61 }
void SortLess()
Definition: DirOfGamma.cxx:68
unsigned int fSize
Definition: DirOfGamma.h:71
double fTotCharge
Definition: DirOfGamma.h:70
Detector simulation of raw signals on wires.
std::vector< Hit2D * > fHits2D
Definition: DirOfGamma.h:69
const TVector2& ems::Bin2D::GetCenter ( void  ) const
inline

Definition at line 63 of file DirOfGamma.h.

References radius.

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

Definition at line 61 of file DirOfGamma.h.

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

Definition at line 73 of file DirOfGamma.cxx.

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

74 {
75 
76  std::vector< art::Ptr< recob::Hit > > vec;
77  for (unsigned int i = 0; i < fHits2D.size(); i++)
78  {
79  if (pma::Dist2(fHits2D[i]->GetPointCm(), fCenter2D) < radius*radius)
80  {
81  vec.push_back(fHits2D[i]->GetHitPtr());
82  if (vec.size() == nhits) break;
83  }
84  }
85 
86  return vec;
87 }
double Dist2(const TVector2 &v1, const TVector2 &v2)
Definition: Utilities.cxx:19
const TVector2 & fCenter2D
Definition: DirOfGamma.h:68
Double_t radius
std::vector< Hit2D * > fHits2D
Definition: DirOfGamma.h:69
double ems::Bin2D::GetTotCharge ( void  ) const
inline

Definition at line 57 of file DirOfGamma.h.

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

Definition at line 59 of file DirOfGamma.h.

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

Definition at line 63 of file DirOfGamma.cxx.

References fCenter2D, and fHits2D.

64 {
65  return std::sort(fHits2D.begin(), fHits2D.end(), bDistCentMore2D(fCenter2D));
66 }
const TVector2 & fCenter2D
Definition: DirOfGamma.h:68
std::vector< Hit2D * > fHits2D
Definition: DirOfGamma.h:69
void ems::Bin2D::SortLess ( )

Definition at line 68 of file DirOfGamma.cxx.

References fCenter2D, and fHits2D.

Referenced by Add().

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

Member Data Documentation

const TVector2& ems::Bin2D::fCenter2D
private

Definition at line 68 of file DirOfGamma.h.

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

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

Definition at line 69 of file DirOfGamma.h.

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

unsigned int ems::Bin2D::fSize
private

Definition at line 71 of file DirOfGamma.h.

Referenced by Add().

double ems::Bin2D::fTotCharge
private

Definition at line 70 of file DirOfGamma.h.

Referenced by Add().


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