Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

TrkFitTypeKey Class Reference

#include <TrkFitTypeKey.h>

List of all members.

Public Member Functions

const IfdKeyifdKey () const
const IfdKeyifdKey () const
bool operator< (const TrkFitTypeKey &rhs) const
bool operator< (const TrkFitTypeKey &rhs) const
TrkFitTypeKeyoperator= (const TrkFitTypeKey &rhs)
TrkFitTypeKeyoperator= (const TrkFitTypeKey &rhs)
bool operator== (const TrkFitTypeKey &rhs) const
bool operator== (const TrkFitTypeKey &rhs) const
PdtPid::PidType pidType () const
PdtPid::PidType pidType () const
void printAll (std::ostream &os=std::cout) const
void printAll (std::ostream &os=std::cout) const
 TrkFitTypeKey (const int &)
 TrkFitTypeKey (const TrkFitTypeKey &)
 TrkFitTypeKey (const char *name=0, const PdtPid::PidType pid=PdtPid::null)
 TrkFitTypeKey (const int &)
 TrkFitTypeKey (const TrkFitTypeKey &)
 TrkFitTypeKey (const char *name=0, const PdtPid::PidType pid=PdtPid::null)
const int & value () const
const int & value () const
virtual ~TrkFitTypeKey ()
virtual ~TrkFitTypeKey ()

Static Public Member Functions

int currentKey ()
int currentKey ()
void killFitType (const TrkFitTypeKey key)
void killFitType (const TrkFitTypeKey key)

Static Protected Member Functions

int newFitType (const char *name=0)
int newFitType (const char *name=0)

Private Attributes

int _value

Static Private Attributes

const int _defaultValue
std::vector< IfdKey * > _keys
std::vector< IfdKey * > _keys
std::vector< PdtPid::PidType_pidTypes
std::vector< PdtPid::PidType_pidTypes


Constructor & Destructor Documentation

TrkFitTypeKey::TrkFitTypeKey const char *  name = 0,
const PdtPid::PidType  pid = PdtPid::null
 

00088   :_value(newFitType(name))
00089 {
00090     if ( _value >= 0 ) _pidTypes.push_back(pid);
00091 }

TrkFitTypeKey::TrkFitTypeKey const TrkFitTypeKey  ) 
 

00094   :_value(rhs.value())
00095 {
00096 }

TrkFitTypeKey::TrkFitTypeKey const int &   ) 
 

00099   :_value(val)
00100 {
00101 }

TrkFitTypeKey::~TrkFitTypeKey  )  [virtual]
 

00108 {
00109 }

TrkFitTypeKey::TrkFitTypeKey const char *  name = 0,
const PdtPid::PidType  pid = PdtPid::null
 

TrkFitTypeKey::TrkFitTypeKey const TrkFitTypeKey  ) 
 

TrkFitTypeKey::TrkFitTypeKey const int &   ) 
 

virtual TrkFitTypeKey::~TrkFitTypeKey  )  [virtual]
 


Member Function Documentation

int TrkFitTypeKey::currentKey  )  [inline, static]
 

00039 { return _keys.size(); }

int TrkFitTypeKey::currentKey  )  [inline, static]
 

00039 { return _keys.size(); }

const IfdKey* TrkFitTypeKey::ifdKey  )  const [inline]
 

00085                                {
00086     if ( _value < 0 || _value >= currentKey() ) return 0;
00087     return _keys[_value];
00088   }

const IfdKey* TrkFitTypeKey::ifdKey  )  const [inline]
 

00085                                {
00086     if ( _value < 0 || _value >= currentKey() ) return 0;
00087     return _keys[_value];
00088   }

void TrkFitTypeKey::killFitType const TrkFitTypeKey  key  )  [static]
 

void TrkFitTypeKey::killFitType const TrkFitTypeKey  key  )  [static]
 

00073 {
00074   const int i = key.value();
00075   if ( i < 0 || i >= currentKey() ) return;
00076   IfdKey* theKey = _keys[i];
00077   assert(theKey != 0 );
00078   delete theKey;
00079   theKey = 0;
00080 }

int TrkFitTypeKey::newFitType const char *  name = 0  )  [static, protected]
 

int TrkFitTypeKey::newFitType const char *  name = 0  )  [static, protected]
 

00065 {
00066   if ( name == 0 ) return _defaultValue;
00067   _keys.push_back( new IfdStrKey(name) );
00068   return (currentKey()-1);
00069 }

bool TrkFitTypeKey::operator< const TrkFitTypeKey rhs  )  const [inline]
 

00074                                                    {
00075     return _value < rhs.value();
00076   }

bool TrkFitTypeKey::operator< const TrkFitTypeKey rhs  )  const [inline]
 

00074                                                    {
00075     return _value < rhs.value();
00076   }

TrkFitTypeKey& TrkFitTypeKey::operator= const TrkFitTypeKey rhs  )  [inline]
 

00077                                                         {
00078     _value = rhs.value();
00079     return *this;
00080   }

TrkFitTypeKey& TrkFitTypeKey::operator= const TrkFitTypeKey rhs  )  [inline]
 

00077                                                         {
00078     _value = rhs.value();
00079     return *this;
00080   }

bool TrkFitTypeKey::operator== const TrkFitTypeKey rhs  )  const [inline]
 

00071                                                    {
00072     return _value == rhs.value();
00073   }

bool TrkFitTypeKey::operator== const TrkFitTypeKey rhs  )  const [inline]
 

00071                                                    {
00072     return _value == rhs.value();
00073   }

PdtPid::PidType TrkFitTypeKey::pidType  )  const [inline]
 

00090                                 {
00091     if ( _value < 0 || _value >= currentKey() ) return PdtPid::null;
00092     return _pidTypes[_value];
00093   }

PdtPid::PidType TrkFitTypeKey::pidType  )  const [inline]
 

00090                                 {
00091     if ( _value < 0 || _value >= currentKey() ) return PdtPid::null;
00092     return _pidTypes[_value];
00093   }

void TrkFitTypeKey::printAll std::ostream os = std::cout  )  const
 

void TrkFitTypeKey::printAll std::ostream os = std::cout  )  const
 

00114 {
00115   char* pidName(0);
00116   switch ( pidType() ) {
00117   case PdtPid::electron:
00118     pidName = "Electron";
00119     break;
00120   case PdtPid::muon:
00121     pidName = "Muon";
00122     break;
00123   case PdtPid::pion:
00124     pidName = "Pion";
00125     break;
00126   case PdtPid::kaon:
00127     pidName = "Kaon";
00128     break;
00129   case PdtPid::proton:
00130     pidName = "Proton";
00131     break;
00132   case PdtPid::null:
00133   default:
00134     pidName = "Unknown";
00135     break;
00136   }
00137   os << ifdKey() << ' ' << pidName << " key: " << _value << endl;
00138 }

const int& TrkFitTypeKey::value  )  const [inline]
 

00083 { return _value; }

const int& TrkFitTypeKey::value  )  const [inline]
 

00083 { return _value; }


Member Data Documentation

const int TrkFitTypeKey::_defaultValue [static, private]
 

std::vector<IfdKey*> TrkFitTypeKey::_keys [static, private]
 

std::vector< IfdKey * > TrkFitTypeKey::_keys [static, private]
 

std::vector<PdtPid::PidType> TrkFitTypeKey::_pidTypes [static, private]
 

std::vector< PdtPid::PidType > TrkFitTypeKey::_pidTypes [static, private]
 

int TrkFitTypeKey::_value [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 19:07:18 2011 for BOSS6.5.5 by  doxygen 1.3.9.1