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

Pixel Class Reference

#include <Pixel.h>

List of all members.

Public Member Functions

 Pixel ()
 Pixel (int id)
 ~Pixel ()
int GetId ()
PixelSpotGetPixelSpot (int id, int create=1)
std::vector< int > GetPixelSpotVector ()
double GetE ()
double GetStripE ()
int GetNStrips ()
void AddE (double ee)
void TakeE (double ee)
void AddStripE (double ee)
void Dump ()
void SetPMT (PMT *pmt)
PMTGetPMT ()
int GetStatus ()
void SetStatus (int s)

Public Attributes

int type
int hopstomixed

Static Public Attributes

int printit = -1

Private Attributes

int id
std::vector< PixelSpotpixelspots
double e
double stripE
PMTparentPMT
int status


Constructor & Destructor Documentation

Pixel::Pixel  ) 
 

Definition at line 9 of file Pixel.cxx.

00010 {
00011         id=-1;
00012 }

Pixel::Pixel int  id  ) 
 

Definition at line 14 of file Pixel.cxx.

References e, hopstomixed, MsgService::Instance(), MsgService::IsActive(), parentPMT, pixelspots, printit, status, stripE, and type.

00015 {
00016         if(printit<0)
00017         {
00018                 if(MsgService::Instance()->IsActive("XTalkFilter",
00019                                            Msg::kDebug))printit=1;
00020                 else printit=0;
00021         }
00022 
00023         this->id=id;
00024         parentPMT=0;
00025         stripE=0;
00026         e=0;
00027         pixelspots.clear();
00028         status=0;
00029         type=-1;
00030         hopstomixed=-1;
00031 }

Pixel::~Pixel  ) 
 

Definition at line 33 of file Pixel.cxx.

00033 {}


Member Function Documentation

void Pixel::AddE double  ee  )  [inline]
 

Definition at line 26 of file Pixel.h.

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

00026 {e+=ee; if(e<0)e=0;};

void Pixel::AddStripE double  ee  )  [inline]
 

Definition at line 29 of file Pixel.h.

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

00029 {stripE+=ee;if(stripE<0)stripE=0;};

void Pixel::Dump  ) 
 

Definition at line 91 of file Pixel.cxx.

References PixelSpot::Dump(), e, and pixelspots.

Referenced by PMT::Dump().

00092 {
00093         if(printit)printf("\t Pixel %d e %f\n",id,e);
00094         for(unsigned int i=0;i<pixelspots.size();i++)pixelspots[i].Dump();
00095 }

double Pixel::GetE  )  [inline]
 

Definition at line 22 of file Pixel.h.

Referenced by XTalkFilter::CleanXTalk().

00022 {return e;};

int Pixel::GetId  )  [inline]
 

Definition at line 16 of file Pixel.h.

Referenced by XTalkFilter::CleanXTalk(), XTalkFilter::GetHops(), GetPixelSpotVector(), and XTalkFilter::SaveAdjustment().

00016 {return id;};

int Pixel::GetNStrips  ) 
 

Definition at line 97 of file Pixel.cxx.

References PixelSpot::GetNStrips(), and pixelspots.

00098 {
00099         int n=0;
00100         for(unsigned int i=0;i<pixelspots.size();i++)
00101                 n+=pixelspots[i].GetNStrips(); 
00102         return n;
00103 }

PixelSpot * Pixel::GetPixelSpot int  id,
int  create = 1
 

Definition at line 67 of file Pixel.cxx.

References pixelspots, and PixelSpot::SetPixel().

Referenced by XTalkFilter::CleanXTalk(), XTalkFilter::DoTrueFilter(), and XTalkFilter::SaveAdjustment().

