FitView Class Reference

#include <FitView.h>

Inheritance diagram for FitView:
Page

List of all members.

Public Member Functions

 FitView ()
 ~FitView ()
virtual void BuildDisplay (TCanvas *c)
virtual void DrawEvent (ParticleObjectHolder *poh=0, NtpStRecord *ntp=0, int ntpEvt=-1)
void DrawAngles ()

Private Attributes

TPad * padU
TPad * padV
TPad * padMC
TPad * padInfo
TH1D * viewTheta
TH1D * viewPhi
TH2D * view3D
ParticleObjectHoldermypoh

Detailed Description

Definition at line 12 of file FitView.h.


Constructor & Destructor Documentation

FitView::FitView (  ) 

Definition at line 17 of file FitView.cxx.

References padU, padV, viewPhi, and viewTheta.

00017                 :Page()
00018 {
00019         viewTheta=0;
00020         viewPhi=0;
00021         padU=0;
00022         padV=0;
00023 
00024 }

FitView::~FitView (  ) 

Definition at line 27 of file FitView.cxx.

00028 {}


Member Function Documentation

void FitView::BuildDisplay ( TCanvas *  c  )  [virtual]

Reimplemented from Page.

Definition at line 31 of file FitView.cxx.

References Page::myCanvas, padInfo, padMC, padU, and padV.

00032 {
00033         myCanvas=c;
00034         padV=new TPad("chainview_padv","chainview_padu",0,0,0.7,0.5);
00035         padU=new TPad("chainview_padu","chainview_padv",0,0.5,0.7,1.0);
00036         padMC=new TPad("chainview_padmc","chainview_padmc",0.71,0.0,1.0,0.8);
00037         padInfo=new TPad("chainview_padinfo","chainview_padinfo",0.71,0.8,1.0,1.0);
00038         myCanvas->cd();
00039         padU->Draw();
00040         padV->Draw();
00041         padMC->Draw();
00042         padInfo->Draw();
00043         
00044 }

void FitView::DrawAngles (  ) 

Definition at line 131 of file FitView.cxx.

References Particle3D::e, ParticleObjectHolder::event, mypoh, ParticleObjectHolder::particles3d, Particle3D::sum_e, Particle3D::u, Particle3D::v, view3D, viewPhi, viewTheta, ParticleEvent::vtx_u, ParticleEvent::vtx_v, ParticleEvent::vtx_z, and Particle3D::z.

Referenced by DrawEvent().

00132 {
00133         //find max particle index...
00134         double maxe=0;
00135         int maxi=-1;
00136         std::vector<Particle3D>  particles3d = mypoh->particles3d;      
00137         for(unsigned int i=0;i<particles3d.size();i++)
00138         {
00139                 Particle3D * p3 = (Particle3D *)&particles3d[i];
00140                 if(p3 <=0)continue;
00141                 if(p3->sum_e>maxe)
00142                 {
00143                         maxe=p3->sum_e;
00144                         maxi=i;
00145                 }
00146         }
00147 
00148         if(maxi<0)return;
00149 
00150         Particle3D * p = &particles3d[maxi];
00151         
00152         for(unsigned int i=0;i<p->e.size();i++)
00153         {
00154                 double u = p->u[i]-mypoh->event.vtx_u;
00155                 double v = p->v[i]-mypoh->event.vtx_v;
00156                 double z = p->z[i]-mypoh->event.vtx_z;
00157         
00158                 double r = sqrt(u*u+v*v+z*z);
00159                 double theta = atan(u/v);
00160                 double phi = acos(z/r);
00161 
00162                 phi=phi<0?phi+2*3.141592:phi;
00163                 theta=theta<0?theta+2*3.141592:theta;
00164                 
00165                 viewPhi->Fill(phi,p->e[i]);
00166                 viewTheta->Fill(theta,p->e[i]);
00167                 view3D->Fill(theta,phi,p->e[i]);
00168         
00169         }
00170         
00171         
00172 
00173 
00174 
00175 } 

void FitView::DrawEvent ( ParticleObjectHolder poh = 0,
NtpStRecord ntp = 0,
int  ntpEvt = -1 
) [virtual]

Reimplemented from Page.

Definition at line 47 of file FitView.cxx.

References DrawAngles(), RecRecordImp< T >::GetHeader(), VldContext::GetSimFlag(), RecHeader::GetVldContext(), isMC, SimFlag::kMC, StripHolder::maxu, StripHolder::maxv, StripHolder::maxz, ParticleObjectHolder::mctrue, StripHolder::minu, StripHolder::minv, StripHolder::minz, Page::myCanvas, mypoh, padInfo, padMC, padU, padV, ParticleObjectHolder::strips, view3D, viewPhi, viewTheta, MCTrue::vtx_u, MCTrue::vtx_v, and MCTrue::vtx_z.

