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

Comparing UserCode/MitAna/DataTree/src/CompositeParticle.cc (file contents):
Revision 1.6 by bendavid, Wed Feb 18 08:18:36 2009 UTC vs.
Revision 1.9 by loizides, Thu Jun 11 04:44:46 2009 UTC

# Line 7 | Line 7 | ClassImp(mithep::CompositeParticle)
7   using namespace mithep;
8  
9   //--------------------------------------------------------------------------------------------------
10 < Double_t CompositeParticle::Charge() const
11 < {
12 <  // Return sum of charge of daughter particles.
13 <
14 <  Double_t charge = 0;
15 <  for (UInt_t i=0; i<NDaughters(); ++i)
16 <    charge += Daughter(i)->Charge();
17 <  
18 <  return charge;
19 < }
20 <
21 < //--------------------------------------------------------------------------------------------------
22 < Bool_t CompositeParticle::HasDaughter(const Particle* p) const
10 > Bool_t CompositeParticle::HasDaughter(const Particle *p) const
11   {
12    // Return true if given particle is among daughters.
13  
14 <  if(!p) return kFALSE;
14 >  if(!p)
15 >    return kFALSE;
16  
17    return fDaughters.HasObject(p);
18   }
# Line 33 | Line 22 | Bool_t CompositeParticle::HasCommonDaugh
22   {
23    // Return true if a common daughter exists.
24  
25 <  if(!p) return kFALSE;
25 >  if(!p)
26 >    return kFALSE;
27  
28    for (UInt_t i=0; i<p->NDaughters(); ++i)
29      if (HasDaughter(p->Daughter(i)))
# Line 43 | Line 33 | Bool_t CompositeParticle::HasCommonDaugh
33   }
34  
35   //--------------------------------------------------------------------------------------------------
36 < Bool_t CompositeParticle::HasSameDaughters(const CompositeParticle* p) const
36 > Bool_t CompositeParticle::HasSameDaughters(const CompositeParticle *p) const
37   {
38    // Return true if daughters are the same.
39  
40 <  if(!p) return kFALSE;
40 >  if(!p)
41 >    return kFALSE;
42  
43    if (NDaughters()!= p->NDaughters())
44      return kFALSE;
# Line 58 | Line 49 | Bool_t CompositeParticle::HasSameDaughte
49          
50    return kTRUE;
51   }
61
62 //--------------------------------------------------------------------------------------------------
63 FourVector CompositeParticle::Mom() const
64 {
65  // Return the vector sum of the momenta of the daughters.
66
67  FourVector mom;
68  for (UInt_t i=0; i<NDaughters(); ++i)
69    mom += (Daughter(i))->Mom();
70  
71  return mom;
72 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines