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.4 by loizides, Wed Dec 3 17:37:46 2008 UTC vs.
Revision 1.9 by paus, Wed Mar 28 12:15:34 2012 UTC

# Line 3 | Line 3
3   //
4   // DaughterData
5   //
6 < // Additional information on a daughter which is specific to a particular decay
6 > // Daughter decay information: Keep reference to original particle.
7   //
8 //
8   // Authors: J.Bendavid
9   //--------------------------------------------------------------------------------------------------
10  
# Line 13 | 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 21 | 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 >      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 <      Double_t             Charge()    const { return Original()->Charge(); }
32 <      const Particle      *Original()  const;
31 >      // Some structural tools
32 >      void                 Mark()                         const;
33  
34      protected:
35 <      TRef                 fOriginal; //TRef to original particle
35 >      Ref<Particle>        fOriginal; //reference to original particle
36  
37 <    ClassDef(DaughterData, 1) // Stable daughter class
37 >    ClassDef(DaughterData, 1) // Daughter data class
38    };
39   }
40  
41 < inline const mithep::Particle *mithep::DaughterData::Original() const
41 > //--------------------------------------------------------------------------------------------------
42 > inline void mithep::DaughterData::Mark() const
43   {
44 <  // Return global combined track.
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