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

GfxMCVec Class Reference

Graphical representation of a CandMCVec. More...

#include <GfxMCVec.h>

List of all members.

Public Member Functions

 GfxMCVec (const TParticle &part, const float evntP, GfxMCVecList &parent)
 GfxMCVec (const GfxMCVec &rhs)
virtual ~GfxMCVec ()
void Clear (Option_t *option="")
void Configure (int ind)
void ExecuteEvent (int event, int px, int py)
void Paint (Option_t *option="")
int DistancetoPrimitive (int px, int py)
const TParticle & GetParticle ()

Private Member Functions

bool BuildRealImp (int ipart)
bool BuildDiscreteImp (int)

Private Attributes

const TParticle & fParticle
const float fEventP
GfxMCVecListfParent
TObject * fImp


Detailed Description

Graphical representation of a CandMCVec.

Id
GfxMCVec.h,v 1.4 2003/08/22 16:47:10 musser Exp

EVD

Contact: bv@bnl.gov

Created on: Wed Oct 2 15:43:48 2002

Definition at line 28 of file GfxMCVec.h.


Constructor & Destructor Documentation

GfxMCVec::GfxMCVec const TParticle &  part,
const float  evntP,
GfxMCVecList parent
 

Definition at line 23 of file GfxMCVec.cxx.

00024     : fParticle(part)
00025     , fEventP(evntP)
00026     , fParent(parent)
00027     , fImp(0)
00028 {
00029 }

GfxMCVec::GfxMCVec const GfxMCVec rhs  ) 
 

Definition at line 31 of file GfxMCVec.cxx.

00032     : TObject()
00033       ,fParticle(rhs.fParticle), fEventP(rhs.fEventP), fParent(rhs.fParent), fImp(0)
00034 {
00035 }

GfxMCVec::~GfxMCVec  )  [virtual]
 

Definition at line 38 of file GfxMCVec.cxx.

References Clear().

00039 {
00040   this->Clear();
00041 }


Member Function Documentation

bool GfxMCVec::BuildDiscreteImp int   )  [private]
 

Definition at line 165 of file GfxMCVec.cxx.

References fImp, fParent, and GfxBase::GetGraphicsView().

Referenced by Configure().

00166 {
00167   TList* MCVec = new TList;
00168   MCVec->SetOwner();
00169 
00170   if(fParent.GetGraphicsView() != GraphicsView::kXY && 
00171      fParent.GetGraphicsView() != GraphicsView::kUV)
00172       {
00173       }
00174 
00175     else if(fParent.GetGraphicsView() == GraphicsView::kXY) 
00176       {                     
00177      }
00178     else if(fParent.GetGraphicsView() == GraphicsView::kUV) 
00179       {                     
00180   
00181       }
00182 
00183  
00184     fImp = MCVec;
00185 
00186     return true;
00187 }

bool GfxMCVec::BuildRealImp int  ipart  )  [private]
 

Definition at line 65 of file GfxMCVec.cxx.

References abs(), fEventP, fImp, fParent, fParticle, GfxBase::GetGraphicsView(), and len.

Referenced by Configure().

00066 {
00067    
00068     float motherlength;
00069 
00070     TList* MCVec = new TList;
00071     MCVec->SetOwner();
00072 
00073     double x1=0;
00074     double x2=0;
00075     double y1=0;
00076     double y2=0;
00077 
00078     int sign=1;
00079     if((abs(fParticle.GetPdgCode())==12 || 
00080        abs(fParticle.GetPdgCode())==14 ||
00081        abs(fParticle.GetPdgCode())==16) && fParticle.GetStatusCode()==0) sign=-1;
00082     
00083 
00084     if (fParent.GetGraphicsView() == GraphicsView::kUZ) 
00085       {
00086         motherlength=4;
00087         x1 = fParticle.Vz();
00088         y1 = 0.7071678*(fParticle.Vx()+fParticle.Vy());
00089         double len=0.2*fParticle.P();
00090         double pu = 0.7071678*(fParticle.Px()+fParticle.Py());
00091         double pz = fParticle.Pz();
00092         double P=fParticle.P();
00093         if(P>0 && fEventP>0)
00094           {
00095             len= motherlength*(fParticle.P()/fEventP);    
00096             x2=x1+sign*len*pz/P;
00097             y2=y1+sign*len*pu/P;
00098           }
00099       }
00100     else if(fParent.GetGraphicsView() == GraphicsView::kVZ) 
00101       {  
00102         motherlength=4;
00103         x1  = fParticle.Vz();
00104         y1 = 0.7071678*(fParticle.Vy()-fParticle.Vx());
00105         double len=0.2*fParticle.P();
00106         double pv = 0.7071678*(fParticle.Py()-fParticle.Px());
00107         double pz = fParticle.Pz();
00108         double P=fParticle.P();
00109         if(P>0 && fEventP>0)
00110           {
00111             len= motherlength*(fParticle.P()/fEventP);
00112             x2=x1+sign*len*pz/P;
00113             y2=y1+sign*len*pv/P;
00114           }
00115       }
00116     else if(fParent.GetGraphicsView() == GraphicsView::kXY) 
00117       {                
00118         motherlength=6;
00119         x1 = fParticle.Vx();
00120         y1 = fParticle.Vy();
00121         double px =fParticle.Px(); 
00122         double py =fParticle.Py();
00123         double P=fParticle.P();
00124 
00125         double len=0.2*fParticle.P();
00126         if(P>0 && fEventP>0)
00127           {
00128             len= motherlength*(fParticle.P()/fEventP);
00129             x2=x1+sign*len*px/P;
00130             y2=y1+sign*len*py/P;
00131           }
00132     }
00133     else if(fParent.GetGraphicsView() == GraphicsView::kUV) 
00134       {                
00135         motherlength=6;
00136         x1 = 0.7071678*(fParticle.Vx()+fParticle.Vy());
00137         y1 = 0.7071678*(fParticle.Vy()-fParticle.Vx());
00138         double pu =0.7071678*(fParticle.Px()+fParticle.Py()); 
00139         double pv =0.7071678*(fParticle.Py()-fParticle.Px());
00140         double P=fParticle.P();
00141         double len=0.2*fParticle.P();
00142         if(P>0 && fEventP>0)
00143           {
00144             len= motherlength*(fParticle.P()/fEventP);
00145             x2=x1+sign*len*pu/P;
00146             y2=y1+sign*len*pv/P;
00147           }
00148       }
00149     TLine * Vec = new TLine(x1,y1,x2,y2);
00150     Vec->SetLineColor(15);
00151     if(abs(fParticle.GetPdgCode())==2212) Vec->SetLineColor(45);
00152     if(abs(fParticle.GetPdgCode())==12 || 
00153        abs(fParticle.GetPdgCode())==14 ||
00154        abs(fParticle.GetPdgCode())==16)  Vec->SetLineColor(1);
00155     if(abs(fParticle.GetPdgCode())==11)  Vec->SetLineColor(2);  
00156     if(abs(fParticle.GetPdgCode())==13)  Vec->SetLineColor(3);
00157     MCVec->Add(Vec);
00158     
00159     fImp = MCVec;
00160 
00161 
00162     return true;
00163 }

