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

BubUtil Namespace Reference


Functions

Float_t GetFitUFromV (const CandTrackHandle &cth, Float_t v)
Float_t GetFitUFromZ (const CandTrackHandle &cth, Float_t z)
Float_t GetFitVFromU (const CandTrackHandle &cth, Float_t u)
Float_t GetFitVFromZ (const CandTrackHandle &cth, Float_t z)
Float_t GetFitZFromU (const CandTrackHandle &cth, Float_t u)
Float_t GetFitZFromV (const CandTrackHandle &cth, Float_t v)
Float_t GetTrkLenInStrip (const CandTrackHandle &cth, PlexStripEndId seid, Float_t pt1[3]=0, Float_t pt2[3]=0)
Bool_t SaveIntxPt (Int_t npt, Float_t u, Float_t v, Float_t z, Float_t pts[2][3])


Function Documentation

Float_t BubUtil::GetFitUFromV const CandTrackHandle cth,
Float_t  v
 

Definition at line 19 of file BubUtil.cxx.

References CandRecoHandle::GetDirCosU(), CandRecoHandle::GetDirCosV(), CandRecoHandle::GetVtxU(), CandRecoHandle::GetVtxV(), and v.

Referenced by GetTrkLenInStrip().

00020 {
00021 //
00022 //  Purpose:  Return the corresponding u-position of a track fit.
00023 //
00024 //  Arguments:
00025 //    cth     in      handle to CandTrack that contains track fit
00026 //    v       in      v-coordinate of fit position
00027 //
00028 //  Return:   u-coordinate corresponding to v.
00029 //            -1e7 if there is no v-dependence
00030 //
00031 
00032    Float_t cosv = cth.GetDirCosV();
00033    return (cosv != 0
00034          ? cth.GetVtxU() + (v - cth.GetVtxV()) * cth.GetDirCosU() / cosv
00035          : -1e7);
00036 }

Float_t BubUtil::GetFitUFromZ const CandTrackHandle cth,
Float_t  z
 

Definition at line 40 of file BubUtil.cxx.

References CandRecoHandle::GetDirCosU(), CandRecoHandle::GetDirCosZ(), CandRecoHandle::GetVtxU(), and CandRecoHandle::GetVtxZ().

Referenced by GetTrkLenInStrip().

00041 {
00042 //
00043 //  Purpose:  Return the corresponding u-position of a track fit.
00044 //
00045 //  Arguments:
00046 //    cth     in      handle to CandTrack that contains track fit
00047 //    z       in      z-coordinate of fit position
00048 //
00049 //  Return:   u-coordinate corresponding to z.
00050 //            -1e7 if there is no z-dependence
00051 //
00052 
00053    Float_t cosz = cth.GetDirCosZ();
00054    return (cosz != 0
00055          ? cth.GetVtxU() + (z - cth.GetVtxZ()) * cth.GetDirCosU() / cosz
00056          : -1e7);
00057 }

Float_t BubUtil::GetFitVFromU const CandTrackHandle cth,
Float_t  u
 

Definition at line 61 of file BubUtil.cxx.

References CandRecoHandle::GetDirCosU(), CandRecoHandle::GetDirCosV(), CandRecoHandle::GetVtxU(), and CandRecoHandle::GetVtxV().

Referenced by GetTrkLenInStrip().

00062 {
00063 //
00064 //  Purpose:  Return the corresponding v-position of a track fit.
00065 //
00066 //  Arguments:
00067 //    cth     in      handle to CandTrack that contains track fit
00068 //    u       in      u-coordinate of fit position
00069 //
00070 //  Return:   v-coordinate corresponding to u.
00071 //            -1e7 if there is no u-dependence
00072 //
00073 
00074    Float_t cosu = cth.GetDirCosU();
00075    return (cosu != 0
00076          ? cth.GetVtxV() + (u - cth.GetVtxU()) * cth.GetDirCosV() / cosu
00077          : -1e7);
00078 }

Float_t BubUtil::GetFitVFromZ const CandTrackHandle cth,
Float_t  z
 

Definition at line 82 of file BubUtil.cxx.

References CandRecoHandle::GetDirCosV(), CandRecoHandle::GetDirCosZ(), CandRecoHandle::GetVtxV(), and CandRecoHandle::GetVtxZ().

Referenced by GetTrkLenInStrip().

00083 {
00084 //
00085 //  Purpose:  Return the corresponding v-position of a track fit.
00086 //
00087 //  Arguments:
00088 //    cth     in      handle to CandTrack that contains track fit
00089 //    z       in      z-coordinate of fit position
00090 //
00091 //  Return:   v-coordinate corresponding to z.
00092 //            -1e7 if there is no z-dependence
00093 //
00094 
00095    Float_t cosz = cth.GetDirCosZ();
00096    return (cosz != 0
00097          ? cth.GetVtxV() + (z - cth.GetVtxZ()) * cth.GetDirCosV() / cosz
00098          : -1e7);
00099 }

Float_t BubUtil::GetFitZFromU const CandTrackHandle cth,
Float_t  u
 

Definition at line 103 of file BubUtil.cxx.

References CandRecoHandle::GetDirCosU(), CandRecoHandle::GetDirCosZ(), CandRecoHandle::GetVtxU(), and CandRecoHandle::GetVtxZ().

Referenced by GetTrkLenInStrip().

00104 {
00105 //
00106 //  Purpose:  Return the corresponding z-position of a track fit.
00107 //
00108 //  Arguments:
00109 //    cth     in      handle to CandTrack that contains track fit
00110 //    u       in      u-coordinate of fit position
00111 //
00112 //  Return:   z-coordinate corresponding to u.
00113 //            -1e7 if there is no u-dependence
00114 //
00115 
00116    Float_t cosu = cth.GetDirCosU();
00117    return (cosu != 0
00118          ? cth.GetVtxZ() + (u - cth.GetVtxU()) * cth.GetDirCosZ() / cosu
00119          : -1e7);
00120 }

Float_t BubUtil::GetFitZFromV const CandTrackHandle cth,
Float_t  v
 

Definition at line 124 of file BubUtil.cxx.

References CandRecoHandle::GetDirCosV(), CandRecoHandle::GetDirCosZ(), CandRecoHandle::GetVtxV(), CandRecoHandle::GetVtxZ(), and v.

Referenced by GetTrkLenInStrip().

00125 {
00126 //
00127 //  Purpose:  Return the corresponding z-position of a track fit.
00128 //
00129 //  Arguments:
00130 //    cth     in      handle to CandTrack that contains track fit
00131 //    v       in      v-coordinate of fit position
00132 //
00133 //  Return:   z-coordinate corresponding to v.
00134 //            -1e7 if there is no v-dependence
00135 //
00136 
00137    Float_t cosv = cth.GetDirCosV();
00138    return (cosv != 0
00139          ? cth.GetVtxZ() + (v - cth.GetVtxV()) * cth.GetDirCosZ() / cosv
00140          : -1e7);
00141 }

Float_t BubUtil::GetTrkLenInStrip const CandTrackHandle cth,
PlexStripEndId  seid,
Float_t  pt1[3] = 0,
Float_t  pt2[3] = 0
 

Definition at line 145 of file BubUtil.cxx.

References GetFitUFromV(), GetFitUFromZ(), GetFitVFromU(), GetFitVFromZ(), GetFitZFromU(), GetFitZFromV(), UgliStripHandle::GetHalfLength(), UgliStripHandle::GetHalfThickness(), UgliStripHandle::GetHalfWidth(), PlexPlaneId::GetPlaneView(), UgliStripHandle::GetTPos(), CandHandle::GetVldContext(), UgliStripHandle::GlobalPos(), UgliStripHandle::IsValid(), and SaveIntxPt().

Referenced by SelectGoodMuon::IsGoodGeom(), and SelectGoodMuon::IsStraightMuon().

00147 {
00148 //
00149 //  Purpose:  Return pathlength of a track in a strip.
00150 //
00151 //  Arguments:
00152 //    cth     in     handle to CandTrack
00153 //    seid    in     PlexStripEndId of strip in question
00154 //    pt1     out    Intersection point between track and strip
00155 //    pt2     out    Intersection point between track and strip
00156 //
00157 //  Return:   Pathlength in std length units.
00158 //            Negative value if not a valid strip.
00159 //
00160 
00161 // Calculate strip endpoints.
00162    assert(cth.GetVldContext());
00163    UgliGeomHandle ugh(*cth.GetVldContext());
00164    UgliStripHandle ush = ugh.GetStripHandle(seid);
00165    if (!ush.IsValid()) return -1;
00166    Float_t ulo, uhi, vlo, vhi, zlo, zhi;
00167    Float_t tpos = ush.GetTPos();
00168    Float_t zpos = ush.GlobalPos(0).Z();
00169    Float_t halflen = ush.GetHalfLength();
00170    Float_t halfwid = ush.GetHalfWidth();
00171    Float_t halfthick = ush.GetHalfThickness();
00172 
00173    zlo = zpos - halfthick;
00174    zhi = zpos + halfthick;
00175    switch (seid.GetPlaneView()) {
00176    case PlaneView::kU:
00177       ulo = tpos - halfwid;
00178       uhi = tpos + halfwid;
00179       vlo = -halflen;
00180       vhi = halflen;
00181       break;
00182    case PlaneView::kV:
00183       ulo = -halflen;
00184       uhi = halflen;
00185       vlo = tpos - halfwid;
00186       vhi = tpos + halfwid;
00187       break;
00188    default:
00189       ulo = uhi = vlo = vhi = 0;
00190    }
00191 
00192 // Declare variables for fit checking.
00193    Float_t ufit, vfit, zfit;
00194    Int_t npt = 0;
00195    Float_t intpt[2][3];
00196 
00197 // Check z-faces.
00198    ufit = GetFitUFromZ(cth, zlo);
00199    vfit = GetFitVFromZ(cth, zlo);
00200    if ((ulo <= ufit) && (ufit <= uhi) && (vlo <= vfit) && (vfit <= vhi))
00201       if (BubUtil::SaveIntxPt(++npt, ufit, vfit, zlo, intpt)) return 0;
00202 
00203    ufit = GetFitUFromZ(cth, zhi);
00204    vfit = GetFitVFromZ(cth, zhi);
00205    if ((ulo <= ufit) && (ufit <= uhi) && (vlo <= vfit) && (vfit <= vhi))
00206       if (BubUtil::SaveIntxPt(++npt, ufit, vfit, zhi, intpt)) return 0;
00207 
00208 // Check u-faces.
00209    vfit = GetFitVFromU(cth, ulo);
00210    zfit = GetFitZFromU(cth, ulo);
00211    if ((vlo <= vfit) && (vfit <= vhi) && (zlo <= zfit) && (zfit <= zhi))
00212       if (BubUtil::SaveIntxPt(++npt, ulo, vfit, zfit, intpt)) return 0;
00213 
00214    vfit = GetFitVFromU(cth, uhi);
00215    zfit = GetFitZFromU(cth, uhi);
00216    if ((vlo <= vfit) && (vfit <= vhi) && (zlo <= zfit) && (zfit <= zhi))
00217       if (BubUtil::SaveIntxPt(++npt, uhi, vfit, zfit, intpt)) return 0;
00218 
00219 // Check v-faces.
00220    zfit = GetFitZFromV(cth, vlo);
00221    ufit = GetFitUFromV(cth, vlo);
00222    if ((zlo <= zfit) && (zfit <= zhi) && (ulo <= ufit) && (ufit <= uhi))
00223       if (BubUtil::SaveIntxPt(++npt, ufit, vlo, zfit, intpt)) return 0;
00224 
00225    zfit = GetFitZFromV(cth, vhi);
00226    ufit = GetFitUFromV(cth, vhi);
00227    if ((zlo <= zfit) && (zfit <= zhi) && (ulo <= ufit) && (ufit <= uhi))
00228       if (BubUtil::SaveIntxPt(++npt, ufit, vhi, zfit, intpt)) return 0;
00229 
00230 // Check how many intersections found.
00231    if (npt == 2) {
00232       if (pt1)
00233          for (int i=0; i<3; i++) pt1[i] = intpt[0][i];
00234       if (pt2)
00235          for (int i=0; i<3; i++) pt2[i] = intpt[1][i];
00236       Float_t udiff = intpt[0][0] - intpt[1][0];
00237       Float_t vdiff = intpt[0][1] - intpt[1][1];
00238       Float_t zdiff = intpt[0][2] - intpt[1][2];
00239       return TMath::Sqrt(udiff * udiff + vdiff * vdiff + zdiff * zdiff);
00240    }
00241    else return 0;
00242 }

Bool_t BubUtil::SaveIntxPt Int_t  npt,
Float_t  u,
Float_t  v,
Float_t  z,
Float_t  pts[2][3]
 

Definition at line 246 of file BubUtil.cxx.

Referenced by GetTrkLenInStrip().

00248 {
00249 //
00250 //  Purpose:  Store intersection points for BubUtil::GetTrkLenInStrip.
00251 //
00252 //  Arguments:
00253 //    npt     in      Number of intersection points found so far.
00254 //    u,v,z   in      Coordinates of intersection point.
00255 //    pts     out     Array of intersection points.
00256 //
00257 //  Return:   kTRUE if more than 2 points found, kFALSE otherwise.
00258 //
00259 
00260    npt--;    // For indexing convenience.
00261    if ((0 <= npt) && (npt < 2)) {
00262       pts[npt][0] = u;
00263       pts[npt][1] = v;
00264       pts[npt][2] = z;
00265       return kFALSE;
00266    }
00267    else return kTRUE;
00268 }


Generated on Thu Nov 1 15:58:50 2007 for loon by  doxygen 1.3.9.1