BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
TrkDetElemId.cxx
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: TrkDetElemId.cxx,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-Madison
16//
17//------------------------------------------------------------------------
18
19//----------------
20// BaBar header
21//----------------
22//#include "BaBar/BaBar.hh"
23
24//-----------------------
25// This Class's Header --
26//-----------------------
28using std::endl;
29using std::ostream;
30
31//-------------
32// C Headers --
33//-------------
34extern "C" {
35}
36
37//---------------
38// C++ Headers --
39//---------------
40
41//-------------------------------
42// Collaborating Class Headers --
43//-------------------------------
44
45//-----------------------------------------------------------------------
46// Local Macros, Typedefs, Structures, Unions and Forward Declarations --
47//-----------------------------------------------------------------------
48
49
50
51// -----------------------------------------------
52// -- Static Data & Function Member Definitions --
53// -----------------------------------------------
54
55const int TrkDetElemId::svtOffset(0);
56const int TrkDetElemId::mdcOffset(10000);
57const int TrkDetElemId::nullElemID(-1);
58
59int TrkDetElemId::calcValue( const int& id,
61 int retVal(id);
62 switch (sysInd) {
64 retVal += TrkDetElemId::svtOffset;
65 return retVal;
67 retVal += TrkDetElemId::mdcOffset;
68 return retVal;
69 default:
70 break;
71 }
72 return TrkDetElemId::nullElemID;
73}
74
75// ----------------------------------------
76// -- Public Function Member Definitions --
77// ----------------------------------------
78
79//----------------
80// Constructors --
81//----------------
82
84 :_id(id),_sysInd(sysInd){
85}
86
87
89 :_id(rhs.systemElemId()),_sysInd(rhs.sysInd()){
90}
91
92//--------------
93// Destructor --
94//--------------
95
97}
98
99//-------------
100// Operators --
101//-------------
102
105 _id = rhs.systemElemId();
106 _sysInd = rhs.sysInd();
107 return *this;
108}
109
110void
111TrkDetElemId::printAll( ostream& os ) const{
112 os << _id << ' ' << _sysInd << ' ' << elemId() << endl;
113}
114
115ostream& operator<<(ostream& os, const TrkDetElemId& id){
116 id.printAll(os);
117 return os;
118}
119
ostream & operator<<(ostream &os, const TrkDetElemId &id)
int elemId() const
Definition: TrkDetElemId.h:88
static int calcValue(const int &id, TrkDetElemId::systemIndex sysInd)
virtual ~TrkDetElemId()
TrkDetElemId & operator=(const TrkDetElemId &)
TrkDetElemId(const int &id, TrkDetElemId::systemIndex sysInd)
const TrkDetElemId::systemIndex & sysInd() const
Definition: TrkDetElemId.h:96
const int & systemElemId() const
Definition: TrkDetElemId.h:92
void printAll(std::ostream &os=std::cout) const