Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

recobase::Cluster Class Reference

#include <Cluster.h>

List of all members.

Public Member Functions

 Cluster ()
 Cluster (vector< const recobase::CellHit * > &cellvec)
 ~Cluster ()
bool Add (const recobase::CellHit *cell)
int NPlane () const
int NXPlane () const
int NYPlane () const
int Plane (int i) const
int XPlane (int i) const
int YPlane (int i) const
int NCell () const
int NXCell () const
int NYCell () const
bool Is3D () const
const recobase::CellHitXCell (int i) const
const recobase::CellHitYCell (int i) const
const recobase::CellHitXCell (int icell, int iplane) const
const recobase::CellHitYCell (int icell, int iplane) const
const double * XYZT () const
double Z () const
double dZ () const
double T () const
double dT () const
double X () const
double dX () const
double Y () const
double dY () const
double Q () const
double dQ () const
void SetQ (double q)
void SetdQ (double dq)
void SetXYZT (double x[])
void SetdXYZT (double dx[])

Private Attributes

TRefArray fXCell
TRefArray fYCell
vector< int > fXPlane
 sorted vector of x-planes
vector< int > fYPlane
 sorted vector of y-planes
vector< int > fPlane
 sorted vector of planes
short fStatus
double f4Vec [4]
double fd4Vec [4]
double fQ
double fdQ


Constructor & Destructor Documentation

Cluster::Cluster  ) 
 

Definition at line 25 of file Cluster.cxx.

References f4Vec, and fd4Vec.

00025                  : 
00026   fXPlane(0), fYPlane(0), fPlane(0), fStatus(0), 
00027   fQ(0), fdQ(0)
00028 {
00029   for (int i=0; i<4; ++i) {
00030     f4Vec[i] = -1.e9;
00031     fd4Vec[i] = 0.;
00032   }
00033 } 

Cluster::Cluster vector< const recobase::CellHit * > &  cellvec  ) 
 

Definition at line 39 of file Cluster.cxx.

References f4Vec, fd4Vec, fPlane, fXCell, fXPlane, fYCell, fYPlane, and Plane().

00039                                              : 
00040   fXPlane(0), fYPlane(0), fPlane(0), fStatus(0), 
00041   fQ(0), fdQ(0)
00042 {
00043   for (int i=0; i<4; ++i) {
00044     f4Vec[i] = -1.e9;
00045     fd4Vec[i] = 0.;
00046   }
00047 
00048   for (unsigned int i=0; i<cell.size(); ++i) {
00049     if (cell[i]->View() == geo::kX) { // cell is in a x-plane
00050       fXCell.Add((CellHit*)cell[i]);
00051       if (find(fXPlane.begin(),fXPlane.end(),cell[i]->Plane()) ==
00052           fXPlane.end()) fXPlane.push_back(cell[i]->Plane());
00053     }
00054     else { // cell is in a y-plane
00055       fYCell.Add((CellHit*)cell[i]);
00056       if (find(fYPlane.begin(),fYPlane.end(),cell[i]->Plane()) ==
00057           fYPlane.end()) fYPlane.push_back(cell[i]->Plane());      
00058     }
00059 
00060     if (find(fPlane.begin(),fPlane.end(),cell[i]->Plane()) ==
00061         fPlane.end()) fPlane.push_back(cell[i]->Plane());
00062   }
00063 
00064   // sort planes
00065   sort(fXPlane.begin(),fXPlane.end());
00066   sort(fYPlane.begin(),fYPlane.end());
00067   sort(fPlane.begin(),fPlane.end());
00068 
00069 } 

Cluster::~Cluster  ) 
 

Definition at line 74 of file Cluster.cxx.

00075 {
00076 
00077 }


Member Function Documentation

bool Cluster::Add const recobase::CellHit cell  ) 
 

Definition at line 186 of file Cluster.cxx.

References recobase::CellHit::Cell(), fXCell, fYCell, NXCell(), NYCell(), recobase::CellHit::Plane(), recobase::CellHit::View(), XCell(), and YCell().

Referenced by recobase::Prong::Add().

00187 {
00188   bool foundDup = false;
00189 
00190   if (cell->View() == geo::kX) {
00191     for (int i=0; i<this->NXCell(); ++i) {
00192       const CellHit* c2 = this->XCell(i);
00193       if (c2->Plane() == cell->Plane() && c2->Cell() == cell->Cell()) {
00194         foundDup = true;
00195         break;
00196       }
00197     }
00198     if (!foundDup) fXCell.Add((CellHit*)cell);
00199   }
00200   else {
00201     for (int i=0; i<this->NYCell(); ++i) {
00202       const CellHit* c2 = this->YCell(i);
00203       if (c2->Plane() == cell->Plane() && c2->Cell() == cell->Cell()) {
00204         foundDup = true;
00205         break;
00206       }
00207     }
00208     if (!foundDup) fYCell.Add((CellHit*)cell);
00209   }
00210 
00211   return !foundDup;
00212 }

double recobase::Cluster::dQ  )  const [inline]
 

Definition at line 62 of file Cluster.h.

00062 {return fdQ;}

double recobase::Cluster::dT  )  const [inline]
 

Definition at line 56 of file Cluster.h.

00056 {return fd4Vec[3];}

double recobase::Cluster::dX  )  const [inline]
 

Definition at line 58 of file Cluster.h.

00058 {return fd4Vec[0];}

double recobase::Cluster::dY  )  const [inline]
 

Definition at line 60 of file Cluster.h.

00060 {return fd4Vec[1];}

double recobase::Cluster::dZ  )  const [inline]
 

Definition at line 54 of file Cluster.h.

00054 {return fd4Vec[2];}

bool recobase::Cluster::Is3D  )  const [inline]
 

Definition at line 43 of file Cluster.h.

00043                                {return (this->NXPlane()>0 &&
00044                                         this->NYPlane()>0); }

int Cluster::NCell  )  const
 

Definition at line 129 of file Cluster.cxx.

References NXCell(), and NYCell().

00130 {
00131   return this->NXCell() + this->NYCell();
00132 }

int recobase::Cluster::NPlane  )  const [inline]
 

Definition at line 31 of file Cluster.h.

00031 {return fXPlane.size() + fYPlane.size(); }

int Cluster::NXCell  )  const
 

Definition at line 115 of file Cluster.cxx.

References fXCell.

Referenced by Add(), evd::PlaneView::DrawTrackCandidates(), NCell(), and XCell().

00116 {
00117   return fXCell.GetLast() + 1;
00118 }

int recobase::Cluster::NXPlane  )  const [inline]
 

Definition at line 32 of file Cluster.h.

00032 {return fXPlane.size(); }

int Cluster::NYCell  )  const
 

Definition at line 122 of file Cluster.cxx.

References fYCell.

Referenced by Add(), evd::PlaneView::DrawTrackCandidates(), NCell(), and YCell().

00123 {
00124   return fYCell.GetLast() + 1;
00125 }

int recobase::Cluster::NYPlane  )  const [inline]
 

Definition at line 33 of file Cluster.h.

00033 {return fYPlane.size(); }

int Cluster::Plane int  i  )  const
 

Definition at line 101 of file Cluster.cxx.

References assert_jobc, fPlane, fXPlane, fYPlane, XPlane(), and YPlane().

Referenced by Cluster().

00102 {
00103   unsigned int j = i;
00104   assert_jobc((i >= 0 && j < (fPlane.size())),
00105               "Cluster::Plane(): out of bounds exception!");
00106   
00107   if (fYPlane.empty()) return this->XPlane(i);
00108   if (fXPlane.empty()) return this->YPlane(i);
00109   
00110   return fPlane[j];
00111 }

double recobase::Cluster::Q  )  const [inline]
 

Definition at line 61 of file Cluster.h.

00061 {return fQ;}

void recobase::Cluster::SetdQ double  dq  )  [inline]
 

Definition at line 65 of file Cluster.h.

00065 { fdQ = dq; }

void recobase::Cluster::SetdXYZT double  dx[]  )  [inline]
 

Definition at line 67 of file Cluster.h.

00067 { for (int i=0; i<4; ++i) fd4Vec[i] = dx[i]; }

void recobase::Cluster::SetQ double  q  )  [inline]
 

Definition at line 64 of file Cluster.h.

00064 { fQ = q; }

void recobase::Cluster::SetXYZT double  x[]  )  [inline]
 

Definition at line 66 of file Cluster.h.

00066 { for (int i=0; i<4; ++i) f4Vec[i] = x[i]; }

double recobase::Cluster::T  )  const [inline]
 

Definition at line 55 of file Cluster.h.

00055 {return f4Vec[3];}

double recobase::Cluster::X  )  const [inline]
 

Definition at line 57 of file Cluster.h.

00057 {return f4Vec[0];}

const CellHit * Cluster::XCell int  icell,
int  iplane
const
 

Definition at line 147 of file Cluster.cxx.

References recobase::CellHit::Cell(), NXCell(), recobase::CellHit::Plane(), and XCell().

00148 {
00149   for (int i=0; i<this->NXCell(); ++i) {
00150     const CellHit* c2 = this->XCell(i);
00151     if (c2->Plane() == iplane &&
00152         c2->Cell() == icell)
00153       return c2;
00154   }
00155 
00156   return 0;
00157 }

const CellHit * Cluster::XCell int  i  )  const
 

Definition at line 136 of file Cluster.cxx.

References assert_jobc, fXCell, and NXCell().

Referenced by Add(), evd::PlaneView::DrawTrackCandidates(), and XCell().

00137 {
00138   assert_jobc((i >= 0) && (i < this->NXCell()),
00139               "Cluster::XCell(): out of bounds exception!");
00140   
00141   CellHit* cell = dynamic_cast<CellHit*>(fXCell.At(i));
00142   return cell;
00143 }

int Cluster::XPlane int  i  )  const
 

Definition at line 81 of file Cluster.cxx.

References assert_jobc, and fXPlane.

Referenced by Plane().

00082 {
00083   unsigned int j = i;
00084   assert_jobc((i >= 0 && j < fXPlane.size()),
00085               "Cluster::XPlane(): out of bounds exception!");
00086   return fXPlane[j];
00087 }

const double* recobase::Cluster::XYZT  )  const [inline]
 

Definition at line 52 of file Cluster.h.

00052 { return f4Vec; }

double recobase::Cluster::Y  )  const [inline]
 

Definition at line 59 of file Cluster.h.

00059 {return f4Vec[1];}

const CellHit * Cluster::YCell int  icell,
int  iplane
const
 

Definition at line 172 of file Cluster.cxx.

References recobase::CellHit::Cell(), NYCell(), recobase::CellHit::Plane(), and YCell().

00173 {
00174   for (int i=0; i<this->NYCell(); ++i) {
00175     const CellHit* c2 = this->YCell(i);
00176     if (c2->Plane() == iplane &&
00177         c2->Cell() == icell)
00178       return c2;
00179   }
00180   
00181   return 0;
00182 }

const CellHit * Cluster::YCell int  i  )  const
 

Definition at line 161 of file Cluster.cxx.

References assert_jobc, fYCell, and NYCell().

Referenced by Add(), evd::PlaneView::DrawTrackCandidates(), and YCell().

00162 {
00163   assert_jobc((i >= 0) && (i < this->NYCell()),
00164               "Cluster::YCell(): out of bounds exception!");
00165   
00166   CellHit* cell = dynamic_cast<CellHit*>(fYCell.At(i));
00167   return cell;
00168 }

int Cluster::YPlane int  i  )  const
 

Definition at line 91 of file Cluster.cxx.

References assert_jobc, and fYPlane.

Referenced by Plane().

00092 {
00093   unsigned int j = i;
00094   assert_jobc((i >= 0 && j < fYPlane.size()),
00095               "Cluster::YPlane(): out of bounds exception!");
00096   return fYPlane[j];
00097 }

double recobase::Cluster::Z  )  const [inline]
 

Definition at line 53 of file Cluster.h.

Referenced by evd::PlaneView::DrawTrackCandidates(), and zSort().

00053 {return f4Vec[2];}


Member Data Documentation

double recobase::Cluster::f4Vec[4] [private]
 

Definition at line 78 of file Cluster.h.

Referenced by Cluster().

double recobase::Cluster::fd4Vec[4] [private]
 

Definition at line 79 of file Cluster.h.

Referenced by Cluster().

double recobase::Cluster::fdQ [private]
 

Definition at line 80 of file Cluster.h.

vector<int> recobase::Cluster::fPlane [private]
 

sorted vector of planes

Definition at line 75 of file Cluster.h.

Referenced by Cluster(), and Plane().

double recobase::Cluster::fQ [private]
 

Definition at line 80 of file Cluster.h.

short recobase::Cluster::fStatus [private]
 

Definition at line 77 of file Cluster.h.

TRefArray recobase::Cluster::fXCell [private]
 

Definition at line 70 of file Cluster.h.

Referenced by Add(), Cluster(), NXCell(), and XCell().

vector<int> recobase::Cluster::fXPlane [private]
 

sorted vector of x-planes

Definition at line 73 of file Cluster.h.

Referenced by Cluster(), Plane(), and XPlane().

TRefArray recobase::Cluster::fYCell [private]
 

Definition at line 71 of file Cluster.h.

Referenced by Add(), Cluster(), NYCell(), and YCell().

vector<int> recobase::Cluster::fYPlane [private]
 

sorted vector of y-planes

Definition at line 74 of file Cluster.h.

Referenced by Cluster(), Plane(), and YPlane().


The documentation for this class was generated from the following files:
Generated on Wed Mar 18 04:45:47 2009 for NOvA Offline by  doxygen 1.3.9.1