00001 #ifndef CLEODCHAIN_CDFOOTPRINT_H 00002 #define CLEODCHAIN_CDFOOTPRINT_H 00003 // -*- C++ -*- 00004 // 00005 // Package: DChain 00006 // Module: CDFootPrint 00007 // 00008 // Description: keep record of which building-block a CDCandidate uses. 00009 // 00010 // Usage: 00011 // <usage> 00012 // 00013 // Author: Simon Patton 00014 // Created: Wed Oct 30 13:29:19 EST 1996 00015 // $Id: CDFootPrint.h,v 1.3 2009/10/14 07:18:50 hujf Exp $ 00016 // 00017 // Revision history 00018 // Modified by Sang-Joon Lee 06/26/96 00019 // 00020 // $Log: CDFootPrint.h,v $ 00021 // Revision 1.3 2009/10/14 07:18:50 hujf 00022 // see ChangeLog 00023 // 00024 // Revision 1.2 2009/09/22 08:24:41 hujf 00025 // see ChangeLog 00026 // 00027 // Revision 1.1.1.1 2009/03/03 06:05:56 maqm 00028 // first import of BesDChain 00029 // 00030 // Revision 1.1 2001/04/11 13:19:17 urner 00031 // transition to files with CD prefix. Addition of new files 00032 // 00033 // Revision 1.2 2001/03/30 20:13:09 cdj 00034 // CDFootPrint now resets its m_numberIssued when the last CDFootPrint is deleted 00035 // 00036 // Revision 1.1.1.1 2000/12/18 22:17:26 cdj 00037 // imported CleoDChain 00038 // 00039 // Revision 1.12 1998/04/17 18:54:22 sjp 00040 // Modified to use latest CLEO types 00041 // 00042 // Revision 1.11 1997/08/19 23:01:42 sjp 00043 // Restructured package to be independent of CleoDChain 00044 // 00045 // Revision 1.10 1997/08/19 20:42:02 sjp 00046 // Updated to use <package>/<file>.h include structure. 00047 // (Note: This version of the code has not been compiled) 00048 // 00049 // Revision 1.9 1997/01/21 20:36:06 sjp 00050 // Changed CPP flags and include because of library reorganization 00051 // 00052 // Revision 1.8 1996/12/20 21:26:59 sjp 00053 // major overhaul, and fixed memoery bug 00054 // 00055 // Revision 1.7 1996/11/04 16:48:31 sjp 00056 // Variable length storage is implemented 00057 // 00058 // Revision 1.4 1996/04/06 02:49:24 sjp 00059 // Added equality check and `contains' function 00060 // 00061 // Revision 1.3 1996/02/27 15:03:57 sjp 00062 // Extended Array size to 6 to handle MCParticles 00063 // 00064 // Revision 1.2 1996/02/20 00:36:15 sjp 00065 // Changed 'fresh' to return CDFootPrint, made other return values 'const' 00066 // 00067 // Revision 1.1 1995/11/09 20:02:10 sjp 00068 // New class to keep track of object that have already been `used'. 00069 // 00070 00071 // system include files 00072 #include <stdint.h> 00073 #include <iostream> 00074 00075 // user include files 00076 00077 // forward declarations 00078 class FingerPrint; 00079 00080 class CDFootPrint 00081 { 00082 // friend classses and functions 00083 friend std::ostream& operator << ( std::ostream& os, const CDFootPrint& obj ); 00084 friend class FingerPrint; 00085 00086 public: 00087 // Constructors and destructor 00088 CDFootPrint() ; 00089 CDFootPrint( const CDFootPrint& ) ; 00090 virtual ~CDFootPrint() ; 00091 00092 // assignment operator(s) 00093 const CDFootPrint& operator=( const CDFootPrint& ); 00094 const CDFootPrint& operator+=( const CDFootPrint& aOtherPrint ) ; 00095 00096 // member functions 00097 CDFootPrint& fresh() ; 00098 00099 // const member functions 00100 bool operator==( const CDFootPrint& aOtherPrint ) const ; 00101 bool operator!=( const CDFootPrint& aOtherPrint ) const ; 00102 CDFootPrint operator+( const CDFootPrint& aOtherPrint ) const ; 00103 bool overlap( const CDFootPrint& aOtherPrint) const ; 00104 bool contains( const CDFootPrint& aOtherPrint) const ; 00105 00106 // static member functions 00107 static void reset() ; 00108 00109 uint32_t ToUInt32() const { return m_array[0]; } 00110 // protected const member functions 00111 00112 private: 00113 // Constructors and destructor 00114 00115 // private member functions 00116 void resize( const uint32_t aNewSize ) ; 00117 00118 // private const member functions 00119 00120 // data members 00121 uint32_t m_size ; 00122 uint32_t* m_array ; 00123 00124 // static data members 00125 static uint32_t m_numberIssued ; 00126 //when number of footprints reaches 0, reset m_numberIssued 00127 static uint32_t m_numberFootprints; 00128 00129 } ; 00130 00131 // inline function definitions 00132 00133 #endif /* CLEODCHAIN_CDFOOTPRINT_H */