ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/src/DecayParticle.cc
(Generate patch)

Comparing UserCode/MitAna/DataTree/src/DecayParticle.cc (file contents):
Revision 1.4 by bendavid, Tue Sep 30 12:53:59 2008 UTC vs.
Revision 1.5 by bendavid, Wed Oct 29 17:02:55 2008 UTC

# Line 31 | Line 31 | Double_t DecayParticle::PdgMass() const
31      printf("Absolute Pdg Code %i not found in table, returning Mass=-99.0 GeV", fAbsPdgId);
32    }
33   }
34 +
35 + //--------------------------------------------------------------------------------------------------
36 + Bool_t DecayParticle::HasDaughter(const Particle* p) const
37 + {
38 +  // Return true if given particle is among daughters.
39 +
40 +  if(!p) return kFALSE;
41 +
42 +  if (!NDaughters())
43 +    return kFALSE;
44 +
45 +  for (UInt_t i=0; i<NDaughters(); ++i)
46 +    if (Daughter(i)==p)
47 +      return kTRUE;
48 +  
49 +  return kFALSE;
50 + }
51 +
52 + //--------------------------------------------------------------------------------------------------
53 + Bool_t DecayParticle::HasCommonDaughter(const DecayParticle *p) const
54 + {
55 +  // Return true if a common daughter exists.
56 +
57 +  if(!p) return kFALSE;
58 +
59 +  for (UInt_t i=0; i<p->NDaughters(); ++i)
60 +    if (HasDaughter(p->Daughter(i)))
61 +      return kTRUE;
62 +        
63 +  return kFALSE;
64 + }
65 +
66 + //--------------------------------------------------------------------------------------------------
67 + Bool_t DecayParticle::HasSameDaughters(const DecayParticle* p) const
68 + {
69 +  // Return true if daughters are the same.
70 +
71 +  if(!p) return kFALSE;
72 +
73 +  if (NDaughters()!= p->NDaughters())
74 +    return kFALSE;
75 +                
76 +  for (UInt_t i=0; i<p->NDaughters(); ++i)
77 +    if (!HasDaughter(p->Daughter(i)))
78 +        return kFALSE;
79 +        
80 +  return kTRUE;
81 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines