#ifndef HEP_HepTopDecay
#include <HepTopDecay.h>
#endif
#include <iostream>
using namespace std;
#ifndef __CINT__
ClassImp(HepTopDecay);
#endif
HepTopDecay::HepTopDecay() {
fWDecay = new TRef;
fBJetOrig = new TRef;
fTruthTop = new TRef;
}
HepTopDecay::HepTopDecay(Int_t Id, Float_t Px_T, Float_t Py_T, Float_t Pz_T,
Float_t E_T, HepWDecay *WDecay, HepJet *BJetOrig,
Float_t Px_j, Float_t Py_j, Float_t Pz_j,
Float_t E_j, ProductionMode mode) :
HepDecayParticle(Id, Px_T, Py_T, Pz_T, E_T,
(WDecay->IsPositive()) ? 6 : -6) {
fWDecay = new TRef;
fBJetOrig = new TRef;
fTruthTop = new TRef;
*fWDecay = (TObject*)WDecay;
*fBJetOrig = (TObject*)BJetOrig;
fP_BJet.SetPxPyPzE(Px_j, Py_j, Pz_j, E_j);
fMode = mode;
}
HepTopDecay::~HepTopDecay() {
delete fWDecay; fWDecay = 0;
delete fBJetOrig; fBJetOrig = 0;
delete fTruthTop; fTruthTop = 0;
}
void HepTopDecay::Clear(Option_t *option) {
HepDecayParticle::Clear(option);
delete fWDecay; fWDecay = 0;
delete fBJetOrig; fBJetOrig = 0;
delete fTruthTop; fTruthTop = 0;
fP_BJet.SetPxPyPzE(0, 0, 1, 0);
}
void HepTopDecay::Print(Option_t *option) {
cout << endl << endl
<< "Semi-leptonic t-quark decay #" << fId << endl
<< "============================" << endl
<< "Kinematic fit result: chi^2/NDoF = "
<< fChi2 << " / " << fNDoF << " Prob = " << fProb << endl << endl
<< "Reconstructed top-quark:" << endl;
HepParticle::Print();
cout << endl
<< "Outgoing B-jet:" << endl;
GetBJetOrig()->Print();
cout << "Improved B-jet 4-momentum: ";
HepParticle::PrintLorentzVector(GetP_BJet());
cout << "Reconstructed W-boson:" << endl;
GetWDecay()->Print();
cout << endl << endl;
}
Int_t HepTopDecay::Compare(const TObject *obj) const {
static const Double_t m_top = 172.5;
if ( TMath::Abs(M("rec") - m_top)
< TMath::Abs(((HepTopDecay*)obj)->M("rec") - m_top) ) return 1;
if ( TMath::Abs(M("rec") - m_top)
> TMath::Abs(((HepTopDecay*)obj)->M("rec") - m_top) ) return -1;
return 0;
}