CandTrackCamHandle Class Reference

#include <CandTrackCamHandle.h>

Inheritance diagram for CandTrackCamHandle:
CandTrackHandle CandRecoHandle CandHandle

List of all members.

Public Member Functions

 CandTrackCamHandle ()
 CandTrackCamHandle (const CandTrackCamHandle &rhs)
 CandTrackCamHandle (CandTrackCam *candidate)
virtual ~CandTrackCamHandle ()
virtual CandTrackCamHandleDupHandle () const
double GetDirCos (int plane, int iuvz) const
double GetDirCosU (int plane) const
double GetDirCosV (int plane) const
double GetDirCosZ (int plane) const
 ClassDef (CandTrackCamHandle, 1)

Detailed Description

Definition at line 17 of file CandTrackCamHandle.h.


Constructor & Destructor Documentation

CandTrackCamHandle::CandTrackCamHandle (  ) 

Definition at line 19 of file CandTrackCamHandle.cxx.

Referenced by DupHandle().

00020 {
00021 }

CandTrackCamHandle::CandTrackCamHandle ( const CandTrackCamHandle rhs  ) 

Definition at line 26 of file CandTrackCamHandle.cxx.

00027     : CandTrackHandle(handle)
00028 {
00029 }

CandTrackCamHandle::CandTrackCamHandle ( CandTrackCam candidate  ) 

Definition at line 34 of file CandTrackCamHandle.cxx.

00035     : CandTrackHandle(candidate)
00036 {
00037 }

CandTrackCamHandle::~CandTrackCamHandle (  )  [virtual]

Definition at line 42 of file CandTrackCamHandle.cxx.

00043 {
00044 }


Member Function Documentation

CandTrackCamHandle::ClassDef ( CandTrackCamHandle  ,
 
)
CandTrackCamHandle * CandTrackCamHandle::DupHandle (  )  const [virtual]

Reimplemented from CandTrackHandle.

Definition at line 49 of file CandTrackCamHandle.cxx.

References CandTrackCamHandle().

00050 {
00051   return new CandTrackCamHandle(*this);
00052 }

double CandTrackCamHandle::GetDirCos ( int  plane,
int  iuvz 
) const

Definition at line 58 of file CandTrackCamHandle.cxx.

References CandHandle::GetDaughterIterator(), Msg::kError, PlaneView::kU, PlaneView::kV, MSG, and LinearFit::Weighted().

Referenced by GetDirCosU(), GetDirCosV(), and GetDirCosZ().

00059 {
00060 
00061   if (iuvz<0 || iuvz>=3) {
00062     MSG("TrackCam",Msg::kError) << "iuvz out of range\n";
00063     return 0.;
00064   }
00065 
00066   TIter stripItr(GetDaughterIterator());
00067   double uzpos[1000],upos[1000],uph[1000];
00068   int uplane[1000];
00069   double vzpos[1000],vpos[1000],vph[1000];
00070   int vplane[1000];
00071   for (int i=0; i<1000; i++) {
00072     uzpos[i] = 0.;
00073     upos[i] = 0.;
00074     uph[i] = 0.;
00075     uplane[i] = 0;
00076     vzpos[i] = 0.;
00077     vpos[i] = 0.;
00078     vph[i] = 0.;
00079     vplane[i] = 0;
00080   }
00081   while (CandStripHandle *strip = dynamic_cast<CandStripHandle*>(stripItr())) {
00082     int iplane = strip->GetPlane();
00083     if (iplane<0 || iplane>=1000) {
00084       MSG("TrackCam",Msg::kError) << "plane out of range\n";
00085     }
00086     else {
00087       switch (strip->GetPlaneView()) {
00088       case PlaneView::kU:
00089         uph[iplane] += strip->GetCharge();
00090         upos[iplane] += strip->GetCharge()*strip->GetTPos();
00091         uzpos[iplane] = strip->GetZPos();
00092         uplane[iplane] = iplane;
00093         break;
00094       case PlaneView::kV:
00095         vph[iplane] += strip->GetCharge();
00096         vpos[iplane] += strip->GetCharge()*strip->GetTPos();
00097         vzpos[iplane] = strip->GetZPos();
00098         vplane[iplane] = iplane;
00099         break;
00100       default:
00101         break;
00102       }
00103     }
00104   }
00105   for (int i=0; i<1000; i++) {
00106     if (uph[i]>0) upos[i] /= uph[i];
00107     if (vph[i]>0) vpos[i] /= vph[i];
00108   }
00109   double uzfit[5],ufit[5];
00110   double uwfit[5] = {0.,0.,0.,0.,0.};
00111   double vzfit[5],vfit[5];
00112   double vwfit[5] = {0.,0.,0.,0.,0.};
00113   for (int i=0; i<5; i++) {
00114     uzfit[i] = ufit[i] = vzfit[i] = vfit[i] = 0.0;
00115     int dplane[2]={-1,-1};
00116     int jbest[2]={-1,-1};
00117     for (int j=0; j<1000; j++) {
00118       if (uph[j]>0. && (dplane[0]<0 || TMath::Abs(uplane[j]-plane)<dplane[0])) {
00119         dplane[0] = TMath::Abs(uplane[j]-plane);
00120         uzfit[i] = uzpos[j];
00121         ufit[i] = upos[j];
00122         uwfit[i] = 1.;
00123         jbest[0] = j;
00124       }
00125       if (vph[j]>0. && (dplane[1]<0 || TMath::Abs(vplane[j]-plane)<dplane[1])) {
00126         dplane[1] = TMath::Abs(vplane[j]-plane);
00127         vzfit[i] = vzpos[j];
00128         vfit[i] = vpos[j];
00129         vwfit[i] = 1.;
00130         jbest[1] = j;
00131       }
00132     }
00133     if (jbest[0]>=0) uph[jbest[0]] = 0.;
00134     if (jbest[1]>=0) vph[jbest[1]] = 0.;
00135   }
00136   double uparm[2],ueparm[2];
00137   double vparm[2],veparm[2];
00138   LinearFit::Weighted(5,uzfit,ufit,uwfit,uparm,ueparm);
00139   LinearFit::Weighted(5,vzfit,vfit,vwfit,vparm,veparm);
00140   double dudz = uparm[1];
00141   double dvdz = vparm[1];
00142   double ddz[3] = {uparm[1],vparm[1],1.};
00143   
00144   return ddz[iuvz]/sqrt(1.+dudz*dudz+dvdz*dvdz);
00145 }

double CandTrackCamHandle::GetDirCosU ( int  plane  )  const

Definition at line 150 of file CandTrackCamHandle.cxx.

References GetDirCos().

00151 {
00152   return GetDirCos(plane,0);
00153 }

double CandTrackCamHandle::GetDirCosV ( int  plane  )  const

Definition at line 158 of file CandTrackCamHandle.cxx.

References GetDirCos().

00159 {
00160   return GetDirCos(plane,1);
00161 }

double CandTrackCamHandle::GetDirCosZ ( int  plane  )  const

Definition at line 166 of file CandTrackCamHandle.cxx.

References GetDirCos().

00167 {
00168   return GetDirCos(plane,2);
00169 }


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1