1 |
bendavid |
1.1 |
// $Id: MCParticle.cc,v 1.3 2008/07/16 09:32:05 bendavid Exp $
|
2 |
|
|
|
3 |
|
|
#include "MitAna/DataTree/interface/MCParticle.h"
|
4 |
|
|
|
5 |
|
|
ClassImp(mithep::MCParticle)
|
6 |
|
|
|
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 |
|
|
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
|
25 |
|
|
{
|
26 |
|
|
printf("id=%5d st=%3d px=%.3f py=%.3f pz=%.3f e=%.3f\n",
|
27 |
|
|
PdgId(), Status(), Px(), Py(), Pz(), E());
|
28 |
|
|
}
|