BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
TrkView.cxx
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: TrkView.cxx,v 1.1.1.1 2005/04/21 06:01:42 zhangy Exp $
4//
5// Description:
6// Class TrkView.
7//
8// Environment:
9// Software developed for the BaBar Detector at the SLAC B-Factory.
10//
11// Copyright Infomation;
12// Copyright (C) 2002 Lawrence Berkeley Laboratory
13//
14// Author(s): Dave Brown 10/25/02
15//
16//------------------------------------------------------------------------
17
18#include "TrkBase/TrkView.h"
19
20const unsigned short
22const unsigned short
24const unsigned short
26
28 _view(0)
29{
31}
32
33TrkView::TrkView(unsigned short& pat) :
34 _view( (pat & _bothview))
35{
36}
37
38TrkView::TrkView(const TrkView& other) : _view(other._view)
39{}
40
41TrkView&
43 if(this != &other){
44 _view = other._view;
45 }
46 return *this;
47}
48
50{}
51
52void
54 switch (view) {
55 case TrkEnums::noView: default:
56 break;
58 _view |= _xyview;
59 break;
60 case TrkEnums::zView:
61 _view |= _zview;
62 break;
64 _view |= _bothview;
65 break;
66 }
67}
68
71 switch (_view) {
72 case 0: default:
73 return TrkEnums::noView;
74 case _xyview:
75 return TrkEnums::xyView;
76 case _zview:
77 return TrkEnums::zView;
78 case _bothview:
79 return TrkEnums::bothView;
80 }
81}
82
83bool
84TrkView::contains(const TrkView& other) const {
85 return (other.viewData() & _view) == other.viewData();
86}
87
88bool
89TrkView::operator ==(const TrkView& other) const {
90 return other.viewData() == _view;
91}
92
93bool
94TrkView::operator != (const TrkView& other) const {
95 return other.viewData() != _view;
96}
97
98bool
100 TrkView other(view);
101 return contains(other);
102}
103
virtual ~TrkView()
Definition: TrkView.cxx:49
static const unsigned short _bothview
Definition: TrkView.h:51
void addView(TrkEnums::TrkViewInfo view)
Definition: TrkView.cxx:53
TrkView & operator=(const TrkView &)
Definition: TrkView.cxx:42
static const unsigned short _xyview
Definition: TrkView.h:49
bool operator==(const TrkView &other) const
Definition: TrkView.cxx:89
static const unsigned short _zview
Definition: TrkView.h:50
TrkView(TrkEnums::TrkViewInfo view=TrkEnums::noView)
Definition: TrkView.cxx:27
TrkEnums::TrkViewInfo view() const
Definition: TrkView.cxx:70
bool contains(const TrkView &other) const
Definition: TrkView.cxx:84
bool operator!=(const TrkView &other) const
Definition: TrkView.cxx:94
TrkViewInfo
Definition: TrkEnums.h:22
@ xyView
Definition: TrkEnums.h:22
@ zView
Definition: TrkEnums.h:22
@ noView
Definition: TrkEnums.h:22
@ bothView
Definition: TrkEnums.h:22