BOSS 8.0.0
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//-----------------------
27#include "TrkBase/TrkDetElemId.h"
28using std::endl;
29using std::ostream;
30
31//-------------
32// C Headers --
33//-------------
34extern "C" {}
35
36//---------------
37// C++ Headers --
38//---------------
39
40//-------------------------------
41// Collaborating Class Headers --
42//-------------------------------
43
44//-----------------------------------------------------------------------
45// Local Macros, Typedefs, Structures, Unions and Forward Declarations --
46//-----------------------------------------------------------------------
47
48// -----------------------------------------------
49// -- Static Data & Function Member Definitions --
50// -----------------------------------------------
51
52const int TrkDetElemId::svtOffset( 0 );
53const int TrkDetElemId::mdcOffset( 10000 );
54const int TrkDetElemId::nullElemID( -1 );
55
57 int retVal( id );
58 switch ( sysInd )
59 {
60 case TrkDetElemId::svt: retVal += TrkDetElemId::svtOffset; return retVal;
61 case TrkDetElemId::mdc: retVal += TrkDetElemId::mdcOffset; return retVal;
62 default: break;
63 }
64 return TrkDetElemId::nullElemID;
65}
66
67// ----------------------------------------
68// -- Public Function Member Definitions --
69// ----------------------------------------
70
71//----------------
72// Constructors --
73//----------------
74
76 : _id( id ), _sysInd( sysInd ) {}
77
79 : _id( rhs.systemElemId() ), _sysInd( rhs.sysInd() ) {}
80
81//--------------
82// Destructor --
83//--------------
84
86
87//-------------
88// Operators --
89//-------------
90
92 _id = rhs.systemElemId();
93 _sysInd = rhs.sysInd();
94 return *this;
95}
96
97void TrkDetElemId::printAll( ostream& os ) const {
98 os << _id << ' ' << _sysInd << ' ' << elemId() << endl;
99}
100
101ostream& operator<<( ostream& os, const TrkDetElemId& id ) {
102 id.printAll( os );
103 return os;
104}
ostream & operator<<(ostream &os, const TrkDetElemId &id)
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
void printAll(std::ostream &os=std::cout) const