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

static int printit = -1

Private Attributes

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

Detailed Description

Definition at line 9 of file Pixel.h.


Constructor & Destructor Documentation

Pixel::Pixel (  ) 

Definition at line 11 of file Pixel.cxx.

00012 {
00013         id=-1;
00014 }

Pixel::Pixel ( int  id  ) 

Definition at line 16 of file Pixel.cxx.

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

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

Pixel::~Pixel (  ) 

Definition at line 35 of file Pixel.cxx.

00035 {}


Member Function Documentation

void Pixel::AddE ( double  ee  )  [inline]

Definition at line 26 of file Pixel.h.

References e.

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.

References stripE.

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

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

void Pixel::Dump (  ) 

Definition at line 93 of file Pixel.cxx.

References e, pixelspots, and printit.

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

double Pixel::GetE (  )  [inline]

Definition at line 22 of file Pixel.h.

References e.

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(), GetPixelSpot(), and XTalkFilter::SaveAdjustment().

00016 {return id;};

int Pixel::GetNStrips (  ) 

Definition at line 99 of file Pixel.cxx.

References n, and pixelspots.

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

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

Definition at line 69 of file Pixel.cxx.

References GetId(), pixelspots, and PixelSpot::SetPixel().

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

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

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

Definition at line 37 of file Pixel.cxx.

References pixelspots.

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

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

PMT* Pixel::GetPMT (  )  [inline]

Definition at line 35 of file Pixel.h.

References parentPMT.

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

00035 {return parentPMT;};

int Pixel::GetStatus (  )  [inline]

Definition at line 37 of file Pixel.h.

References status.

Referenced by XTalkFilter::SaveAdjustment().

00037 {return status;};

double Pixel::GetStripE (  )  [inline]

Definition at line 23 of file Pixel.h.

References stripE.

Referenced by XTalkFilter::CleanXTalk().

00023 {return stripE;};

void Pixel::SetPMT ( PMT pmt  )  [inline]

Definition at line 34 of file Pixel.h.

References parentPMT.

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 46 of file Pixel.cxx.

References e, and pixelspots.

Referenced by XTalkFilter::CleanXTalk().

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


Member Data Documentation

double Pixel::e [private]

Definition at line 48 of file Pixel.h.

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

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 GetPMT(), Pixel(), and SetPMT().

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 43 of file Pixel.h.

Referenced by Dump(), and Pixel().

int Pixel::status [private]

Definition at line 52 of file Pixel.h.

Referenced by GetStatus(), and Pixel().

double Pixel::stripE [private]

Definition at line 49 of file Pixel.h.

Referenced by AddStripE(), GetStripE(), and Pixel().

Definition at line 38 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 22 Nov 2017 for loon by  doxygen 1.6.1