00068 {
00069         for(unsigned int i=0;i<pixelspots.size();i++)
00070         {
00071                 if(pixelspots[i].GetId()==id)
00072                 {
00073 // make sure the address is correct...somehow it can get shifted!
00074                         pixelspots[i].SetPixel(this);
00075                         return &(pixelspots[i]);
00076                 }
00077         }
00078         
00079         if(!create)return 0;
00080         
00081 // if its not there... create it
00082         PixelSpot newpixelspot(id);
00083         newpixelspot.SetPixel(this);
00084         
00085 // if(printit)printf("creating pixelspot id %d with pixel addr %p\n",id,this); 
00086         pixelspots.push_back(newpixelspot);
00087         return & (pixelspots[pixelspots.size()-1]);
00088 }

std::vector< int > Pixel::GetPixelSpotVector  ) 
 

Definition at line 35 of file Pixel.cxx.

References GetId(), and pixelspots.

Referenced by XTalkFilter::CleanXTalk(), and XTalkFilter::SaveAdjustment().

00036 {
00037         std::vector<int> ps; 
00038         for(unsigned int i=0;i<pixelspots.size();i++)  
00039                 ps.push_back(pixelspots[i].GetId()); 
00040         return ps;
00041 }

PMT* Pixel::GetPMT  )  [inline]
 

Definition at line 35 of file Pixel.h.

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

00035 {return parentPMT;};

int Pixel::GetStatus  )  [inline]
 

Definition at line 37 of file Pixel.h.

Referenced by XTalkFilter::SaveAdjustment().

00037 {return status;};

double Pixel::GetStripE  )  [inline]
 

Definition at line 23 of file Pixel.h.

Referenced by XTalkFilter::CleanXTalk().

00023 {return stripE;};

void Pixel::SetPMT PMT pmt  )  [inline]
 

Definition at line 34 of file Pixel.h.

Referenced by PMT::GetPixel().

00034 {parentPMT=pmt;};

void Pixel::SetStatus int  s  )  [inline]
 

Definition at line 38 of file Pixel.h.

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

00038 {status=s;};

void Pixel::TakeE double  ee  ) 
 

Definition at line 44 of file Pixel.cxx.

References e, and pixelspots.

Referenced by XTalkFilter::CleanXTalk().

00045 {
00046 
00047      //   if(printit)printf("pixel take %f\n",ee);
00048         if(e<=0)return;
00049         
00050 // take the energy from the spots as well by proportion
00051 // that they contribute
00052         
00053         for(unsigned int i=0;i<pixelspots.size();i++)
00054         {
00055                 if(e<1e-5)break; //already took the energy
00056                 double totake = ee * pixelspots[i].GetE()/e;
00057                 pixelspots[i].TakeE(totake);            
00058        //         if(printit)printf("call pixelspot take %f from %d\n",
00059          //                         totake,i);
00060         }
00061 
00062 //      if(ee<=e)e=0; 
00063 //      else e-=ee; 
00064 
00065 }


Member Data Documentation

double Pixel::e [private]
 

Definition at line 48 of file Pixel.h.

Referenced by Dump(), Pixel(), and TakeE().

int Pixel::hopstomixed
 

Definition at line 41 of file Pixel.h.

Referenced by XTalkFilter::CleanXTalk(), and Pixel().

int Pixel::id [private]
 

Definition at line 46 of file Pixel.h.

PMT* Pixel::parentPMT [private]
 

Definition at line 50 of file Pixel.h.

Referenced by Pixel().

std::vector<PixelSpot> Pixel::pixelspots [private]
 

Definition at line 47 of file Pixel.h.

Referenced by Dump(), GetNStrips(), GetPixelSpot(), GetPixelSpotVector(), Pixel(), and TakeE().

int Pixel::printit = -1 [static]
 

Definition at line 7 of file Pixel.cxx.

Referenced by Pixel().

int Pixel::status [private]
 

Definition at line 52 of file Pixel.h.

Referenced by Pixel().

double Pixel::stripE [private]
 

Definition at line 49 of file Pixel.h.

Referenced by Pixel().

int Pixel::type
 

Definition at line 40 of file Pixel.h.

Referenced by XTalkFilter::CleanXTalk(), XTalkFilter::GetHops(), and Pixel().


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:10:03 2010 for loon by  doxygen 1.3.9.1