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

Comparing UserCode/MitAna/DataTree/interface/DaughterData.h (file contents):
Revision 1.5 by loizides, Tue Dec 9 17:46:59 2008 UTC vs.
Revision 1.9 by paus, Wed Mar 28 12:15:34 2012 UTC

# Line 12 | Line 12
12   #define MITANA_DATATREE_DAUGHTERDATA_H
13  
14   #include "MitAna/DataTree/interface/Particle.h"
15 < #include "MitAna/DataTree/interface/Types.h"
15 > #include "MitAna/DataCont/interface/Ref.h"
16  
17   namespace mithep
18   {
# Line 20 | Line 20 | namespace mithep
20    {
21      public:
22        DaughterData() {}
23 <      DaughterData(const Particle *orig) : fOriginal(const_cast<Particle*>(orig)) {}
24 <      ~DaughterData() {}
23 >      DaughterData(const Particle *orig) : fOriginal(orig) {}
24  
25 <      Double_t             Charge()    const { return Original()->Charge(); }
26 <      EObjType             ObjType()   const { return kDaughterData;        }
27 <      const Particle      *Original()  const;
25 >      Double_t             Charge()                       const { return Original()->Charge();    }
26 >      Bool_t               HasOriginal()                  const { return fOriginal.IsValid();     }
27 >      Bool_t               HasOriginal(const Particle *p) const { return fOriginal.RefsObject(p); }
28 >      EObjType             ObjType()                      const { return kDaughterData;           }
29 >      const Particle      *Original()                     const { return fOriginal.Obj();         }
30 >
31 >      // Some structural tools
32 >      void                 Mark()                         const;
33  
34      protected:
35 <      TRef                 fOriginal; //reference to original particle
35 >      Ref<Particle>        fOriginal; //reference to original particle
36  
37      ClassDef(DaughterData, 1) // Daughter data class
38    };
39   }
40  
41   //--------------------------------------------------------------------------------------------------
42 < inline const mithep::Particle *mithep::DaughterData::Original() const
42 > inline void mithep::DaughterData::Mark() const
43   {
44 <  // Return original particle.
45 <
46 <  return static_cast<const Particle*>(fOriginal.GetObject());
44 >  // mark myself
45 >  mithep::DataObject::Mark();
46 >  // mark my dependencies if they are there
47 >  Original()->Mark();
48   }
49   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines