//____________________________________________________________________
//
// Single-top t-Channel Mem Discriminant Analysis
// 
//  
// Author: Soeren Stamm <mailto: stamm@physik.hu-berlin.de>
// Update: $Id: AtlSgTop_tChannelMemDiscr.cxx,v 1.6 2016/04/19 08:35:21 stamm Exp $
// Copyright: 2013 (C) Soeren Stamm
// 
#ifndef SINGLETOP_AtlSgTop_tChannelMemDiscr
#include <AtlSgTop_tChannelMemDiscr.h>
#endif
#include <iostream>

using namespace std;

#ifndef __CINT__
ClassImp(AtlSgTop_tChannelMemDiscr);
#endif

const Double_t AtlSgTop_tChannelMemDiscr::fgBinEdges_tChannel4FSRatio[fgNBins_tChannel4FSRatio+1] = {
    0.00000000, 0.05720000, 0.10245000, 0.14880000, 0.19485000,
    0.24065000, 0.28830000, 0.33725000, 0.38955000, 0.44280000,
    0.49965000, 0.55915000, 0.62080000, 0.68120000, 0.74070000,
    0.79490000, 0.84405000, 0.88805000, 0.92735000, 0.96095000,
    1.00000000};

const Double_t AtlSgTop_tChannelMemDiscr::fgBinEdges_tChannel5FSRatio[fgNBins_tChannel5FSRatio+1] = {
    0.00000000, 0.00240000, 0.02945000, 0.08520000, 0.15505000,
    0.23185000, 0.31030000, 0.39220000, 0.47825000, 0.56455000,
    0.65025000, 0.72795000, 0.79470000, 0.84965000, 0.89300000,
    0.92580000, 0.95045000, 0.96965000, 0.98450000, 0.99385000,
    1.00000000};
    
//____________________________________________________________________

AtlSgTop_tChannelMemDiscr::AtlSgTop_tChannelMemDiscr(const char* OutputFile) :
    AtlSelector(OutputFile) {
    //
    // Default constructor
    //
    
    // Init
    fLeptons   = 0;
    fLooseLeptons = 0;
    fElectrons = 0;
    fMuons     = 0;
    fJets      = 0;
    fBJets     = 0;
    fObjTool   = 0;
    fSFTool    = 0;
    fPdfTool   = 0;

    SetCutDefaults();
	
}

//____________________________________________________________________

AtlSgTop_tChannelMemDiscr::~AtlSgTop_tChannelMemDiscr() {
    //
    // Default destructor
    //
}

//____________________________________________________________________

void AtlSgTop_tChannelMemDiscr::Clear(Option_t *option) {
    //
    //  Clears the dynamically allocated objects
    //
}

//____________________________________________________________________

void AtlSgTop_tChannelMemDiscr::Begin(TTree *tree) {
    //
    // Begin analysis job
    //

    // Create event writer
    fEvtWriter = 0;

    AtlSelector::Begin(tree);
}

//____________________________________________________________________

void AtlSgTop_tChannelMemDiscr::SetBranchStatus() {
    //
    // Switch on/off branches in order to gain speed
    //

    // Switch off all branches by default
    fTree->SetBranchStatus("*", kFALSE);
}

//____________________________________________________________________

void AtlSgTop_tChannelMemDiscr::SetCutDefaults() {
    //
    // Selection cut defaults
    //
    fPrintEvent = kFALSE;
    // this _is_ used to determine the bookkeeping histogram names
    fInputMode  = kD3PDSgTop_v2;
    // fInputMode  = kD3PDSgTop;

    fSchannelVeto = kTRUE;

    
    fEvtReader  = new AtlEvtReaderMem(this);
    Info("SetCutDefaults", "Using AtlEvtReaderMem");
}

//____________________________________________________________________

void AtlSgTop_tChannelMemDiscr::BookHistograms() {
    //
    // Book histograms
    //    
	
    // Get ObjectSelection Tool + pointers to analysis objects
    fObjTool = 
	(AtlObjectsToolD3PDSgTop*)GetTool("AtlObjectsToolD3PDSgTop"
					  ,"",kTRUE);
    fElectrons = fObjTool->GetElectrons();
    fMuons     = fObjTool->GetMuons();
    fLeptons   = fObjTool->GetLeptons();
    fLooseLeptons = fObjTool->GetLooseLeptons();
    fJets      = fObjTool->GetJets();
    fBJets     = fObjTool->GetBJets();

    // Provide tools with pointers to analysis objects
    fSFTool = 
	(AtlObjRecoScaleFactorTool*)GetTool("AtlObjRecoScaleFactorTool"
					    ,"",kTRUE);
    fSFTool->SetLeptons(fLeptons);
    fSFTool->SetJets(fJets);

    // Provide tools with histogram names
    fPdfTool = 
    	(AtlPdfReweightingTool*)GetTool("AtlPdfReweightingTool"
    					,"",kTRUE);
    
    fPdfTool->AddObservable("MemDiscriminant/tChannelProb4FS");
    fPdfTool->AddObservable("MemDiscriminant/tChannelProb4FS_odd");
    fPdfTool->AddObservable("MemDiscriminant/tChannelProb4FS_even");

    // a-priori probabilities

    // probabilities after di-lepton veto
    fP_sChannel2j_ePlus   = 0.00467074;
    fP_sChannel2j_muPlus  = 0.0062965;
    fP_sChannel2j_eMinus  = 0.00266235;
    fP_sChannel2j_muMinus = 0.00353846;
    
    fP_tChannel4FS_ePlus   = 0.0963275;
    fP_tChannel4FS_muPlus  = 0.123222;	
    fP_tChannel4FS_eMinus  = 0.0531231;
    fP_tChannel4FS_muMinus = 0.0652147;
    
    fP_Wjj_ePlus   = 0.0045943;
    fP_Wjj_muPlus  = 0.0093268;
    fP_Wjj_eMinus  = 0.00327138;
    fP_Wjj_muMinus = 0.00414807;
    
    Double_t wbbVSwcjFrac = 0.5; // guestimated!
    // redo plotting with other plotting scheme to get a more precise number!
    
    Double_t wHF_ePlus   = 0.0753649;
    Double_t wHF_muPlus  = 0.103652;
    Double_t wHF_eMinus  = 0.0606024;
    Double_t wHF_muMinus = 0.0781944;
    
    fP_Wbb_ePlus   = wbbVSwcjFrac * wHF_ePlus;
    fP_Wbb_muPlus  = wbbVSwcjFrac * wHF_muPlus;
    fP_Wbb_eMinus  = wbbVSwcjFrac * wHF_eMinus;
    fP_Wbb_muMinus = wbbVSwcjFrac * wHF_muMinus;
    
    fP_Wcj_ePlus   = (1.0 - wbbVSwcjFrac) * wHF_ePlus;
    fP_Wcj_muPlus  = (1.0 - wbbVSwcjFrac) * wHF_muPlus;
    fP_Wcj_eMinus  = (1.0 - wbbVSwcjFrac) * wHF_eMinus;
    fP_Wcj_muMinus = (1.0 - wbbVSwcjFrac) * wHF_muMinus;
    
    Double_t ttbarSL_vs_ttbarDL_frac_el = 1. - 0.435;
    Double_t ttbarSL_vs_ttbarDL_frac_mu = 1. - 0.435;
    
    Double_t ttbar_ePlus   = 0.0680078;
    Double_t ttbar_muPlus  = 0.0844124;
    Double_t ttbar_eMinus  = 0.0684759;
    Double_t ttbar_muMinus = 0.0848944;
    
    fP_ttbarSL_ePlus   = ttbarSL_vs_ttbarDL_frac_el * ttbar_ePlus;
    fP_ttbarSL_muPlus  = ttbarSL_vs_ttbarDL_frac_mu * ttbar_muPlus;
    fP_ttbarSL_eMinus  = ttbarSL_vs_ttbarDL_frac_el * ttbar_eMinus;
    fP_ttbarSL_muMinus = ttbarSL_vs_ttbarDL_frac_mu * ttbar_muMinus;
    
    fP_ttbarDL_ePlus   = (1.0 - ttbarSL_vs_ttbarDL_frac_el) * ttbar_ePlus;
    fP_ttbarDL_muPlus  = (1.0 - ttbarSL_vs_ttbarDL_frac_mu) * ttbar_muPlus;
    fP_ttbarDL_eMinus  = (1.0 - ttbarSL_vs_ttbarDL_frac_el) * ttbar_eMinus;
    fP_ttbarDL_muMinus = (1.0 - ttbarSL_vs_ttbarDL_frac_mu) * ttbar_muMinus;
    

    gDirectory->mkdir("MemDiscriminant");
    gDirectory->cd("MemDiscriminant");
	
    // Discriminant Plots (four flavour scheme)
    fHist_llh_tChannel_ratio_4FS = new TH1F("tChannelProb4FS", "t-channel likelihood ratio 4FS",
					    fgNBins_tChannel4FSRatio, 0.0, 1.0);
    fHist_llh_tChannel_ratio_4FS->SetXTitle("P(S|X)");
    fHist_llh_tChannel_ratio_4FS->SetYTitle("Number of Entries");
    
    fHist_llh_tChannel_ratio_4FS_even = new TH1F("tChannelProb4FS_even", "t-channel likelihood ratio 4FS, even evt numbers",
						 fgNBins_tChannel4FSRatio, 0.0, 1.0);
    fHist_llh_tChannel_ratio_4FS_even->SetXTitle("P(S|X)");
    fHist_llh_tChannel_ratio_4FS_even->SetYTitle("Number of Entries");
    
    fHist_llh_tChannel_ratio_4FS_odd = new TH1F("tChannelProb4FS_odd", "t-channel likelihood ratio 4FS, odd evt numbers",
						fgNBins_tChannel4FSRatio, 0.0, 1.0);
    fHist_llh_tChannel_ratio_4FS_odd->SetXTitle("P(S|X)");
    fHist_llh_tChannel_ratio_4FS_odd->SetYTitle("Number of Entries");

    fHist_llh_tChannel_ratio2_4FS = new TH1F("tChannelProb4FS_c", "t-channel likelihood ratio 4FS",
					     25, 0.0, 1.0);
    fHist_llh_tChannel_ratio2_4FS->SetXTitle("P(S|X)");
    fHist_llh_tChannel_ratio2_4FS->SetYTitle("Number of Entries");

    fHist_llh_Wjets_ratio_4FS = new TH1F("WjetsProb4FS", "Wjets likelihood ratio 4FS",
					 25, 0.0, 1.0);
    fHist_llh_Wjets_ratio_4FS->SetXTitle("P(S|X)");
    fHist_llh_Wjets_ratio_4FS->SetYTitle("Number of Entries");

    fHist_llh_Wbb_ratio_4FS = new TH1F("WbbProb4FS", "Wbb likelihood ratio 4FS",
					 25, 0.0, 1.0);
    fHist_llh_Wbb_ratio_4FS->SetXTitle("P(S|X)");
    fHist_llh_Wbb_ratio_4FS->SetYTitle("Number of Entries");

    fHist_llh_Wcj_ratio_4FS = new TH1F("WcjProb4FS", "Wcj likelihood ratio 4FS",
					 25, 0.0, 1.0);
    fHist_llh_Wcj_ratio_4FS->SetXTitle("P(S|X)");
    fHist_llh_Wcj_ratio_4FS->SetYTitle("Number of Entries");

    fHist_llh_Wjj_ratio_4FS = new TH1F("WjjProb4FS", "Wjj likelihood ratio 4FS",
					 25, 0.0, 1.0);
    fHist_llh_Wjj_ratio_4FS->SetXTitle("P(S|X)");
    fHist_llh_Wjj_ratio_4FS->SetYTitle("Number of Entries");

    fHist_llh_ttbar_ratio_4FS = new TH1F("ttbarProb4FS", "ttbar likelihood ratio 4FS",
					 25, 0.0, 1.0);
    fHist_llh_ttbar_ratio_4FS->SetXTitle("P(S|X)");
    fHist_llh_ttbar_ratio_4FS->SetYTitle("Number of Entries");

    
    // Discriminant Plots (five flavour scheme)
    fHist_llh_tChannel_ratio_5FS = new TH1F("tChannelProb5FS", "t-channel likelihood ratio 5FS",
					    fgNBins_tChannel5FSRatio, 0.0, 1.0);
    fHist_llh_tChannel_ratio_5FS->SetXTitle("P(S|X)");
    fHist_llh_tChannel_ratio_5FS->SetYTitle("Number of Entries");
    
    fHist_llh_tChannel_ratio_5FS_even = new TH1F("tChannelProb5FS_even", "t-channel likelihood ratio 5FS, even evt numbers",
						 fgNBins_tChannel5FSRatio, 0.0, 1.0);
    fHist_llh_tChannel_ratio_5FS_even->SetXTitle("P(S|X)");
    fHist_llh_tChannel_ratio_5FS_even->SetYTitle("Number of Entries");
    
    fHist_llh_tChannel_ratio_5FS_odd = new TH1F("tChannelProb5FS_odd", "t-channel likelihood ratio 5FS, odd evt numbers",
						fgNBins_tChannel5FSRatio, 0.0, 1.0);
    fHist_llh_tChannel_ratio_5FS_odd->SetXTitle("P(S|X)");
    fHist_llh_tChannel_ratio_5FS_odd->SetYTitle("Number of Entries");

    fHist_llh_tChannel_ratio2_5FS = new TH1F("tChannelProb5FS_c", "t-channel likelihood ratio 5FS",
					     25, 0.0, 1.0);
    fHist_llh_tChannel_ratio2_5FS->SetXTitle("P(S|X)");
    fHist_llh_tChannel_ratio2_5FS->SetYTitle("Number of Entries");

    fHist_llh_Wjets_ratio_5FS = new TH1F("WjetsProb5FS", "Wjets likelihood ratio 5FS",
					 25, 0.0, 1.0);
    fHist_llh_Wjets_ratio_5FS->SetXTitle("P(S|X)");
    fHist_llh_Wjets_ratio_5FS->SetYTitle("Number of Entries");

    fHist_llh_ttbar_ratio_5FS = new TH1F("ttbarProb5FS", "ttbar likelihood ratio 5FS",
					 25, 0.0, 1.0);
    fHist_llh_ttbar_ratio_5FS->SetXTitle("P(S|X)");
    fHist_llh_ttbar_ratio_5FS->SetYTitle("Number of Entries");

    gDirectory->cd("..");

    gDirectory->mkdir("2D");
    gDirectory->cd("2D");

    fHist_2D_tChannel_4FS_vs_5FS = new TH2F("tChannel_4FS_vs_5FS", "tChannel 4FS vs 5FS",
     					    50, 0., 1.,
     					    50, 0., 1.);
    fHist_2D_tChannel_4FS_vs_5FS->SetXTitle("P(S|X) 4FS");
    fHist_2D_tChannel_4FS_vs_5FS->SetYTitle("P(S|X) 5FS");
    fHist_2D_tChannel_4FS_vs_5FS->SetZTitle("Events");

    fHist_2D_tChannel_4FS_vs_Wjets = new TH2F("tChannel_4FS_vs_Wjets", "tChannel 4FS vs Wjets discriminant",
					      25, 0.0, 1.0,
					      25, 0.0, 1.0);
    fHist_2D_tChannel_4FS_vs_Wjets->SetXTitle("P(S|X) 4FS");
    fHist_2D_tChannel_4FS_vs_Wjets->SetYTitle("P(S|X) Wjets");
    fHist_2D_tChannel_4FS_vs_Wjets->SetZTitle("Events");

    fHist_2D_tChannel_4FS_vs_Wbb = new TH2F("tChannel_4FS_vs_Wbb", "tChannel 4FS vs Wbb discriminant",
					      25, 0.0, 1.0,
					      25, 0.0, 1.0);
    fHist_2D_tChannel_4FS_vs_Wbb->SetXTitle("P(S|X) 4FS");
    fHist_2D_tChannel_4FS_vs_Wbb->SetYTitle("P(S|X) Wbb");
    fHist_2D_tChannel_4FS_vs_Wbb->SetZTitle("Events");

    fHist_2D_tChannel_4FS_vs_Wcj = new TH2F("tChannel_4FS_vs_Wcj", "tChannel 4FS vs Wcj discriminant",
					      25, 0.0, 1.0,
					      25, 0.0, 1.0);
    fHist_2D_tChannel_4FS_vs_Wcj->SetXTitle("P(S|X) 4FS");
    fHist_2D_tChannel_4FS_vs_Wcj->SetYTitle("P(S|X) Wcj");
    fHist_2D_tChannel_4FS_vs_Wcj->SetZTitle("Events");

    fHist_2D_tChannel_4FS_vs_ttbar = new TH2F("tChannel_4FS_vs_ttbar", "tChannel 4FS vs ttbar discriminant",
					      25, 0.0, 1.0,
					      25, 0.0, 1.0);
    fHist_2D_tChannel_4FS_vs_ttbar->SetXTitle("P(S|X) 4FS");
    fHist_2D_tChannel_4FS_vs_ttbar->SetYTitle("P(S|X) ttbar");
    fHist_2D_tChannel_4FS_vs_ttbar->SetZTitle("Events");

    gDirectory->cd("..");
    
    gDirectory->mkdir("ManyBins");
    gDirectory->cd("ManyBins");

    // t-channel ratio all leptons, all charge
    fHist_llh_tChannel_ratio_4FS_raw = new TH1F("tChannelProb4FS_raw", "t-channel likelihood ratio 4FS", 20000, 0.0, 1.0);
    fHist_llh_tChannel_ratio_4FS_raw->SetXTitle("P(S|X)");
    fHist_llh_tChannel_ratio_4FS_raw->SetYTitle("Number of Entries");

    fHist_llh_tChannel_ratio_5FS_raw = new TH1F("tChannelProb5FS_raw", "t-channel likelihood ratio 5FS", 20000, 0.0, 1.0);
    fHist_llh_tChannel_ratio_5FS_raw->SetXTitle("P(S|X)");
    fHist_llh_tChannel_ratio_5FS_raw->SetYTitle("Number of Entries");

    gDirectory->cd("..");

    gDirectory->cd("..");
    
    gDirectory->mkdir("MemLikelihoods");
    gDirectory->cd("MemLikelihoods");

    // Log-Likelihood Plots
    fHist_logllh_sChannel2j = new TH1F("logllh_sChannel2j", "s-channel likelihood 2j", 50., -12., 3.);
    fHist_logllh_sChannel2j->SetXTitle("Log(L_{s-channel 2j})");
    fHist_logllh_sChannel2j->SetYTitle("Number of Entries");

    fHist_logllh_tChannel4FS = new TH1F("logllh_tChannel4FS", "t-channel likelihood", 50., -12., 3.);
    fHist_logllh_tChannel4FS->SetXTitle("Log(L_{t-channel})");
    fHist_logllh_tChannel4FS->SetYTitle("Number of Entries");

    fHist_logllh_tChannel5FS = new TH1F("logllh_tChannel5FS", "t-channel likelihood", 50., -12., 3.);
    fHist_logllh_tChannel5FS->SetXTitle("Log(L_{t-channel})");
    fHist_logllh_tChannel5FS->SetYTitle("Number of Entries");

    fHist_logllh_ttbarSL = new TH1F("logllh_ttbarSL", "ttbar SL", 50., -12., 3.);
    fHist_logllh_ttbarSL->SetXTitle("Log(L_{t#bar{t}, SL})");
    fHist_logllh_ttbarSL->SetYTitle("Number of Entries");

    fHist_logllh_ttbarDL = new TH1F("logllh_ttbarDL", "ttbar DL likelihood", 50., -15, 0.);
    fHist_logllh_ttbarDL->SetXTitle("Log(L_{t#bar{t}, DL})");
    fHist_logllh_ttbarDL->SetYTitle("Number of Entries");

    fHist_logllh_Wjj = new TH1F("logllh_Wjj", "Wjj likelihood", 50., -12., 3.);
    fHist_logllh_Wjj->SetXTitle("Log(L_{Wjj})");
    fHist_logllh_Wjj->SetYTitle("Number of Entries");

    fHist_logllh_Wcj = new TH1F("logllh_Wcj", "Wcj likelihood", 50., -12., 3.);
    fHist_logllh_Wcj->SetXTitle("Log(L_{Wcj})");
    fHist_logllh_Wcj->SetYTitle("Number of Entries");

    fHist_logllh_Wbb = new TH1F("logllh_Wbb", "Wbb likelihood", 50., -12., 3.);
    fHist_logllh_Wbb->SetXTitle("Log(L_{Wb#bar{b}})");
    fHist_logllh_Wbb->SetYTitle("Number of Entries");

    gDirectory->cd("..");
}

//____________________________________________________________________

Bool_t AtlSgTop_tChannelMemDiscr::ProcessPreCut() {
    //
    // Event pre-selection
    //

    // Currently, no cuts applied

    // Remove buggy event for PDF reweighting
    if ( fEvent->RunNr() == 195847 && fEvent->EventNr() == 14022767
	 && fEvent->IsMC() ) return kFALSE;
    
    // Accept event
    return kTRUE;
}

//____________________________________________________________________

Bool_t AtlSgTop_tChannelMemDiscr::ProcessCut() {
    //
    // Event selection
    //

    if ( fSchannelVeto ) {
	AtlBTag::ETagger schan_tagger = AtlBTag::kMV1;
	Double_t schan_wp = 0.7892;
	
	AtlJet *jet1 = (AtlJet*) fJets->At(0);
	AtlJet *jet2 = (AtlJet*) fJets->At(1);
	if ( jet1->GetTag(schan_tagger)->GetWeight() > schan_wp &&
	     jet2->GetTag(schan_tagger)->GetWeight() > schan_wp )
	    return kFALSE;
    }

    // No further event selection
    return kTRUE;
}

//____________________________________________________________________

void AtlSgTop_tChannelMemDiscr::FillHistograms() {
    //
    // Fill histograms
    //
    // This method will be called only for events surviving the
    // ProcessCut() routine
    //

    HepParticle *lepton        = (HepParticle*)fLeptons->At(0);
    Float_t      lepCharge     = lepton->Charge();
    Bool_t       lepIsElectron = lepton->IsElectron();
    Bool_t       lepIsMuon     = lepton->IsMuon();
    
    Double_t llh_sChannel2j  = GetEvtReader()->v_llh_sChannel2j;
    Double_t llh_tChannel4FS = GetEvtReader()->v_llh_tChannel4FS;
    Double_t llh_tChannel5FS = GetEvtReader()->v_llh_tChannel5FS;
    Double_t llh_ttbarSL     = GetEvtReader()->v_llh_ttbarSL;
    Double_t llh_ttbarDL     = GetEvtReader()->v_llh_ttbarDL;
    Double_t llh_Wjj         = GetEvtReader()->v_llh_Wjj;
    Double_t llh_Wcj         = GetEvtReader()->v_llh_Wcj;
    Double_t llh_Wbb         = GetEvtReader()->v_llh_Wbb;

    Double_t p_sChannel2j  = 0.0;
    Double_t p_tChannel4FS = 0.0;
    Double_t p_tChannel5FS = 0.0;
    Double_t p_Wjj         = 0.0;
    Double_t p_Wbb         = 0.0;
    Double_t p_Wcj         = 0.0;
    Double_t p_ttbarSL     = 0.0;
    Double_t p_ttbarDL     = 0.0;
    
    if ( lepIsElectron ) {
	if ( lepCharge > 0.0 ) {
	    // e+
	    p_sChannel2j  = fP_sChannel2j_ePlus;
	    p_tChannel4FS = fP_tChannel4FS_ePlus;
	    p_tChannel5FS = fP_tChannel4FS_ePlus; // same as 4FS
	    p_Wjj         = fP_Wjj_ePlus;
	    p_Wbb         = fP_Wbb_ePlus;
	    p_Wcj         = fP_Wcj_ePlus;
	    p_ttbarSL     = fP_ttbarSL_ePlus;
	    p_ttbarDL     = fP_ttbarDL_ePlus;
	} else {
	    // e-
	    p_sChannel2j  = fP_sChannel2j_eMinus;
	    p_tChannel4FS = fP_tChannel4FS_eMinus;
	    p_tChannel5FS = fP_tChannel4FS_eMinus; // same as 4FS
	    p_Wjj         = fP_Wjj_eMinus;
	    p_Wbb         = fP_Wbb_eMinus;
	    p_Wcj         = fP_Wcj_eMinus;
	    p_ttbarSL     = fP_ttbarSL_eMinus;
	    p_ttbarDL     = fP_ttbarDL_eMinus;
	}
    }
    else if ( lepIsMuon ) {
	if ( lepCharge > 0.0 ) {
	    // mu+
	    p_sChannel2j  = fP_sChannel2j_muPlus;
	    p_tChannel4FS = fP_tChannel4FS_muPlus;
	    p_tChannel5FS = fP_tChannel4FS_muPlus; // same as 4FS
	    p_Wjj         = fP_Wjj_muPlus;
	    p_Wbb         = fP_Wbb_muPlus;
	    p_Wcj         = fP_Wcj_muPlus;
	    p_ttbarSL     = fP_ttbarSL_muPlus;
	    p_ttbarDL     = fP_ttbarDL_muPlus;
	} else {
	    // mu-
	    p_sChannel2j  = fP_sChannel2j_muMinus;
	    p_tChannel4FS = fP_tChannel4FS_muMinus;
	    p_tChannel5FS = fP_tChannel4FS_muMinus; // same as 4FS
	    p_Wjj         = fP_Wjj_muMinus;
	    p_Wbb         = fP_Wbb_muMinus;
	    p_Wcj         = fP_Wcj_muMinus;
	    p_ttbarSL     = fP_ttbarSL_muMinus;
	    p_ttbarDL     = fP_ttbarDL_muMinus;
	}
    }
    
    Double_t sig_4FS = p_tChannel4FS * llh_tChannel4FS;
    Double_t sig_5FS = p_tChannel5FS * llh_tChannel5FS;
    Double_t bkg = p_sChannel2j * llh_sChannel2j +
    	p_Wjj * llh_Wjj +
    	p_Wbb * llh_Wbb +
    	p_Wcj * llh_Wcj +
    	p_ttbarSL * llh_ttbarSL +
    	p_ttbarDL * llh_ttbarDL;

    Double_t sig_wjets = p_Wjj * llh_Wjj + p_Wbb * llh_Wbb + p_Wcj * llh_Wcj;
    Double_t sig_ttbar = p_ttbarSL * llh_ttbarSL + p_ttbarDL * llh_ttbarDL;

    
    Double_t tChannelRatio = 0.;
    Double_t WjetsRatio = 0.;
    Double_t ttbarRatio = 0.;
    Int_t bin = 0.;
    Double_t tChannelRatio_reBinned = 0.;

    // 4FS - stuff
    // ===========
    
    // t-Channel Ratio with t-channel 4FS as signal
    // --------------------------------------------
    tChannelRatio = sig_4FS / (sig_4FS + bkg);
    bin = 1 + TMath::BinarySearch(fgNBins_tChannel4FSRatio,
				  fgBinEdges_tChannel4FSRatio,
				  tChannelRatio);
    if ( bin == 0 )
	bin++; // Don't use underflow bin
    tChannelRatio_reBinned = (bin - 0.5)/fgNBins_tChannel4FSRatio;
    
    fHist_llh_tChannel_ratio_4FS->Fill(tChannelRatio_reBinned, GetTagEvtWeight());
    if ( fEvent->EventNr() % 2 == 0 )
	fHist_llh_tChannel_ratio_4FS_even->Fill(tChannelRatio_reBinned, GetTagEvtWeight());
    else
	fHist_llh_tChannel_ratio_4FS_odd->Fill(tChannelRatio_reBinned, GetTagEvtWeight());
    fHist_llh_tChannel_ratio_4FS_raw->Fill(tChannelRatio, GetTagEvtWeight());
    fHist_llh_tChannel_ratio2_4FS->Fill(tChannelRatio, GetTagEvtWeight());

    // Wjets Ratio with t-channel 4FS as signal
    WjetsRatio = sig_wjets / (sig_4FS + bkg);
    fHist_llh_Wjets_ratio_4FS->Fill(WjetsRatio, GetTagEvtWeight());

    fHist_llh_Wbb_ratio_4FS->Fill((p_Wbb*llh_Wbb)/(sig_4FS + bkg), GetTagEvtWeight());
    fHist_llh_Wcj_ratio_4FS->Fill((p_Wcj*llh_Wcj)/(sig_4FS + bkg), GetTagEvtWeight());
    fHist_llh_Wjj_ratio_4FS->Fill((p_Wjj*llh_Wjj)/(sig_4FS + bkg), GetTagEvtWeight());
				  
    
    // ttbar Ratio with t-channel 4FS as signal
    ttbarRatio = sig_ttbar / (sig_4FS + bkg);
    fHist_llh_ttbar_ratio_4FS->Fill(ttbarRatio, GetTagEvtWeight());

    // 2D
    fHist_2D_tChannel_4FS_vs_5FS->Fill(sig_4FS / (sig_4FS + bkg),
				       sig_5FS / (sig_5FS + bkg),
				       GetTagEvtWeight());
    fHist_2D_tChannel_4FS_vs_Wjets->Fill(sig_4FS/(sig_4FS + bkg),
					 WjetsRatio,			 
					 GetTagEvtWeight());
    fHist_2D_tChannel_4FS_vs_Wbb->Fill(sig_4FS/(sig_4FS + bkg),
				       (p_Wbb*llh_Wbb)/(sig_4FS + bkg),
				       GetTagEvtWeight());
    fHist_2D_tChannel_4FS_vs_Wcj->Fill(sig_4FS/(sig_4FS + bkg),
				       (p_Wcj*llh_Wcj)/(sig_4FS + bkg),
				       GetTagEvtWeight());
    fHist_2D_tChannel_4FS_vs_ttbar->Fill(sig_4FS/(sig_4FS + bkg),
					 ttbarRatio,
					 GetTagEvtWeight());
    
    // t-Channel Ratio with t-channel 5FS as signal
    // --------------------------------------------
    tChannelRatio = sig_5FS / (sig_5FS + bkg);
    bin = 1 + TMath::BinarySearch(fgNBins_tChannel5FSRatio,
				  fgBinEdges_tChannel5FSRatio,
				  tChannelRatio);
    if ( bin == 0 )
	bin++; // Don't use underflow bin
    tChannelRatio_reBinned = (bin - 0.5)/fgNBins_tChannel5FSRatio;
    
    fHist_llh_tChannel_ratio_5FS->Fill(tChannelRatio_reBinned, GetTagEvtWeight());
    if ( fEvent->EventNr() % 2 == 0 )
	fHist_llh_tChannel_ratio_5FS_even->Fill(tChannelRatio_reBinned, GetTagEvtWeight());
    else
	fHist_llh_tChannel_ratio_5FS_odd->Fill(tChannelRatio_reBinned, GetTagEvtWeight());	
    fHist_llh_tChannel_ratio_5FS_raw->Fill(tChannelRatio, GetTagEvtWeight());
    fHist_llh_tChannel_ratio2_5FS->Fill(tChannelRatio, GetTagEvtWeight());

    // Wjets Ratio with t-channel 5FS as signal
    WjetsRatio = sig_wjets / (sig_5FS + bkg);
    fHist_llh_Wjets_ratio_5FS->Fill(WjetsRatio, GetTagEvtWeight());

    // ttbar Ratio with t-channel 5FS as signal
    ttbarRatio = sig_ttbar / (sig_5FS + bkg);
    fHist_llh_ttbar_ratio_5FS->Fill(ttbarRatio, GetTagEvtWeight());


    // Likelihood plots
    // ----------------
    fHist_logllh_sChannel2j->Fill(TMath::Log(llh_sChannel2j), GetTagEvtWeight());
    fHist_logllh_tChannel4FS->Fill(TMath::Log(llh_tChannel4FS), GetTagEvtWeight());
    fHist_logllh_tChannel5FS->Fill(TMath::Log(llh_tChannel5FS), GetTagEvtWeight());
    fHist_logllh_ttbarSL->Fill(TMath::Log(llh_ttbarSL), GetTagEvtWeight());
    fHist_logllh_ttbarDL->Fill(TMath::Log(llh_ttbarDL), GetTagEvtWeight());
    fHist_logllh_Wjj->Fill(TMath::Log(llh_Wjj), GetTagEvtWeight());
    fHist_logllh_Wcj->Fill(TMath::Log(llh_Wcj), GetTagEvtWeight());
    fHist_logllh_Wbb->Fill(TMath::Log(llh_Wbb), GetTagEvtWeight());
}

