ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataCont/interface/Array.h
(Generate patch)

Comparing UserCode/MitAna/DataCont/interface/Array.h (file contents):
Revision 1.7 by loizides, Tue Dec 9 17:42:32 2008 UTC vs.
Revision 1.8 by loizides, Wed Dec 10 11:26:52 2008 UTC

# Line 39 | Line 39 | namespace mithep
39        TIterator           *Iterator(Bool_t dir = kIterForward)  const;
40        Bool_t               MustClear()                          const { return this->TestBit(14); }
41        Bool_t               MustDelete()                         const { return this->TestBit(15); }
42 +      TObject             *ObjAt(UInt_t idx);
43 +      const TObject       *ObjAt(UInt_t idx)                    const;
44        void                 Print(Option_t *opt="")              const;
45        void                 Reset();
46        void                 SetMustClearBit()                          { this->SetBit(14); }
# Line 58 | Line 60 | namespace mithep
60      private:
61        Array(const Array &a);
62  
63 <    ClassDefT(Array,1) // Wrapper around TClonesArray class
63 >    ClassDefT(Array, 1) // Wrapper around TClonesArray class
64    };
65   }
66  
# Line 109 | Line 111 | inline ArrayElement *mithep::Array<Array
111    if (idx<fNumEntries)
112      return static_cast<ArrayElement*>(fArray.UncheckedAt(idx));
113  
112  ArrayElement tmp;
114    TObject::Fatal("At","Index too large: (%ud < %ud violated) for %s containing %s",
115 <                 idx, fNumEntries, GetName(), tmp.GetName());
115 >                 idx, fNumEntries, GetName(), ArrayElement::Class_Name());
116    return 0;
117   }
118  
# Line 124 | Line 125 | inline const ArrayElement *mithep::Array
125    if (idx<fNumEntries)
126      return static_cast<const ArrayElement*>(fArray.UncheckedAt(idx));
127  
127  ArrayElement tmp;
128    TObject::Fatal("At","Index too large: (%ud < %ud violated) for %s containing %s",
129 <                 idx, fNumEntries, GetName(), tmp.GetName());
129 >                 idx, fNumEntries, GetName(), ArrayElement::Class_Name());
130    return 0;
131   }
132  
# Line 167 | Line 167 | void mithep::Array<ArrayElement>::Print(
167   }
168  
169   //--------------------------------------------------------------------------------------------------
170 + template<class ArrayElement>
171 + inline TObject *mithep::Array<ArrayElement>::ObjAt(UInt_t idx)
172 + {
173 +  // Return object at given index.
174 +
175 +  if (idx<fNumEntries)
176 +    return fArray.UncheckedAt(idx);
177 +
178 +  TObject::Fatal("At","Index too large: (%ud < %ud violated) for %s containing %s",
179 +                 idx, fNumEntries, GetName(), ArrayElement::Class_Name());
180 +  return 0;
181 + }
182 +
183 + //--------------------------------------------------------------------------------------------------
184 + template<class ArrayElement>
185 + const TObject *mithep::Array<ArrayElement>::ObjAt(UInt_t idx) const
186 + {
187 +  // Return object at given index.
188 +
189 +  if (idx<fNumEntries)
190 +    return static_cast<const TObject*>(fArray.UncheckedAt(idx));
191 +
192 +  TObject::Fatal("At","Index too large: (%ud < %ud violated) for %s containing %s",
193 +                 idx, fNumEntries, GetName(), ArrayElement::Class_Name());
194 +  return 0;
195 + }
196 +
197 + //--------------------------------------------------------------------------------------------------
198   template<class ArrayElement>
199   inline void mithep::Array<ArrayElement>::Reset()
200   {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines