BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TrkFitTypeKey.cxx
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: TrkFitTypeKey.cxx,v 1.1.1.1 2005/04/21 06:01:42 zhangy Exp $
4//
5// Description:
6// Class TrkFitTypeKey
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/TrkFitTypeKey.h"
28
29//-------------
30// C Headers --
31//-------------
32extern "C" {}
33
34//---------------
35// C++ Headers --
36//---------------
37
38//-------------------------------
39// Collaborating Class Headers --
40//-------------------------------
41
42#include "ProxyDict/IfdStrKey.h"
43using std::endl;
44using std::ostream;
45
46//-----------------------------------------------------------------------
47// Local Macros, Typedefs, Structures, Unions and Forward Declarations --
48//-----------------------------------------------------------------------
49
50// -----------------------------------------------
51// -- Static Data & Function Member Definitions --
52// -----------------------------------------------
53
54const int TrkFitTypeKey::_defaultValue( -1 );
55std::vector<IfdKey*> TrkFitTypeKey::_keys;
56std::vector<PdtPid::PidType> TrkFitTypeKey::_pidTypes;
57
58int TrkFitTypeKey::newFitType( const char* name ) {
59 if ( name == 0 ) return _defaultValue;
60 _keys.push_back( new IfdStrKey( name ) );
61 return ( currentKey() - 1 );
62}
63
65 const int i = key.value();
66 if ( i < 0 || i >= currentKey() ) return;
67 IfdKey* theKey = _keys[i];
68 assert( theKey != 0 );
69 delete theKey;
70 theKey = 0;
71}
72
73//----------------
74// Constructors --
75//----------------
76
77TrkFitTypeKey::TrkFitTypeKey( const char* name, const PdtPid::PidType pid )
78 : _value( newFitType( name ) ) {
79 if ( _value >= 0 ) _pidTypes.push_back( pid );
80}
81
82TrkFitTypeKey::TrkFitTypeKey( const TrkFitTypeKey& rhs ) : _value( rhs.value() ) {}
83
84TrkFitTypeKey::TrkFitTypeKey( const int& val ) : _value( val ) {}
85
86//--------------
87// Destructor --
88//--------------
89
91
92void TrkFitTypeKey::printAll( ostream& os ) const {
93 char* pidName( 0 );
94 switch ( pidType() )
95 {
96 case PdtPid::electron: pidName = "Electron"; break;
97 case PdtPid::muon: pidName = "Muon"; break;
98 case PdtPid::pion: pidName = "Pion"; break;
99 case PdtPid::kaon: pidName = "Kaon"; break;
100 case PdtPid::proton: pidName = "Proton"; break;
101 case PdtPid::null:
102 default: pidName = "Unknown"; break;
103 }
104 os << ifdKey() << ' ' << pidName << " key: " << _value << endl;
105}
106
107ostream& operator<<( ostream& os, const TrkFitTypeKey& key ) {
108 key.printAll( os );
109 return os;
110}
*************DOUBLE PRECISION m_pi *DOUBLE PRECISION m_HvecTau2 DOUBLE PRECISION m_HvClone2 DOUBLE PRECISION m_gamma1 DOUBLE PRECISION m_gamma2 DOUBLE PRECISION m_thet1 DOUBLE PRECISION m_thet2 INTEGER m_IFPHOT *COMMON c_Taupair $ !Spin Polarimeter vector first Tau $ !Spin Polarimeter vector second Tau $ !Clone Spin Polarimeter vector first Tau $ !Clone Spin Polarimeter vector second Tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !phi of HvecTau1 $ !theta of HvecTau1 $ !phi of HvecTau2 $ !theta of HvecTau2 $ !super key
Definition Taupair.h:42
ostream & operator<<(ostream &os, const TrkFitTypeKey &key)
virtual ~TrkFitTypeKey()
TrkFitTypeKey(const char *name=0, const PdtPid::PidType pid=PdtPid::null)
void printAll(std::ostream &os=std::cout) const
static int newFitType(const char *name=0)
static void killFitType(const TrkFitTypeKey key)