BOSS 7.0.3
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//---------------
36// C++ Headers --
37//---------------
38
39//-------------------------------
40// Collaborating Class Headers --
41//-------------------------------
42
43#include "ProxyDict/IfdStrKey.h"
44using std::endl;
45using std::ostream;
46
47//-----------------------------------------------------------------------
48// Local Macros, Typedefs, Structures, Unions and Forward Declarations --
49//-----------------------------------------------------------------------
50
51
52
53
54
55// -----------------------------------------------
56// -- Static Data & Function Member Definitions --
57// -----------------------------------------------
58
59const int TrkFitTypeKey::_defaultValue(-1);
60std::vector<IfdKey*> TrkFitTypeKey::_keys ;
61std::vector<PdtPid::PidType> TrkFitTypeKey::_pidTypes ;
62
63int
64TrkFitTypeKey::newFitType( const char* name )
65{
66 if ( name == 0 ) return _defaultValue;
67 _keys.push_back( new IfdStrKey(name) );
68 return (currentKey()-1);
69}
70
71void
73{
74 const int i = key.value();
75 if ( i < 0 || i >= currentKey() ) return;
76 IfdKey* theKey = _keys[i];
77 assert(theKey != 0 );
78 delete theKey;
79 theKey = 0;
80}
81
82//----------------
83// Constructors --
84//----------------
85
87 const PdtPid::PidType pid )
88 :_value(newFitType(name))
89{
90 if ( _value >= 0 ) _pidTypes.push_back(pid);
91}
92
94 :_value(rhs.value())
95{
96}
97
99 :_value(val)
100{
101}
102
103//--------------
104// Destructor --
105//--------------
106
108{
109}
110
111
112void
113TrkFitTypeKey::printAll( ostream& os ) const
114{
115 char* pidName(0);
116 switch ( pidType() ) {
117 case PdtPid::electron:
118 pidName = "Electron";
119 break;
120 case PdtPid::muon:
121 pidName = "Muon";
122 break;
123 case PdtPid::pion:
124 pidName = "Pion";
125 break;
126 case PdtPid::kaon:
127 pidName = "Kaon";
128 break;
129 case PdtPid::proton:
130 pidName = "Proton";
131 break;
132 case PdtPid::null:
133 default:
134 pidName = "Unknown";
135 break;
136 }
137 os << ifdKey() << ' ' << pidName << " key: " << _value << endl;
138}
139
140ostream&
141operator<<(ostream& os, const TrkFitTypeKey& key)
142{
143 key.printAll(os);
144 return os;
145}
*************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)