//
// Author: Felix Thomas <mailto: Felix.Thomas@mailbox.tu-dresden.de>
// Update: $Id: AtlTopPair.h,v 1.3 2011/12/16 10:38:30 fthomas Exp $
// Copyright: 2011 (C) Felix Thomas
//
#ifndef ATLAS_AtlTopPair
#define ATLAS_AtlTopPair
#ifndef HEP_HepTopDecay
#include <HepTopDecay.h>
#endif
#ifndef ROOT_TObject
#include <TObject.h>
#endif
#ifndef ATLAS_AtlWDecayLNu
#include <AtlWDecayLNu.h>
#endif
#ifndef ATLAS_AtlWDecayJJ
#include <AtlWDecayJJ.h>
#endif


#include <TMath.h>
#include <TMatrixD.h>

class AtlTopPair : public TObject {

  public:
      
  enum EType { kInvalid = 0, kDiLeptonic, kSemiLeptonic, kFullHadronic};

  private:
    TRef          *fTop1;                               // Top quark 1
    TRef          *fTop2;                               // Top quark 2
    Double_t       fChi2;                               // Chi2 of the candidate as computed by the KinFitter 
    Int_t          fNdof;                               // number of degrees of freedom
    Double_t       fChi2Prob;                           // Chi2-Probability of the candidate as computed by the KinFitter
    Int_t          fId;                                 // Id of the reconstructed top pair
    EType          fType;                               // Type of the top pair (see EType enumeration)
    
    TMatrixD fChargedLeptonPull;
    TMatrixD fNeutrinoPull;
    TMatrixD fLepBJetPull;
    TMatrixD fHadJet1Pull;
    TMatrixD fHadJet2Pull;
    TMatrixD fHadBJetPull;
    
  public:
    AtlTopPair();
    AtlTopPair(Int_t Id, HepTopDecay* top1, HepTopDecay* top2, 
        Double_t chi2, Int_t ndof, AtlTopPair::EType type);
    virtual ~AtlTopPair();
    virtual void Clear(Option_t *option = "");
    virtual void Print(Option_t *option = "") const;
    void InitPulls();
    inline HepTopDecay*       GetTop1() const { return (HepTopDecay*)fTop1->GetObject(); }
    inline HepTopDecay*       GetTop2() const { return (HepTopDecay*)fTop2->GetObject(); }
    HepTopDecay*       GetLeptonicTop() const;
    HepTopDecay*       GetHadronicTop() const;

    inline Double_t           GetChi2() const { return fChi2; }
    inline Double_t           GetChi2Prob() const { return fChi2Prob; }
    inline Int_t              GetId() const { return fId; }
    inline AtlTopPair::EType  GetType() const { return fType; }
    inline TMatrixD GetLeptonPull()   { return fChargedLeptonPull; }
    inline TMatrixD GetNeutrinoPull() { return fNeutrinoPull; }
    inline TMatrixD GetLepBJetPull()  { return fLepBJetPull; }
    inline TMatrixD GetHadJet1Pull()  { return fHadJet1Pull; }
    inline TMatrixD GetHadJet2Pull()  { return fHadJet2Pull; }
    inline TMatrixD GetHadBJetPull()  { return fHadBJetPull; }
    void SetPullMatrices(TMatrixD leptonpull, TMatrixD neutrinopull, TMatrixD lepbjetpull,
                         TMatrixD hadjet1pull, TMatrixD hadjet2pull, TMatrixD hadbjetpull);    
    ClassDef(AtlTopPair,3)  // ATLAS Top Pair
};

#endif
 AtlTopPair.h:1
 AtlTopPair.h:2
 AtlTopPair.h:3
 AtlTopPair.h:4
 AtlTopPair.h:5
 AtlTopPair.h:6
 AtlTopPair.h:7
 AtlTopPair.h:8
 AtlTopPair.h:9
 AtlTopPair.h:10
 AtlTopPair.h:11
 AtlTopPair.h:12
 AtlTopPair.h:13
 AtlTopPair.h:14
 AtlTopPair.h:15
 AtlTopPair.h:16
 AtlTopPair.h:17
 AtlTopPair.h:18
 AtlTopPair.h:19
 AtlTopPair.h:20
 AtlTopPair.h:21
 AtlTopPair.h:22
 AtlTopPair.h:23
 AtlTopPair.h:24
 AtlTopPair.h:25
 AtlTopPair.h:26
 AtlTopPair.h:27
 AtlTopPair.h:28
 AtlTopPair.h:29
 AtlTopPair.h:30
 AtlTopPair.h:31
 AtlTopPair.h:32
 AtlTopPair.h:33
 AtlTopPair.h:34
 AtlTopPair.h:35
 AtlTopPair.h:36
 AtlTopPair.h:37
 AtlTopPair.h:38
 AtlTopPair.h:39
 AtlTopPair.h:40
 AtlTopPair.h:41
 AtlTopPair.h:42
 AtlTopPair.h:43
 AtlTopPair.h:44
 AtlTopPair.h:45
 AtlTopPair.h:46
 AtlTopPair.h:47
 AtlTopPair.h:48
 AtlTopPair.h:49
 AtlTopPair.h:50
 AtlTopPair.h:51
 AtlTopPair.h:52
 AtlTopPair.h:53
 AtlTopPair.h:54
 AtlTopPair.h:55
 AtlTopPair.h:56
 AtlTopPair.h:57
 AtlTopPair.h:58
 AtlTopPair.h:59
 AtlTopPair.h:60
 AtlTopPair.h:61
 AtlTopPair.h:62
 AtlTopPair.h:63
 AtlTopPair.h:64
 AtlTopPair.h:65
 AtlTopPair.h:66
 AtlTopPair.h:67
 AtlTopPair.h:68
 AtlTopPair.h:69
 AtlTopPair.h:70
 AtlTopPair.h:71
 AtlTopPair.h:72
 AtlTopPair.h:73
 AtlTopPair.h:74
 AtlTopPair.h:75