Changeset 654 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 03/01/01 15:56:58 (24 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MArray.h
r458 r654 21 21 { 22 22 protected: 23 Int_t fN; // Number of array elements23 UInt_t fN; // Number of array elements 24 24 25 25 public: 26 26 MArray() { fN = 0; } 27 MArray( Int_t n){ fN = n; }27 MArray(UInt_t n) { fN = n; } 28 28 MArray(const MArray &a) { fN = a.fN; } 29 29 virtual ~MArray() { fN = 0; } … … 31 31 MArray &operator=(const MArray &rhs) { fN = rhs.fN; return *this; } 32 32 33 Int_tGetSize() const { return fN; }34 virtual void Set( Int_t n) = 0;33 UInt_t GetSize() const { return fN; } 34 virtual void Set(UInt_t n) = 0; 35 35 36 36 ClassDef(MArray, 1) //Abstract array base class for TObject derived Arrays -
trunk/MagicSoft/Mars/mbase/MArrayB.h
r458 r654 26 26 MArrayB() 27 27 { 28 fN = 0;28 fN = 0; 29 29 fArray = NULL; 30 30 } 31 31 32 MArrayB( Int_t n)32 MArrayB(UInt_t n) 33 33 { 34 fN = 0;34 fN = 0; 35 35 fArray = NULL; 36 if (n > 0) 37 36 37 Set(n); 38 38 } 39 39 40 MArrayB( Int_t n, Byte_t *array)40 MArrayB(UInt_t n, Byte_t *array) 41 41 { 42 42 // Create TArrayC object and initialize it with values of array. 43 fN = 0;43 fN = 0; 44 44 fArray = NULL; 45 45 46 Set(n, array); 46 47 } … … 53 54 } 54 55 55 Int_t GetSize() const56 UInt_t GetSize() const 56 57 { 57 58 return fN; … … 73 74 } 74 75 75 void Adopt( Int_t n, Byte_t *array)76 void Adopt(UInt_t n, Byte_t *array) 76 77 { 77 78 // Adopt array arr into TArrayC, i.e. don't copy arr but use it directly … … 84 85 } 85 86 86 void AddAt(Byte_t c, Int_t i)87 void AddAt(Byte_t c, UInt_t i) 87 88 { 88 89 // Add char c at position i. Check for out of bounds. … … 90 91 } 91 92 92 void AddAt(Byte_t *array, Int_t i,Int_t n)93 void AddAt(Byte_t *array, UInt_t i, UInt_t n) 93 94 { 94 95 // Add char c at position i. Check for out of bounds. … … 96 97 } 97 98 98 Byte_t At( Int_t i)99 Byte_t At(UInt_t i) 99 100 { 100 101 return fArray[i]; … … 111 112 } 112 113 113 void Set( Int_t n)114 void Set(UInt_t n) 114 115 { 115 116 // Set size of this array to n chars. … … 117 118 // then the old array is deleted. 118 119 119 if (n < 0 || n==fN)120 if (n==fN) 120 121 return; 121 122 122 123 Byte_t *temp = fArray; 123 if (n != 0) 124 if (n == 0) 125 fArray = 0; 126 else 124 127 { 125 128 fArray = new Byte_t[n]; … … 132 135 } 133 136 } 134 else135 {136 fArray = 0;137 }138 137 139 138 if (fN) … … 143 142 } 144 143 145 void Set( Int_t n, Byte_t *array)144 void Set(UInt_t n, Byte_t *array) 146 145 { 147 146 // Set size of this array to n chars and set the contents. 148 if ( n < 0 || array == 0)147 if (!array) 149 148 return; 150 149 … … 154 153 fArray = 0; 155 154 } 155 156 156 fN = n; 157 157 … … 165 165 } 166 166 167 Byte_t &operator[]( Int_t i)167 Byte_t &operator[](UInt_t i) 168 168 { 169 169 return fArray[i]; -
trunk/MagicSoft/Mars/mbase/MArrayS.h
r458 r654 25 25 MArrayS() 26 26 { 27 fN = 0;27 fN = 0; 28 28 fArray = NULL; 29 29 } 30 30 31 MArrayS( Int_t n)31 MArrayS(UInt_t n) 32 32 { 33 fN = 0;33 fN = 0; 34 34 fArray = NULL; 35 if (n > 0) 36 Set(n); 35 Set(n); 37 36 } 38 37 39 MArrayS( Int_t n, UShort_t *array)38 MArrayS(UInt_t n, UShort_t *array) 40 39 { 41 40 // Create TArrayC object and initialize it with values of array. 42 fN = 0;41 fN = 0; 43 42 fArray = NULL; 44 43 Set(n, array); … … 52 51 } 53 52 54 Int_t GetSize() const53 UInt_t GetSize() const 55 54 { 56 55 return fN; … … 72 71 } 73 72 74 void Adopt( Int_t n, UShort_t *array)73 void Adopt(UInt_t n, UShort_t *array) 75 74 { 76 75 // Adopt array arr into TArrayC, i.e. don't copy arr but use it directly … … 83 82 } 84 83 85 void AddAt(UShort_t c, Int_t i)84 void AddAt(UShort_t c, UInt_t i) 86 85 { 87 86 // Add char c at position i. Check for out of bounds. … … 89 88 } 90 89 91 UShort_t At( Int_t i)90 UShort_t At(UInt_t i) 92 91 { 93 92 return fArray[i]; … … 104 103 } 105 104 106 void Set( Int_t n)105 void Set(UInt_t n) 107 106 { 108 107 // Set size of this array to n chars. … … 110 109 // then the old array is deleted. 111 110 112 if (n < 0 || n==fN)111 if (n==fN) 113 112 return; 114 113 115 114 UShort_t *temp = fArray; 116 if (n != 0) 115 if (n == 0) 116 fArray = NULL; 117 else 117 118 { 118 119 fArray = new UShort_t[n]; … … 125 126 } 126 127 } 127 else128 {129 fArray = NULL;130 }131 128 132 129 if (fN) … … 136 133 } 137 134 138 void Set( Int_t n, UShort_t *array)135 void Set(UInt_t n, UShort_t *array) 139 136 { 140 137 // Set size of this array to n chars and set the contents. 141 if ( n < 0 || array == 0)138 if (!array) 142 139 return; 143 140 … … 158 155 } 159 156 160 UShort_t &operator[]( Int_t i)157 UShort_t &operator[](UInt_t i) 161 158 { 162 159 return fArray[i]; -
trunk/MagicSoft/Mars/mbase/MLogManip.h
r604 r654 53 53 // 54 54 #ifndef __CINT__ 55 #define __DINF____FILE__ << " " << __LINE__ << ": "55 #define dbginf __FILE__ << " " << __LINE__ << ": " 56 56 #endif 57 57 // … … 63 63 // 64 64 #ifndef __CINT__ 65 #define DEBUG(lvl) flush << debug(lvl) << __DINF__65 #define DEBUG(lvl) flush << debug(lvl) << dbginf 66 66 #endif 67 67 -
trunk/MagicSoft/Mars/mbase/MReadTree.cc
r609 r654 43 43 { 44 44 // 45 // open file 45 // open file and check if file is really open 46 46 // 47 47 fFile = new TFile(fFileName, "READ"); … … 54 54 } 55 55 56 // 57 // try to get the tree and check if it was found 58 // 56 59 fTree = (TTree*)fFile->Get(fTreeName); 57 58 60 if (!fTree) 59 61 { … … 63 65 } 64 66 67 // 68 // get number of events in this tree 69 // 65 70 fNumEntries = (UInt_t)fTree->GetEntries(); 71 72 // 73 // set pointer to first event 74 // 66 75 fNumEntry = 0; 67 76 77 // 78 // output logging information 79 // 68 80 *fLog << "File: '" << fFileName << "' Tree: '" << fTreeName; 69 81 *fLog << "' with " << fNumEntries << " Entries opened." << endl;
Note:
See TracChangeset
for help on using the changeset viewer.