void GfxMCVec::Clear Option_t *  option = ""  ) 
 

Definition at line 43 of file GfxMCVec.cxx.

References fImp.

Referenced by ~GfxMCVec().

00044 {
00045   if (fImp) delete fImp; fImp=0;
00046 }

void GfxMCVec::Configure int  ind  ) 
 

Definition at line 48 of file GfxMCVec.cxx.

References BuildDiscreteImp(), BuildRealImp(), fImp, fParent, ViewState::GetSpatialMetric(), and GfxBase::GetViewState().

00049 {
00050     if (fImp) { delete fImp; fImp = 0; }
00051 
00052 
00053     switch (fParent.GetViewState()->GetSpatialMetric()) {
00054     case ViewState::metric_is_continuous:
00055         if (! this->BuildRealImp(ipart)) return;
00056         break;
00057     case ViewState::metric_is_discreet: default:
00058         if (! this->BuildDiscreteImp(ipart)) return;
00059         break;
00060     }
00061 
00062 }

int GfxMCVec::DistancetoPrimitive int  px,
int  py
 

Definition at line 199 of file GfxMCVec.cxx.

References fImp.

00200 {
00201     int dist = 0xdead;
00202     if (fImp) {
00203         TList* l = dynamic_cast<TList*>(fImp);
00204         if (!l) 
00205             dist = fImp->DistancetoPrimitive(px,py);
00206         else {
00207             TIter next(l);
00208             TObject* obj;
00209             while ((obj=next())) {
00210                 int d = obj->DistancetoPrimitive(px,py);
00211                 if (d < dist) dist = d;
00212             }
00213         }
00214     }
00215     return dist;
00216 }

void GfxMCVec::ExecuteEvent int  event,
int  px,
int  py
 

Definition at line 189 of file GfxMCVec.cxx.

References GfxMCVecList::ExecuteEvent(), and fParent.

00190 {
00191     fParent.ExecuteEvent(event,px,py,this);
00192 }

const TParticle& GfxMCVec::GetParticle  )  [inline]
 

Definition at line 45 of file GfxMCVec.h.

Referenced by GfxMCVecList::ExecuteEvent().

00045 { return fParticle; };

void GfxMCVec::Paint Option_t *  option = ""  ) 
 

Definition at line 193 of file GfxMCVec.cxx.

References fImp, and option.

00194 {
00195     if (!fImp) return;
00196 
00197     fImp->Paint(option);
00198 }


Member Data Documentation

const float GfxMCVec::fEventP [private]
 

Definition at line 52 of file GfxMCVec.h.

Referenced by BuildRealImp().

TObject* GfxMCVec::fImp [private]
 

Definition at line 54 of file GfxMCVec.h.

Referenced by BuildDiscreteImp(), BuildRealImp(), Clear(), Configure(), DistancetoPrimitive(), and Paint().

GfxMCVecList& GfxMCVec::fParent [private]
 

Definition at line 53 of file GfxMCVec.h.

Referenced by BuildDiscreteImp(), BuildRealImp(), Configure(), and ExecuteEvent().

const TParticle& GfxMCVec::fParticle [private]
 

Definition at line 51 of file GfxMCVec.h.

Referenced by BuildRealImp().


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