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

Comparing UserCode/MitAna/DataTree/src/MCParticle.cc (file contents):
Revision 1.3 by loizides, Mon Nov 24 11:51:21 2008 UTC vs.
Revision 1.5 by loizides, Wed Feb 18 15:38:55 2009 UTC

# Line 7 | Line 7 | ClassImp(mithep::MCParticle)
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   {
# Line 58 | Line 44 | const MCParticle *MCParticle::FindMother
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;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines