00001 // @(#)root/table:$Id: TDsKey.h 27656 2009-02-28 02:49:41Z pcanal $ 00002 // Author: Victor Perevoztchikov (perev@bnl.gov) 01/03/2001 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2001, Rene Brun and Fons Rademakers. * 00006 * Copyright (C) 2001 [BNL] Brookhaven National Laboratory. * 00007 * All rights reserved. * 00008 * * 00009 * For the licensing terms see $ROOTSYS/LICENSE. * 00010 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00011 *************************************************************************/ 00012 00013 #ifndef ROOT_TDsKey 00014 #define ROOT_TDsKey 00015 00016 #include "TString.h" 00017 #include "TArrayI.h" 00018 00019 const UInt_t kUMAX = (UInt_t)(-1); 00020 00021 class TDsKey 00022 { 00023 private: 00024 TString fName; 00025 TArrayI fUrr; 00026 00027 public: 00028 TDsKey(const char *name=0,UInt_t *uk=0,int nk=1); 00029 TDsKey(const char *name,UInt_t uk); 00030 TDsKey(UInt_t uRun,UInt_t uEvent=0); 00031 virtual ~TDsKey(){} 00032 virtual TDsKey &operator=( const TDsKey &from); 00033 virtual TDsKey &operator=( UInt_t from); 00034 virtual TDsKey &operator=( Int_t from){ *this=(UInt_t)from; return *this;} 00035 virtual TDsKey &operator=( const char *from); 00036 virtual Bool_t operator==(const TDsKey &from) const; 00037 virtual UInt_t operator[](Int_t i) const { return fUrr[i]; } 00038 virtual void Update(const TDsKey &from,const char *name=0); 00039 virtual void SetName(const char *name){fName=name;} 00040 virtual const char *GetName() const {return fName;} 00041 virtual TString GetKey() const; 00042 virtual UInt_t EventNumber() const { return (*this)[1];} 00043 virtual UInt_t RunNumber() const { return (*this)[0];} 00044 virtual void SetKey(const char *key); 00045 virtual void SetUrr(const UInt_t *key,int nk); 00046 virtual UInt_t GetSum() const; 00047 virtual Int_t EOK() const { return (UInt_t)fUrr[0]==kUMAX;} 00048 virtual Int_t IsNull() const { return !fUrr[0];} 00049 00050 }; 00051 00052 00053 #endif