BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
InstallArea/include/TrkBase/TrkBase/TrkDetElemId.h
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: TrkDetElemId.h,v 1.1.1.1 2005/04/21 06:01:42 zhangy Exp $
4//
5// Description:
6// Class TrkDetElemId
7//
8// Environment:
9// Software developed for BaBar expirment @ SLAC B-Factory
10//
11// Author List:
12// Eric A Charles
13//
14// Copyright Information:
15// Copyright (C) 1998 Univ. Wisconsin-Madsion
16//
17//------------------------------------------------------------------------
18
19#ifndef TRKDETELEMID_HH
20#define TRKDETELEMID_HH
21
22//-------------
23// C Headers --
24//-------------
25extern "C" {
26}
27
28//---------------
29// C++ Headers --
30//---------------
31
32#include <iostream>
33
34// ---------------------
35// -- Class Interface --
36// ---------------------
37
39
40//------------------
41// Static Members --
42//------------------
43
44public:
45
46 // Typedefs, consts, and enums
47 enum systemIndex { null=0,
48 svt=1,
49 mdc=2 };
50
51 // functions
52 static int calcValue( const int& id,
54
55private:
56
57 static const int svtOffset;
58 static const int mdcOffset;
59 static const int nullElemID;
60
61//--------------------
62// Instance Members --
63//--------------------
64
65public:
66
67 // Constructors
69
70 // Copy Constructor
71 TrkDetElemId( const TrkDetElemId& );
72
73 // Destructor
74 virtual ~TrkDetElemId( );
75
76 // Operators
77
79
80 bool operator==( const TrkDetElemId& rhs ) const{
81 return elemId() == rhs.elemId();
82 }
83 bool operator<( const TrkDetElemId& rhs) const {
84 return elemId() < rhs.elemId();
85 }
86
87 // Selectors (const)
88 int elemId() const{
89 return calcValue(_id,_sysInd);
90 };
91
92 const int& systemElemId() const{
93 return _id;
94 }
95
97 return _sysInd;
98 }
99
100 void printAll( std::ostream& os=std::cout ) const;
101
102private:
103
104 // Data members
105 int _id;
107
108};
109
110std::ostream& operator<<(std::ostream& os, const TrkDetElemId& id);
111
112// Inline implementations
113//#include "TrkDetElemId.icc"
114
115#endif
std::ostream & operator<<(std::ostream &os, const TrkDetElemId &id)
static int calcValue(const int &id, TrkDetElemId::systemIndex sysInd)
virtual ~TrkDetElemId()
bool operator<(const TrkDetElemId &rhs) const
TrkDetElemId & operator=(const TrkDetElemId &)
bool operator==(const TrkDetElemId &rhs) const
const TrkDetElemId::systemIndex & sysInd() const
void printAll(std::ostream &os=std::cout) const