//
// Author: Michelangelo Giorgi <mailto: strider@physik.hu-berlin.de>
// Update: $Id: AtlWtChallenge.h,v 1.5 2017/03/30 16:27:30 mergelm Exp $
// Copyright: 2009 (C) Oliver Maria Kind
//
#ifndef ATLAS_AtlWtChallenge
#define ATLAS_AtlWtChallenge
#ifndef ATLAS_AtlSelector
#include <AtlSelector.h>
#endif
#include <fstream>


class TString;
class TH1F;
class TH2F;

class AtlWtChallenge : public AtlSelector {
    
  private:
    std::ofstream fOut;
    
    TH1F *fHistCutFlow_e;  // Cut-flow, electrons
    TH1F *fHistCutFlow_mu; // Cut-flow, muons

    // Lepton candidates
    HepParticle *fLepton; // Signal lepton for effiency scale factor determination used for evt re-weighting
    TList *fLeptons;      // Merged list of signal leptons (e, mu) from Top Common Objects selection
    TList *fElectrons;    // Signal electron list from  Top Common Objects selection
    TList *fMuons;        // Signal muon list from  Top Common Objects selection
    TList *fVetoLeptons;  // Merged list of veto leptons (e, mu) from Top Common Objects selection

    // Generic jet and b-jet candidates
    TList *fJets;  // List of all jets from Top Common Objects selection
    TList *fBJets; // List of B-jets from Top Common Objects selection

    // Transverse W mass
    Double_t fWmassT;
    
    // Veto decisions
    Bool_t fVertexTracksPresent; // Enough vertex tracks present?
    Bool_t fBadJetsPresent;      // Bad jets search in Top Common Objects tool successful?
    Bool_t fElMuTrackMatched;    // Electron-muon track-match in Top Common Objects tool successful?

    
 public:
    enum ELeptonMode {
	kElectronMode = BIT(0), // electron channel
	kMuonMode     = BIT(1), // muon channel
    };
    
    
    // Mode
    ELeptonMode fLeptonMode;  // Indicate the lepton channel mode (e/mu)
    
    TString fEleTriggerChoice;
    TString fMuTriggerChoice;

    // Etmiss
    TVector2 fMET;              // MissingEt of current event
    Float_t  fMET_Mag_min;      // MissingEt cut
    Float_t  fElPt_Min;         // ElectronPt cut
    Float_t  fMuPt_Min;         // ElectronPt cut
    Float_t  fJets_Pt_min;      // JetPt cut
    Float_t  fJets_Eta_min;     // JetEta min cut
    Float_t  fJets_Eta_max;     // JetEta max cut
    Float_t  fBJets_Pt_min;      // JetPt cut
    Float_t  fBJets_Eta_min;    // BJetEta min cut
    Float_t  fBJets_Eta_max;    // BJetEta max cut

    Float_t  fWmassT_min;
    
    HepParticle *fRecoW;        // reconstructed W-boson

    
    AtlWtChallenge(const char* OutputFilename);
    virtual ~AtlWtChallenge();
    
    virtual void SetBranchStatus();
    virtual void SetCutDefaults();
    virtual void BookHistograms();
    virtual void InitEvent();
    virtual void FillHistograms();
    virtual Bool_t ProcessCut();
    virtual void Terminate();
    virtual void Print() const;
    void ReconstructW();
    
    ClassDef(AtlWtChallenge,2) // Single-top analysis validation
};
#endif

 AtlWtChallenge.h:1
 AtlWtChallenge.h:2
 AtlWtChallenge.h:3
 AtlWtChallenge.h:4
 AtlWtChallenge.h:5
 AtlWtChallenge.h:6
 AtlWtChallenge.h:7
 AtlWtChallenge.h:8
 AtlWtChallenge.h:9
 AtlWtChallenge.h:10
 AtlWtChallenge.h:11
 AtlWtChallenge.h:12
 AtlWtChallenge.h:13
 AtlWtChallenge.h:14
 AtlWtChallenge.h:15
 AtlWtChallenge.h:16
 AtlWtChallenge.h:17
 AtlWtChallenge.h:18
 AtlWtChallenge.h:19
 AtlWtChallenge.h:20
 AtlWtChallenge.h:21
 AtlWtChallenge.h:22
 AtlWtChallenge.h:23
 AtlWtChallenge.h:24
 AtlWtChallenge.h:25
 AtlWtChallenge.h:26
 AtlWtChallenge.h:27
 AtlWtChallenge.h:28
 AtlWtChallenge.h:29
 AtlWtChallenge.h:30
 AtlWtChallenge.h:31
 AtlWtChallenge.h:32
 AtlWtChallenge.h:33
 AtlWtChallenge.h:34
 AtlWtChallenge.h:35
 AtlWtChallenge.h:36
 AtlWtChallenge.h:37
 AtlWtChallenge.h:38
 AtlWtChallenge.h:39
 AtlWtChallenge.h:40
 AtlWtChallenge.h:41
 AtlWtChallenge.h:42
 AtlWtChallenge.h:43
 AtlWtChallenge.h:44
 AtlWtChallenge.h:45
 AtlWtChallenge.h:46
 AtlWtChallenge.h:47
 AtlWtChallenge.h:48
 AtlWtChallenge.h:49
 AtlWtChallenge.h:50
 AtlWtChallenge.h:51
 AtlWtChallenge.h:52
 AtlWtChallenge.h:53
 AtlWtChallenge.h:54
 AtlWtChallenge.h:55
 AtlWtChallenge.h:56
 AtlWtChallenge.h:57
 AtlWtChallenge.h:58
 AtlWtChallenge.h:59
 AtlWtChallenge.h:60
 AtlWtChallenge.h:61
 AtlWtChallenge.h:62
 AtlWtChallenge.h:63
 AtlWtChallenge.h:64
 AtlWtChallenge.h:65
 AtlWtChallenge.h:66
 AtlWtChallenge.h:67
 AtlWtChallenge.h:68
 AtlWtChallenge.h:69
 AtlWtChallenge.h:70
 AtlWtChallenge.h:71
 AtlWtChallenge.h:72
 AtlWtChallenge.h:73
 AtlWtChallenge.h:74
 AtlWtChallenge.h:75
 AtlWtChallenge.h:76
 AtlWtChallenge.h:77
 AtlWtChallenge.h:78
 AtlWtChallenge.h:79
 AtlWtChallenge.h:80
 AtlWtChallenge.h:81
 AtlWtChallenge.h:82
 AtlWtChallenge.h:83
 AtlWtChallenge.h:84
 AtlWtChallenge.h:85
 AtlWtChallenge.h:86
 AtlWtChallenge.h:87
 AtlWtChallenge.h:88
 AtlWtChallenge.h:89
 AtlWtChallenge.h:90
 AtlWtChallenge.h:91
 AtlWtChallenge.h:92