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.1 by bendavid, Fri Jul 25 11:32:45 2008 UTC vs.
Revision 1.2 by loizides, Fri Nov 21 20:15:02 2008 UTC

# Line 9 | Line 9 | using namespace mithep;
9   //--------------------------------------------------------------------------------------------------
10   Double_t MCParticle::Charge() const
11   {
12 <  // Get Charge from Pdg Lookup
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;
19    printf("Pdg Code %i not found in table, returning Charge=-99.0", fPdgId);
20    }
21   }
22  
23   //--------------------------------------------------------------------------------------------------
24 < void MCParticle::Print(Option_t */*opt*/) const
24 > void MCParticle::Print(Option_t *opt) const
25   {
26 <  printf("id=%5d st=%3d px=%.3f py=%.3f pz=%.3f e=%.3f\n",
27 <         PdgId(), Status(), Px(), Py(), Pz(), E());
26 >  // Print particle kinematics. In case option "l" is given then also print info about daughters.
27 >
28 >  printf("id=%5d st=%2d nd=%3d gen=%d px=%.3f py=%.3f pz=%.3f e=%.3f\n",
29 >         PdgId(), Status(), NDaughters(), IsGenerated(), Px(), Py(), Pz(), E());
30 >
31 >  if (opt && opt[0]=='l') {
32 >    for (UInt_t i=0; i<NDaughters(); ++i) {
33 >      printf("  %2d -> id=%5d st=%2d gen=%d px=%.3f py=%.3f pz=%.3f e=%.3f\n",
34 >             i, Daughter(i)->PdgId(), Daughter(i)->Status(), Daughter(i)->IsGenerated(),
35 >             Daughter(i)->Px(), Daughter(i)->Py(), Daughter(i)->Pz(), Daughter(i)->E());
36 >    }
37 >  }
38   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines