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 |
|
} |
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))) |
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; |
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 |
– |
} |