PMT Class Reference

#include <PMT.h>

List of all members.

Public Member Functions

 PMT (int id)
 PMT ()
 ~PMT ()
int GetId ()
PixelGetPixel (int id, int create=1)
std::vector< int > GetPixelVector ()
void Dump ()
int GetNStrips ()
void IncStripCount ()
int GetStatus ()
void SetStatus (int s)

Static Public Attributes

static int printit = -1

Private Member Functions

void Init (int id)

Private Attributes

int id
int nstrips
std::vector< Pixelpixels
int status


Detailed Description

Definition at line 9 of file PMT.h.


Constructor & Destructor Documentation

PMT::PMT ( int  id  )  [inline]

Definition at line 13 of file PMT.h.

References Init().

00013 {Init(id);};

PMT::PMT (  )  [inline]

Definition at line 14 of file PMT.h.

References Init().

00014 {Init(-1);};

PMT::~PMT (  ) 

Definition at line 24 of file PMT.cxx.

00024 {}


Member Function Documentation

void PMT::Dump (  ) 

Definition at line 50 of file PMT.cxx.

References nstrips, and pixels.

00051 {
00052         if(nstrips<2)return;
00053         printf("PMT %d with %d strips\n",id,nstrips);
00054         for(unsigned int i=0;i<pixels.size();i++)pixels[i].Dump();
00055 }

int PMT::GetId (  )  [inline]

Definition at line 17 of file PMT.h.

References id.

Referenced by GetPixel().

00017 {return id;};

int PMT::GetNStrips (  )  [inline]

Definition at line 25 of file PMT.h.

References nstrips.

00025 {return nstrips;};

Pixel * PMT::GetPixel ( int  id,
int  create = 1 
)

Definition at line 34 of file PMT.cxx.

References GetId(), pixels, and Pixel::SetPMT().

Referenced by XTalkFilter::DoTrueFilter(), and XTalkFilter::GetHops().

00035 {
00036         for(unsigned int i=0;i<pixels.size();i++)
00037         {
00038                 pixels[i].SetPMT(this);
00039                 if(pixels[i].GetId()==id)return &(pixels[i]);
00040         }
00041         
00042         if(!create)return 0;
00043 //if its not there... create it
00044         Pixel newpixel(id);
00045         newpixel.SetPMT(this);
00046         pixels.push_back(newpixel);
00047         return & (pixels[pixels.size()-1]);
00048 }

std::vector< int > PMT::GetPixelVector (  ) 

Definition at line 26 of file PMT.cxx.

References pixels.

Referenced by XTalkFilter::GetHops().

00027 {
00028         std::vector<int>p; 
00029         for(unsigned int i=0;i<pixels.size();i++)
00030                 p.push_back(pixels[i].GetId());
00031         return p;
00032 }

int PMT::GetStatus (  )  [inline]

Definition at line 28 of file PMT.h.

References status.

00028 {return status;};

void PMT::IncStripCount (  )  [inline]

Definition at line 26 of file PMT.h.

References nstrips.

Referenced by PixelSpot::AddStrip().

00026 {nstrips++;};

void PMT::Init ( int  id  )  [private]

Definition at line 9 of file PMT.cxx.

References MsgService::Instance(), Msg::kDebug, nstrips, pixels, printit, and status.

Referenced by PMT().

00010 {
00011         if(printit<0)
00012         {
00013                 if(MsgService::Instance()->IsActive("XTalkFilter",
00014                                            Msg::kDebug))printit=1;
00015                 else printit=0;
00016         }
00017 
00018         this->id=id;
00019         pixels.clear();
00020         nstrips=0;
00021         status=0;
00022 }

void PMT::SetStatus ( int  s  )  [inline]

Definition at line 29 of file PMT.h.

References status.

Referenced by PixelSpot::AddE(), and PixelSpot::TakeE().

00029 {status=s;};


Member Data Documentation

int PMT::id [private]

Definition at line 36 of file PMT.h.

Referenced by GetId().

int PMT::nstrips [private]

Definition at line 37 of file PMT.h.

Referenced by Dump(), GetNStrips(), IncStripCount(), and Init().

std::vector<Pixel> PMT::pixels [private]

Definition at line 39 of file PMT.h.

Referenced by Dump(), GetPixel(), GetPixelVector(), and Init().

int PMT::printit = -1 [static]

Definition at line 29 of file PMT.h.

Referenced by Init().

int PMT::status [private]

Definition at line 40 of file PMT.h.

Referenced by GetStatus(), Init(), and SetStatus().


The documentation for this class was generated from the following files:
Generated on Thu Apr 10 23:03:30 2014 for loon by  doxygen 1.4.7