7 |
|
using namespace mithep; |
8 |
|
|
9 |
|
//-------------------------------------------------------------------------------------------------- |
10 |
– |
Double_t MCParticle::Charge() const |
11 |
– |
{ |
12 |
– |
// Get charge from pdg lookup. |
13 |
– |
|
14 |
– |
TParticlePDG* pdgEntry = PdgEntry(); |
15 |
– |
if (pdgEntry) |
16 |
– |
return pdgEntry->Charge()/3.0; |
17 |
– |
else { |
18 |
– |
Error("Charge", "Pdg code %i not found in table, returning charge=-99.0", fPdgId); |
19 |
– |
return -99.0; |
20 |
– |
} |
21 |
– |
} |
22 |
– |
|
23 |
– |
//-------------------------------------------------------------------------------------------------- |
10 |
|
const MCParticle *MCParticle::FindDaughter(Int_t pid, |
11 |
|
Bool_t checkCharge, const MCParticle *start) const |
12 |
|
{ |
44 |
|
return 0; |
45 |
|
|
46 |
|
if (checkCharge) { |
47 |
< |
while (mother->PdgId()==fPdgId) |
47 |
> |
while (mother && mother->PdgId()!=pid) |
48 |
|
mother = mother->Mother(); |
49 |
|
return mother; |
50 |
|
} |
51 |
|
|
52 |
|
Int_t apid = pid>0?pid:-pid; |
53 |
< |
while (mother->AbsPdgId()==apid) |
53 |
> |
while (mother && mother->AbsPdgId()!=apid) |
54 |
|
mother = mother->Mother(); |
55 |
|
|
56 |
|
return mother; |