#include #include #include #include #include #include #include #include "TMath.h" #include "TChain.h" #include "TFile.h" #include "TTree.h" #include "TLatex.h" #include "TString.h" #include "TObjString.h" #include #include #include #include #include "TSystem.h" #include "TROOT.h" #include "TMVA/Factory.h" #include "TMVA/DataLoader.h" #include "TMVA/Reader.h" #include "TMVA/Tools.h" #include "TMVA/MethodCuts.h" #include "TMVA/TMVAGui.h" using namespace std; using namespace TMVA; /*--------------------------------------------------------------------------* * Significance Function for Minuit Analysis * *--------------------------------------------------------------------------*/ // fcn passes back f = chi, the function to be minimized. void fcn(int nvars, double* deriv, double f, double par[], int flag) { TString sigFilename = "hhttbb.root"; TString bckFilename[] = {"ttbar_new.root", "Ztautau.root", "ZtautauB.root", "ZtautauC.root", "ZtautauL.root"}; TString TupleName = "CxAODTuple_Nominal"; const int nBackgrounds = 5; // Get the TTree objects from files TFile* siginputfile = new TFile(sigFilename); TTree* sigTree = (TTree*)siginputfile->Get(TupleName); // Get the TTree objects from files TFile* bckinputfile[nBackgrounds]; TTree* bckTree[nBackgrounds]; for ( int i=0 ; iGet(TupleName); } TString varsName[] = {"mBB", "mMMC","mHH", "drBB", "drLepTau", "mtLepMet"}; double sf[] = {1e-3, 1., 1e-3, 1., 1., 1e-3}; const int nSig = sigTree->GetEntries(); int nBck[nBackgrounds]; for ( int i=0 ; iGetEntries(); } // set address of variable to cut over TString SVN = "SelVars_Nominal_"; float var[nvars], weight; sigTree->SetBranchAddress("EventWeight_Nominal_TotalWeight", &weight); for ( int i=0 ; iSetBranchAddress(SVN + varsName[i], &var[i]); } for ( int i=0 ; iSetBranchAddress("EventWeight_Nominal_TotalWeight", &weight); for ( int j=0 ; jSetBranchAddress(SVN + varsName[j], &var[j]); } } double cutVals[nvars][2]; for ( int i=0 ; iGetEvent(i); bool pass = true; for ( int k=0 ; k cutVals[k][1]/sf[k] ) { pass = false;} } if ( pass == true ) { sigCount += weight; } sigTotalWeight += weight; } // get the background events for each cut // get the background events for each cut double bckCount[nBackgrounds]; for( int i=0 ; iGetEvent(j); bool pass = true; for ( int l=0 ; l cutVals[l][1]/sf[l] ) { pass = false; } } if ( pass == true ) { bckCount[i] += weight; } bckTotalWeight[i] += weight; } } // find the significance value double s = sigCount/sigTotalWeight; double b = 0.; for ( int j=0 ; j