#ifndef ATLAS_AtlTopPair
#include <AtlTopPair.h>
#endif
#include <iostream>
#include <TMath.h>
using namespace std;
#ifndef __CINT__
ClassImp(AtlTopPair);
#endif
AtlTopPair::AtlTopPair() {
fTop1 = new TRef;
fTop2 = new TRef;
fId = 0;
fChi2 = 0;
fNdof = 0;
fChi2Prob = 0;
fType = AtlTopPair::kInvalid;
InitPulls();
}
AtlTopPair::AtlTopPair(Int_t Id, HepTopDecay* top1, HepTopDecay* top2,
Double_t chi2, Int_t ndof, AtlTopPair::EType type){
fTop1 = new TRef;
fTop2 = new TRef;
*fTop1 = (TObject*)top1;
*fTop2 = (TObject*)top2;
fId = Id;
fChi2 = chi2;
fNdof = ndof;
fChi2Prob = TMath::Prob(chi2, ndof);
fType = type;
InitPulls();
}
void AtlTopPair::InitPulls(){
fChargedLeptonPull.ResizeTo(3,1);
fNeutrinoPull.ResizeTo(3,1);
fLepBJetPull.ResizeTo(3,1);
fHadJet1Pull.ResizeTo(3,1);
fHadJet2Pull.ResizeTo(3,1);
fHadBJetPull.ResizeTo(3,1);
fChargedLeptonPull.Zero();
fNeutrinoPull.Zero();
fLepBJetPull.Zero();
fHadJet1Pull.Zero();
fHadJet2Pull.Zero();
fHadBJetPull.Zero();
}
AtlTopPair::~AtlTopPair() {
delete fTop1; fTop1 = 0;
delete fTop2; fTop2 = 0;
}
void AtlTopPair::Clear(Option_t *option) {
delete fTop1; fTop1 = 0;
delete fTop2; fTop2 = 0;
fId = 0;
fChi2 = 0;
fNdof = 0;
fChi2Prob = 0;
fType = kInvalid;
}
HepTopDecay* AtlTopPair::GetLeptonicTop() const {
if (((HepTopDecay*)fTop1->GetObject())->IsSemiLeptonicDecay() == kTRUE) return (HepTopDecay*)fTop1->GetObject();
if (((HepTopDecay*)fTop2->GetObject())->IsSemiLeptonicDecay() == kTRUE) return (HepTopDecay*)fTop2->GetObject();
return 0;
}
HepTopDecay* AtlTopPair::GetHadronicTop() const {
if (((HepTopDecay*)fTop1->GetObject())->IsHadronicDecay() == kTRUE) return (HepTopDecay*)fTop1->GetObject();
if (((HepTopDecay*)fTop2->GetObject())->IsHadronicDecay() == kTRUE) return (HepTopDecay*)fTop2->GetObject();
return 0;
}
void AtlTopPair::SetPullMatrices(TMatrixD leptonpull, TMatrixD neutrinopull, TMatrixD lepbjetpull,
TMatrixD hadjet1pull, TMatrixD hadjet2pull, TMatrixD hadbjetpull){
fChargedLeptonPull = leptonpull;
fNeutrinoPull = neutrinopull;
fLepBJetPull = lepbjetpull;
fHadJet1Pull = hadjet1pull;
fHadJet2Pull = hadjet2pull;
fHadBJetPull = hadbjetpull;
}
void AtlTopPair::Print(Option_t *option) const {
((HepTopDecay*)fTop1->GetObject())->Print();
((HepTopDecay*)fTop2->GetObject())->Print();
}