PmtPixelsMxx Class Reference

#include <PmtPixels.h>

List of all members.

Public Member Functions

 PmtPixelsMxx (int pixels_wide=4)
virtual ~PmtPixelsMxx ()
void Clear ()
void SetPixelSpot (const PlexPixelSpotId &ppsid, double relval=1.0)

Detailed Description

Definition at line 89 of file PmtPixels.h.


Constructor & Destructor Documentation

PmtPixelsMxx::PmtPixelsMxx ( int  pixels_wide = 4  ) 

Definition at line 159 of file PmtPixels.cxx.

References PmtPixel::Draw().

00160 {
00161     int pixel_num = 0;
00162     // The width in some units
00163     const double real_width = 1.0;
00164     // border around each pixel
00165     const double d = 0.01*real_width; 
00166     // The width of one pixel
00167     const double w = (real_width - (2.0*pixels_wide)*d)/(pixels_wide);
00168 
00169     // indices origin is in upper right.  
00170     for (int yind = 0; yind < pixels_wide; ++yind) {
00171         double yc = (2*(pixels_wide-yind)-1)*(0.5*w+d);
00172 
00173         for (int xind = 0; xind < pixels_wide; ++xind) {
00174             double xc = (2*(pixels_wide-xind)-1)*(0.5*w+d);
00175 
00176             PmtPixel* pixel = new PmtPixel(pixel_num,xc,yc,w,w);
00177             this->push_back(pixel);
00178             pixel->Draw();
00179         }
00180     }
00181 
00182 }

PmtPixelsMxx::~PmtPixelsMxx (  )  [virtual]

Definition at line 184 of file PmtPixels.cxx.

References done(), and it.

00185 {
00186     iterator it, done = this->end();
00187     for (it = this->begin(); it != done; ++it) {
00188         PmtPixel* pp = (*it);
00189         delete pp;
00190         *it = 0;
00191     }
00192 }


Member Function Documentation

void PmtPixelsMxx::Clear ( void   ) 

Definition at line 194 of file PmtPixels.cxx.

References done(), it, and PmtSpot::SetRelativeColor().

Referenced by PmtPixels::Refresh().

00195 {
00196     iterator it, done = this->end();
00197     for (it = this->begin(); it != done; ++it) {
00198         PmtPixel* pp = *it;
00199         
00200         PmtPixel::iterator ppit, ppdone = pp->end();
00201         for (ppit = pp->begin(); ppit != ppdone; ++ppit) {
00202             PmtSpot* ps = *ppit;
00203             ps->SetRelativeColor(0);
00204         }
00205     }
00206 }

void PmtPixelsMxx::SetPixelSpot ( const PlexPixelSpotId ppsid,
double  relval = 1.0 
)

Definition at line 208 of file PmtPixels.cxx.

References PlexPixelSpotId::GetPixel(), and PlexPixelSpotId::GetSpot().

Referenced by PmtPixels::Refresh().

00209 {
00210     int pixel = ppsid.GetPixel();
00211     int spot = ppsid.GetSpot();
00212 
00213     (*(*this)[pixel])[spot]->SetRelativeColor(relval);
00214 }


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

Generated on 16 Jan 2018 for loon by  doxygen 1.6.1