//____________________________________________________________________

void AtlSgTop_tChannelMemDiscr::InitEvent() {
    //
    // Prepare event analysis
    //
}

//____________________________________________________________________

void AtlSgTop_tChannelMemDiscr::Print(Option_t *option) const {
    //
    // Print user analysis configuration
    //
    cout << endl
	 << "================================================================" << endl
	 << "  Atlas Single-Top t-Channel Mem Discriminant Analysis Selector " << endl
	 << "================================================================" << endl
	 << endl;
    AtlSelector::Print();
    cout << endl
	 << "================================================================" << endl
	 << endl;
}

//____________________________________________________________________

void AtlSgTop_tChannelMemDiscr::Terminate() {
    //
    // Terminate routine called at the end of event loop
    //    
	
    AtlSelector::Terminate();
}
 AtlSgTop_tChannelMemDiscr.cxx:1
 AtlSgTop_tChannelMemDiscr.cxx:2
 AtlSgTop_tChannelMemDiscr.cxx:3
 AtlSgTop_tChannelMemDiscr.cxx:4
 AtlSgTop_tChannelMemDiscr.cxx:5
 AtlSgTop_tChannelMemDiscr.cxx:6
 AtlSgTop_tChannelMemDiscr.cxx:7
 AtlSgTop_tChannelMemDiscr.cxx:8
 AtlSgTop_tChannelMemDiscr.cxx:9
 AtlSgTop_tChannelMemDiscr.cxx:10
 AtlSgTop_tChannelMemDiscr.cxx:11
 AtlSgTop_tChannelMemDiscr.cxx:12
 AtlSgTop_tChannelMemDiscr.cxx:13
 AtlSgTop_tChannelMemDiscr.cxx:14
 AtlSgTop_tChannelMemDiscr.cxx:15
 AtlSgTop_tChannelMemDiscr.cxx:16
 AtlSgTop_tChannelMemDiscr.cxx:17
 AtlSgTop_tChannelMemDiscr.cxx:18
 AtlSgTop_tChannelMemDiscr.cxx:19
 AtlSgTop_tChannelMemDiscr.cxx:20
 AtlSgTop_tChannelMemDiscr.cxx:21
 AtlSgTop_tChannelMemDiscr.cxx:22
 AtlSgTop_tChannelMemDiscr.cxx:23
 AtlSgTop_tChannelMemDiscr.cxx:24
 AtlSgTop_tChannelMemDiscr.cxx:25
 AtlSgTop_tChannelMemDiscr.cxx:26
 AtlSgTop_tChannelMemDiscr.cxx:27
 AtlSgTop_tChannelMemDiscr.cxx:28
 AtlSgTop_tChannelMemDiscr.cxx:29
 AtlSgTop_tChannelMemDiscr.cxx:30
 AtlSgTop_tChannelMemDiscr.cxx:31
 AtlSgTop_tChannelMemDiscr.cxx:32
 AtlSgTop_tChannelMemDiscr.cxx:33
 AtlSgTop_tChannelMemDiscr.cxx:34
 AtlSgTop_tChannelMemDiscr.cxx:35
 AtlSgTop_tChannelMemDiscr.cxx:36
 AtlSgTop_tChannelMemDiscr.cxx:37
 AtlSgTop_tChannelMemDiscr.cxx:38
 AtlSgTop_tChannelMemDiscr.cxx:39
 AtlSgTop_tChannelMemDiscr.cxx:40
 AtlSgTop_tChannelMemDiscr.cxx:41
 AtlSgTop_tChannelMemDiscr.cxx:42
 AtlSgTop_tChannelMemDiscr.cxx:43
 AtlSgTop_tChannelMemDiscr.cxx:44
 AtlSgTop_tChannelMemDiscr.cxx:45
 AtlSgTop_tChannelMemDiscr.cxx:46
 AtlSgTop_tChannelMemDiscr.cxx:47
 AtlSgTop_tChannelMemDiscr.cxx:48
 AtlSgTop_tChannelMemDiscr.cxx:49
 AtlSgTop_tChannelMemDiscr.cxx:50
 AtlSgTop_tChannelMemDiscr.cxx:51
 AtlSgTop_tChannelMemDiscr.cxx:52
 AtlSgTop_tChannelMemDiscr.cxx:53
 AtlSgTop_tChannelMemDiscr.cxx:54
 AtlSgTop_tChannelMemDiscr.cxx:55
 AtlSgTop_tChannelMemDiscr.cxx:56
 AtlSgTop_tChannelMemDiscr.cxx:57
 AtlSgTop_tChannelMemDiscr.cxx:58
 AtlSgTop_tChannelMemDiscr.cxx:59
 AtlSgTop_tChannelMemDiscr.cxx:60
 AtlSgTop_tChannelMemDiscr.cxx:61
 AtlSgTop_tChannelMemDiscr.cxx:62
 AtlSgTop_tChannelMemDiscr.cxx:63
 AtlSgTop_tChannelMemDiscr.cxx:64
 AtlSgTop_tChannelMemDiscr.cxx:65
 AtlSgTop_tChannelMemDiscr.cxx:66
 AtlSgTop_tChannelMemDiscr.cxx:67
 AtlSgTop_tChannelMemDiscr.cxx:68
 AtlSgTop_tChannelMemDiscr.cxx:69
 AtlSgTop_tChannelMemDiscr.cxx:70
 AtlSgTop_tChannelMemDiscr.cxx:71
 AtlSgTop_tChannelMemDiscr.cxx:72
 AtlSgTop_tChannelMemDiscr.cxx:73
 AtlSgTop_tChannelMemDiscr.cxx:74
 AtlSgTop_tChannelMemDiscr.cxx:75
 AtlSgTop_tChannelMemDiscr.cxx:76
 AtlSgTop_tChannelMemDiscr.cxx:77
 AtlSgTop_tChannelMemDiscr.cxx:78
 AtlSgTop_tChannelMemDiscr.cxx:79
 AtlSgTop_tChannelMemDiscr.cxx:80
 AtlSgTop_tChannelMemDiscr.cxx:81
 AtlSgTop_tChannelMemDiscr.cxx:82
 AtlSgTop_tChannelMemDiscr.cxx:83
 AtlSgTop_tChannelMemDiscr.cxx:84
 AtlSgTop_tChannelMemDiscr.cxx:85
 AtlSgTop_tChannelMemDiscr.cxx:86
 AtlSgTop_tChannelMemDiscr.cxx:87
 AtlSgTop_tChannelMemDiscr.cxx:88
 AtlSgTop_tChannelMemDiscr.cxx:89
 AtlSgTop_tChannelMemDiscr.cxx:90
 AtlSgTop_tChannelMemDiscr.cxx:91
 AtlSgTop_tChannelMemDiscr.cxx:92
 AtlSgTop_tChannelMemDiscr.cxx:93
 AtlSgTop_tChannelMemDiscr.cxx:94
 AtlSgTop_tChannelMemDiscr.cxx:95
 AtlSgTop_tChannelMemDiscr.cxx:96
 AtlSgTop_tChannelMemDiscr.cxx:97
 AtlSgTop_tChannelMemDiscr.cxx:98
 AtlSgTop_tChannelMemDiscr.cxx:99
 AtlSgTop_tChannelMemDiscr.cxx:100
 AtlSgTop_tChannelMemDiscr.cxx:101
 AtlSgTop_tChannelMemDiscr.cxx:102
 AtlSgTop_tChannelMemDiscr.cxx:103
 AtlSgTop_tChannelMemDiscr.cxx:104
 AtlSgTop_tChannelMemDiscr.cxx:105
 AtlSgTop_tChannelMemDiscr.cxx:106
 AtlSgTop_tChannelMemDiscr.cxx:107
 AtlSgTop_tChannelMemDiscr.cxx:108
 AtlSgTop_tChannelMemDiscr.cxx:109
 AtlSgTop_tChannelMemDiscr.cxx:110
 AtlSgTop_tChannelMemDiscr.cxx:111
 AtlSgTop_tChannelMemDiscr.cxx:112
 AtlSgTop_tChannelMemDiscr.cxx:113
 AtlSgTop_tChannelMemDiscr.cxx:114
 AtlSgTop_tChannelMemDiscr.cxx:115
 AtlSgTop_tChannelMemDiscr.cxx:116
 AtlSgTop_tChannelMemDiscr.cxx:117
 AtlSgTop_tChannelMemDiscr.cxx:118
 AtlSgTop_tChannelMemDiscr.cxx:119
 AtlSgTop_tChannelMemDiscr.cxx:120
 AtlSgTop_tChannelMemDiscr.cxx:121
 AtlSgTop_tChannelMemDiscr.cxx:122
 AtlSgTop_tChannelMemDiscr.cxx:123
 AtlSgTop_tChannelMemDiscr.cxx:124
 AtlSgTop_tChannelMemDiscr.cxx:125
 AtlSgTop_tChannelMemDiscr.cxx:126
 AtlSgTop_tChannelMemDiscr.cxx:127
 AtlSgTop_tChannelMemDiscr.cxx:128
 AtlSgTop_tChannelMemDiscr.cxx:129
 AtlSgTop_tChannelMemDiscr.cxx:130
 AtlSgTop_tChannelMemDiscr.cxx:131
 AtlSgTop_tChannelMemDiscr.cxx:132
 AtlSgTop_tChannelMemDiscr.cxx:133
 AtlSgTop_tChannelMemDiscr.cxx:134
 AtlSgTop_tChannelMemDiscr.cxx:135
 AtlSgTop_tChannelMemDiscr.cxx:136
 AtlSgTop_tChannelMemDiscr.cxx:137
 AtlSgTop_tChannelMemDiscr.cxx:138
 AtlSgTop_tChannelMemDiscr.cxx:139
 AtlSgTop_tChannelMemDiscr.cxx:140
 AtlSgTop_tChannelMemDiscr.cxx:141
 AtlSgTop_tChannelMemDiscr.cxx:142
 AtlSgTop_tChannelMemDiscr.cxx:143
 AtlSgTop_tChannelMemDiscr.cxx:144
 AtlSgTop_tChannelMemDiscr.cxx:145
 AtlSgTop_tChannelMemDiscr.cxx:146
 AtlSgTop_tChannelMemDiscr.cxx:147
 AtlSgTop_tChannelMemDiscr.cxx:148
 AtlSgTop_tChannelMemDiscr.cxx:149
 AtlSgTop_tChannelMemDiscr.cxx:150
 AtlSgTop_tChannelMemDiscr.cxx:151
 AtlSgTop_tChannelMemDiscr.cxx:152
 AtlSgTop_tChannelMemDiscr.cxx:153
 AtlSgTop_tChannelMemDiscr.cxx:154
 AtlSgTop_tChannelMemDiscr.cxx:155
 AtlSgTop_tChannelMemDiscr.cxx:156
 AtlSgTop_tChannelMemDiscr.cxx:157
 AtlSgTop_tChannelMemDiscr.cxx:158
 AtlSgTop_tChannelMemDiscr.cxx:159
 AtlSgTop_tChannelMemDiscr.cxx:160
 AtlSgTop_tChannelMemDiscr.cxx:161
 AtlSgTop_tChannelMemDiscr.cxx:162
 AtlSgTop_tChannelMemDiscr.cxx:163
 AtlSgTop_tChannelMemDiscr.cxx:164
 AtlSgTop_tChannelMemDiscr.cxx:165
 AtlSgTop_tChannelMemDiscr.cxx:166
 AtlSgTop_tChannelMemDiscr.cxx:167
 AtlSgTop_tChannelMemDiscr.cxx:168
 AtlSgTop_tChannelMemDiscr.cxx:169
 AtlSgTop_tChannelMemDiscr.cxx:170
 AtlSgTop_tChannelMemDiscr.cxx:171
 AtlSgTop_tChannelMemDiscr.cxx:172
 AtlSgTop_tChannelMemDiscr.cxx:173
 AtlSgTop_tChannelMemDiscr.cxx:174
 AtlSgTop_tChannelMemDiscr.cxx:175
 AtlSgTop_tChannelMemDiscr.cxx:176
 AtlSgTop_tChannelMemDiscr.cxx:177
 AtlSgTop_tChannelMemDiscr.cxx:178
 AtlSgTop_tChannelMemDiscr.cxx:179
 AtlSgTop_tChannelMemDiscr.cxx:180
 AtlSgTop_tChannelMemDiscr.cxx:181
 AtlSgTop_tChannelMemDiscr.cxx:182
 AtlSgTop_tChannelMemDiscr.cxx:183
 AtlSgTop_tChannelMemDiscr.cxx:184
 AtlSgTop_tChannelMemDiscr.cxx:185
 AtlSgTop_tChannelMemDiscr.cxx:186
 AtlSgTop_tChannelMemDiscr.cxx:187
 AtlSgTop_tChannelMemDiscr.cxx:188
 AtlSgTop_tChannelMemDiscr.cxx:189
 AtlSgTop_tChannelMemDiscr.cxx:190
 AtlSgTop_tChannelMemDiscr.cxx:191
 AtlSgTop_tChannelMemDiscr.cxx:192
 AtlSgTop_tChannelMemDiscr.cxx:193
 AtlSgTop_tChannelMemDiscr.cxx:194
 AtlSgTop_tChannelMemDiscr.cxx:195
 AtlSgTop_tChannelMemDiscr.cxx:196
 AtlSgTop_tChannelMemDiscr.cxx:197
 AtlSgTop_tChannelMemDiscr.cxx:198
 AtlSgTop_tChannelMemDiscr.cxx:199
 AtlSgTop_tChannelMemDiscr.cxx:200
 AtlSgTop_tChannelMemDiscr.cxx:201
 AtlSgTop_tChannelMemDiscr.cxx:202
 AtlSgTop_tChannelMemDiscr.cxx:203
 AtlSgTop_tChannelMemDiscr.cxx:204
 AtlSgTop_tChannelMemDiscr.cxx:205
 AtlSgTop_tChannelMemDiscr.cxx:206
 AtlSgTop_tChannelMemDiscr.cxx:207
 AtlSgTop_tChannelMemDiscr.cxx:208
 AtlSgTop_tChannelMemDiscr.cxx:209
 AtlSgTop_tChannelMemDiscr.cxx:210
 AtlSgTop_tChannelMemDiscr.cxx:211
 AtlSgTop_tChannelMemDiscr.cxx:212
 AtlSgTop_tChannelMemDiscr.cxx:213
 AtlSgTop_tChannelMemDiscr.cxx:214
 AtlSgTop_tChannelMemDiscr.cxx:215
 AtlSgTop_tChannelMemDiscr.cxx:216
 AtlSgTop_tChannelMemDiscr.cxx:217
 AtlSgTop_tChannelMemDiscr.cxx:218
 AtlSgTop_tChannelMemDiscr.cxx:219
 AtlSgTop_tChannelMemDiscr.cxx:220
 AtlSgTop_tChannelMemDiscr.cxx:221
 AtlSgTop_tChannelMemDiscr.cxx:222
 AtlSgTop_tChannelMemDiscr.cxx:223
 AtlSgTop_tChannelMemDiscr.cxx:224
 AtlSgTop_tChannelMemDiscr.cxx:225
 AtlSgTop_tChannelMemDiscr.cxx:226
 AtlSgTop_tChannelMemDiscr.cxx:227
 AtlSgTop_tChannelMemDiscr.cxx:228
 AtlSgTop_tChannelMemDiscr.cxx:229
 AtlSgTop_tChannelMemDiscr.cxx:230
 AtlSgTop_tChannelMemDiscr.cxx:231
 AtlSgTop_tChannelMemDiscr.cxx:232
 AtlSgTop_tChannelMemDiscr.cxx:233
 AtlSgTop_tChannelMemDiscr.cxx:234
 AtlSgTop_tChannelMemDiscr.cxx:235
 AtlSgTop_tChannelMemDiscr.cxx:236
 AtlSgTop_tChannelMemDiscr.cxx:237
 AtlSgTop_tChannelMemDiscr.cxx:238
 AtlSgTop_tChannelMemDiscr.cxx:239
 AtlSgTop_tChannelMemDiscr.cxx:240
 AtlSgTop_tChannelMemDiscr.cxx:241
 AtlSgTop_tChannelMemDiscr.cxx:242
 AtlSgTop_tChannelMemDiscr.cxx:243
 AtlSgTop_tChannelMemDiscr.cxx:244
 AtlSgTop_tChannelMemDiscr.cxx:245
 AtlSgTop_tChannelMemDiscr.cxx:246
 AtlSgTop_tChannelMemDiscr.cxx:247
 AtlSgTop_tChannelMemDiscr.cxx:248
 AtlSgTop_tChannelMemDiscr.cxx:249
 AtlSgTop_tChannelMemDiscr.cxx:250
 AtlSgTop_tChannelMemDiscr.cxx:251
 AtlSgTop_tChannelMemDiscr.cxx:252
 AtlSgTop_tChannelMemDiscr.cxx:253
 AtlSgTop_tChannelMemDiscr.cxx:254
 AtlSgTop_tChannelMemDiscr.cxx:255
 AtlSgTop_tChannelMemDiscr.cxx:256
 AtlSgTop_tChannelMemDiscr.cxx:257
 AtlSgTop_tChannelMemDiscr.cxx:258
 AtlSgTop_tChannelMemDiscr.cxx:259
 AtlSgTop_tChannelMemDiscr.cxx:260
 AtlSgTop_tChannelMemDiscr.cxx:261
 AtlSgTop_tChannelMemDiscr.cxx:262
 AtlSgTop_tChannelMemDiscr.cxx:263
 AtlSgTop_tChannelMemDiscr.cxx:264
 AtlSgTop_tChannelMemDiscr.cxx:265
 AtlSgTop_tChannelMemDiscr.cxx:266
 AtlSgTop_tChannelMemDiscr.cxx:267
 AtlSgTop_tChannelMemDiscr.cxx:268
 AtlSgTop_tChannelMemDiscr.cxx:269
 AtlSgTop_tChannelMemDiscr.cxx:270
 AtlSgTop_tChannelMemDiscr.cxx:271
 AtlSgTop_tChannelMemDiscr.cxx:272
 AtlSgTop_tChannelMemDiscr.cxx:273
 AtlSgTop_tChannelMemDiscr.cxx:274
 AtlSgTop_tChannelMemDiscr.cxx:275
 AtlSgTop_tChannelMemDiscr.cxx:276
 AtlSgTop_tChannelMemDiscr.cxx:277
 AtlSgTop_tChannelMemDiscr.cxx:278
 AtlSgTop_tChannelMemDiscr.cxx:279
 AtlSgTop_tChannelMemDiscr.cxx:280
 AtlSgTop_tChannelMemDiscr.cxx:281
 AtlSgTop_tChannelMemDiscr.cxx:282
 AtlSgTop_tChannelMemDiscr.cxx:283
 AtlSgTop_tChannelMemDiscr.cxx:284
 AtlSgTop_tChannelMemDiscr.cxx:285
 AtlSgTop_tChannelMemDiscr.cxx:286
 AtlSgTop_tChannelMemDiscr.cxx:287
 AtlSgTop_tChannelMemDiscr.cxx:288
 AtlSgTop_tChannelMemDiscr.cxx:289
 AtlSgTop_tChannelMemDiscr.cxx:290
 AtlSgTop_tChannelMemDiscr.cxx:291
 AtlSgTop_tChannelMemDiscr.cxx:292
 AtlSgTop_tChannelMemDiscr.cxx:293
 AtlSgTop_tChannelMemDiscr.cxx:294
 AtlSgTop_tChannelMemDiscr.cxx:295
 AtlSgTop_tChannelMemDiscr.cxx:296
 AtlSgTop_tChannelMemDiscr.cxx:297
 AtlSgTop_tChannelMemDiscr.cxx:298
 AtlSgTop_tChannelMemDiscr.cxx:299
 AtlSgTop_tChannelMemDiscr.cxx:300
 AtlSgTop_tChannelMemDiscr.cxx:301
 AtlSgTop_tChannelMemDiscr.cxx:302
 AtlSgTop_tChannelMemDiscr.cxx:303
 AtlSgTop_tChannelMemDiscr.cxx:304
 AtlSgTop_tChannelMemDiscr.cxx:305
 AtlSgTop_tChannelMemDiscr.cxx:306
 AtlSgTop_tChannelMemDiscr.cxx:307
 AtlSgTop_tChannelMemDiscr.cxx:308
 AtlSgTop_tChannelMemDiscr.cxx:309
 AtlSgTop_tChannelMemDiscr.cxx:310
 AtlSgTop_tChannelMemDiscr.cxx:311
 AtlSgTop_tChannelMemDiscr.cxx:312
 AtlSgTop_tChannelMemDiscr.cxx:313
 AtlSgTop_tChannelMemDiscr.cxx:314
 AtlSgTop_tChannelMemDiscr.cxx:315
 AtlSgTop_tChannelMemDiscr.cxx:316
 AtlSgTop_tChannelMemDiscr.cxx:317
 AtlSgTop_tChannelMemDiscr.cxx:318
 AtlSgTop_tChannelMemDiscr.cxx:319
 AtlSgTop_tChannelMemDiscr.cxx:320
 AtlSgTop_tChannelMemDiscr.cxx:321
 AtlSgTop_tChannelMemDiscr.cxx:322
 AtlSgTop_tChannelMemDiscr.cxx:323
 AtlSgTop_tChannelMemDiscr.cxx:324
 AtlSgTop_tChannelMemDiscr.cxx:325
 AtlSgTop_tChannelMemDiscr.cxx:326
 AtlSgTop_tChannelMemDiscr.cxx:327
 AtlSgTop_tChannelMemDiscr.cxx:328
 AtlSgTop_tChannelMemDiscr.cxx:329
 AtlSgTop_tChannelMemDiscr.cxx:330
 AtlSgTop_tChannelMemDiscr.cxx:331
 AtlSgTop_tChannelMemDiscr.cxx:332
 AtlSgTop_tChannelMemDiscr.cxx:333
 AtlSgTop_tChannelMemDiscr.cxx:334
 AtlSgTop_tChannelMemDiscr.cxx:335
 AtlSgTop_tChannelMemDiscr.cxx:336
 AtlSgTop_tChannelMemDiscr.cxx:337
 AtlSgTop_tChannelMemDiscr.cxx:338
 AtlSgTop_tChannelMemDiscr.cxx:339
 AtlSgTop_tChannelMemDiscr.cxx:340
 AtlSgTop_tChannelMemDiscr.cxx:341
 AtlSgTop_tChannelMemDiscr.cxx:342
 AtlSgTop_tChannelMemDiscr.cxx:343
 AtlSgTop_tChannelMemDiscr.cxx:344
 AtlSgTop_tChannelMemDiscr.cxx:345
 AtlSgTop_tChannelMemDiscr.cxx:346
 AtlSgTop_tChannelMemDiscr.cxx:347
 AtlSgTop_tChannelMemDiscr.cxx:348
 AtlSgTop_tChannelMemDiscr.cxx:349
 AtlSgTop_tChannelMemDiscr.cxx:350
 AtlSgTop_tChannelMemDiscr.cxx:351
 AtlSgTop_tChannelMemDiscr.cxx:352
 AtlSgTop_tChannelMemDiscr.cxx:353
 AtlSgTop_tChannelMemDiscr.cxx:354
 AtlSgTop_tChannelMemDiscr.cxx:355
 AtlSgTop_tChannelMemDiscr.cxx:356
 AtlSgTop_tChannelMemDiscr.cxx:357
 AtlSgTop_tChannelMemDiscr.cxx:358
 AtlSgTop_tChannelMemDiscr.cxx:359
 AtlSgTop_tChannelMemDiscr.cxx:360
 AtlSgTop_tChannelMemDiscr.cxx:361
 AtlSgTop_tChannelMemDiscr.cxx:362
 AtlSgTop_tChannelMemDiscr.cxx:363
 AtlSgTop_tChannelMemDiscr.cxx:364
 AtlSgTop_tChannelMemDiscr.cxx:365
 AtlSgTop_tChannelMemDiscr.cxx:366
 AtlSgTop_tChannelMemDiscr.cxx:367
 AtlSgTop_tChannelMemDiscr.cxx:368
 AtlSgTop_tChannelMemDiscr.cxx:369
 AtlSgTop_tChannelMemDiscr.cxx:370
 AtlSgTop_tChannelMemDiscr.cxx:371
 AtlSgTop_tChannelMemDiscr.cxx:372
 AtlSgTop_tChannelMemDiscr.cxx:373
 AtlSgTop_tChannelMemDiscr.cxx:374
 AtlSgTop_tChannelMemDiscr.cxx:375
 AtlSgTop_tChannelMemDiscr.cxx:376
 AtlSgTop_tChannelMemDiscr.cxx:377
 AtlSgTop_tChannelMemDiscr.cxx:378
 AtlSgTop_tChannelMemDiscr.cxx:379
 AtlSgTop_tChannelMemDiscr.cxx:380
 AtlSgTop_tChannelMemDiscr.cxx:381
 AtlSgTop_tChannelMemDiscr.cxx:382
 AtlSgTop_tChannelMemDiscr.cxx:383
 AtlSgTop_tChannelMemDiscr.cxx:384
 AtlSgTop_tChannelMemDiscr.cxx:385
 AtlSgTop_tChannelMemDiscr.cxx:386
 AtlSgTop_tChannelMemDiscr.cxx:387
 AtlSgTop_tChannelMemDiscr.cxx:388
 AtlSgTop_tChannelMemDiscr.cxx:389
 AtlSgTop_tChannelMemDiscr.cxx:390
 AtlSgTop_tChannelMemDiscr.cxx:391
 AtlSgTop_tChannelMemDiscr.cxx:392
 AtlSgTop_tChannelMemDiscr.cxx:393
 AtlSgTop_tChannelMemDiscr.cxx:394
 AtlSgTop_tChannelMemDiscr.cxx:395
 AtlSgTop_tChannelMemDiscr.cxx:396
 AtlSgTop_tChannelMemDiscr.cxx:397
 AtlSgTop_tChannelMemDiscr.cxx:398
 AtlSgTop_tChannelMemDiscr.cxx:399
 AtlSgTop_tChannelMemDiscr.cxx:400
 AtlSgTop_tChannelMemDiscr.cxx:401
 AtlSgTop_tChannelMemDiscr.cxx:402
 AtlSgTop_tChannelMemDiscr.cxx:403
 AtlSgTop_tChannelMemDiscr.cxx:404
 AtlSgTop_tChannelMemDiscr.cxx:405
 AtlSgTop_tChannelMemDiscr.cxx:406
 AtlSgTop_tChannelMemDiscr.cxx:407
 AtlSgTop_tChannelMemDiscr.cxx:408
 AtlSgTop_tChannelMemDiscr.cxx:409
 AtlSgTop_tChannelMemDiscr.cxx:410
 AtlSgTop_tChannelMemDiscr.cxx:411
 AtlSgTop_tChannelMemDiscr.cxx:412
 AtlSgTop_tChannelMemDiscr.cxx:413
 AtlSgTop_tChannelMemDiscr.cxx:414
 AtlSgTop_tChannelMemDiscr.cxx:415
 AtlSgTop_tChannelMemDiscr.cxx:416
 AtlSgTop_tChannelMemDiscr.cxx:417
 AtlSgTop_tChannelMemDiscr.cxx:418
 AtlSgTop_tChannelMemDiscr.cxx:419
 AtlSgTop_tChannelMemDiscr.cxx:420
 AtlSgTop_tChannelMemDiscr.cxx:421
 AtlSgTop_tChannelMemDiscr.cxx:422
 AtlSgTop_tChannelMemDiscr.cxx:423
 AtlSgTop_tChannelMemDiscr.cxx:424
 AtlSgTop_tChannelMemDiscr.cxx:425
 AtlSgTop_tChannelMemDiscr.cxx:426
 AtlSgTop_tChannelMemDiscr.cxx:427
 AtlSgTop_tChannelMemDiscr.cxx:428
 AtlSgTop_tChannelMemDiscr.cxx:429
 AtlSgTop_tChannelMemDiscr.cxx:430
 AtlSgTop_tChannelMemDiscr.cxx:431
 AtlSgTop_tChannelMemDiscr.cxx:432
 AtlSgTop_tChannelMemDiscr.cxx:433
 AtlSgTop_tChannelMemDiscr.cxx:434
 AtlSgTop_tChannelMemDiscr.cxx:435
 AtlSgTop_tChannelMemDiscr.cxx:436
 AtlSgTop_tChannelMemDiscr.cxx:437
 AtlSgTop_tChannelMemDiscr.cxx:438
 AtlSgTop_tChannelMemDiscr.cxx:439
 AtlSgTop_tChannelMemDiscr.cxx:440
 AtlSgTop_tChannelMemDiscr.cxx:441
 AtlSgTop_tChannelMemDiscr.cxx:442
 AtlSgTop_tChannelMemDiscr.cxx:443
 AtlSgTop_tChannelMemDiscr.cxx:444
 AtlSgTop_tChannelMemDiscr.cxx:445
 AtlSgTop_tChannelMemDiscr.cxx:446
 AtlSgTop_tChannelMemDiscr.cxx:447
 AtlSgTop_tChannelMemDiscr.cxx:448
 AtlSgTop_tChannelMemDiscr.cxx:449
 AtlSgTop_tChannelMemDiscr.cxx:450
 AtlSgTop_tChannelMemDiscr.cxx:451
 AtlSgTop_tChannelMemDiscr.cxx:452
 AtlSgTop_tChannelMemDiscr.cxx:453
 AtlSgTop_tChannelMemDiscr.cxx:454
 AtlSgTop_tChannelMemDiscr.cxx:455
 AtlSgTop_tChannelMemDiscr.cxx:456
 AtlSgTop_tChannelMemDiscr.cxx:457
 AtlSgTop_tChannelMemDiscr.cxx:458
 AtlSgTop_tChannelMemDiscr.cxx:459
 AtlSgTop_tChannelMemDiscr.cxx:460
 AtlSgTop_tChannelMemDiscr.cxx:461
 AtlSgTop_tChannelMemDiscr.cxx:462
 AtlSgTop_tChannelMemDiscr.cxx:463
 AtlSgTop_tChannelMemDiscr.cxx:464
 AtlSgTop_tChannelMemDiscr.cxx:465
 AtlSgTop_tChannelMemDiscr.cxx:466
 AtlSgTop_tChannelMemDiscr.cxx:467
 AtlSgTop_tChannelMemDiscr.cxx:468
 AtlSgTop_tChannelMemDiscr.cxx:469
 AtlSgTop_tChannelMemDiscr.cxx:470
 AtlSgTop_tChannelMemDiscr.cxx:471
 AtlSgTop_tChannelMemDiscr.cxx:472
 AtlSgTop_tChannelMemDiscr.cxx:473
 AtlSgTop_tChannelMemDiscr.cxx:474
 AtlSgTop_tChannelMemDiscr.cxx:475
 AtlSgTop_tChannelMemDiscr.cxx:476
 AtlSgTop_tChannelMemDiscr.cxx:477
 AtlSgTop_tChannelMemDiscr.cxx:478
 AtlSgTop_tChannelMemDiscr.cxx:479
 AtlSgTop_tChannelMemDiscr.cxx:480
 AtlSgTop_tChannelMemDiscr.cxx:481
 AtlSgTop_tChannelMemDiscr.cxx:482
 AtlSgTop_tChannelMemDiscr.cxx:483
 AtlSgTop_tChannelMemDiscr.cxx:484
 AtlSgTop_tChannelMemDiscr.cxx:485
 AtlSgTop_tChannelMemDiscr.cxx:486
 AtlSgTop_tChannelMemDiscr.cxx:487
 AtlSgTop_tChannelMemDiscr.cxx:488
 AtlSgTop_tChannelMemDiscr.cxx:489
 AtlSgTop_tChannelMemDiscr.cxx:490
 AtlSgTop_tChannelMemDiscr.cxx:491
 AtlSgTop_tChannelMemDiscr.cxx:492
 AtlSgTop_tChannelMemDiscr.cxx:493
 AtlSgTop_tChannelMemDiscr.cxx:494
 AtlSgTop_tChannelMemDiscr.cxx:495
 AtlSgTop_tChannelMemDiscr.cxx:496
 AtlSgTop_tChannelMemDiscr.cxx:497
 AtlSgTop_tChannelMemDiscr.cxx:498
 AtlSgTop_tChannelMemDiscr.cxx:499
 AtlSgTop_tChannelMemDiscr.cxx:500
 AtlSgTop_tChannelMemDiscr.cxx:501
 AtlSgTop_tChannelMemDiscr.cxx:502
 AtlSgTop_tChannelMemDiscr.cxx:503
 AtlSgTop_tChannelMemDiscr.cxx:504
 AtlSgTop_tChannelMemDiscr.cxx:505
 AtlSgTop_tChannelMemDiscr.cxx:506
 AtlSgTop_tChannelMemDiscr.cxx:507
 AtlSgTop_tChannelMemDiscr.cxx:508
 AtlSgTop_tChannelMemDiscr.cxx:509
 AtlSgTop_tChannelMemDiscr.cxx:510
 AtlSgTop_tChannelMemDiscr.cxx:511
 AtlSgTop_tChannelMemDiscr.cxx:512
 AtlSgTop_tChannelMemDiscr.cxx:513
 AtlSgTop_tChannelMemDiscr.cxx:514
 AtlSgTop_tChannelMemDiscr.cxx:515
 AtlSgTop_tChannelMemDiscr.cxx:516
 AtlSgTop_tChannelMemDiscr.cxx:517
 AtlSgTop_tChannelMemDiscr.cxx:518
 AtlSgTop_tChannelMemDiscr.cxx:519
 AtlSgTop_tChannelMemDiscr.cxx:520
 AtlSgTop_tChannelMemDiscr.cxx:521
 AtlSgTop_tChannelMemDiscr.cxx:522
 AtlSgTop_tChannelMemDiscr.cxx:523
 AtlSgTop_tChannelMemDiscr.cxx:524
 AtlSgTop_tChannelMemDiscr.cxx:525
 AtlSgTop_tChannelMemDiscr.cxx:526
 AtlSgTop_tChannelMemDiscr.cxx:527
 AtlSgTop_tChannelMemDiscr.cxx:528
 AtlSgTop_tChannelMemDiscr.cxx:529
 AtlSgTop_tChannelMemDiscr.cxx:530
 AtlSgTop_tChannelMemDiscr.cxx:531
 AtlSgTop_tChannelMemDiscr.cxx:532
 AtlSgTop_tChannelMemDiscr.cxx:533
 AtlSgTop_tChannelMemDiscr.cxx:534
 AtlSgTop_tChannelMemDiscr.cxx:535
 AtlSgTop_tChannelMemDiscr.cxx:536
 AtlSgTop_tChannelMemDiscr.cxx:537
 AtlSgTop_tChannelMemDiscr.cxx:538
 AtlSgTop_tChannelMemDiscr.cxx:539
 AtlSgTop_tChannelMemDiscr.cxx:540
 AtlSgTop_tChannelMemDiscr.cxx:541
 AtlSgTop_tChannelMemDiscr.cxx:542
 AtlSgTop_tChannelMemDiscr.cxx:543
 AtlSgTop_tChannelMemDiscr.cxx:544
 AtlSgTop_tChannelMemDiscr.cxx:545
 AtlSgTop_tChannelMemDiscr.cxx:546
 AtlSgTop_tChannelMemDiscr.cxx:547
 AtlSgTop_tChannelMemDiscr.cxx:548
 AtlSgTop_tChannelMemDiscr.cxx:549
 AtlSgTop_tChannelMemDiscr.cxx:550
 AtlSgTop_tChannelMemDiscr.cxx:551
 AtlSgTop_tChannelMemDiscr.cxx:552
 AtlSgTop_tChannelMemDiscr.cxx:553
 AtlSgTop_tChannelMemDiscr.cxx:554
 AtlSgTop_tChannelMemDiscr.cxx:555
 AtlSgTop_tChannelMemDiscr.cxx:556
 AtlSgTop_tChannelMemDiscr.cxx:557
 AtlSgTop_tChannelMemDiscr.cxx:558
 AtlSgTop_tChannelMemDiscr.cxx:559
 AtlSgTop_tChannelMemDiscr.cxx:560
 AtlSgTop_tChannelMemDiscr.cxx:561
 AtlSgTop_tChannelMemDiscr.cxx:562
 AtlSgTop_tChannelMemDiscr.cxx:563
 AtlSgTop_tChannelMemDiscr.cxx:564
 AtlSgTop_tChannelMemDiscr.cxx:565
 AtlSgTop_tChannelMemDiscr.cxx:566
 AtlSgTop_tChannelMemDiscr.cxx:567
 AtlSgTop_tChannelMemDiscr.cxx:568
 AtlSgTop_tChannelMemDiscr.cxx:569
 AtlSgTop_tChannelMemDiscr.cxx:570
 AtlSgTop_tChannelMemDiscr.cxx:571
 AtlSgTop_tChannelMemDiscr.cxx:572
 AtlSgTop_tChannelMemDiscr.cxx:573
 AtlSgTop_tChannelMemDiscr.cxx:574
 AtlSgTop_tChannelMemDiscr.cxx:575
 AtlSgTop_tChannelMemDiscr.cxx:576
 AtlSgTop_tChannelMemDiscr.cxx:577
 AtlSgTop_tChannelMemDiscr.cxx:578
 AtlSgTop_tChannelMemDiscr.cxx:579
 AtlSgTop_tChannelMemDiscr.cxx:580
 AtlSgTop_tChannelMemDiscr.cxx:581
 AtlSgTop_tChannelMemDiscr.cxx:582
 AtlSgTop_tChannelMemDiscr.cxx:583
 AtlSgTop_tChannelMemDiscr.cxx:584
 AtlSgTop_tChannelMemDiscr.cxx:585
 AtlSgTop_tChannelMemDiscr.cxx:586
 AtlSgTop_tChannelMemDiscr.cxx:587
 AtlSgTop_tChannelMemDiscr.cxx:588
 AtlSgTop_tChannelMemDiscr.cxx:589
 AtlSgTop_tChannelMemDiscr.cxx:590
 AtlSgTop_tChannelMemDiscr.cxx:591
 AtlSgTop_tChannelMemDiscr.cxx:592
 AtlSgTop_tChannelMemDiscr.cxx:593
 AtlSgTop_tChannelMemDiscr.cxx:594
 AtlSgTop_tChannelMemDiscr.cxx:595
 AtlSgTop_tChannelMemDiscr.cxx:596
 AtlSgTop_tChannelMemDiscr.cxx:597
 AtlSgTop_tChannelMemDiscr.cxx:598
 AtlSgTop_tChannelMemDiscr.cxx:599
 AtlSgTop_tChannelMemDiscr.cxx:600
 AtlSgTop_tChannelMemDiscr.cxx:601
 AtlSgTop_tChannelMemDiscr.cxx:602
 AtlSgTop_tChannelMemDiscr.cxx:603
 AtlSgTop_tChannelMemDiscr.cxx:604
 AtlSgTop_tChannelMemDiscr.cxx:605
 AtlSgTop_tChannelMemDiscr.cxx:606
 AtlSgTop_tChannelMemDiscr.cxx:607
 AtlSgTop_tChannelMemDiscr.cxx:608
 AtlSgTop_tChannelMemDiscr.cxx:609
 AtlSgTop_tChannelMemDiscr.cxx:610
 AtlSgTop_tChannelMemDiscr.cxx:611
 AtlSgTop_tChannelMemDiscr.cxx:612
 AtlSgTop_tChannelMemDiscr.cxx:613
 AtlSgTop_tChannelMemDiscr.cxx:614
 AtlSgTop_tChannelMemDiscr.cxx:615
 AtlSgTop_tChannelMemDiscr.cxx:616
 AtlSgTop_tChannelMemDiscr.cxx:617
 AtlSgTop_tChannelMemDiscr.cxx:618
 AtlSgTop_tChannelMemDiscr.cxx:619
 AtlSgTop_tChannelMemDiscr.cxx:620
 AtlSgTop_tChannelMemDiscr.cxx:621
 AtlSgTop_tChannelMemDiscr.cxx:622
 AtlSgTop_tChannelMemDiscr.cxx:623
 AtlSgTop_tChannelMemDiscr.cxx:624
 AtlSgTop_tChannelMemDiscr.cxx:625
 AtlSgTop_tChannelMemDiscr.cxx:626
 AtlSgTop_tChannelMemDiscr.cxx:627
 AtlSgTop_tChannelMemDiscr.cxx:628
 AtlSgTop_tChannelMemDiscr.cxx:629
 AtlSgTop_tChannelMemDiscr.cxx:630
 AtlSgTop_tChannelMemDiscr.cxx:631
 AtlSgTop_tChannelMemDiscr.cxx:632
 AtlSgTop_tChannelMemDiscr.cxx:633
 AtlSgTop_tChannelMemDiscr.cxx:634
 AtlSgTop_tChannelMemDiscr.cxx:635
 AtlSgTop_tChannelMemDiscr.cxx:636
 AtlSgTop_tChannelMemDiscr.cxx:637
 AtlSgTop_tChannelMemDiscr.cxx:638
 AtlSgTop_tChannelMemDiscr.cxx:639
 AtlSgTop_tChannelMemDiscr.cxx:640
 AtlSgTop_tChannelMemDiscr.cxx:641
 AtlSgTop_tChannelMemDiscr.cxx:642
 AtlSgTop_tChannelMemDiscr.cxx:643
 AtlSgTop_tChannelMemDiscr.cxx:644