// Systematic arrays int isyst(0); char *ename[15]; double nps_low[15], nps_high[15], lowsigma[15], highsigma[15]; TH1 *lowshape[15], *highshape[15]; // Scaling double sfact(1.); // Null and test hypothesis csm_model* nullhyp = new csm_model(); csm_model* testhyp = new csm_model(); // Histograms, signal(0) + bkg(>0), with systematics (2nd index) TH1* data_hist; TH1D* histo[12][15]; cout << "Reading histos ..." << endl; std::vector samples; samples.push_back("H2l2tau300"); samples.push_back("ZZ"); samples.push_back("Zee"); samples.push_back("Zmumu"); samples.push_back("Ttbar"); // Might have trouble with data if expects integer number of events int nsamples(samples.size()); for (int isample(0); isample < nsamples; isample++) { TFile* file = new TFile(TString(samples.at(isample).c_str()) + ".1tau3l.Hists.root"); histo[isample][isyst] = (TH1D*) file->Get("HMass"); // Data = sum of backgrounds if (isample == 1) data_hist = (TH1D*) histo[isample][isyst]->Clone(); else if (isample > 1) data_hist->Add(histo[isample][isyst]); } // Scale float scale = 1.; //1/10.; histo[0][0]->Scale(scale); histo[1][0]->Scale(scale); histo[2][0]->Scale(scale); histo[3][0]->Scale(scale); histo[4][0]->Scale(scale); data_hist->Scale(scale); cout <<"H2l2tau sum " <GetSumOfWeights() <GetSumOfWeights() <GetSumOfWeights() <GetSumOfWeights() <GetSumOfWeights() <GetSumOfWeights() <add_template(histo[1][0],sfact,0,ename,nps_low,nps_high, lowshape,lowsigma,highshape,highsigma,0,0,"hzzllbb"); testhyp->add_template(histo[1][0],sfact,0,ename,nps_low,nps_high, lowshape,lowsigma,highshape,highsigma,0,0,"hzzllbb"); // ---------------------------------------------------------------------------- // Zee // ---------------------------------------------------------------------------- cout << "Zee background ... " << endl; // Zero systs for(int i(0);i<15;i++) { nps_low[i] = 0; nps_high[i] = 0; lowsigma[i] = 0; highsigma[i] = 0; lowshape[i] = 0; highshape[i] = 0; } nullhyp->add_template(histo[2][0],sfact,0,ename,nps_low,nps_high, lowshape,lowsigma,highshape,highsigma,0,0,"hzzllbb"); testhyp->add_template(histo[2][0],sfact,0,ename,nps_low,nps_high, lowshape,lowsigma,highshape,highsigma,0,0,"hzzllbb"); // ---------------------------------------------------------------------------- // Zmumu // ---------------------------------------------------------------------------- cout << "Zmumu background ... " << endl; // Zero systs for(int i(0);i<15;i++) { nps_low[i] = 0; nps_high[i] = 0; lowsigma[i] = 0; highsigma[i] = 0; lowshape[i] = 0; highshape[i] = 0; } nullhyp->add_template(histo[3][0],sfact,0,ename,nps_low,nps_high, lowshape,lowsigma,highshape,highsigma,0,0,"hzzllbb"); testhyp->add_template(histo[3][0],sfact,0,ename,nps_low,nps_high, lowshape,lowsigma,highshape,highsigma,0,0,"hzzllbb"); // ---------------------------------------------------------------------------- // TTbar // ---------------------------------------------------------------------------- cout << "Ttbar background ... " << endl; // Zero systs for(int i(0);i<15;i++) { nps_low[i] = 0; nps_high[i] = 0; lowsigma[i] = 0; highsigma[i] = 0; lowshape[i] = 0; highshape[i] = 0; } nullhyp->add_template(histo[4][0],sfact,0,ename,nps_low,nps_high, lowshape,lowsigma,highshape,highsigma,0,0,"hzzllbb"); testhyp->add_template(histo[4][0],sfact,0,ename,nps_low,nps_high, lowshape,lowsigma,highshape,highsigma,0,0,"hzzllbb"); // ---------------------------------------------------------------------------- // H2l2tau // ---------------------------------------------------------------------------- cout << "H2l2tau signal ..." << endl; // Zero systs for(int i(0);i<15;i++) { nps_low[i] = 0; nps_high[i] = 0; lowsigma[i] = 0; highsigma[i] = 0; lowshape[i] = 0; highshape[i] = 0; } // Only add signal to test hypothesis testhyp->add_template(histo[0][0],sfact,0,ename,nps_low,nps_high, lowshape,lowsigma,highshape,highsigma,0,1,"hzzllbb"); // Use the same hypotheses in the ensemble as in the fit csm_model* nullhyp_pe = nullhyp->Clone(); csm_model* testhyp_pe = testhyp->Clone(); nullhyp->set_interpolation_style("hzzllbb",CSM_INTERP_VERTICAL); //CSM_INTERP_HORIZONTAL); nullhyp_pe->set_interpolation_style("hzzllbb",CSM_INTERP_VERTICAL); //CSM_INTERP_HORIZONTAL); testhyp->set_interpolation_style("hzzllbb",CSM_INTERP_VERTICAL); //CSM_INTERP_HORIZONTAL); testhyp_pe->set_interpolation_style("hzzllbb",CSM_INTERP_VERTICAL); //CSM_INTERP_HORIZONTAL); cout << "end of templates" << endl;