00048 {
00049         padU->Clear();
00050         padV->Clear();
00051         padMC->Clear();
00052         padInfo->Clear();
00053         
00054         mypoh=poh;
00055         
00056         int isMC=0;
00057         if(poh->GetHeader().GetVldContext().GetSimFlag() == SimFlag::kMC)isMC=1;
00058         
00059         double minz= mypoh->strips.minz;
00060         double minu= mypoh->strips.minu;
00061         double minv= mypoh->strips.minv;
00062         double maxz= mypoh->strips.maxz;
00063         double maxu= mypoh->strips.maxu;
00064         double maxv= mypoh->strips.maxv;
00065         
00066 
00067         
00068         if(isMC)
00069         {
00070                 if(mypoh->mctrue.vtx_z>=0)minz=minz<mypoh->mctrue.vtx_z ? minz : mypoh->mctrue.vtx_z;
00071                 maxz=maxz>mypoh->mctrue.vtx_z ? maxz : mypoh->mctrue.vtx_z;
00072                 minu=minu<mypoh->mctrue.vtx_u ? minu : mypoh->mctrue.vtx_u;
00073                 maxu=maxu>mypoh->mctrue.vtx_u ? maxu : mypoh->mctrue.vtx_u;
00074                 minv=minv<mypoh->mctrue.vtx_v ? minv : mypoh->mctrue.vtx_v;
00075                 maxv=maxv>mypoh->mctrue.vtx_v ? maxv : mypoh->mctrue.vtx_v;
00076         }
00077         
00078 
00079 
00080 
00081         minz -= 0.1;
00082         minu -= 0.1;
00083         minv -= 0.1;
00084         maxz += 0.1;
00085         maxu += 0.1;
00086         maxv += 0.1;
00087         
00088         //int nu=(int)((maxu-minu)/0.0412);
00089         //int nv=(int)((maxv-minv)/0.0412);
00090         //int nz=(int)((maxz-minz)/0.0354);
00091 
00092 
00093         if(viewTheta)delete viewTheta;
00094         if(viewPhi)delete viewPhi;
00095 
00096         viewTheta = new TH1D("hu","Theta",100,0,2*3.141592);
00097         viewPhi = new TH1D("hv","Phi", 100,0,3.141592);
00098         view3D = new TH2D("view3D","view3D",100,0,2*3.141592,100,0,3.141592);
00099 //      viewTheta->SetStats(0);
00100 //      viewPhi->SetStats(0);
00101         viewTheta->SetDirectory(0);
00102         viewPhi->SetDirectory(0);
00103 
00104         if(mypoh)
00105         {       
00106                 DrawAngles();
00107 
00108         }
00109         
00110         if(ntp)
00111         {
00112 
00113         }
00114         
00115         padU->cd();
00116         viewTheta->Draw();
00117         padV->cd();
00118         viewPhi->Draw();
00119         padMC->cd();
00120         view3D->Draw("colz");
00121         
00122         
00123         padU->Update();
00124         padV->Update();
00125         padMC->Update();
00126         padInfo->Update();
00127         myCanvas->Update();
00128         
00129 }


Member Data Documentation

Definition at line 33 of file FitView.h.

Referenced by DrawAngles(), and DrawEvent().

TPad* FitView::padInfo [private]

Definition at line 28 of file FitView.h.

Referenced by BuildDisplay(), and DrawEvent().

TPad* FitView::padMC [private]

Definition at line 27 of file FitView.h.

Referenced by BuildDisplay(), and DrawEvent().

TPad* FitView::padU [private]

Definition at line 25 of file FitView.h.

Referenced by BuildDisplay(), DrawEvent(), and FitView().

TPad* FitView::padV [private]

Definition at line 26 of file FitView.h.

Referenced by BuildDisplay(), DrawEvent(), and FitView().

TH2D* FitView::view3D [private]

Definition at line 32 of file FitView.h.

Referenced by DrawAngles(), and DrawEvent().

TH1D* FitView::viewPhi [private]

Definition at line 31 of file FitView.h.

Referenced by DrawAngles(), DrawEvent(), and FitView().

TH1D* FitView::viewTheta [private]

Definition at line 30 of file FitView.h.

Referenced by DrawAngles(), DrawEvent(), and FitView().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1