int main( int argc, char* argv[] ) { runName = "test_10"; if( argc>1 ) { std::string runName_str(argv[1]); runName = runName_str; } std::string fileName = "PosAn_" + runName + ".root"; TFile* file = TFile::Open( fileName.c_str() ); std::cout << "-> Opened file: " << fileName << std::endl; std::string outputdir = "Plots_" + runName; std::string mkdir_command = "mkdir -p " + outputdir; system(mkdir_command.c_str()); TStyle* style = DrawTools::setStyle(); style->cd(); drawSinglePositionPlot( outputdir, file, runName, "" ); drawSinglePositionPlot( outputdir, file, runName, "_singleEle" ); //drawSinglePlot( outputdir, "cef3_spectrum" , file, "cef3" , "ADC Counts", 4, 0., 3500., 10, true ); //drawSinglePlot( outputdir, "cef3_corr_spectrum" , file, "cef3_corr", "ADC Counts", 4, 0., 3500., 10, true ); drawSinglePlot( outputdir, "cef3_spectrum_lin" , file, "cef3" , "ADC Counts", 4, 0., 3500., 10, false ); drawSinglePlot( outputdir, "cef3_corr_spectrum_lin" , file, "cef3_corr", "ADC Counts", 4, 0., 3500., 10, false ); return 0; }
void draw2ndJet(const std::string& fileName) { TStyle *simpleStyle = new TStyle("simpleStyle",""); simpleStyle->SetCanvasColor(0); simpleStyle->SetFrameFillColor(0); simpleStyle->SetStatColor(0); simpleStyle->SetOptStat(0); simpleStyle->SetTitleFillColor(0); simpleStyle->SetCanvasBorderMode(0); simpleStyle->SetPadBorderMode(0); simpleStyle->SetFrameBorderMode(0); simpleStyle->cd(); int nBins_pt = 23; for( int i=0; i<(nBins_pt-1); ++i) { drawSinglePtBin(fileName, i, "reco"); drawSinglePtBin(fileName, i, "gen"); drawSinglePtBin(fileName, i, "recoRel"); drawSinglePtBin(fileName, i, "genRel"); } }
void drawTracks() { TStyle *simpleStyle = new TStyle("simpleStyle",""); simpleStyle->SetCanvasColor(0); simpleStyle->SetFrameFillColor(0); simpleStyle->SetStatColor(0); simpleStyle->SetOptStat(0); simpleStyle->SetTitleFillColor(0); simpleStyle->SetCanvasBorderMode(0); simpleStyle->SetPadBorderMode(0); simpleStyle->SetFrameBorderMode(0); simpleStyle->cd(); TFile* dataFile = TFile::Open("Runs_123592_123596_123615_123732/output_1.root"); TTree* dataTree = (TTree*)dataFile->Get("myanalysis/pippo"); TFile* mcFile = TFile::Open("MC_MinBias_900GeV/output_12.root"); TTree* mcTree = (TTree*)dataFile->Get("myanalysis/pippo"); std::cout << "1" << std::endl; Int_t nEventTracks_data; dataTree->SetBranchAddress("nEventTracks", &nEventTracks_data); Int_t nChargedHadrons_data; dataTree->SetBranchAddress("nChargedHadrons", &nChargedHadrons_data); std::cout << "2" << std::endl; Int_t nEventTracks_mc; mcTree->SetBranchAddress("nEventTracks", &nEventTracks_mc); Int_t nChargedHadrons_mc; mcTree->SetBranchAddress("nChargedHadrons", &nChargedHadrons_mc); std::cout << "3" << std::endl; TH1F* h1_data = new TH1F("data", "", 100, 0., 100.); h1_data->SetMarkerStyle(20); TH1F* h1_mc = new TH1F("mc", "", 100, 0., 100.); h1_mc->SetFillColor(kGray); std::cout << "4" << std::endl; for( int iEntry=0; iEntry<dataTree->GetEntries(); ++iEntry) { dataTree->GetEntry(iEntry); Float_t trackRatio = (nChargedHadrons_data>0) ? (Float_t)(nEventTracks_data/nChargedHadrons_data) : 0.; h1_data->Fill( trackRatio ); } std::cout << "5" << std::endl; for( int iEntry=0; iEntry<mcTree->GetEntries(); ++iEntry) { Float_t trackRatio = (nChargedHadrons_mc>0) ? (Float_t)(nEventTracks_mc/nChargedHadrons_mc) : 0.; h1_mc->Fill( trackRatio ); } std::cout << "6" << std::endl; TCanvas* c1 = new TCanvas("c1", "c1", 800, 600); c1->cd(); h1_data->Draw("E"); h1_mc->Draw("histo same"); c1->SaveAs("tracks.eps"); }
void PlotHistsNhitsPerModule(TFile* f, TTree* tr, TString strMillepedeRes, TString strOutdir) { TString canvName="c_"; canvName+=strMillepedeRes; canvName+="_"; canvName+=StrPlotType(NHITS); canvName.ReplaceAll(".res",""); //enum {PXB,PXF,TIB,TID,TOB,TEC}; int colors[6]={1,2,3,4,6,7}; // TString labels[6]={"PXB","PXF","TIB","TID","TOB","TEC"}; f->cd(); TCanvas* canv = new TCanvas(canvName,canvName,600,600); canv->SetLogx(); canv->SetLogy(); for (int ind=1; ind<=1; ind++){ TString strHist = "hNhits_"; strHist+=StrPar(ind); TString strCut="label<700000 && ((label%20-1)%9+1)=="; strCut+=ind; TStyle style; style.SetTitleFontSize(0.2); THStack *hSt = new THStack("hNhits","# of derivatives (~tracks or hits) per module"); TLegend *leg = new TLegend(0.75,0.65,0.95,0.95); for (int inv=0; inv<6; inv++){ std::cout<<"- - - - - -"<<std::endl; std::cout<<subdLabels[inv]<<":"<<std::endl; std::cout<<StrCutSubd(inv)<<": "<<tr->GetEntries(StrCutSubd(inv))<<" parameters"<<std::endl; TString strHist1=strHist; strHist1+=ind; strHist1+=inv; TH1F* hValInt = new TH1F(strHist1,strHist1,300,10,15000); TString strCut1 = strCut+TString(" && ")+StrCutSubd(inv); tr->Draw(TString("Nhits>>")+strHist1,strCut1,"goff"); std::cout<<"# hits = "<<(int)hValInt->GetMean()<<"+-"<<(int)hValInt->GetRMS()<<std::endl; hValInt->SetLineColor(1); hValInt->SetFillColor(colors[inv]); hValInt->SetLineWidth(2); hSt->Add(hValInt); leg->AddEntry(hValInt,subdLabels[inv],"f"); leg->SetFillColor(0); } hSt->Draw(); leg->Draw("same"); }//end of loop over ind canvName+=".png"; TString saveName=strOutdir+canvName; canv->SaveAs(saveName); saveName.ReplaceAll(".png",".pdf"); canv->SaveAs(saveName); }//end of PlotHistsNhitsPerModule
void drawPtSpectrum() { TStyle *simpleStyle = new TStyle("simpleStyle",""); simpleStyle->SetCanvasColor(0); simpleStyle->SetFrameFillColor(0); simpleStyle->SetStatColor(0); simpleStyle->SetOptStat(0); simpleStyle->SetTitleFillColor(0); simpleStyle->SetCanvasBorderMode(0); simpleStyle->SetPadBorderMode(0); simpleStyle->SetFrameBorderMode(0); simpleStyle->cd(); TChain* chain = new TChain("jetTree"); chain->Add("2ndLevelOutputFile_PhotonJet15.root"); chain->Add("2ndLevelOutputFile_PhotonJet30.root"); chain->Add("2ndLevelOutputFile_PhotonJet80.root"); chain->Add("2ndLevelOutputFile_PhotonJet170.root"); chain->Add("2ndLevelOutputFile_PhotonJet300.root"); chain->Add("2ndLevelOutputFile_PhotonJet470.root"); chain->Add("2ndLevelOutputFile_PhotonJet800.root"); Float_t eventWeight; chain->SetBranchAddress("eventWeight", &eventWeight); Float_t ptHat; chain->SetBranchAddress("ptHat", &ptHat); TH1F* h1_ptSpectrum = new TH1F("ptSpectrum", "", 100, 0., 1000.); h1_ptSpectrum->SetXTitle("#hat{p}_{T} [GeV/c]"); h1_ptSpectrum->SetMarkerStyle(20); h1_ptSpectrum->SetMarkerSize(1.4); Int_t nEntries = chain->GetEntries(); for( Int_t iEntry = 0; iEntry<nEntries; ++iEntry) { if( (iEntry%100000) == 0 ) std::cout << "Entry: " << iEntry << "/" << nEntries << std::endl; chain->GetEntry(iEntry); h1_ptSpectrum->Fill(ptHat, eventWeight); } TCanvas* c1 = new TCanvas("c1", "c1", 800, 600); c1->cd(); c1->SetLogy(); h1_ptSpectrum->Draw("P"); c1->SaveAs("ptSpectrum.eps"); }
MWLPlot() { _legendTextSize = 0.048; _axisLabelSize = 0.08; _titleOffset = 1.4; TStyle *ls = LatinoStyle(); ls->SetCanvasDefH (794); ls->SetTitleFontSize (0.045); ls->SetTitleY (0.830); }
void placeholder(TString saveas,Bool_t wide) { TStyle *tdrStyle = setTDRStyle(); if (wide) tdrStyle->SetCanvasDefW(678); TText *line1 = new TText(.5,.6,"This is a placeholder so that when there are"); TText *line2 = new TText(.5,.4,"4 plots per line it lines up nicely"); line1->SetTextAlign(22); line2->SetTextAlign(22); TCanvas *c1 = TCanvas::MakeDefCanvas(); line1->Draw(); line2->Draw(); if (saveas != "") saveplot(c1,saveas); }
void drawRxResolutions(const std::string& dataset) { TStyle *simpleStyle = new TStyle("simpleStyle",""); simpleStyle->SetCanvasColor(0); simpleStyle->SetFrameFillColor(0); simpleStyle->SetStatColor(0); simpleStyle->SetOptStat(0); simpleStyle->SetTitleFillColor(0); simpleStyle->SetCanvasBorderMode(0); simpleStyle->SetPadBorderMode(0); simpleStyle->SetFrameBorderMode(0); simpleStyle->cd(); bool logScale=true; drawResolution(dataset, "Ech"); drawResolution(dataset, "Egamma"); drawResolution(dataset, "Egammanh"); //drawResolution(dataset, "Ee"); drawResolution(dataset, "Enh", logScale); }
void drawProjections() { TStyle *simpleStyle = new TStyle("simpleStyle",""); simpleStyle->SetCanvasColor(0); simpleStyle->SetFrameFillColor(0); simpleStyle->SetStatColor(0); simpleStyle->SetOptStat(0); simpleStyle->SetTitleFillColor(0); simpleStyle->SetCanvasBorderMode(0); simpleStyle->SetPadBorderMode(0); simpleStyle->SetFrameBorderMode(0); simpleStyle->cd(); draw("PFItCone5_barrel"); draw("PFItCone5_endcap"); draw("caloItCone5_barrel"); draw("caloItCone5_endcap"); draw("Rch90_100_endcap"); }
int main( int argc, char* argv[] ) { runName = "test_10"; if( argc>1 ) { std::string runName_str(argv[1]); runName = runName_str; } std::string tag = "V02"; if( argc>2 ) { std::string tag_str(argv[2]); tag = tag_str; } std::string fileName = "PosAnTrees_" + tag + "/PosAn_" + runName + ".root"; TFile* file = TFile::Open( fileName.c_str() ); std::cout << "-> Opened file: " << fileName << std::endl; std::string outputdir = "Plots_" + runName + "_" + tag; std::string mkdir_command = "mkdir -p " + outputdir; system(mkdir_command.c_str()); TStyle* style = DrawTools::setStyle(); style->cd(); drawSinglePositionPlot( outputdir, file, runName, "" ); drawSinglePositionPlot( outputdir, file, runName, "_singleEle" ); drawPositionResolutionXY( outputdir, file, runName, "bgo", "Beam" ); return 0; }
void SetTMVAStyle() { TStyle *TMVAStyle = gROOT->GetStyle("TMVA"); if(TMVAStyle!=0) { gROOT->SetStyle("TMVA"); return; } TMVAStyle = new TStyle(*gROOT->GetStyle("Plain")); // our style is based on Plain TMVAStyle->SetName("TMVA"); TMVAStyle->SetTitle("TMVA style based on \"Plain\" with modifications defined in tmvaglob.C"); gROOT->GetListOfStyles()->Add(TMVAStyle); gROOT->SetStyle("TMVA"); TMVAStyle->SetLineStyleString( 5, "[52 12]" ); TMVAStyle->SetLineStyleString( 6, "[22 12]" ); TMVAStyle->SetLineStyleString( 7, "[22 10 7 10]" ); // the pretty color palette of old TMVAStyle->SetPalette((UsePaperStyle ? 18 : 1),0); // use plain black on white colors TMVAStyle->SetFrameBorderMode(0); TMVAStyle->SetCanvasBorderMode(0); TMVAStyle->SetPadBorderMode(0); TMVAStyle->SetPadColor(0); TMVAStyle->SetFillStyle(0); TMVAStyle->SetLegendBorderSize(0); // title properties // TMVAStyle->SetTitleW(.4); // TMVAStyle->SetTitleH(.10); // MVAStyle->SetTitleX(.5); // TMVAStyle->SetTitleY(.9); TMVAStyle->SetTitleFillColor( c_TitleBox ); TMVAStyle->SetTitleTextColor( c_TitleText ); TMVAStyle->SetTitleBorderSize( 1 ); TMVAStyle->SetLineColor( c_TitleBorder ); if (!UsePaperStyle) { TMVAStyle->SetFrameFillColor( c_FrameFill ); TMVAStyle->SetCanvasColor( c_Canvas ); } // set the paper & margin sizes TMVAStyle->SetPaperSize(20,26); TMVAStyle->SetPadTopMargin(0.10); TMVAStyle->SetPadRightMargin(0.05); TMVAStyle->SetPadBottomMargin(0.11); TMVAStyle->SetPadLeftMargin(0.12); // use bold lines and markers TMVAStyle->SetMarkerStyle(21); TMVAStyle->SetMarkerSize(0.3); TMVAStyle->SetHistLineWidth(2); TMVAStyle->SetLineStyleString(2,"[12 12]"); // postscript dashes // do not display any of the standard histogram decorations TMVAStyle->SetOptTitle(1); TMVAStyle->SetTitleH(0.052); TMVAStyle->SetOptStat(0); TMVAStyle->SetOptFit(0); // put tick marks on top and RHS of plots TMVAStyle->SetPadTickX(1); TMVAStyle->SetPadTickY(1); }
// tdrGrid: Turns the grid lines on (true) or off (false) void tdrGrid(bool gridOn) { TStyle *tdrStyle = (TStyle*)gROOT->FindObject("tdrStyle"); assert(tdrStyle); tdrStyle->SetPadGridX(gridOn); tdrStyle->SetPadGridY(gridOn); }
void roc_plot(){ TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR"); // For the canvas: tdrStyle->SetCanvasBorderMode(0); tdrStyle->SetCanvasColor(kWhite); tdrStyle->SetCanvasDefH(600); //Height of canvas tdrStyle->SetCanvasDefW(600); //Width of canvas tdrStyle->SetCanvasDefX(0); //POsition on screen tdrStyle->SetCanvasDefY(0); // For the Pad: tdrStyle->SetPadBorderMode(0); tdrStyle->SetPadColor(kWhite); tdrStyle->SetPadGridX(true); tdrStyle->SetPadGridY(true); tdrStyle->SetGridColor(0); tdrStyle->SetGridStyle(3); tdrStyle->SetGridWidth(1); // For the frame: tdrStyle->SetFrameBorderMode(0); tdrStyle->SetFrameBorderSize(1); tdrStyle->SetFrameFillColor(0); tdrStyle->SetFrameFillStyle(0); tdrStyle->SetFrameLineColor(1); tdrStyle->SetFrameLineStyle(1); tdrStyle->SetFrameLineWidth(1); // For the histo: tdrStyle->SetHistLineColor(1); tdrStyle->SetHistLineStyle(0); tdrStyle->SetHistLineWidth(1); tdrStyle->SetEndErrorSize(2); tdrStyle->SetErrorX(0.); tdrStyle->SetMarkerStyle(20); //For the fit/function: tdrStyle->SetOptFit(1); tdrStyle->SetFitFormat("5.4g"); tdrStyle->SetFuncColor(2); tdrStyle->SetFuncStyle(1); tdrStyle->SetFuncWidth(1); //For the date: tdrStyle->SetOptDate(0); // For the statistics box: tdrStyle->SetOptFile(0); tdrStyle->SetOptStat("emr"); // To display the mean and RMS: SetOptStat("mr"); tdrStyle->SetStatColor(kWhite); tdrStyle->SetStatFont(42); tdrStyle->SetStatFontSize(0.025); tdrStyle->SetStatTextColor(1); tdrStyle->SetStatFormat("6.4g"); tdrStyle->SetStatBorderSize(1); tdrStyle->SetStatH(0.1); tdrStyle->SetStatW(0.15); // Margins: tdrStyle->SetPadTopMargin(0.05); tdrStyle->SetPadBottomMargin(0.13); tdrStyle->SetPadLeftMargin(0.13); tdrStyle->SetPadRightMargin(0.05); // For the Global title: tdrStyle->SetOptTitle(0); tdrStyle->SetTitleFont(42); tdrStyle->SetTitleColor(1); tdrStyle->SetTitleTextColor(1); tdrStyle->SetTitleFillColor(10); tdrStyle->SetTitleFontSize(0.05); // For the axis titles: tdrStyle->SetTitleColor(1, "XYZ"); tdrStyle->SetTitleFont(42, "XYZ"); tdrStyle->SetTitleSize(0.06, "XYZ"); tdrStyle->SetTitleXOffset(0.9); tdrStyle->SetTitleYOffset(1.05); // For the axis labels: tdrStyle->SetLabelColor(1, "XYZ"); tdrStyle->SetLabelFont(42, "XYZ"); tdrStyle->SetLabelOffset(0.007, "XYZ"); tdrStyle->SetLabelSize(0.05, "XYZ"); // For the axis: tdrStyle->SetAxisColor(1, "XYZ"); tdrStyle->SetStripDecimals(kTRUE); tdrStyle->SetTickLength(0.03, "XYZ"); tdrStyle->SetNdivisions(510, "XYZ"); tdrStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame tdrStyle->SetPadTickY(1); // Change for log plots: tdrStyle->SetOptLogx(0); tdrStyle->SetOptLogy(0); tdrStyle->SetOptLogz(0); // Postscript options: tdrStyle->SetPaperSize(20.,20.); tdrStyle->SetPalette(1); gROOT -> ForceStyle(); tdrStyle->cd(); gStyle->SetOptStat(0111); gStyle->SetOptFit(1111); int bkg = 787623.93; int sig = 9313.; const int n = 5; //minmet //Double_t cut[n] = {10,15,20,25,30,35,40,45,50,55} ; //pvalue //Double_t cut[n] = {0,0.5,1,1.5,2,2.5,3,3.5,4.0}; //metsig Double_t cut[n] = {5,10,15,20,25}; //minmet //Double_t sensitivity_bkg_n[n]={660142.26/bkg,551026.78/bkg,444547.21/bkg,354649.92/bkg,283093.63/bkg ,227934.73/bkg ,187564.23/bkg,158191.46/bkg,103089.49/bkg,68423.49/bkg}; //Double_t sensitivity_sig_n[n]={9274./sig ,9233./sig,9172./sig,9089./sig,8995./sig,8870./sig,8718./sig,8539./sig,7398./sig,6497./sig}; //pvalue //Double_t sensitivity_bkg_n[n]={787623.93/bkg,290416.84/bkg, 166165.65/bkg, 87792.43/bkg, 49447.43/bkg, 30536.76/bkg, 19869.09/bkg, 13705.00/bkg, 10075.21/bkg}; //Double_t sensitivity_sig_n[n]={9313./sig,9005./sig, 8499./sig,7547./sig,6508./sig,5579./sig,4832./sig,4213./sig,3649./sig}; //metsig Double_t sensitivity_bkg_n[n]={579088.98/bkg,94310.14/bkg, 13034.68/bkg,2503.93./bkg,756.13./bkg}; Double_t sensitivity_sig_n[n]={9045./sig,7492./sig,5899./sig,4654./sig,3726./sig}; sensitivity_bkg = new TGraph(n,cut,sensitivity_bkg_n); sensitivity_sig = new TGraph(n,cut,sensitivity_sig_n); //Double_t xdummy[2] = {10,55}; //Double_t xdummy[2] = {-0.1,3}; Double_t xdummy[2] = {0,25}; Double_t ydummy[2] = {0.0,1.0}; dummy = new TGraph(2,xdummy,ydummy); dummy->SetLineColor(0); dummy->SetLineWidth(0); dummy->SetMarkerColor(0); dummy->SetMarkerSize(0); dummy->Draw("AP*"); dummy->GetYaxis()->SetTitle("Efficiency"); //dummy->GetXaxis()->SetTitle("Minimized #slash{E}_{T} Cut [GeV]"); //dummy->GetXaxis()->SetTitle("|Log10(P_{#Chi^{2}})|"); dummy->GetXaxis()->SetTitle("Met Significance"); dummy->GetYaxis()->SetLabelSize(0.04); dummy->GetXaxis()->SetLabelSize(0.04); sensitivity_bkg->SetLineColor(2); sensitivity_bkg->SetMarkerColor(2); sensitivity_sig->SetLineColor(4); sensitivity_sig->SetMarkerColor(4); sensitivity_bkg->Draw("LPSame"); sensitivity_sig->Draw("LPSame"); //legend = new TLegend(.70,.70,.90,.90,"Final Selection e/#mu+jets"); legend = new TLegend(0.1845638,0.2027972,0.3674497,0.3024476,NULL,"brNDC"); legend->AddEntry(sensitivity_bkg, "#gamma + Jets", "lp"); legend->AddEntry(sensitivity_sig, "Z (#nu#nu) #gamma" , "lp"); legend->SetShadowColor(0); legend->SetFillColor(0); legend->SetLineColor(0); legend->Draw("Same"); latex2 = new TLatex(); latex2->SetNDC(); latex2->SetTextSize(0.04); latex2->SetTextAlign(31); latex2->DrawLatex(0.87, 0.96, "CMS Preliminary, #sqrt{s} = 8 TeV"); }
int main() { TH1::SetDefaultSumw2(1); //gROOT->SetBatch(1); if (gSystem->AccessPathName(plotdir)) gSystem->mkdir(plotdir); // Setup style cout << "Setting tdr style." << endl; TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR"); setTDRStyle(tdrStyle); tdrStyle->cd(); ttbar_ch = new TChain("reduced_tree"); qcd_ch = new TChain("reduced_tree"); znn_ch = new TChain("reduced_tree"); wjets_ch = new TChain("reduced_tree"); single_top_ch = new TChain("reduced_tree"); other_ch = new TChain("reduced_tree"); t1tttt_1500_100_ch = new TChain("reduced_tree"); t1tttt_1200_800_ch = new TChain("reduced_tree"); t1bbbb_1500_100_ch = new TChain("reduced_tree"); t1bbbb_1000_900_ch = new TChain("reduced_tree"); t1qqqq_1400_100_ch = new TChain("reduced_tree"); t1qqqq_1000_800_ch = new TChain("reduced_tree"); TFileCollection* ttbar_fc = new TFileCollection("ttbar_fc","","../../reduced_trees/tfcs/13TeV/Phys14/ttbar.txt"); TFileCollection* qcd_fc = new TFileCollection("qcd_fc","","../../reduced_trees/tfcs/13TeV/Phys14/qcd.txt"); TFileCollection* znn_fc = new TFileCollection("znn_fc","","../../reduced_trees/tfcs/13TeV/Phys14/znn.txt"); TFileCollection* wjets_fc = new TFileCollection("wjets_fc","","../../reduced_trees/tfcs/13TeV/Phys14/wjets.txt"); TFileCollection* single_top_fc = new TFileCollection("single_top_fc","","../../reduced_trees/tfcs/13TeV/Phys14/single_top.txt"); TFileCollection* other_fc = new TFileCollection("other_fc","","../../reduced_trees/tfcs/13TeV/Phys14/other.txt"); ttbar_ch->AddFileInfoList((TCollection*)ttbar_fc->GetList()); qcd_ch->AddFileInfoList((TCollection*)qcd_fc->GetList()); znn_ch->AddFileInfoList((TCollection*)znn_fc->GetList()); wjets_ch->AddFileInfoList((TCollection*)wjets_fc->GetList()); single_top_ch->AddFileInfoList((TCollection*)single_top_fc->GetList()); other_ch->AddFileInfoList((TCollection*)other_fc->GetList()); //ttbar_ch->Add("../../reduced_trees/13TeV/skimmed/TTJets*v77*.root"); //ttbar_ch->Add("../../reduced_trees/13TeV/skimmed/TTbar*v77*.root"); //ttbar_ch->Add("../../reduced_trees/13TeV/skimmed/TTW*v77*.root"); //ttbar_ch->Add("../../reduced_trees/13TeV/skimmed/TTZ*v77*.root"); // qcd_ch->Add("../../reduced_trees/13TeV/skimmed/QCD_HT*v77*.root"); // znn_ch->Add("../../reduced_trees/13TeV/skimmed/ZJets*v77*.root"); // wjets_ch->Add("../../reduced_trees/13TeV/skimmed/WJets*v77*.root"); // single_top_ch->Add("../../reduced_trees/13TeV/skimmed/TTo*v77*.root"); // single_top_ch->Add("../../reduced_trees/13TeV/skimmed/TBarTo*v77*.root"); // single_top_ch->Add("../../reduced_trees/13TeV/skimmed/*tW*v77*.root"); // other_ch->Add("../../reduced_trees/13TeV/skimmed/ZH*v77*.root"); // other_ch->Add("../../reduced_trees/13TeV/skimmed/WH*v77*.root"); t1tttt_1500_100_ch->Add("../../reduced_trees/13TeV/SMS-T1tttt_2J_mGl-1500_mLSP-100_Tune4C_13TeV-madgraph-tauola_Phys14DR-PU20bx25_tsg_PHYS14_25_V1-v1_MINIAODSIM_UCSB2299_v77/*.root"); t1tttt_1200_800_ch->Add("../../reduced_trees/13TeV/SMS-T1tttt_2J_mGl-1200_mLSP-800_Tune4C_13TeV-madgraph-tauola_Phys14DR-PU20bx25_tsg_PHYS14_25_V1-v1_MINIAODSIM_UCSB2301_v77/*.root"); t1bbbb_1500_100_ch->Add("../../reduced_trees/13TeV/SMS-T1bbbb_2J_mGl-1500_mLSP-100_Tune4C_13TeV-madgraph-tauola_Phys14DR-PU20bx25_tsg_PHYS14_25_V1-v1_MINIAODSIM_UCSB2300_v77/*.root"); t1bbbb_1000_900_ch->Add("../../reduced_trees/13TeV/SMS-T1bbbb_2J_mGl-1000_mLSP-900_Tune4C_13TeV-madgraph-tauola_Phys14DR-PU20bx25_tsg_PHYS14_25_V1-v1_MINIAODSIM_UCSB2288_v77/*.root"); t1qqqq_1400_100_ch->Add("../../reduced_trees/13TeV/SMS-T1qqqq_2J_mGl-1400_mLSP-100_Tune4C_13TeV-madgraph-tauola_Phys14DR-PU20bx25_tsg_PHYS14_25_V1-v1_MINIAODSIM_UCSB2302_v77/*.root"); t1qqqq_1000_800_ch->Add("../../reduced_trees/13TeV/SMS-T1qqqq_2J_mGl-1000_mLSP-800_Tune4C_13TeV-madgraph-tauola_Phys14DR-PU20bx25_tsg_PHYS14_25_V1-v1_MINIAODSIM_UCSB2303_v77/*.root"); cout << "Entries in chains..." << endl; cout << "t1tttt_1500_100 N=" << t1tttt_1500_100_ch->GetEntries() << endl; cout << "t1tttt_1200_800 N=" << t1tttt_1200_800_ch->GetEntries() << endl; cout << "t1bbbb_1500_100 N=" << t1bbbb_1500_100_ch->GetEntries() << endl; cout << "t1bbbb_1000_900 N=" << t1bbbb_1000_900_ch->GetEntries() << endl; cout << "t1qqqq_1400_100 N=" << t1qqqq_1400_100_ch->GetEntries() << endl; cout << "t1qqqq_1000_800 N=" << t1qqqq_1000_800_ch->GetEntries() << endl; cout << "ttbar N=" << ttbar_ch->GetEntries() << endl; cout << "qcd N=" << qcd_ch->GetEntries() << endl; cout << "znn N=" << znn_ch->GetEntries() << endl; cout << "wjets N=" << wjets_ch->GetEntries() << endl; cout << "single_top N=" << single_top_ch->GetEntries() << endl; cout << "other N=" << other_ch->GetEntries() << endl; // quick skim TCut baseline("mht30>200&&min_delta_phi_met_N>4&&num_reco_veto_muons==0&&num_reco_veto_electrons==0&&num_jets_pt30>=4&&ht30>500&&num_iso_tracks_pt15_mT==0"); TCut baseline_pre_tk("mht30>200&&min_delta_phi_met_N>4&&num_reco_veto_muons==0&&num_reco_veto_electrons==0&&num_jets_pt30>=4&&ht30>500"); TCut nj1("num_jets_pt30>=4&&num_jets_pt30<=6"), nj2("num_jets_pt30>=7&&num_jets_pt30<=8"), nj3("num_jets_pt30>=9"); TCut nb0("num_csvm_jets30==0"), nb1("num_csvm_jets30==1"), nb2("num_csvm_jets30==2"), nb3("num_csvm_jets30>=3"); TCut bgeq0("num_csvm_jets30>=0"), bgeq1("num_csvm_jets30>=1"), bgeq2("num_csvm_jets30>=2"), bgeq3("num_csvm_jets30>=3"); TCut mht1("mht30>200&&mht30<500"), mht2("mht30>500&&mht30<750"), mht3("mht30>750"); TCut ht1("ht30>500&&ht30<800"), ht2("ht30>800&&ht30<1200"), ht3("ht30>1200"); /*draw_from_trees(TString var, TCut other_cuts, TString weights, TString title, int nbinsx, double xlow, double xup, TString options="plotSig:plotLog:plotData", double cut_low=-1, double cut_high=-1, TString plot_title="default") */ // Baseline N-1 draw_from_trees("ht30","mht30>200&&num_reco_veto_muons==0&&num_reco_veto_electrons==0&&num_jets_pt30>=4&&min_delta_phi_met_N>4&&num_iso_tracks_pt15_mT==0","(weightppb*4000)", ";H_{T} [GeV];Events / 5 fb^{-1}", 20, 0, 4000., "plotSig:plotLog",-1,-1, "ht30_baseline_nm1_125"); draw_from_trees("mht30","ht30>500&&num_reco_veto_muons==0&&num_reco_veto_electrons==0&&num_jets_pt30>=4&&min_delta_phi_met_N>4&&num_iso_tracks_pt15_mT==0","(weightppb*4000)", ";H_{T}^{miss} [GeV];Events / 5 fb^{-1}", 30, 0, 1500., "plotSig:plotLog",-1,-1, "mht30_baseline_nm1_125"); draw_from_trees("min_delta_phi_met_N","mht30>200&&ht30>500&&num_reco_veto_muons==0&&num_reco_veto_electrons==0&&num_jets_pt30>=4&&num_iso_tracks_pt15_mT==0","(weightppb*4000)", ";#Delta#Phi^{min}_{N};Events / 20 fb^{-1}", 20, 0., 40, "plotSig:plotLog",-1,-1, "min_delta_phi_met_N_baseline_nm1_125"); draw_from_trees("num_reco_veto_electrons+num_reco_veto_muons","mht30>200&&ht30>500&&num_jets_pt30>=4&&min_delta_phi_met_N>4&&num_iso_tracks_pt15_mT==0","(weightppb*4000)", ";n_{e+#mu} (p_{T} > 10 GeV);Events / 5 fb^{-1}", 6, 0, 6, "plotSig:plotLog",-1,-1, "num_reco_veto_lepton_baseline_nm1_125"); draw_from_trees("num_iso_tracks_pt15_mT","mht30>200&&ht30>500&&num_jets_pt30>=4&&min_delta_phi_met_N>4&&num_reco_veto_muons==0&&num_reco_veto_electrons==0","(weightppb*4000)", ";n_{IsoTk} (p_{T} > 15 GeV);Events / 5 fb^{-1}", 6, 0, 6, "plotSig:plotLog",-1,-1, "num_iso_tracks_pt15_mT0_baseline_nm1_125"); draw_from_trees("num_jets_pt30","mht30>200&&ht30>500&&min_delta_phi_met_N>4&&num_reco_veto_muons==0&&num_reco_veto_electrons==0&&num_iso_tracks_pt15_mT==0","(weightppb*4000)", ";n_{jets} (p_{T} > 30 GeV);Events / 5 fb^{-1}", 15, 0, 15, "plotSig:plotLog",-1,-1, "num_jets_pt30_baseline_nm1_125"); draw_from_trees("num_csvm_jets30","mht30>200&&ht30>500&&num_jets_pt30>=4&&min_delta_phi_met_N>4&&num_reco_veto_muons==0&&num_reco_veto_electrons==0&&num_iso_tracks_pt15_mT==0","(weightppb*4000)", ";n_{CSVM} (p_{T} > 30 GeV);Events / 5 fb^{-1}", 6, 0, 6, "plotSig:plotLog",-1,-1, "num_csvm_jets30_baseline_nm1_125"); // Tracks and taus draw_from_trees("iso_track_mT",baseline_pre_tk+"iso_track_pt>0","(weightppb*4000)", ";m_{T} (IsoTk, E_{T}^{miss}) [GeV];Events / 5 fb^{-1}", 10, 0, 200, ":plotSig",100,-1, "iso_track_mT_120"); draw_from_trees("iso_track_mT",baseline_pre_tk+"iso_track_pt>0","(weightppb*4000)", ";m_{T} (IsoTk, E_{T}^{miss}) [GeV];Events / 5 fb^{-1}", 10, 0, 200, "plotLog:plotSig",100,-1, "iso_track_mT_log_120"); draw_from_trees("num_iso_tracks_pt15",baseline_pre_tk,"(weightppb*4000)", ";n_{IsoTk} (p_{T} > 15 GeV);Events / 5 fb^{-1}", 6, 0, 6, "plotLog:plotSig",-1,-1, "num_iso_tracks_pt15_120"); draw_from_trees("num_iso_tracks_pt15_mT",baseline_pre_tk,"(weightppb*4000)", ";n_{IsoTk} (p_{T} > 15 GeV);Events / 5 fb^{-1}", 6, 0, 6, "plotLog:plotSig",-1,-1, "num_iso_tracks_pt15_mT_120"); draw_from_trees("e_track_pt",baseline_pre_tk+"num_mu_iso_tracks_mT==0&&num_had_iso_tracks_mT==0&&e_track_pt>0&&e_track_mT<100&&e_track_relIso<0.2","(weightppb*4000)", ";p_{Tl}^{tk};Events / 5 fb^{-1}", 20, 0, 100, ":plotSig",-1,-1, "e_track_pt_120_nm1"); draw_from_trees("e_track_pt",baseline_pre_tk+"num_mu_iso_tracks_mT==0&&num_had_iso_tracks_mT==0&&e_track_pt>0&&e_track_mT<100&&e_track_relIso<0.2","(weightppb*4000)", ";p_{T}^{tk};Events / 5 fb^{-1}", 20, 0, 100, "plotLog:plotSig",-1,-1, "e_track_pt_120_nm1_log"); draw_from_trees("e_track_relIso",baseline_pre_tk+"num_mu_iso_tracks_mT==0&&num_had_iso_tracks_mT==0&&e_track_pt>5&&e_track_mT<100","(weightppb*4000)", ";I_{rel}^{tk};Events / 5 fb^{-1}", 20, 0, 1, ":plotSig",-1,-1, "e_track_relIso_120_nm1"); draw_from_trees("e_track_relIso",baseline_pre_tk+"num_mu_iso_tracks_mT==0&&num_had_iso_tracks_mT==0&&e_track_pt>5&&e_track_mT<100","(weightppb*4000)", ";I_{rel}^{tk};Events / 5 fb^{-1}", 20, 0, 1, "plotLog:plotSig",-1,-1, "e_track_relIso_120_nm1_log"); draw_from_trees("e_track_mT",baseline_pre_tk+"num_mu_iso_tracks_mT==0&&num_had_iso_tracks_mT==0&&e_track_pt>5&&e_track_relIso<0.2","(weightppb*4000)", ";m_{T} (IsoTk, E_{T}^{miss}) [GeV];Events / 5 fb^{-1}", 10, 0, 200, ":plotSig",100,-1, "e_track_mT_120_nm1"); draw_from_trees("e_track_mT",baseline_pre_tk+"num_mu_iso_tracks_mT==0&&num_had_iso_tracks_mT==0&&e_track_pt>5&&e_track_relIso<0.2","(weightppb*4000)", ";m_{T} (IsoTk, E_{T}^{miss}) [GeV];Events / 5 fb^{-1}", 10, 0, 200, "plotLog:plotSig",100,-1, "e_track_mT_log_120_nm1"); draw_from_trees("e_track_mT",baseline_pre_tk+"e_track_pt>0","(weightppb*4000)", ";m_{T} (IsoTk, E_{T}^{miss}) [GeV];Events / 5 fb^{-1}", 10, 0, 200, ":plotSig",100,-1, "e_track_mT_120"); draw_from_trees("e_track_mT",baseline_pre_tk+"e_track_pt>0","(weightppb*4000)", ";m_{T} (IsoTk, E_{T}^{miss}) [GeV];Events / 5 fb^{-1}", 10, 0, 200, "plotLog:plotSig",100,-1, "e_track_mT_log_120"); draw_from_trees("num_e_iso_tracks",baseline_pre_tk,"(weightppb*4000)", ";n_{IsoTk};Events / 5 fb^{-1}", 6, 0, 6, "plotLog:plotSig",-1,-1, "num_e_iso_tracks_pt15_120"); draw_from_trees("num_e_iso_tracks_mT",baseline_pre_tk,"(weightppb*4000)", ";n_{IsoTk};Events / 5 fb^{-1}", 6, 0, 6, "plotLog:plotSig",-1,-1, "num_e_iso_tracks_mT_120"); draw_from_trees("e_track_pt",baseline_pre_tk+"e_track_pt>0&&e_track_mT<100","(weightppb*4000)", ";p_{T}^{tk} [GeV];Events / 5 fb^{-1}", 20, 0, 100, ":plotSig",-1,-1, "e_track_pt_120"); draw_from_trees("e_track_pt",baseline_pre_tk+"e_track_pt>0&&e_track_mT<100","(weightppb*4000)", ";p_{T}^{tk} [GeV];Events / 5 fb^{-1}", 20, 0, 100, "plotLog:plotSig",-1,-1, "e_track_pt_log_120"); draw_from_trees("e_track_pt",baseline_pre_tk+"e_track_pt>0&&e_track_mT<100&&e_track_relIso<0.2","(weightppb*4000)", ";p_{T}^{tk} [GeV];Events / 5 fb^{-1}", 20, 0, 100, ":plotSig",-1,-1, "e_track_pt_relIso0p2_120"); draw_from_trees("e_track_pt",baseline_pre_tk+"e_track_pt>0&&e_track_mT<100&&e_track_relIso<0.2","(weightppb*4000)", ";p_{T}^{tk} [GeV];Events / 5 fb^{-1}", 20, 0, 100, "plotLog:plotSig",-1,-1, "e_track_pt_relIso0p2_log_120"); draw_from_trees("e_track_relIso",baseline_pre_tk+"e_track_pt>0&&e_track_mT<100","(weightppb*4000)", ";I_{rel}^{tk};Events / 5 fb^{-1}", 20, 0, 1, ":plotSig",-1,-1, "e_track_relIso_120"); draw_from_trees("e_track_relIso",baseline_pre_tk+"e_track_pt>0&&e_track_mT<100","(weightppb*4000)", ";I_{rel}^{tk};Events / 5 fb^{-1}", 20, 0, 1, "plotLog:plotSig",-1,-1, "e_track_relIso_log_120"); draw_from_trees("mu_track_pt",baseline_pre_tk+"num_e_iso_tracks_mT==0&&num_had_iso_tracks_mT==0&&mu_track_pt>0&&mu_track_relIso<0.2&&mu_track_mT<100","(weightppb*4000)", ";p_{T}^{tk} {GeV];Events / 5 fb^{-1}", 20, 0, 100, ":plotSig",-1,-1, "mu_track_pt_120_nm1"); draw_from_trees("mu_track_pt",baseline_pre_tk+"num_e_iso_tracks_mT==0&&num_had_iso_tracks_mT==0&&mu_track_pt>0&&mu_track_relIso<0.2&&mu_track_mT<100","(weightppb*4000)", ";p_{T}^{tk} [GeV];Events / 5 fb^{-1}", 20, 0, 100, "plotLog:plotSig",-1,-1, "mu_track_pt_120_nm1_log"); draw_from_trees("mu_track_relIso",baseline_pre_tk+"num_e_iso_tracks_mT==0&&num_had_iso_tracks_mT==0&&mu_track_pt>5&&mu_track_mT<100","(weightppb*4000)", ";I_{rel}^{tk};Events / 5 fb^{-1}", 20, 0, 1, ":plotSig",-1,-1, "mu_track_relIso_120_nm1"); draw_from_trees("mu_track_relIso",baseline_pre_tk+"num_e_iso_tracks_mT==0&&num_had_iso_tracks_mT==0&&mu_track_pt>5&&mu_track_mT<100","(weightppb*4000)", ";I_{rel}^{tk};Events / 5 fb^{-1}", 20, 0, 1, "plotLog:plotSig",-1,-1, "mu_track_relIso_120_nm1_log"); draw_from_trees("mu_track_mT",baseline_pre_tk+"num_e_iso_tracks_mT==0&&num_had_iso_tracks_mT==0&&mu_track_pt>5&&mu_track_relIso<0.2","(weightppb*4000)", ";m_{T} (IsoTk, E_{T}^{miss}) [GeV];Events / 5 fb^{-1}", 10, 0, 200, ":plotSig",100,-1, "mu_track_mT_120_nm1"); draw_from_trees("mu_track_mT",baseline_pre_tk+"num_e_iso_tracks_mT==0&&num_had_iso_tracks_mT==0&&mu_track_pt>5&&mu_track_relIso<0.2","(weightppb*4000)", ";m_{T} (IsoTk, E_{T}^{miss}) [GeV];Events / 5 fb^{-1}", 10, 0, 200, "plotLog:plotSig",100,-1, "mu_track_mT_log_120_nm1"); draw_from_trees("mu_track_mT",baseline_pre_tk+"mu_track_pt>0","(weightppb*4000)", ";m_{T} (IsoTk, E_{T}^{miss}) [GeV];Events / 5 fb^{-1}", 10, 0, 200, ":plotSig",100,-1, "mu_track_mT_120"); draw_from_trees("mu_track_mT",baseline_pre_tk+"mu_track_pt>0","(weightppb*4000)", ";m_{T} (IsoTk, E_{T}^{miss}) [GeV];Events / 5 fb^{-1}", 10, 0, 200, "plotLog:plotSig",100,-1, "mu_track_mT_log_120"); draw_from_trees("num_mu_iso_tracks",baseline_pre_tk,"(weightppb*4000)", ";n_{IsoTk};Events / 5 fb^{-1}", 6, 0, 6, "plotLog:plotSig",-1,-1, "num_mu_iso_tracks_pt15_120"); draw_from_trees("num_mu_iso_tracks_mT",baseline_pre_tk,"(weightppb*4000)", ";n_{IsoTk};Events / 5 fb^{-1}", 6, 0, 6, "plotLog:plotSig",-1,-1, "num_mu_iso_tracks_mT_120"); draw_from_trees("mu_track_pt",baseline_pre_tk+"mu_track_pt>0&&mu_track_mT<100","(weightppb*4000)", ";p_{T}^{tk} [GeV];Events / 5 fb^{-1}", 20, 0, 100, ":plotSig",-1,-1, "mu_track_pt_120"); draw_from_trees("mu_track_pt",baseline_pre_tk+"mu_track_pt>0&&mu_track_mT<100","(weightppb*4000)", ";p_{T}^{tk} [GeV];Events / 5 fb^{-1}", 20, 0, 100, "plotLog:plotSig",-1,-1, "mu_track_pt_log_120"); draw_from_trees("mu_track_pt",baseline_pre_tk+"mu_track_pt>0&&mu_track_mT<100&&mu_track_relIso<0.2","(weightppb*4000)", ";p_{T}^{tk} [GeV];Events / 5 fb^{-1}", 20, 0, 100, ":plotSig",-1,-1, "mu_track_pt_relIso0p2_120"); draw_from_trees("mu_track_pt",baseline_pre_tk+"mu_track_pt>0&&mu_track_mT<100&&mu_track_relIso<0.2","(weightppb*4000)", ";p_{T}^{tk} [GeV];Events / 5 fb^{-1}", 20, 0, 100, "plotLog:plotSig",-1,-1, "mu_track_pt_relIso0p2_log_120"); draw_from_trees("mu_track_relIso",baseline_pre_tk+"mu_track_pt>0&&mu_track_mT<100","(weightppb*4000)", ";I_{rel}^{tk};Events / 5 fb^{-1}", 20, 0, 1, ":plotSig",-1,-1, "mu_track_relIso_120"); draw_from_trees("mu_track_relIso",baseline_pre_tk+"mu_track_pt>0&&mu_track_mT<100","(weightppb*4000)", ";I_{rel}^{tk};Events / 5 fb^{-1}", 20, 0, 1, "plotLog:plotSig",-1,-1, "mu_track_relIso_log_120"); draw_from_trees("had_track_pt",baseline_pre_tk+"num_e_iso_tracks_mT==0&&num_mu_iso_tracks_mT==0&&had_track_pt>0&&had_track_relIso<0.1&&had_track_mT<100","(weightppb*4000)", ";p_{T}^{tk} [GeV];Events / 5 fb^{-1}", 20, 0, 100, ":plotSig",-1,-1, "had_track_pt_120_nm1"); draw_from_trees("had_track_pt",baseline_pre_tk+"num_e_iso_tracks_mT==0&&num_mu_iso_tracks_mT==0&&had_track_pt>0&&had_track_relIso<0.1&&had_track_mT<100","(weightppb*4000)", ";p_{T}^{tk} [GeV];Events / 5 fb^{-1}", 20, 0, 100, "plotLog:plotSig",-1,-1, "had_track_pt_120_nm1_log"); draw_from_trees("had_track_relIso",baseline_pre_tk+"num_e_iso_tracks_mT==0&&num_mu_iso_tracks_mT==0&&had_track_pt>10&&had_track_mT<100","(weightppb*4000)", ";I_{rel}^{tk};Events / 5 fb^{-1}", 20, 0, 1, ":plotSig",-1,-1, "had_track_relIso_120_nm1"); draw_from_trees("had_track_relIso",baseline_pre_tk+"num_e_iso_tracks_mT==0&&num_mu_iso_tracks_mT==0&&had_track_pt>10&&had_track_mT<100","(weightppb*4000)", ";I_{rel}^{tk};Events / 5 fb^{-1}", 20, 0, 1, "plotLog:plotSig",-1,-1, "had_track_relIso_120_nm1_log"); draw_from_trees("had_track_mT",baseline_pre_tk+"num_e_iso_tracks_mT==0&&num_mu_iso_tracks_mT==0&&had_track_pt>10&&had_track_relIso<0.1","(weightppb*4000)", ";m_{T} (IsoTk, E_{T}^{miss}) [GeV];Events / 5 fb^{-1}", 10, 0, 200, ":plotSig",100,-1, "had_track_mT_120_nm1"); draw_from_trees("had_track_mT",baseline_pre_tk+"num_e_iso_tracks_mT==0&&num_mu_iso_tracks_mT==0&&had_track_pt>10&&had_track_relIso<0.1","(weightppb*4000)", ";m_{T} (IsoTk, E_{T}^{miss}) [GeV];Events / 5 fb^{-1}", 10, 0, 200, "plotLog:plotSig",100,-1, "had_track_mT_log_120_nm1"); draw_from_trees("had_track_mT",baseline_pre_tk+"had_track_pt>0","(weightppb*4000)", ";m_{T} (IsoTk, E_{T}^{miss}) [GeV];Events / 5 fb^{-1}", 10, 0, 200, ":plotSig",100,-1, "had_track_mT_120"); draw_from_trees("had_track_mT",baseline_pre_tk+"had_track_pt>0","(weightppb*4000)", ";m_{T} (IsoTk, E_{T}^{miss}) [GeV];Events / 5 fb^{-1}", 10, 0, 200, "plotLog:plotSig",100,-1, "had_track_mT_log_120"); draw_from_trees("num_had_iso_tracks",baseline_pre_tk,"(weightppb*4000)", ";n_{IsoTk};Events / 5 fb^{-1}", 6, 0, 6, "plotLog:plotSig",-1,-1, "num_had_iso_tracks_pt15_120"); draw_from_trees("num_had_iso_tracks_mT",baseline_pre_tk,"(weightppb*4000)", ";n_{IsoTk};Events / 5 fb^{-1}", 6, 0, 6, "plotLog:plotSig",-1,-1, "num_had_iso_tracks_mT_120"); draw_from_trees("had_track_pt",baseline_pre_tk+"had_track_pt>0&&had_track_mT<100","(weightppb*4000)", ";p_{T}^{tk} [GeV];Events / 5 fb^{-1}", 20, 0, 100, ":plotSig",-1,-1, "had_track_pt_120"); draw_from_trees("had_track_pt",baseline_pre_tk+"had_track_pt>0&&had_track_mT<100","(weightppb*4000)", ";p_{T}^{tk} [GeV];Events / 5 fb^{-1}", 20, 0, 100, "plotLog:plotSig",-1,-1, "had_track_pt_log_120"); draw_from_trees("had_track_pt",baseline_pre_tk+"had_track_pt>0&&had_track_mT<100&&had_track_relIso<0.1","(weightppb*4000)", ";p_{T}^{tk} [GeV];Events / 5 fb^{-1}", 20, 0, 100, ":plotSig",-1,-1, "had_track_pt_relIso0p1_120"); draw_from_trees("had_track_pt",baseline_pre_tk+"had_track_pt>0&&had_track_mT<100&&had_track_relIso<0.1","(weightppb*4000)", ";p_{T}^{tk} [GeV];Events / 5 fb^{-1}", 20, 0, 100, "plotLog:plotSig",-1,-1, "had_track_pt_relIso0p1_log_120"); draw_from_trees("had_track_relIso",baseline_pre_tk+"had_track_pt>0&&had_track_mT<100","(weightppb*4000)", ";I_{rel}^{tk};Events / 5 fb^{-1}", 20, 0, 1, ":plotSig",-1,-1, "had_track_relIso_120"); draw_from_trees("had_track_relIso",baseline_pre_tk+"had_track_pt>0&&had_track_mT<100","(weightppb*4000)", ";I_{rel}^{tk};Events / 5 fb^{-1}", 20, 0, 1, "plotLog:plotSig",-1,-1, "had_track_relIso_log_120"); draw_from_trees("had_track_relIso",baseline_pre_tk+"had_track_pt>10&&had_track_mT<100","(weightppb*4000)", ";I_{rel}^{tk};Events / 5 fb^{-1}", 20, 0, 1, ":plotSig",-1,-1, "had_track_relIso_pt10_120"); draw_from_trees("had_track_relIso",baseline_pre_tk+"had_track_pt>10&&had_track_mT<100","(weightppb*4000)", ";I_{rel}^{tk};Events / 5 fb^{-1}", 20, 0, 1, "plotLog:plotSig",-1,-1, "had_track_relIso_pt10_log_120"); // Most sensitive bins // T1bbbb (1500, 100) draw_from_trees("ht30",baseline+bgeq2+"num_jets_pt30>=4&&mht30>500","(weightppb*4000)", ";H_{T} [GeV];Events / 5 fb^{-1}", 10, 500, 3500., "plotSig:plotLog",1200,-1, "ht30_mht500_bgeq2_nj1_ht1200_nm1_t1bbbb_1500_100_120"); draw_from_trees("mht30",baseline+bgeq2+"num_jets_pt30>=4&&ht30>1200","(weightppb*4000)", ";H_{T}^{miss} [GeV];Events / 5 fb^{-1}", 13, 200, 1500., "plotSig:plotLog",500,-1, "mht30_bgeq2_nj1_ht1200_nm1_t1bbbb_1500_100_120"); draw_from_trees("num_jets_pt30",baseline+bgeq2+"mht30>500&&ht30>1200","(weightppb*4000)", ";n_{jets} (p_{T} > 30 GeV);Events / 5 fb^{-1}", 11, 4, 15, "plotSig:plotLog",4,-1, "num_jets_pt30_mht500_bgeq2_ht1200_nm1_t1bbbb_1500_100_120"); draw_from_trees("num_csvm_jets30",baseline+"num_jets_pt30>=4&&mht30>500&&ht30>1200","(weightppb*4000)", ";n_{CSVM} (p_{T} > 30 GeV);Events / 5 fb^{-1}", 6, 0, 6, "plotLog:plotSig",2,-1, "num_csvm_jets30_mht500_nj1_ht1200_nm1_t1bbbb_1500_100_120"); // T1bbbb (1000, 900) draw_from_trees("ht30",baseline+bgeq2+"num_jets_pt30>=4&&mht30>500","(weightppb*4000)", ";H_{T} [GeV];Events / 5 fb^{-1}", 10, 500, 3500., "plotSig:plotLog",500,-1, "ht30_mht500_bgeq2_nj1_ht500_nm1_t1bbbb_1000_900_120"); draw_from_trees("mht30",baseline+bgeq2+"num_jets_pt30>=4&&ht30>500","(weightppb*4000)", ";H_{T}^{miss} [GeV];Events / 5 fb^{-1}", 13, 200, 1500., "plotSig:plotLog",500,-1, "mht30_bgeq2_nj1_ht500_nm1_t1bbbb_1000_900_120"); draw_from_trees("num_jets_pt30",baseline+bgeq2+"mht30>500&&ht30>500","(weightppb*4000)", ";n_{jets} (p_{T} > 30 GeV);Events / 5 fb^{-1}", 11, 4, 15, "plotSig:plotLog",4,-1, "num_jets_pt30_mht500_bgeq2_ht500_nm1_t1bbbb_1000_900_120"); draw_from_trees("num_csvm_jets30",baseline+"num_jets_pt30>=4&&mht30>500&&ht30>500","(weightppb*4000)", ";n_{CSVM} (p_{T} > 30 GeV);Events / 5 fb^{-1}", 6, 0, 6, "plotLog:plotSig",2,-1, "num_csvm_jets30_mht500_nj1_ht500_nm1_t1bbbb_1000_900_120"); // T1tttt (1500, 100) draw_from_trees("ht30",baseline+bgeq2+"num_jets_pt30>=9&&mht30>500","(weightppb*4000)", ";H_{T} [GeV];Events / 5 fb^{-1}", 10, 500, 3500., "plotSig:",1000,-1, "ht30_mht500_bgeq2_nj3_nm1_t1tttt_1500_100_120"); draw_from_trees("mht30",baseline+bgeq2+"ht30>1000&&num_jets_pt30>=9","(weightppb*4000)", ";H_{T}^{miss} [GeV];Events / 5 fb^{-1}", 13, 200, 1500., "plotSig:plotLog",500,-1, "mht30_ht1000_bgeq2_nj3_nm1_t1tttt_1500_100_120"); draw_from_trees("num_jets_pt30",baseline+bgeq2+"ht30>1000&&mht30>500","(weightppb*4000)", ";n_{jets} (p_{T} > 30 GeV);Events / 5 fb^{-1}", 11, 4, 15, "plotSig:plotLog",9,-1, "num_jets_pt30_ht1000_mht500_bgeq2_nm1_t1tttt_1500_100_120"); draw_from_trees("num_csvm_jets30",baseline+"ht30>1000&&num_jets_pt30>=9&&mht30>500","(weightppb*4000)", ";n_{CSVM} (p_{T} > 30 GeV);Events / 5 fb^{-1}", 6, 0, 6, "plotSig",2,-1, "num_csvm_jets30_ht1000_mht500_nj3_nm1_t1tttt_1500_100_120"); // T1tttt (1200, 800) draw_from_trees("ht30",baseline+bgeq2+"num_jets_pt30>=9","(weightppb*4000)", ";H_{T} [GeV];Events / 5 fb^{-1}", 10, 500, 3500., "plotSig:plotLog",500,-1, "ht30_mht200_bgeq2_nj3_ht500_nm1_t1tttt_1200_800_120"); draw_from_trees("mht30",baseline+bgeq2+"num_jets_pt30>=9","(weightppb*4000)", ";H_{T}^{miss} [GeV];Events / 5 fb^{-1}", 13, 200, 1500., "plotSig:plotLog",200,-1, "mht30_bgeq2_nj3_ht500_nm1_t1tttt_1200_800_120"); draw_from_trees("num_jets_pt30",baseline+bgeq2,"(weightppb*4000)", ";n_{jets} (p_{T} > 30 GeV);Events / 5 fb^{-1}", 11, 4, 15, "plotSig:plotLog",9,-1, "num_jets_pt30_mht200_bgeq2_ht500_nm1_t1tttt_1200_800_120"); draw_from_trees("num_csvm_jets30",baseline+"num_jets_pt30>=9","(weightppb*4000)", ";n_{CSVM} (p_{T} > 30 GeV);Events / 5 fb^{-1}", 6, 0, 6, "plotLog:plotSig",2,-1, "num_csvm_jets30_mht200_nj3_ht500_nm1_t1tttt_1200_800_120"); // T1qqqq (1400, 100) draw_from_trees("ht30",baseline+"mht30>400","(weightppb*4000)", ";H_{T} [GeV];Events / 5 fb^{-1}", 10, 500, 3500., "plotSig:plotLog",1400,-1, "ht30_mht400_nj1_nm1_t1qqqq_1400_100_120"); draw_from_trees("mht30",baseline+"ht30>1400","(weightppb*4000)", ";H_{T}^{miss} [GeV];Events / 5 fb^{-1}", 13, 200, 1500., "plotSig:plotLog",400,-1, "mht30_ht1400_nj1_nm1_t1qqqq_1400_100_120"); draw_from_trees("num_jets_pt30",baseline+"ht30>1400&&mht30>400","(weightppb*4000)", ";n_{jets} (p_{T} > 30 GeV);Events / 5 fb^{-1}", 11, 4, 15, "plotSig:plotLog",4,-1, "num_jets_pt30_mht400_ht1400_nm1_t1qqqq_1400_100_120"); draw_from_trees("num_csvm_jets30",baseline+"ht30>1400&&mht30>400","(weightppb*4000)", ";n_{CSVM} (p_{T} > 30 GeV);Events / 5 fb^{-1}", 6, 0, 6, "plotLog:plotSig",-1,-1, "num_csvm_jets30_mht400_ht1400_nj1_nm1_t1qqqq_1400_100_120"); // T1qqqq (1000, 800) draw_from_trees("num_csvm_jets30",baseline+"num_jets_pt30>=6&&mht30>300","(weightppb*4000)", ";n_{CSVM} (p_{T} > 30 GeV);Events / 5 fb^{-1}", 6, 0, 6, "plotLog:plotSig",-1,-1, "num_csvm_jets30_mht300_ht500_6j_nm1_t1qqqq_1000_800_120"); draw_from_trees("ht30",baseline+"num_jets_pt30>=6&&mht30>300","(weightppb*4000)", ";H_{T} [GeV];Events / 5 fb^{-1}", 10, 500, 3500., "plotSig:plotLog",-1,-1, "ht30_mht300_6j_nm1_t1qqqq_1000_800_120"); draw_from_trees("mht30",baseline+"num_jets_pt30>=6","(weightppb*4000)", ";H_{T}^{miss} [GeV];Events / 5 fb^{-1}", 13, 200, 1500., "plotSig:plotLog",300,-1, "mht30_ht500_6j_nm1_t1qqqq_1000_800_120"); draw_from_trees("num_jets_pt30",baseline+"mht30>300","(weightppb*4000)", ";n_{jets} (p_{T} > 30 GeV);Events / 5 fb^{-1}", 11, 4, 15, "plotSig:plotLog",6,-1, "num_jets_pt30_mht300_ht500_nm1_t1qqqq_1000_800_120"); draw_from_trees("num_taus_POG_phys14_ID",baseline_pre_tk,"(weightppb*4000)", ";n_{#tau} (p_{T} > 20 GeV);Events / 5 fb^{-1}", 6, 0, 6, "plotLog:plotSig",-1,-1, "num_taus_POG_phys14_ID_120"); draw_from_trees("tau_mT",baseline_pre_tk+"tau_pt>0","(weightppb*4000)", ";m_{T} (#tau, E_{T}^{miss}) [GeV];Events / 5 fb^{-1}", 10, 0, 200, "plotLog:plotSig",-1,-1, "tau_mT_120"); return 0; }
void setTDRStyle() { TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR"); // For the canvas: tdrStyle->SetCanvasBorderMode(0); tdrStyle->SetCanvasColor(kWhite); tdrStyle->SetCanvasDefH(600); //Height of canvas tdrStyle->SetCanvasDefW(600); //Width of canvas tdrStyle->SetCanvasDefX(0); //POsition on screen tdrStyle->SetCanvasDefY(0); // For the Pad: tdrStyle->SetPadBorderMode(0); // tdrStyle->SetPadBorderSize(Width_t size = 1); tdrStyle->SetPadColor(kWhite); tdrStyle->SetPadGridX(false); tdrStyle->SetPadGridY(false); tdrStyle->SetGridColor(0); tdrStyle->SetGridStyle(3); tdrStyle->SetGridWidth(1); // For the frame: tdrStyle->SetFrameBorderMode(0); tdrStyle->SetFrameBorderSize(1); tdrStyle->SetFrameFillColor(0); tdrStyle->SetFrameFillStyle(0); tdrStyle->SetFrameLineColor(1); tdrStyle->SetFrameLineStyle(1); tdrStyle->SetFrameLineWidth(1); //For the date: tdrStyle->SetOptDate(0); // tdrStyle->SetDateX(Float_t x = 0.01); // tdrStyle->SetDateY(Float_t y = 0.01); // For the statistics box: tdrStyle->SetOptFile(11); tdrStyle->SetOptStat(11111111); // For the Global title: tdrStyle->SetOptTitle(0); tdrStyle->SetTitleFont(42); tdrStyle->SetTitleColor(1); tdrStyle->SetTitleTextColor(1); tdrStyle->SetTitleFillColor(10); tdrStyle->SetTitleFontSize(0.05); // For the axis titles: tdrStyle->SetTitleColor(1, "XYZ"); tdrStyle->SetTitleFont(42, "XYZ"); tdrStyle->SetTitleSize(0.06, "XYZ"); // tdrStyle->SetTitleXSize(Float_t size = 0.02); // Another way to set the size? // tdrStyle->SetTitleYSize(Float_t size = 0.02); tdrStyle->SetTitleXOffset(0.7); tdrStyle->SetTitleYOffset(0.7); // tdrStyle->SetTitleOffset(1.1, "Y"); // Another way to set the Offset // For the axis labels: tdrStyle->SetLabelColor(1, "XYZ"); tdrStyle->SetLabelFont(42, "XYZ"); tdrStyle->SetLabelOffset(0.007, "XYZ"); tdrStyle->SetLabelSize(0.03, "XYZ"); // For the axis: tdrStyle->SetAxisColor(1, "XYZ"); tdrStyle->SetStripDecimals(kTRUE); tdrStyle->SetTickLength(0.03, "XYZ"); tdrStyle->SetNdivisions(510, "XYZ"); tdrStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame tdrStyle->SetPadTickY(1); tdrStyle->cd(); }
void setDefaultStyle() { TStyle *defaultStyle = new TStyle("defaultStyle","Default Style"); defaultStyle->SetOptStat(0000); defaultStyle->SetOptFit(000); defaultStyle->SetPalette(1); /////// pad //////////// defaultStyle->SetPadBorderMode(1); defaultStyle->SetPadBorderSize(1); defaultStyle->SetPadColor(0); defaultStyle->SetPadTopMargin(0.05); defaultStyle->SetPadBottomMargin(0.13); defaultStyle->SetPadLeftMargin(0.14); defaultStyle->SetPadRightMargin(0.02); /////// canvas ///////// defaultStyle->SetCanvasBorderMode(0); defaultStyle->SetCanvasColor(0); defaultStyle->SetCanvasDefH(600); defaultStyle->SetCanvasDefW(600); /////// frame ////////// defaultStyle->SetFrameBorderMode(0); defaultStyle->SetFrameBorderSize(1); defaultStyle->SetFrameFillColor(0); defaultStyle->SetFrameLineColor(1); /////// label ////////// defaultStyle->SetLabelOffset(0.005,"XY"); defaultStyle->SetLabelSize(0.05,"XY"); defaultStyle->SetLabelFont(42,"XY"); /////// title ////////// defaultStyle->SetTitleOffset(1.2,"X"); defaultStyle->SetTitleSize(0.05,"X"); defaultStyle->SetTitleOffset(1.4,"Y"); defaultStyle->SetTitleSize(0.05,"Y"); defaultStyle->SetTitleFont(42, "XYZ"); /////// various //////// defaultStyle->SetLegendBorderSize(0); defaultStyle->cd(); }
void Plotter::Plot(std::string filename) { gROOT->Reset(); //gROOT->SetStyle("Plain"); TStyle *MyStyle = new TStyle("MyStyle","My Root Styles"); MyStyle->SetPaperSize(20,24); MyStyle->SetStatColor(0); MyStyle->SetCanvasColor(0); MyStyle->SetPadColor(0); MyStyle->SetPadBorderMode(0); MyStyle->SetCanvasBorderMode(0); MyStyle->SetFrameBorderMode(0); MyStyle->SetOptStat(0); MyStyle->SetStatBorderSize(2); MyStyle->SetOptTitle(0); MyStyle->SetPadTickX(1); MyStyle->SetPadTickY(1); MyStyle->SetPadBorderSize(2); MyStyle->SetPalette(51, 0); MyStyle->SetPadBottomMargin(0.15); MyStyle->SetPadTopMargin(0.05); MyStyle->SetPadLeftMargin(0.15); MyStyle->SetPadRightMargin(0.25); MyStyle->SetTitleColor(1); MyStyle->SetTitleFillColor(0); MyStyle->SetTitleFontSize(0.05); MyStyle->SetTitleBorderSize(0); MyStyle->SetLineWidth(1); MyStyle->SetHistLineWidth(3); MyStyle->SetLegendBorderSize(0); MyStyle->SetNdivisions(502, "x"); MyStyle->SetMarkerSize(0.8); MyStyle->SetTickLength(0.03); MyStyle->SetTitleOffset(1.5, "x"); MyStyle->SetTitleOffset(1.5, "y"); MyStyle->SetTitleOffset(1.0, "z"); MyStyle->SetLabelSize(0.05, "x"); MyStyle->SetLabelSize(0.05, "y"); MyStyle->SetLabelSize(0.05, "z"); MyStyle->SetLabelOffset(0.03, "x"); MyStyle->SetLabelOffset(0.03, "y"); MyStyle->SetLabelOffset(0.03, "z"); MyStyle->SetTitleSize(0.05, "x"); MyStyle->SetTitleSize(0.05, "y"); MyStyle->SetTitleSize(0.05, "z"); gROOT->SetStyle("MyStyle"); //gROOT->ForceStyle(); bool DrawLog = false; for (int i = 0; i < N_histos; ++i) { THStack *hs; TLegend *l; int Nset = data.size() + bg.size() + signal.size(); if (Nset > 20) Nset = 20.; l = new TLegend(0.76, 0.95 - 0.8 * Nset / 20., 1.0, 0.95); l->SetFillStyle(1001); l->SetFillColor(kWhite); l->SetLineColor(kWhite); l->SetLineWidth(2); if (bg.size() > 0) { hs = new THStack("hs", bg.at(0).at(i)->GetName()); int j = 0; for (std::vector<std::vector<TH1F*> >::const_iterator it = bg.begin(); it != bg.end(); ++it) { TH1F *histogram = it->at(i); switch (j) { case 0: histogram->SetFillColor(kRed); break; case 1: histogram->SetFillColor(kOrange); break; case 2: histogram->SetFillColor(kYellow); break; case 3: histogram->SetFillColor(kGreen); break; case 4: histogram->SetFillColor(kCyan); break; case 5: histogram->SetFillColor(kBlue); break; case 6: histogram->SetFillColor(kMagenta); break; case 7: histogram->SetFillColor(kGray); break; case 8: histogram->SetFillColor(kGray + 2); break; default: histogram->SetFillColor(kBlack); break; } hs->Add(histogram); l->AddEntry(histogram, bg_names.at(j).c_str(), "f"); ++j; } } TCanvas *c = new TCanvas("c", "c", 800, 600); c->SetLogy(DrawLog); std::string plotname; if (data.size() > 0) { plotname = std::string(data.at(0).at(i)->GetName()); data.at(0).at(i)->SetMaximum(1.5 * data.at(0).at(i)->GetMaximum()); data.at(0).at(i)->GetXaxis()->SetTitleOffset(1.3); data.at(0).at(i)->GetYaxis()->SetTitleOffset(1.3); data.at(0).at(i)->GetYaxis()->SetTitle("Events"); data.at(0).at(i)->GetXaxis()->SetNdivisions(505); data.at(0).at(i)->Draw(""); l->AddEntry(data.at(0).at(i), data_names.at(0).c_str(), "p"); if (bg.size() > 0) hs->Draw("histsame"); data.at(0).at(i)->SetMarkerStyle(20); data.at(0).at(i)->Draw("psame"); l->Draw("same"); } if (data.size() == 0 && bg.size() > 0) { plotname = std::string(bg.at(0).at(i)->GetName()); hs->Draw("hist"); hs->GetXaxis()->SetTitleOffset(1.3); hs->GetXaxis()->SetNdivisions(505); hs->GetYaxis()->SetTitleOffset(1.3); if (bg.size() > 0) hs->GetXaxis()->SetTitle(bg.at(0).at(i)->GetXaxis()->GetTitle()); hs->GetYaxis()->SetTitle("Events"); l->Draw("same"); } // if (i==2) { // TLine *line = new TLine(2, 500*1000 , 2, 0); // line->SetLineColor(kBlack); // line->Draw("histsame"); // } // if (i==4) { // TLine *line = new TLine(1, 35000 , 1, 0); // line->SetLineColor(kBlack); // line->Draw("histsame"); // } // if (i==6) { // TLine *line = new TLine(1, 900 , 1, 0); // line->SetLineColor(kBlack); // line->Draw("histsame"); // } // c->Print((filename+std::string("_")+plotname+std::string(".pdf")).c_str()); if (i == 0 && N_histos > 1) { c->Print((filename+std::string("(")).c_str()); } else if (i > 0 && i == N_histos - 1) c->Print((filename+std::string(")")).c_str()); else c->Print(filename.c_str()); } }
void blinding_study() { gSystem->CompileMacro("MitGPTree.h"); // First we define MIT Style for the plots. TStyle *MitStyle = gStyle; //gStyle = MitStyle; // Canvas MitStyle->SetCanvasColor (0); MitStyle->SetCanvasBorderSize(10); MitStyle->SetCanvasBorderMode(0); MitStyle->SetCanvasDefH (700); MitStyle->SetCanvasDefW (700); MitStyle->SetCanvasDefX (100); MitStyle->SetCanvasDefY (100); // Pads MitStyle->SetPadColor (0); MitStyle->SetPadBorderSize (10); MitStyle->SetPadBorderMode (0); MitStyle->SetPadBottomMargin(0.13); MitStyle->SetPadTopMargin (0.04); MitStyle->SetPadLeftMargin (0.18); MitStyle->SetPadRightMargin (0.04); MitStyle->SetPadGridX (0); MitStyle->SetPadGridY (0); MitStyle->SetPadTickX (0); MitStyle->SetPadTickY (0); // Frames MitStyle->SetFrameFillStyle ( 0); MitStyle->SetFrameFillColor ( 0); MitStyle->SetFrameLineColor ( 1); MitStyle->SetFrameLineStyle ( 0); MitStyle->SetFrameLineWidth ( 1); MitStyle->SetFrameBorderSize(10); MitStyle->SetFrameBorderMode( 0); // Histograms MitStyle->SetHistFillColor(2); MitStyle->SetHistFillStyle(0); MitStyle->SetHistLineColor(1); MitStyle->SetHistLineStyle(0); MitStyle->SetHistLineWidth(2); MitStyle->SetNdivisions(505); // Functions MitStyle->SetFuncColor(1); MitStyle->SetFuncStyle(0); MitStyle->SetFuncWidth(2); // Various MitStyle->SetMarkerStyle(20); MitStyle->SetMarkerColor(kBlack); MitStyle->SetMarkerSize (1.2); MitStyle->SetTitleSize (0.055,"X"); MitStyle->SetTitleOffset(1.200,"X"); MitStyle->SetLabelOffset(0.005,"X"); MitStyle->SetLabelSize (0.050,"X"); MitStyle->SetLabelFont (42 ,"X"); MitStyle->SetTickLength (-0.03,"X"); MitStyle->SetStripDecimals(kFALSE); MitStyle->SetTitleSize (0.055,"Y"); MitStyle->SetTitleOffset(1.800,"Y"); MitStyle->SetLabelOffset(0.010,"Y"); MitStyle->SetLabelSize (0.050,"Y"); MitStyle->SetLabelFont (42 ,"Y"); MitStyle->SetTickLength (-0.03,"Y"); MitStyle->SetTextSize (0.055); MitStyle->SetTextFont (42); MitStyle->SetStatFont (42); MitStyle->SetTitleFont (42); MitStyle->SetTitleFont (42,"X"); MitStyle->SetTitleFont (42,"Y"); MitStyle->SetOptStat (0); // Here the style section ends and the macro begins. string sig_samples[] = { "s12-dmmpho-v_m1-v7a", "s12-dmmpho-av_m1-v7a", "s12-dmmpho-v_m10-v7a", "s12-dmmpho-av_m10-v7a", "s12-dmmpho-v_m100-v7a", "s12-dmmpho-av_m100-v7a", "s12-dmmpho-v_m200-v7a", "s12-dmmpho-av_m200-v7a", "s12-dmmpho-av_m300-v7a", "s12-dmmpho-v_m500-v7a", "s12-dmmpho-av_m500-v7a", "s12-dmmpho-v_m1000-v7a", "s12-dmmpho-av_m1000-v7a", "s12-addmpho-md1_d2-v7a", "s12-addmpho-md1_d3-v7a", "s12-addmpho-md1_d4-v7a", "s12-addmpho-md1_d5-v7a", "s12-addmpho-md1_d6-v7a", "s12-addmpho-md2_d2-v7a", "s12-addmpho-md2_d3-v7a", "s12-addmpho-md2_d5-v7a", "s12-addmpho-md2_d6-v7a", "s12-addmpho-md3_d2-v7a", "s12-addmpho-md3_d3-v7a", "s12-addmpho-md3_d4-v7a", "s12-addmpho-md3_d5-v7a", "s12-addmpho-md3_d6-v7a" } Int_t signal_num=0; // This macro considers only one signal sample at a time, so the variable signal_num defines // which signal sample to work on (it is the index of the sample in sig_samples). double sig_weights[] = { 4.81E-07, 4.79E-07, 4.80E-07, 4.81E-07, 4.77E-07, 4.26E-07, 4.23E-07, 3.18E-07, 2.19E-07, 2.01E-07, 9.52E-08, 3.00E-08, 8.22E-09, 6.48E-02, 1.73E-01, 6.93E-02, 9.17E-02, 9.63E-01, 5.87E-03, 4.91E-03, 4.37E-03, 4.26E-03, 1.45E-03, 7.93E-04, 5.53E-04, 4.26E-04, 3.24E-04 }; // The signal weights are given by (sigma_MC * lumi)/(N_processed). Background weights are defined similarly below. string bg_samples[] = {"s12-zgptg130-v7c", "s12-wjets-ptw100-v7a", "s12-wgptg130-v7a", "s12-qcdht100-250-v7a", "s12-qcdht250-500-v7a", "s12-qcdht500-1000-v7a", "s12-qcdht1000-v7a", "s12-2pibo10_25-v7a", "s12-2pibo25_250-v7a", "s12-2pibo250-v7a", "s12-2pibx10_25-v7a", "s12-2pibx25_250-v7a", "s12-2pibx250-v7a", "s12-pj50_80-v7a", "s12-pj80_120-v7a", "s12-pj120_170-v7a", "s12-pj170_300-v7a", "s12-pj300_470-v7a", "s12-pj470_800-v7a", "s12-pj800_1400-v7a", "s12-pj1400_1800-v7a", "s12-pj1800-v7a", "s12-zgllgptg130-v7a", "s12-zgllg-v7a"}; double bg_weights[]= { 5.28E-03, 1.14E-01, 1.38E-02, 5.63E+03, 2.34E+02, 9.71E+00, 3.09E-01, 9.21E+00, 9.90E-01, 4.21E-04, 1.66E+01, 6.43E-01, 4.91E-05, 3.30E+01, 5.49E+00, 1.09E+00, 3.01E-01, 2.15E-02, 2.10E-03, 7.11E-05, 4.45E-07, 1.88E-08, 3.18E-03, 5.10E-01 }; string sigLine = sig_samples[signal_num]; Double_t sigWeight = sig_weights[signal_num]; TH1* sig_hist = new TH1F("sig_hist", TString("Phi Between Met and Photon for Signal Events [") + TString(sigLine) + TString("]"), 70, 0, 3.5); TH1* bg_hist = new TH1F("bg_hist", TString("Phi Between Met and Photon for Background Events [") + TString(sigLine) + TString("]"), 70, 0, 3.5); TH1* signifhist = new TH1F("signifhist", TString(" "), 24, 2, 3.2); cout<<"The selected signal sample is: "<<TString(sigLine)<<" "<<endl; TString sigFilename = TString("monoph-2013-July9_") + TString(sigLine) + TString("_noskim.root"); MitGPTree sigEvent; sigEvent.LoadTree(TString("/scratch/cferko/hist/monoph-2013-July9/merged/")+sigFilename, 0); sigEvent.InitTree(0); int nDataSig=sigEvent.tree_->GetEntries(); for (int evt=0; evt<nDataSig; ++evt) { sigEvent.tree_->GetEntry(evt); Double_t pho1Pt = sigEvent.pho1_.Pt(); Double_t jet1Pt = sigEvent.jet1_.Pt(); Double_t met = sigEvent.met_; Double_t metPhi = sigEvent.metPhi_; Double_t nphotons = sigEvent.nphotons_; Double_t ncosmics = sigEvent.ncosmics_; Double_t phoPassEleVeto = sigEvent.phoPassEleVeto_a1_; Double_t jet1Pt = sigEvent.jet1_.Pt(); Double_t nlep = sigEvent.nlep_; Double_t pho1Eta = sigEvent.pho1_.Eta(); Double_t pho1Phi = sigEvent.pho1_.Phi(); Double_t phoIsTrigger = sigEvent.phoIsTrigger_a1_; Double_t phoLeadTimeSpan = sigEvent.phoLeadTimeSpan_a1_; Double_t phoCoviEtaiEta = sigEvent.phoCoviEtaiEta_a1_; Double_t phoCoviPhiiPhi = sigEvent.phoCoviPhiiPhi_a1_; Double_t phoMipIsHalo = sigEvent.phoMipIsHalo_a1_; Double_t phoSeedTime = sigEvent.phoSeedTime_a1_; Double_t deltaPhi = TMath::ACos(TMath::Cos(pho1Phi - metPhi)); if (TMath::Abs(pho1Eta)<1.479 && met>140 && pho1Pt>160 && nphotons>0 && phoPassEleVeto>0 && phoIsTrigger==1 && TMath::Abs(phoLeadTimeSpan) < 8. && phoCoviEtaiEta > 0.001 && phoCoviPhiiPhi > 0.001 && phoMipIsHalo == 0 && phoSeedTime > -1.5 && nlep==0 && ncosmics==0 && jet1Pt<100) sig_hist->Fill(deltaPhi, sigWeight); } for (int i=0; i<24; i++) { string bgLine = bg_samples[i]; Double_t bgWeight = bg_weights[i]; TString bgFilename = TString("monoph-2013-July9_") + TString(bgLine) + TString("_noskim.root"); MitGPTree bgEvent; bgEvent.LoadTree(TString("/scratch/cferko/hist/monoph-2013-July9/merged/") + bgFilename, 0); bgEvent.InitTree(0); int nDataBg=bgEvent.tree_->GetEntries(); for (int evt=0; evt<nDataBg; ++evt) { bgEvent.tree_->GetEntry(evt); Double_t pho1Pt = bgEvent.pho1_.Pt(); Double_t jet1Pt = bgEvent.jet1_.Pt(); Double_t met = bgEvent.met_; Double_t metPhi = bgEvent.metPhi_; Double_t nphotons = bgEvent.nphotons_; Double_t ncosmics = bgEvent.ncosmics_; Double_t phoPassEleVeto = bgEvent.phoPassEleVeto_a1_; Double_t jet1Pt = bgEvent.jet1_.Pt(); Double_t nlep = bgEvent.nlep_; Double_t pho1Eta = bgEvent.pho1_.Eta(); Double_t pho1Phi = bgEvent.pho1_.Phi(); Double_t phoIsTrigger = bgEvent.phoIsTrigger_a1_; Double_t phoLeadTimeSpan = bgEvent.phoLeadTimeSpan_a1_; Double_t phoCoviEtaiEta = bgEvent.phoCoviEtaiEta_a1_; Double_t phoCoviPhiiPhi = bgEvent.phoCoviPhiiPhi_a1_; Double_t phoMipIsHalo = bgEvent.phoMipIsHalo_a1_; Double_t phoSeedTime = bgEvent.phoSeedTime_a1_; Double_t deltaPhi = TMath::ACos(TMath::Cos(pho1Phi - metPhi)); if (TMath::Abs(pho1Eta)<1.479 && met>140 && pho1Pt>160 && nphotons>0 && phoPassEleVeto>0 && phoIsTrigger==1 && TMath::Abs(phoLeadTimeSpan) < 8. && phoCoviEtaiEta > 0.001 && phoCoviPhiiPhi > 0.001 && phoMipIsHalo == 0 && phoSeedTime > -1.5 && nlep==0 && ncosmics==0 && jet1Pt<100) bg_hist->Fill(deltaPhi, bgWeight); } } Double_t sigTot = sig_hist->Integral(); Double_t bgTot = bg_hist->Integral(); Double_t signifTot = sigTot/TMath::Sqrt(bgTot); Double_t signifTarget = 0.25*signifTot; Int_t reduced=0; // The strange limits in the for loop are a messy hack to get the integral to work out. Since hist->Integral(a,b) // integrates from BIN a to BIN b (bin numbers instead of values of the x-axis), I choose to work from bin 64 // (an angle cut of 3.2) to bin 40 (an angle cut of 2). for (int i=64; i>=40; i--) { Double_t sigcount = sig_hist->Integral(0, i); Double_t bgcount = bg_hist->Integral(0, i); if (bgcount>0) { Double_t significance = sigcount/TMath::Sqrt(bgcount); // cout<<"At a phi cut of "<<sig_hist->GetBinCenter(i)+0.025<<" the significance is "<<significance<<", which is a fraction "<<significance/signifTot<<" of max."<<endl; if (significance<signifTarget && reduced==0) { cout<<"The signal significance is reduced to one-fourth of its uncut value at a phi cut of "<<sig_hist->GetBinCenter(i)+0.025<<endl; reduced=1; } signifhist->Fill(sig_hist->GetBinCenter(i), significance); } } signifhist->SetStats(kFALSE); signifhist->GetXaxis()->SetTitle("Maximum #Delta#phi"); signifhist->GetYaxis()->SetTitle("Signal Significance"); signifhist->Draw(); c1->Print(TString("Blinding_") + TString(sigLine) + TString(".pdf")); }
void setTDRStyle() { TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR"); // For the canvas: tdrStyle->SetCanvasBorderMode(0); tdrStyle->SetCanvasColor(kWhite); tdrStyle->SetCanvasDefH(600); //Height of canvas tdrStyle->SetCanvasDefW(600); //Width of canvas tdrStyle->SetCanvasDefX(0); //POsition on screen tdrStyle->SetCanvasDefY(0); // For the Pad: tdrStyle->SetPadBorderMode(0); // tdrStyle->SetPadBorderSize(Width_t size = 1); tdrStyle->SetPadColor(kWhite); tdrStyle->SetPadGridX(false); tdrStyle->SetPadGridY(false); tdrStyle->SetGridColor(0); tdrStyle->SetGridStyle(3); tdrStyle->SetGridWidth(1); // For the frame: tdrStyle->SetFrameBorderMode(0); tdrStyle->SetFrameBorderSize(1); tdrStyle->SetFrameFillColor(0); tdrStyle->SetFrameFillStyle(0); tdrStyle->SetFrameLineColor(1); tdrStyle->SetFrameLineStyle(1); tdrStyle->SetFrameLineWidth(1); // For the histo: // tdrStyle->SetHistFillColor(1); // tdrStyle->SetHistFillStyle(0); tdrStyle->SetHistLineColor(1); tdrStyle->SetHistLineStyle(0); tdrStyle->SetHistLineWidth(1); // tdrStyle->SetLegoInnerR(Float_t rad = 0.5); // tdrStyle->SetNumberContours(Int_t number = 20); tdrStyle->SetEndErrorSize(2); // tdrStyle->SetErrorMarker(20); // tdrStyle->SetErrorX(0.); tdrStyle->SetMarkerStyle(20); //For the fit/function: tdrStyle->SetOptFit(1); tdrStyle->SetFitFormat("5.4g"); tdrStyle->SetFuncColor(2); tdrStyle->SetFuncStyle(1); tdrStyle->SetFuncWidth(1); //For the date: tdrStyle->SetOptDate(0); // tdrStyle->SetDateX(Float_t x = 0.01); // tdrStyle->SetDateY(Float_t y = 0.01); // For the statistics box: tdrStyle->SetOptFile(0); tdrStyle->SetOptStat(0); // To display the mean and RMS: SetOptStat("mr"); tdrStyle->SetStatColor(kWhite); tdrStyle->SetStatFont(42); tdrStyle->SetStatFontSize(0.025); tdrStyle->SetStatTextColor(1); tdrStyle->SetStatFormat("6.4g"); tdrStyle->SetStatBorderSize(1); tdrStyle->SetStatH(0.1); tdrStyle->SetStatW(0.15); // tdrStyle->SetStatStyle(Style_t style = 1001); // tdrStyle->SetStatX(Float_t x = 0); // tdrStyle->SetStatY(Float_t y = 0); // Margins: tdrStyle->SetPadTopMargin(0.05); tdrStyle->SetPadBottomMargin(0.13); tdrStyle->SetPadLeftMargin(0.16); tdrStyle->SetPadRightMargin(0.02); // For the Global title: tdrStyle->SetOptTitle(0); tdrStyle->SetTitleFont(42); tdrStyle->SetTitleColor(1); tdrStyle->SetTitleTextColor(1); tdrStyle->SetTitleFillColor(10); tdrStyle->SetTitleFontSize(0.05); // tdrStyle->SetTitleH(0); // Set the height of the title box // tdrStyle->SetTitleW(0); // Set the width of the title box // tdrStyle->SetTitleX(0); // Set the position of the title box // tdrStyle->SetTitleY(0.985); // Set the position of the title box // tdrStyle->SetTitleStyle(Style_t style = 1001); // tdrStyle->SetTitleBorderSize(2); // For the axis titles: tdrStyle->SetTitleColor(1, "XYZ"); tdrStyle->SetTitleFont(42, "XYZ"); tdrStyle->SetTitleSize(0.06, "XYZ"); // tdrStyle->SetTitleXSize(Float_t size = 0.02); // Another way to set the size? // tdrStyle->SetTitleYSize(Float_t size = 0.02); tdrStyle->SetTitleXOffset(0.9); tdrStyle->SetTitleYOffset(1.4); // tdrStyle->SetTitleOffset(1.1, "Y"); // Another way to set the Offset // For the axis labels: tdrStyle->SetLabelColor(1, "XYZ"); tdrStyle->SetLabelFont(42, "XYZ"); tdrStyle->SetTitleSize(0.06, "XYZ"); // tdrStyle->SetTitleXSize(Float_t size = 0.02); // Another way to set the size? // tdrStyle->SetTitleYSize(Float_t size = 0.02); tdrStyle->SetTitleXOffset(0.9); tdrStyle->SetTitleYOffset(1.4); // tdrStyle->SetTitleOffset(1.1, "Y"); // Another way to set the Offset // For the axis labels: tdrStyle->SetLabelColor(1, "XYZ"); tdrStyle->SetLabelFont(42, "XYZ"); tdrStyle->SetLabelOffset(0.007, "XYZ"); tdrStyle->SetLabelSize(0.05, "XYZ"); // For the axis: tdrStyle->SetAxisColor(1, "XYZ"); tdrStyle->SetStripDecimals(kTRUE); tdrStyle->SetTickLength(0.03, "XYZ"); tdrStyle->SetNdivisions(510, "XYZ"); tdrStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame tdrStyle->SetPadTickY(1); // Change for log plots: tdrStyle->SetOptLogx(0); tdrStyle->SetOptLogy(0); tdrStyle->SetOptLogz(0); // Postscript options: tdrStyle->SetPaperSize(20.,20.); // tdrStyle->SetLineScalePS(Float_t scale = 3); // tdrStyle->SetLineStyleString(Int_t i, const char* text); // tdrStyle->SetHeaderPS(const char* header); // tdrStyle->SetTitlePS(const char* pstitle); // tdrStyle->SetBarOffset(Float_t baroff = 0.5); // tdrStyle->SetBarWidth(Float_t barwidth = 0.5); // tdrStyle->SetPaintTextFormat(const char* format = "g"); // tdrStyle->SetPalette(Int_t ncolors = 0, Int_t* colors = 0); // tdrStyle->SetTimeOffset(Double_t toffset); // tdrStyle->SetHistMinimumZero(kTRUE); tdrStyle->cd(); }
void LatinoStyle2() { TStyle* GloStyle; GloStyle = gStyle; TStyle* LatinosStyle = new TStyle("LatinosStyle", "LatinosStyle"); gStyle = LatinosStyle; //---------------------------------------------------------------------------- // Canvas //---------------------------------------------------------------------------- LatinosStyle->SetCanvasBorderMode( 0); LatinosStyle->SetCanvasBorderSize( 10); LatinosStyle->SetCanvasColor ( 0); LatinosStyle->SetCanvasDefH (794); LatinosStyle->SetCanvasDefW (550); LatinosStyle->SetCanvasDefX ( 10); LatinosStyle->SetCanvasDefY ( 10); //---------------------------------------------------------------------------- // Pad //---------------------------------------------------------------------------- LatinosStyle->SetPadBorderMode ( 0); LatinosStyle->SetPadBorderSize ( 10); LatinosStyle->SetPadColor ( 0); LatinosStyle->SetPadBottomMargin(0.20); LatinosStyle->SetPadTopMargin (0.08); LatinosStyle->SetPadLeftMargin (0.18); LatinosStyle->SetPadRightMargin (0.05); //---------------------------------------------------------------------------- // Frame //---------------------------------------------------------------------------- LatinosStyle->SetFrameFillStyle ( 0); LatinosStyle->SetFrameFillColor ( 0); LatinosStyle->SetFrameLineColor ( 1); LatinosStyle->SetFrameLineStyle ( 0); LatinosStyle->SetFrameLineWidth ( 2); LatinosStyle->SetFrameBorderMode( 0); LatinosStyle->SetFrameBorderSize(10); //---------------------------------------------------------------------------- // Hist //---------------------------------------------------------------------------- LatinosStyle->SetHistFillColor(0); LatinosStyle->SetHistFillStyle(1); LatinosStyle->SetHistLineColor(1); LatinosStyle->SetHistLineStyle(0); LatinosStyle->SetHistLineWidth(1); //---------------------------------------------------------------------------- // Axis //---------------------------------------------------------------------------- LatinosStyle->SetLabelFont ( 42, "xyz"); LatinosStyle->SetLabelOffset(0.015, "xyz"); LatinosStyle->SetLabelSize (0.050, "xyz"); LatinosStyle->SetNdivisions ( 505, "xyz"); LatinosStyle->SetTitleFont ( 42, "xyz"); LatinosStyle->SetTitleSize (0.050, "xyz"); // LatinosStyle->SetNdivisions ( -503, "y"); LatinosStyle->SetTitleOffset( 1.4, "x"); LatinosStyle->SetTitleOffset( 1.2, "y"); LatinosStyle->SetPadTickX ( 1); // Tick marks on the opposite side of the frame LatinosStyle->SetPadTickY ( 1); // Tick marks on the opposite side of the frame //---------------------------------------------------------------------------- // Title //---------------------------------------------------------------------------- LatinosStyle->SetTitleBorderSize( 0); LatinosStyle->SetTitleFillColor ( 10); LatinosStyle->SetTitleAlign ( 12); LatinosStyle->SetTitleFontSize (0.045); LatinosStyle->SetTitleX (0.590); LatinosStyle->SetTitleY (0.830); LatinosStyle->SetTitleFont(42, ""); //---------------------------------------------------------------------------- // Stat //---------------------------------------------------------------------------- // LatinosStyle->SetOptStat (1110); LatinosStyle->SetOptStat ( 0); LatinosStyle->SetStatBorderSize( 0); LatinosStyle->SetStatColor ( 10); LatinosStyle->SetStatFont ( 42); LatinosStyle->SetStatX (0.94); LatinosStyle->SetStatY (0.91); const Int_t NRGBs = 5; const Int_t NCont = 255; Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 }; Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 }; Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 }; Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 }; TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont); LatinosStyle->SetNumberContours(NCont); return; }
void plotMSSM(const TString& what="(ggA+bbA)*BRAZh*BRhbb"){ const double BRZll=0.06726; const double fb2pb=1000; //TString scale(Form("*%f*%f",BRZll,fb2pb)); TString scale(""); TString cname(what); cname.ReplaceAll("*","x"); cname.ReplaceAll("(","U"); cname.ReplaceAll(")","U"); cname+="_MSSM_mhmax"; // TString goodName(what); goodName.ReplaceAll("mh","m_{h}"); goodName.ReplaceAll("ggA","#sigma_{gg#rightarrowA}"); goodName.ReplaceAll("bbA","#sigma_{bb#rightarrowA}"); goodName.ReplaceAll("BRAZh","B(A#rightarrowZh)"); goodName.ReplaceAll("BRhbb","B(h#rightarrowbb)"); //goodName+=("*B(Z#rightarrowll)"); //goodName+=("[pb] "); goodName+=("[GeV] "); TString goodType("MSSM m_{h}^{max}"); //goodName=("#sigma*B(pp#rightarrowA#rightarrowZh#rightarrowllbb) [fb]"); //goodName=("#sigma*B(pp#rightarrowA) [fb]"); //goodName=("BR(A#rightarrowZh)"); //goodName=("BR(h#rightarrowbb)"); //if (m>0) mass=(Form(" * (mA==%d)",m)); //TString ok(" * validity * stability * perturbativity * unitarity "); //TString ok(" * unitarity"); TString ok(""); TChain* ch=new TChain("TreeMSSM"); ch->Add("lsf_working_dir_M225_20636539/parameter_MSSM.root"); ch->Add("lsf_working_dir_M250_20636540/parameter_MSSM.root"); ch->Add("lsf_working_dir_M275_20636541/parameter_MSSM.root"); ch->Add("lsf_working_dir_M300_20636542/parameter_MSSM.root"); ch->Add("lsf_working_dir_M325_20636543/parameter_MSSM.root"); ch->Add("lsf_working_dir_M350_20636544/parameter_MSSM.root"); ch->Add("lsf_working_dir_M400_20636545/parameter_MSSM.root"); ch->Add("lsf_working_dir_M500_20636546/parameter_MSSM.root"); ch->Add("lsf_working_dir_M600_20636547/parameter_MSSM.root"); //double tanbeta[30]={1,10,20,30,40,50,60,70,80,90,100,120,140,160,180,200,220,240,260,280,300,400,500,600,700,800,900,1000,1100,10000}; //double tanbeta[51]={0,10,20,30,40,50,60,70,80,90,100,120,140,160,180,200,220,240,260,280,300,320,340,360,380,400,420,440,460,480,500,550,600,650,700,750,800,850,900,950,1000,1100,1200,1300,1400,1500,2000,3000,4000,5000,6000}; double tanbeta[51]={0,10,20,30,40,50,60,70,80,90,100,120,140,160,180,200,220,240,260,280,300,320,340,360,380,400,420,440,460,500,550,580,600,650,700,750,800,850,900,950,1000,1100,1200,1300,1400,1500,2000,3000,4000,5000,6000}; Double_t bin_tb[50]; for (unsigned int i=0; i<50; i++) { bin_tb[i]=0.005*(tanbeta[i]+tanbeta[i+1]); //cout << "bin_tb[" << i << "]=" << bin_tb[i] << " " << tanbeta[i+1]/100. << endl; } double mA[11]={200,225,250,275,300,325,350,400,500,600,700}; Double_t bin_mA[10]; for (unsigned int i=0; i<=10; ++i) { bin_mA[i]=0.5*(mA[i]+mA[i+1]); //cout << "bin_mA["<<i<<"]=" << bin_mA[i] << endl; } bin_mA[10]=650; TH2F* hggA=new TH2F("hggA","ggA cross section vs tan#beta,m_{A}; m_{A} GeV; tan#beta",9,bin_mA,49,bin_tb); hggA->Sumw2(); //hggA->Draw(); TString cut=what+scale+ok; cout << "CUT: " << cut << endl; ch->Project("hggA","tb:mA",cut); TStyle *tdrStyle = gROOT->GetStyle("tdrStyle"); // Double_t level[15]={.01,.02,.05,.1,.2,.5,1.,2.,5.,10.,20.,50.,100.,200.,500.}; // hggA->SetContour(14,level); // hggA->SetMinimum(level[0]); // //Double_t level[10]={1.,5.,10.,20.,50.,100.,200.,500.,800.,1000.}; // for x-section //Double_t level[10]={100,105,110.,115.,120.,123,125.7,127,130.,135.}; // for mh Double_t level[10]={1,2,3.,4.,120.,123,125.7,127,130.,135.}; // for mh //Double_t level[10]={.01,.1,.2,0.5,0.6,0.65,0.7,0.75,0.8,0.9}; // for BR //Double_t level[10]={.01,.02,.05,.07,.1,.15,0.2,0.5,0.75,1.}; // for BR hggA->SetContour(9,level); hggA->SetMinimum(level[0]); Double_t level[7]={122.7.,123.7,125.4,126.0,127.7,128.7.,150}; // for mh hggA->SetContour(6,level); hggA->SetMinimum(90); Int_t colors[7] = {kWhite,kGreen,kGreen+2,kBlack,kGreen+2,kGreen,kWhite}; tdrStyle->SetPalette((sizeof(colors)/sizeof(Int_t)), colors); // DRAW tdrStyle->SetOptStat(0); // tdrStyle->SetPadGridX(true); // tdrStyle->SetPadGridY(true); // tdrStyle->SetPadTopMargin(0.05); // tdrStyle->SetPadBottomMargin(0.13); tdrStyle->SetTitleYOffset(1.3); tdrStyle->SetTitleXOffset(1.6); tdrStyle->SetTitleOffset(1.3,"Z"); // tdrStyle->SetOptLogz(1); // tdrStyle->SetOptLogy(1); tdrStyle->SetPadRightMargin(0.14); //tdrStyle->SetPalette(1); tdrStyle->cd(); gROOT->ForceStyle(); cout << "Creating canvas " << cname << endl; TCanvas* c1=new TCanvas(cname,goodName,1200,600); cout << " done " << c1->GetName() << endl; c1->Divide(2); c1->cd(1); hggA->DrawCopy("lego2"); gPad->SetLogz(); gPad->SetLogy(); //gPad->SetPhi(120); gPad->SetPhi(-150); //gPad->SetTheta(30); gPad->UseCurrentStyle(); gPad->Update(); TLatex tl; tl.SetTextSize(0.04); tl.SetNDC(); tl.DrawLatex(0.1,0.95,goodName); tl.SetTextAlign(11); tl.DrawLatex(0.1,0.89,goodType); c1->cd(2); // tdrStyle->SetPadLeftMargin(0.25); gPad->UseCurrentStyle(); gPad->Update(); hggA->GetXaxis()->SetTitleOffset(1.1); hggA->GetYaxis()->SetTitleOffset(1.1); hggA->GetZaxis()->SetTitleOffset(100); //hggA->Smooth(); gPad->SetLogy(kFALSE); hggA->DrawCopy("zcont1"); tl.DrawLatex(0.15,0.97,goodName); tl.SetTextAlign(11); tl.DrawLatex(0.2,0.9,goodType); TCanvas* ctmp=new TCanvas(cname,goodName,600,600); hggA->GetYaxis()->SetRangeUser(0.1,10.); hggA->DrawCopy("zcont1"); tl.DrawLatex(0.83,0.97,goodName); tl.SetTextAlign(11); tl.DrawLatex(0.2,0.9,goodType); pCan(ctmp,cname+"_Lin"); // TH1F* test=new TH1F("test","ggA cross section vs tan#beta; tan#beta",27,bin_tb); // ch->Project("test","tb",what); // test->Draw(); TCanvas* c2=new TCanvas(cname+"Obs",goodName,800,800); gPad->UseCurrentStyle(); gPad->Update(); hggA->GetXaxis()->SetTitleOffset(1.1); hggA->GetYaxis()->SetTitleOffset(1.1); hggA->DrawCopy("cont list"); gPad->Update(); //return; // Get Contours TObjArray *conts = (TObjArray*)gROOT->GetListOfSpecials()->FindObject("contours"); TList* contLevel = NULL; TGraph* curv = NULL; TGraph* gc = NULL; Int_t nGraphs = 0; Int_t TotalConts = 0; if (conts == NULL){ printf("*** No Contours Were Extracted!\n"); TotalConts = 0; return; } else { TotalConts = conts->GetSize(); } printf("TotalConts = %d\n", TotalConts); for(i = 0; i < TotalConts; i++){ contLevel = (TList*)conts->At(i); printf("Contour %d has %d Graphs\n", i, contLevel->GetSize()); nGraphs += contLevel->GetSize(); } nGraphs = 0; TH2F *hr = new TH2F("hr", ";m_{A};tan#beta", 2, 225, 600, 2, 0.1, 100); hr->GetXaxis()->SetTitleOffset(1.1); hr->GetXaxis()->SetRangeUser(200,650); hr->GetYaxis()->SetTitleOffset(1.2); hr->GetYaxis()->SetNdivisions(110,kFALSE); hr->GetXaxis()->SetNdivisions(20205,kFALSE); hr->Draw(); Double_t x0, y0, z0; TLatex l; l.SetTextSize(0.03); l.SetTextAlign(32); char val[20]; for(i = 0; i < TotalConts; i++){ contLevel = (TList*)conts->At(i); z0 = level[i]; printf("Z-Level Passed in as: Z = %f\n", z0); // Get first graph from list on curves on this level curv = (TGraph*)contLevel->First(); for(j = 0; j < contLevel->GetSize(); j++){ // last point //curv->GetPoint(curv->GetN()-1, x0, y0); // first point curv->GetPoint(2, x0, y0); // if (z0<0) curv->SetLineColor(kRed); // if (z0>0) curv->SetLineColor(kBlue); nGraphs ++; printf("\tGraph: %d -- %d Elements\n", nGraphs,curv->GetN()); // Draw clones of the graphs to avoid deletions in case the 1st // pad is redrawn. gc = (TGraph*)curv->Clone(); gc->Draw("C"); if (z0>=.01) sprintf(val,"%0.2f",z0); if (z0>=.1) sprintf(val,"%0.2f",z0); if (z0>=1) sprintf(val,"%0.0f",z0); l.DrawLatex(x0*0.99,y0,val); curv = (TGraph*)contLevel->After(curv); // Get Next graph } } gPad->SetLogy(); gPad->SetGridx(); gPad->SetGridy(); gPad->SetRightMargin(0.05); gPad->SetTopMargin(0.10); c2->Update(); printf("\n\n\tExtracted %d Contours and %d Graphs \n", TotalConts, nGraphs ); tl.SetTextAlign(31); tl.DrawLatex(0.8,0.85,goodName); tl.SetTextAlign(31); tl.DrawLatex(0.8,0.77,goodType); pCan(c2,cname+"_BW"); c1->cd(1); gPad->SetLogy(); gPad->SetLogz(); c1->cd(2); gPad->SetLogy(); c1->Update(); pCan(c1,cname); }
void absoluteCS_CSnPb() { TStyle * style = (TStyle*)gROOT->FindObject("graphStyle"); if(!style) { style = new TStyle("graphStyle","graphStyle"); } TCanvas* c = new TCanvas("c1","",1200,1200); style->SetOptStat(0); style->SetOptTitle(0); style->SetPalette(1,0); style->SetCanvasColor(10); style->SetCanvasBorderMode(0); style->SetFrameLineWidth(3); style->SetFrameFillColor(10); style->SetPadColor(10); style->SetHistLineWidth(3); style->SetHistLineColor(kBlue); style->SetMarkerSize(0.9); style->SetMarkerStyle(8); style->SetFuncWidth(3); style->SetFuncColor(kRed); style->SetLabelColor(kBlack,"xyz"); style->SetTitleSize(0.06,"xyz"); style->SetTitleFillColor(10); style->SetTitleTextColor(kBlack); style->SetEndErrorSize(0); gROOT->SetStyle("graphStyle"); gROOT->ForceStyle(); // read graphs string expFileName = "/data2/analysis/total.root"; string litFileName = "/data2/analysis/literatureData.root"; TFile* expFile = new TFile(expFileName.c_str(),"READ"); TFile* litFile = new TFile(litFileName.c_str(),"READ"); string expCGraphName = "CNat"; string expSnGraphName = "SnNat"; string expPbGraphName = "PbNat"; string litCGraphName = "Natural C (n,tot)"; string litSnGraphName = "Natural Sn (n,tot)"; string litPbGraphName = "Natural Pb (n,tot)"; TGraphAsymmErrors* expCGraph = (TGraphAsymmErrors*)expFile->Get(expCGraphName.c_str()); TGraphAsymmErrors* expSnGraph = (TGraphAsymmErrors*)expFile->Get(expSnGraphName.c_str()); TGraphAsymmErrors* expPbGraph = (TGraphAsymmErrors*)expFile->Get(expPbGraphName.c_str()); TGraphAsymmErrors* litCGraph = (TGraphAsymmErrors*)litFile->Get(litCGraphName.c_str()); TGraphAsymmErrors* litSnGraph = (TGraphAsymmErrors*)litFile->Get(litSnGraphName.c_str()); TGraphAsymmErrors* litPbGraph = (TGraphAsymmErrors*)litFile->Get(litPbGraphName.c_str()); // Set graph point and line characteristics expCGraph->SetLineColor(kRed); expCGraph->SetLineWidth(5); expCGraph->SetLineStyle(0); expCGraph->SetMarkerColor(kRed); expSnGraph->SetLineColor(kRed); expSnGraph->SetLineWidth(5); expSnGraph->SetLineStyle(0); expSnGraph->SetMarkerColor(kRed); expPbGraph->SetLineColor(kRed); expPbGraph->SetLineWidth(5); expPbGraph->SetLineStyle(0); expPbGraph->SetMarkerColor(kRed); litCGraph->SetLineColor(kBlack); litCGraph->SetLineWidth(3); litCGraph->SetLineStyle(2); litCGraph->SetMarkerColor(kBlack); litSnGraph->SetLineColor(kBlack); litSnGraph->SetLineWidth(3); litSnGraph->SetLineStyle(2); litSnGraph->SetMarkerColor(kBlack); litPbGraph->SetLineColor(kBlack); litPbGraph->SetLineWidth(3); litPbGraph->SetLineStyle(2); litPbGraph->SetMarkerColor(kBlack); // Pad dimensions and margins gPad->SetPad(0.005, 0.995, 0.995, 0.005); gPad->SetLeftMargin(0.15); gPad->SetRightMargin(0.01); gPad->SetTopMargin(0.03); gPad->SetBottomMargin(0.15); gPad->SetTicky(2); // X-axis parameters expCGraph->GetXaxis()->SetTitle("Energy (MeV)"); expCGraph->GetXaxis()->SetTitleSize(0.05); expCGraph->GetXaxis()->SetTitleFont(2); expCGraph->GetXaxis()->SetTitleOffset(1.4); expCGraph->GetXaxis()->CenterTitle(); expCGraph->GetXaxis()->SetLabelOffset(0.01); expCGraph->GetXaxis()->SetLabelSize(0.05); expCGraph->GetXaxis()->SetLabelFont(2); expCGraph->GetXaxis()->SetNdivisions(10); expCGraph->GetXaxis()->SetTickLength(0.03); // Y-axis parameters expCGraph->GetYaxis()->SetTitle("#sigma_{tot} (barns)"); expCGraph->GetYaxis()->SetTitleSize(0.06); expCGraph->GetYaxis()->SetTitleFont(2); expCGraph->GetYaxis()->SetTitleOffset(0.8); expCGraph->GetYaxis()->CenterTitle(); expCGraph->GetYaxis()->SetLabelOffset(0.01); expCGraph->GetYaxis()->SetLabelSize(0.05); expCGraph->GetYaxis()->SetLabelFont(2); expCGraph->GetYaxis()->SetNdivisions(10); expCGraph->GetYaxis()->SetTickLength(0.02); expCGraph->Draw(""); expSnGraph->Draw("same"); expPbGraph->Draw("same"); litCGraph->Draw("same"); litSnGraph->Draw("same"); litPbGraph->Draw("same"); expCGraph->Draw("same"); expSnGraph->Draw("same"); expPbGraph->Draw("same"); gPad->SetLogx(1); expCGraph->GetYaxis()->SetRangeUser(0,9); TLatex latex; latex.SetNDC(); latex.SetTextSize(0.035); latex.SetTextAlign(13); // align at top latex.DrawLatex(0.65,0.65,"Pb (elem.)"); latex.DrawLatex(0.35,0.52,"Sn (elem.)"); latex.DrawLatex(0.32,0.4,"C (elem.)"); // Define legend format and contents TLegend *legend = new TLegend(0.7,0.8,0.9,0.9); legend->AddEntry(litCGraph,"lit data (analog)","l"); legend->AddEntry(expCGraph,"new data (DSP)","l"); legend->Draw(); expFile->Close(); litFile->Close(); }
void Style_Toby_2() { // Add the saved style to the current ROOT session. delete gROOT->GetStyle("Toby_2"); TStyle *tmpStyle = new TStyle("Toby_2", "Style for posters and talks"); tmpStyle->SetNdivisions(510, "x"); tmpStyle->SetNdivisions(510, "y"); tmpStyle->SetNdivisions(510, "z"); tmpStyle->SetAxisColor(1, "x"); tmpStyle->SetAxisColor(1, "y"); tmpStyle->SetAxisColor(1, "z"); tmpStyle->SetLabelColor(1, "x"); tmpStyle->SetLabelColor(1, "y"); tmpStyle->SetLabelColor(1, "z"); tmpStyle->SetLabelFont(42, "x"); tmpStyle->SetLabelFont(42, "y"); tmpStyle->SetLabelFont(42, "z"); tmpStyle->SetLabelOffset(0.005, "x"); tmpStyle->SetLabelOffset(0.005, "y"); tmpStyle->SetLabelOffset(0.005, "z"); tmpStyle->SetLabelSize(0.035, "x"); tmpStyle->SetLabelSize(0.035, "y"); tmpStyle->SetLabelSize(0.035, "z"); tmpStyle->SetTickLength(0.03, "x"); tmpStyle->SetTickLength(0.03, "y"); tmpStyle->SetTickLength(0.03, "z"); tmpStyle->SetTitleOffset(1, "x"); tmpStyle->SetTitleOffset(1, "y"); tmpStyle->SetTitleOffset(1, "z"); tmpStyle->SetTitleSize(0.035, "x"); tmpStyle->SetTitleSize(0.035, "y"); tmpStyle->SetTitleSize(0.035, "z"); tmpStyle->SetTitleColor(1, "x"); tmpStyle->SetTitleColor(1, "y"); tmpStyle->SetTitleColor(1, "z"); tmpStyle->SetTitleFont(42, "x"); tmpStyle->SetTitleFont(42, "y"); tmpStyle->SetTitleFont(42, "z"); tmpStyle->SetBarWidth(1); tmpStyle->SetBarOffset(0); tmpStyle->SetDrawBorder(0); tmpStyle->SetOptLogx(0); tmpStyle->SetOptLogy(0); tmpStyle->SetOptLogz(0); tmpStyle->SetOptDate(0); tmpStyle->SetOptStat(111); tmpStyle->SetOptTitle(kTRUE); tmpStyle->SetOptFit(0); tmpStyle->SetNumberContours(20); tmpStyle->GetAttDate()->SetTextFont(62); tmpStyle->GetAttDate()->SetTextSize(0.025); tmpStyle->GetAttDate()->SetTextAngle(0); tmpStyle->GetAttDate()->SetTextAlign(11); tmpStyle->GetAttDate()->SetTextColor(1); tmpStyle->SetDateX(0.01); tmpStyle->SetDateY(0.01); tmpStyle->SetEndErrorSize(2); tmpStyle->SetErrorX(0.5); tmpStyle->SetFuncColor(2); tmpStyle->SetFuncStyle(1); tmpStyle->SetFuncWidth(2); tmpStyle->SetGridColor(0); tmpStyle->SetGridStyle(3); tmpStyle->SetGridWidth(1); tmpStyle->SetLegendBorderSize(1); tmpStyle->SetLegendFillColor(0); tmpStyle->SetLegendFont(42); tmpStyle->SetHatchesLineWidth(1); tmpStyle->SetHatchesSpacing(1); tmpStyle->SetFrameFillColor(0); tmpStyle->SetFrameLineColor(1); tmpStyle->SetFrameFillStyle(1001); tmpStyle->SetFrameLineStyle(1); tmpStyle->SetFrameLineWidth(1); tmpStyle->SetFrameBorderSize(1); tmpStyle->SetFrameBorderMode(0); tmpStyle->SetHistFillColor(0); tmpStyle->SetHistLineColor(602); tmpStyle->SetHistFillStyle(1001); tmpStyle->SetHistLineStyle(1); tmpStyle->SetHistLineWidth(1); tmpStyle->SetHistMinimumZero(kFALSE); tmpStyle->SetCanvasPreferGL(kFALSE); tmpStyle->SetCanvasColor(0); tmpStyle->SetCanvasBorderSize(2); tmpStyle->SetCanvasBorderMode(0); tmpStyle->SetCanvasDefH(500); tmpStyle->SetCanvasDefW(700); tmpStyle->SetCanvasDefX(10); tmpStyle->SetCanvasDefY(10); tmpStyle->SetPadColor(0); tmpStyle->SetPadBorderSize(2); tmpStyle->SetPadBorderMode(0); tmpStyle->SetPadBottomMargin(0.1); tmpStyle->SetPadTopMargin(0.1); tmpStyle->SetPadLeftMargin(0.1); tmpStyle->SetPadRightMargin(0.1); tmpStyle->SetPadGridX(kFALSE); tmpStyle->SetPadGridY(kFALSE); tmpStyle->SetPadTickX(0); tmpStyle->SetPadTickY(0); tmpStyle->SetPaperSize(20, 26); tmpStyle->SetScreenFactor(1); tmpStyle->SetStatColor(0); tmpStyle->SetStatTextColor(1); tmpStyle->SetStatBorderSize(1); tmpStyle->SetStatFont(42); tmpStyle->SetStatFontSize(0); tmpStyle->SetStatStyle(1001); tmpStyle->SetStatFormat("6.4g"); tmpStyle->SetStatX(0.9); tmpStyle->SetStatY(0.97); tmpStyle->SetStatW(0.15); tmpStyle->SetStatH(0.16); tmpStyle->SetStripDecimals(kTRUE); tmpStyle->SetTitleAlign(23); tmpStyle->SetTitleFillColor(0); tmpStyle->SetTitleTextColor(1); tmpStyle->SetTitleBorderSize(0); tmpStyle->SetTitleFont(42); tmpStyle->SetTitleFontSize(0.05); tmpStyle->SetTitleStyle(0); tmpStyle->SetTitleX(0.5); tmpStyle->SetTitleY(0.995); tmpStyle->SetTitleW(0); tmpStyle->SetTitleH(0); tmpStyle->SetLegoInnerR(0.5); Int_t fPaletteColor[50] = {51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100}; tmpStyle->SetPalette(50, fPaletteColor); TString fLineStyleArrayTmp[30] = {"", " ", " 12 12", " 4 8", " 12 16 4 16", " 20 12 4 12", " 20 12 4 12 4 12 4 12", " 20 20", " 20 12 4 12 4 12", " 80 20", " 80 40 4 40", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "}; for (Int_t i=0; i<30; i++) tmpStyle->SetLineStyleString(i, fLineStyleArrayTmp[i]); tmpStyle->SetHeaderPS(""); tmpStyle->SetTitlePS(""); tmpStyle->SetFitFormat("5.4g"); tmpStyle->SetPaintTextFormat("g"); tmpStyle->SetLineScalePS(3); tmpStyle->SetColorModelPS(0); tmpStyle->SetTimeOffset(788918400); tmpStyle->SetLineColor(1); tmpStyle->SetLineStyle(1); tmpStyle->SetLineWidth(1); tmpStyle->SetFillColor(19); tmpStyle->SetFillStyle(1001); tmpStyle->SetMarkerColor(1); tmpStyle->SetMarkerSize(1); tmpStyle->SetMarkerStyle(1); tmpStyle->SetTextAlign(11); tmpStyle->SetTextAngle(0); tmpStyle->SetTextColor(1); tmpStyle->SetTextFont(62); tmpStyle->SetTextSize(0.05); }
void scan_comp_engine( TString engine1_file, TString engine_file) { engine *myengine1 = new engine(engine1_file,0); // TString engine_file="paw/hms_dc_52949.root"; engine *myengine = new engine(engine_file,0); Long64_t nent_engine1 = myengine1->fChain->GetEntriesFast(); Long64_t nent_engine = myengine->fChain->GetEntriesFast(); cout << " engine1 entries = " << nent_engine1 << " engine entries = " << nent_engine << endl; Long64_t nb_engine1 = 0,nb_engine = 0; // TH1F *hntr_engine1 = new TH1F("hntr_engine1","; Ntracks; Counts",50,0,50); TH1F *hntr_eng = new TH1F("hntr_eng","; Ntracks; Counts",50,0,50); TH2F *hntr_2d = new TH2F("hntr_2d","; ENGINE1 Ntracks ; ENGINE Ntracks",40,0,40,40,0,40); TH1F *hntr_diff = new TH1F("hntr_diff","; Ntracks; Counts",50,0,50); TH1F *hxpfp_eng[3],*hxpfp_engine1[3],*hxpfp_diff[3],*hxpfp_sub[3]; TH1F *hypfp_eng[3],*hypfp_engine1[3],*hypfp_diff[3],*hypfp_sub[3]; TH1F *hyfp_eng[3],*hyfp_engine1[3],*hyfp_diff[3],*hyfp_sub[3]; TH1F *hxfp_eng[3],*hxfp_engine1[3],*hxfp_diff[3],*hxfp_sub[3]; // Int_t i; for (i=0 ; i<3 ;i++) { hxpfp_eng[i] = new TH1F(Form("hxpfp_eng%d",i),"; Xpfp (mr); Counts",100,-100.,100.); hxpfp_engine1[i] = new TH1F(Form("hxpfp_engine1%d",i),"; Xpfp (mr); Counts",100,-100.,100.); hxpfp_diff[i] = new TH1F(Form("hxpfp_diff%d",i),"Difference; Xpfp (mr); Counts",100,-100.,100.); hypfp_eng[i] = new TH1F(Form("hypfp_eng%d",i),"; Ypfp (mr); Counts",100,-50.,50.); hypfp_engine1[i] = new TH1F(Form("hypfp_engine1%d",i),"; Ypfp (mr); Counts",100,-50.,50.); hypfp_diff[i] = new TH1F(Form("hypfp_diff%d",i),"Difference; Ypfp (mr); Counts",100,-50.,50.); hxfp_eng[i] = new TH1F(Form("hxfp_eng%d",i),"; Xfp (cm); Counts",100,-50,50); hxfp_engine1[i] = new TH1F(Form("hxfp_engine1%d",i),"; Xfp (cm); Counts",100,-50,50); hxfp_diff[i] = new TH1F(Form("hxfp_diff%d",i),"Difference; Xfp (cm); Counts",100,-50,50); hyfp_eng[i] = new TH1F(Form("hyfp_eng%d",i),"; Yfp (cm); Counts",60,-30,30); hyfp_engine1[i] = new TH1F(Form("hyfp_engine1%d",i),"; Yfp (cm); Counts",60,-30,30); hyfp_diff[i] = new TH1F(Form("hyfp_diff%d",i),"Difference; Yfp (cm); Counts",60,-30,30); hyfp_sub[i] = new TH1F(Form("hyfp_sub%d",i),"; Yfp (ENGINE1-ENGINE); Counts",60,-.5,.5); hxfp_sub[i] = new TH1F(Form("hxfp_sub%d",i),"; Xfp (ENGINE1-ENGINE); Counts",100,-.5,.5); hxpfp_sub[i] = new TH1F(Form("hxpfp_sub%d",i),"; Xpfp (ENGINE1-ENGINE); Counts",100,-.2,.2); hypfp_sub[i] = new TH1F(Form("hypfp_sub%d",i),"; Ypfp (ENGINE1-ENGINE); Counts",100,-.2,.2); }// // Int_t counter=0; for (Long64_t ni=0 ; ni<nent_engine1 ;ni++) { nb_engine1 = myengine1->fChain->GetEntry(ni); nb_engine = myengine->fChain->GetEntry(ni); hntr_engine1->Fill(myengine1->dc_ntr); hntr_eng->Fill(myengine->dc_ntr); if ((myengine1->dc_ntr) != (myengine->dc_ntr) )hntr_2d->Fill(myengine1->dc_ntr,myengine->dc_ntr); if ( myengine1->dc_ntr==myengine->dc_ntr &&myengine1->dc_ntr<=3 ) { for (i=0 ; i<myengine->dc_ntr ;i++) { hxfp_engine1[i]->Fill(myengine1->dc_xfp[i]); hyfp_engine1[i]->Fill(myengine1->dc_yfp[i]); hxpfp_engine1[i]->Fill(myengine1->dc_xpfp[i]*1000); hypfp_engine1[i]->Fill(myengine1->dc_ypfp[i]*1000); hxfp_eng[i]->Fill(myengine->dc_xfp[i]); hyfp_eng[i]->Fill(myengine->dc_yfp[i]); hxpfp_eng[i]->Fill(myengine->dc_xpfp[i]*1000); hypfp_eng[i]->Fill(myengine->dc_ypfp[i]*1000); if ( TMath::Abs((myengine1->dc_yfp[i]-myengine->dc_yfp[i])) != 0.0 || (myengine1->dc_xfp[i]-myengine->dc_xfp[i]) != 0.0 || (myengine1->dc_xpfp[i]-myengine->dc_xpfp[i]) != 0.0 || (myengine1->dc_ypfp[i]-myengine->dc_ypfp[i]) != 0.0 ) { hyfp_sub[i]->Fill((myengine1->dc_yfp[i]-myengine->dc_yfp[i])); hxfp_sub[i]->Fill((myengine1->dc_xfp[i]-myengine->dc_xfp[i])); hypfp_sub[i]->Fill((myengine1->dc_ypfp[i]-myengine->dc_ypfp[i])); hxpfp_sub[i]->Fill((myengine1->dc_xpfp[i]-myengine->dc_xpfp[i])); } } } if ( myengine->dc_ntr == 1 && myengine1->dc_ntr == 1 && -1==1) { cout << " Counter = "<< counter++ << endl; myengine1->PrintTrack(ni); myengine->PrintTrack(ni); } } cout << " Engine1 File= " << engine1_file << endl; cout << " Engine File= " << engine_file << endl; TStyle *MyStyle = new TStyle("MyStyle"," My Style"); MyStyle->SetOptStat(1000000); MyStyle->SetTitleOffset(1.,"Y"); MyStyle->SetTitleOffset(.7,"X"); MyStyle->SetLabelSize(0.04,"XY"); MyStyle->SetTitleSize(0.06,"XY"); MyStyle->SetPadLeftMargin(0.12); MyStyle->SetStatFontSize(0.2); MyStyle->SetTitleFontSize(0.1); gROOT->SetStyle("MyStyle"); // TCanvas *cplot2[3]; for (i=0 ; i<3 ;i++) { cplot2[i] = new TCanvas(Form("cplot2_%d",i),Form(" Focal Plane Positions ( %d track) ",i+1),800,800); cplot2[i]->Divide(2,3); cplot2[i]->cd(1); hxfp_engine1[i]->Draw(); hxfp_eng[i]->Draw("same"); hxfp_eng[i]->SetLineColor(2); cplot2[i]->cd(3); hxfp_diff[i]->Add(hxfp_engine1[i],hxfp_eng[i],-1); hxfp_diff[i]->Draw(); cplot2[i]->cd(5); hxfp_sub[i]->Draw(); cplot2[i]->cd(2); hyfp_engine1[i]->Draw(); hyfp_eng[i]->Draw("same"); hyfp_eng[i]->SetLineColor(2); cplot2[i]->cd(4); hyfp_diff[i]->Add(hyfp_engine1[i],hyfp_eng[i],-1); hyfp_diff[i]->Draw(); cplot2[i]->cd(6); hyfp_sub[i]->Draw(); } TCanvas *cplot3[3]; for (i=0 ; i<3 ;i++) { cplot3[i]= new TCanvas(Form("cplot3_%d",i),Form(" Focal Plane Angles (%d track) ",i+1),800,800); cplot3[i]->Divide(2,3); cplot3[i]->cd(1); hxpfp_engine1[i]->Draw(); hxpfp_eng[i]->Draw("same"); hxpfp_eng[i]->SetLineColor(2); cplot3[i]->cd(3); hxpfp_diff[i]->Add(hxpfp_engine1[i],hxpfp_eng[i],-1); hxpfp_diff[i]->Draw(); cplot3[i]->cd(5); hxpfp_sub[i]->Draw(); cplot3[i]->cd(2); hypfp_engine1[i]->Draw(); hypfp_eng[i]->Draw("same"); hypfp_eng[i]->SetLineColor(2); cplot3[i]->cd(4); hypfp_diff[i]->Add(hypfp_engine1[i],hypfp_eng[i],-1); hypfp_diff[i]->Draw(); cplot3[i]->cd(6); hypfp_sub[i]->Draw(); } TCanvas *cplot1 = new TCanvas("cplot1","2D ntrack ",800,800); hntr_2d->Draw("colz"); TCanvas *cplot = new TCanvas("cplot","1D ntrack ",800,800); cplot->Divide(1,3); cplot->cd(1); hntr_engine1->Draw(); cplot->cd(2); hntr_eng->Draw(); hntr_eng->SetLineColor(2); cplot->cd(3); hntr_diff->Add(hntr_engine1,hntr_eng,-1); hntr_diff->Draw(); // }
void doStackGen() { TStyle *simpleStyle = new TStyle("simpleStyle",""); simpleStyle->SetCanvasColor(0); simpleStyle->SetFrameFillColor(0); simpleStyle->SetStatColor(0); simpleStyle->SetOptStat(0); simpleStyle->SetTitleFillColor(0); simpleStyle->SetCanvasBorderMode(0); simpleStyle->SetPadBorderMode(0); simpleStyle->SetFrameBorderMode(0); simpleStyle->cd(); TFile* inFile = TFile::Open("RxGenOutputFile.root"); TH1D* h1_RchGen_vs_eta = (TH1D*)inFile->Get("RchGen_vs_eta"); TH1D* h1_RgammaGen_vs_eta = (TH1D*)inFile->Get("RgammaGen_vs_eta"); TH1D* h1_RnhGen_vs_eta = (TH1D*)inFile->Get("RnhGen_vs_eta"); // TH1D* h1_RmuGen_vs_eta = (TH1D*)inFile->Get("RmuGen_vs_eta_PFItCone5"); int nBinsX_RchGen = h1_RchGen_vs_eta->GetNbinsX(); int nBinsX_RgammaGen = h1_RgammaGen_vs_eta->GetNbinsX(); int nBinsX_RnhGen = h1_RnhGen_vs_eta->GetNbinsX(); // int nBinsX_RmuGen = h1_RmuGen_vs_eta->GetNbinsX(); double minX_RchGen = h1_RchGen_vs_eta->GetXaxis()->GetXmin(); double maxX_RchGen = h1_RchGen_vs_eta->GetXaxis()->GetXmax(); double minX_RgammaGen = h1_RgammaGen_vs_eta->GetXaxis()->GetXmin(); double maxX_RgammaGen = h1_RgammaGen_vs_eta->GetXaxis()->GetXmax(); double minX_RnhGen = h1_RnhGen_vs_eta->GetXaxis()->GetXmin(); double maxX_RnhGen = h1_RnhGen_vs_eta->GetXaxis()->GetXmax(); // double minX_RmuGen = h1_RmuGen_vs_eta->GetXaxis()->GetXmin(); // double maxX_RmuGen = h1_RmuGen_vs_eta->GetXaxis()->GetXmax(); TH1D* h1_RchGen_vs_eta_stack = new TH1D("RchGen_vs_eta_stack", "", nBinsX_RchGen, minX_RchGen, maxX_RchGen); h1_RchGen_vs_eta_stack->SetFillColor(kRed); h1_RchGen_vs_eta_stack->SetXTitle("#eta^{GEN}"); TH1D* h1_RgammaGen_vs_eta_stack = new TH1D("RgammaGen_vs_eta_stack", "", nBinsX_RgammaGen, minX_RgammaGen, maxX_RgammaGen); h1_RgammaGen_vs_eta_stack->SetFillColor(kGreen); h1_RgammaGen_vs_eta_stack->SetXTitle("#eta^{GEN}"); TH1D* h1_RnhGen_vs_eta_stack = new TH1D("RnhGen_vs_eta_stack", "", nBinsX_RnhGen, minX_RnhGen, maxX_RnhGen); h1_RnhGen_vs_eta_stack->SetFillColor(kBlue); h1_RnhGen_vs_eta_stack->SetXTitle("#eta^{GEN}"); // TH1D* h1_RmuGen_vs_eta_stack = new TH1D("RmuGen_vs_eta", "", nBinsX_RmuGen, minX_RmuGen, maxX_RmuGen); // h1_RmuGen_vs_eta_stack->SetFillColor(kYellow); // h1_RmuGen_vs_eta_stack->SetXTitle("#eta^{GEN}"); for(int i=1; i<101; ++i) { h1_RchGen_vs_eta_stack->SetBinContent( i, h1_RchGen_vs_eta->GetBinContent(i) ); h1_RgammaGen_vs_eta_stack->SetBinContent( i, h1_RgammaGen_vs_eta->GetBinContent(i) ); h1_RnhGen_vs_eta_stack->SetBinContent( i, h1_RnhGen_vs_eta->GetBinContent(i) ); // h1_RmuGen_vs_eta_stack->SetBinContent( i, h1_RmuGen_vs_eta->GetBinContent(i) ); } THStack* stack = new THStack("stack", ""); stack->Add(h1_RchGen_vs_eta_stack); stack->Add(h1_RgammaGen_vs_eta_stack); stack->Add(h1_RnhGen_vs_eta_stack); // stack->Add(h1_RmuGen_vs_eta_stack); stack->Draw(); stack->GetXaxis()->SetTitle("#eta^{GEN}"); stack->GetYaxis()->SetTitle("% of Jet Energy"); TCanvas* c1 = new TCanvas("c1", "c1", 800, 600); c1->cd(); stack->Draw(); c1->SaveAs("Plots/genstack_vs_eta.eps"); TH1D* h1_Rnh_neutron_vs_eta = (TH1D*)inFile->Get("Rnh_neutron_vs_eta"); TH1D* h1_Rnh_K0L_vs_eta = (TH1D*)inFile->Get("Rnh_K0L_vs_eta"); TH1D* h1_Rnh_K0S_vs_eta = (TH1D*)inFile->Get("Rnh_K0S_vs_eta"); TH1D* h1_Rnh_lambda_vs_eta = (TH1D*)inFile->Get("Rnh_lambda_vs_eta"); TH1D* h1_Rnh_csi_vs_eta = (TH1D*)inFile->Get("Rnh_csi_vs_eta"); int nBinsX_Rnh_neutron = h1_Rnh_neutron_vs_eta->GetNbinsX(); int nBinsX_Rnh_K0L = h1_Rnh_K0L_vs_eta->GetNbinsX(); int nBinsX_Rnh_K0S = h1_Rnh_K0S_vs_eta->GetNbinsX(); int nBinsX_Rnh_lambda = h1_Rnh_lambda_vs_eta->GetNbinsX(); int nBinsX_Rnh_csi = h1_Rnh_csi_vs_eta->GetNbinsX(); double minX_Rnh_neutron = h1_Rnh_neutron_vs_eta->GetXaxis()->GetXmin(); double maxX_Rnh_neutron = h1_Rnh_neutron_vs_eta->GetXaxis()->GetXmax(); double minX_Rnh_K0L = h1_Rnh_K0L_vs_eta->GetXaxis()->GetXmin(); double maxX_Rnh_K0L = h1_Rnh_K0L_vs_eta->GetXaxis()->GetXmax(); double minX_Rnh_K0S = h1_Rnh_K0S_vs_eta->GetXaxis()->GetXmin(); double maxX_Rnh_K0S = h1_Rnh_K0S_vs_eta->GetXaxis()->GetXmax(); double minX_Rnh_lambda = h1_Rnh_lambda_vs_eta->GetXaxis()->GetXmin(); double maxX_Rnh_lambda = h1_Rnh_lambda_vs_eta->GetXaxis()->GetXmax(); double minX_Rnh_csi = h1_Rnh_csi_vs_eta->GetXaxis()->GetXmin(); double maxX_Rnh_csi = h1_Rnh_csi_vs_eta->GetXaxis()->GetXmax(); TH1D* h1_Rnh_neutron_vs_eta_stack = new TH1D("Rnh_neutron_vs_eta_stack", "", nBinsX_Rnh_neutron, minX_Rnh_neutron, maxX_Rnh_neutron); h1_Rnh_neutron_vs_eta_stack->SetFillColor(kBlue+4); h1_Rnh_neutron_vs_eta_stack->SetXTitle("#eta^{GEN}"); TH1D* h1_Rnh_K0L_vs_eta_stack = new TH1D("Rnh_K0L_vs_eta_stack", "", nBinsX_Rnh_K0L, minX_Rnh_K0L, maxX_Rnh_K0L); h1_Rnh_K0L_vs_eta_stack->SetFillColor(kBlue); h1_Rnh_K0L_vs_eta_stack->SetXTitle("#eta^{GEN}"); TH1D* h1_Rnh_K0S_vs_eta_stack = new TH1D("Rnh_K0S_vs_eta_stack", "", nBinsX_Rnh_K0S, minX_Rnh_K0S, maxX_Rnh_K0S); h1_Rnh_K0S_vs_eta_stack->SetFillColor(kCyan); h1_Rnh_K0S_vs_eta_stack->SetXTitle("#eta^{GEN}"); TH1D* h1_Rnh_lambda_vs_eta_stack = new TH1D("Rnh_lambda_vs_eta_stack", "", nBinsX_Rnh_lambda, minX_Rnh_lambda, maxX_Rnh_lambda); h1_Rnh_lambda_vs_eta_stack->SetFillColor(kCyan+2); h1_Rnh_lambda_vs_eta_stack->SetXTitle("#eta^{GEN}"); TH1D* h1_Rnh_csi_vs_eta_stack = new TH1D("Rnh_csi_vs_eta_stack", "", nBinsX_Rnh_csi, minX_Rnh_csi, maxX_Rnh_csi); h1_Rnh_csi_vs_eta_stack->SetFillColor(kCyan+4); h1_Rnh_csi_vs_eta_stack->SetXTitle("#eta^{GEN}"); for(int i=1; i<101; ++i) { h1_Rnh_neutron_vs_eta_stack->SetBinContent( i, h1_Rnh_neutron_vs_eta->GetBinContent(i) ); h1_Rnh_K0L_vs_eta_stack->SetBinContent( i, h1_Rnh_K0L_vs_eta->GetBinContent(i) ); h1_Rnh_K0S_vs_eta_stack->SetBinContent( i, h1_Rnh_K0S_vs_eta->GetBinContent(i) ); h1_Rnh_lambda_vs_eta_stack->SetBinContent( i, h1_Rnh_lambda_vs_eta->GetBinContent(i) ); h1_Rnh_csi_vs_eta_stack->SetBinContent( i, h1_Rnh_csi_vs_eta->GetBinContent(i) ); } THStack* stackNH = new THStack("stackNH", ""); stackNH->Add(h1_Rnh_neutron_vs_eta_stack); stackNH->Add(h1_Rnh_K0L_vs_eta_stack); stackNH->Add(h1_Rnh_K0S_vs_eta_stack); stackNH->Add(h1_Rnh_lambda_vs_eta_stack); stackNH->Add(h1_Rnh_csi_vs_eta_stack); stackNH->Draw(); stackNH->GetXaxis()->SetTitle("#eta^{GEN}"); stackNH->GetYaxis()->SetTitle("% of Jet Neutral Hadron Energy"); TCanvas* c3 = new TCanvas("c3", "c3", 800, 600); c3->cd(); stackNH->Draw(); c3->SaveAs("Plots/genstackNH_vs_eta.eps"); /* int nBins = 21; Double_t Lower[nBins]; for(int iLower=0; iLower<11; ++iLower) Lower[iLower] = iLower*10.; Lower[11] = 120.; Lower[12] = 140.; Lower[13] = 160.; Lower[14] = 180.; Lower[15] = 200.; Lower[16] = 250.; Lower[17] = 300.; Lower[18] = 400.; Lower[19] = 500.; Lower[20] = 600.; TH1D* h1_RchGen_vs_pt = (TH1D*)inFile->Get("RchGen_vs_pt_PFItCone5"); TH1D* h1_RgammaGen_vs_pt = (TH1D*)inFile->Get("RgammaGen_vs_pt_PFItCone5"); TH1D* h1_RnhGen_vs_pt = (TH1D*)inFile->Get("RnhGen_vs_pt_PFItCone5"); // TH1D* h1_RmuGen_vs_pt = (TH1D*)inFile->Get("RmuGen_vs_pt_PFItCone5"); TH1D* h1_RchGen_vs_pt_stack = new TH1D("RchGen_vs_pt", "", nBins-2, Lower); h1_RchGen_vs_pt_stack->SetFillColor(kRed); h1_RchGen_vs_pt_stack->SetXTitle("p_{T}^{GEN}"); TH1D* h1_RgammaGen_vs_pt_stack = new TH1D("RgammaGen_vs_pt", "", nBins-2, Lower); h1_RgammaGen_vs_pt_stack->SetFillColor(kGreen); h1_RgammaGen_vs_pt_stack->SetXTitle("p_{T}^{GEN}"); TH1D* h1_RnhGen_vs_pt_stack = new TH1D("RnhGen_vs_pt", "", nBins-2, Lower); h1_RnhGen_vs_pt_stack->SetFillColor(kBlue); h1_RnhGen_vs_pt_stack->SetXTitle("p_{T}^{GEN}"); // TH1D* h1_RmuGen_vs_pt_stack = new TH1D("RmuGen_vs_pt", "", nBins-2, Lower); // h1_RmuGen_vs_pt_stack->SetFillColor(kYellow); // h1_RmuGen_vs_pt_stack->SetXTitle("p_{T}^{GEN}"); for(int i=1; i<21; ++i) { h1_RchGen_vs_pt_stack->SetBinContent( i, h1_RchGen_vs_pt->GetBinContent(i) ); h1_RgammaGen_vs_pt_stack->SetBinContent( i, h1_RgammaGen_vs_pt->GetBinContent(i) ); h1_RnhGen_vs_pt_stack->SetBinContent( i, h1_RnhGen_vs_pt->GetBinContent(i) ); // h1_RmuGen_vs_pt_stack->SetBinContent( i, h1_RmuGen_vs_pt->GetBinContent(i) ); } THStack* stack2 = new THStack("stack2", ""); stack2->Add(h1_RchGen_vs_pt_stack); stack2->Add(h1_RgammaGen_vs_pt_stack); stack2->Add(h1_RnhGen_vs_pt_stack); // stack2->Add(h1_RmuGen_vs_pt_stack); stack2->Draw(); stack2->GetXaxis()->SetTitle("p_{T}^{GEN} [GeV/c]"); stack2->GetYaxis()->SetTitle("% of Jet Energy"); TCanvas* c2 = new TCanvas("c2", "c2", 800, 600); c2->cd(); stack2->Draw(); c2->SaveAs("Plots/genstack_vs_pt.eps"); TH1D* h1_RchGen_vs_pt_barrel = (TH1D*)inFile->Get("RchGen_vs_pt_barrel_PFItCone5"); TH1D* h1_RgammaGen_vs_pt_barrel = (TH1D*)inFile->Get("RgammaGen_vs_pt_barrel_PFItCone5"); TH1D* h1_RnhGen_vs_pt_barrel = (TH1D*)inFile->Get("RnhGen_vs_pt_barrel_PFItCone5"); // TH1D* h1_RmuGen_vs_pt_barrel = (TH1D*)inFile->Get("RmuGen_vs_pt_barrel_PFItCone5"); TH1D* h1_RchGen_vs_pt_barrel_stack = new TH1D("RchGen_vs_pt_barrel", "", nBins-2, Lower); h1_RchGen_vs_pt_barrel_stack->SetFillColor(kRed); h1_RchGen_vs_pt_barrel_stack->SetXTitle("p_{T}^{GEN}"); TH1D* h1_RgammaGen_vs_pt_barrel_stack = new TH1D("RgammaGen_vs_pt_barrel", "", nBins-2, Lower); h1_RgammaGen_vs_pt_barrel_stack->SetFillColor(kGreen); h1_RgammaGen_vs_pt_barrel_stack->SetXTitle("p_{T}^{GEN}"); TH1D* h1_RnhGen_vs_pt_barrel_stack = new TH1D("RnhGen_vs_pt_barrel", "", nBins-2, Lower); h1_RnhGen_vs_pt_barrel_stack->SetFillColor(kBlue); h1_RnhGen_vs_pt_barrel_stack->SetXTitle("p_{T}^{GEN}"); // TH1D* h1_RmuGen_vs_pt_barrel_stack = new TH1D("RmuGen_vs_pt_barrel", "", nBins-2, Lower); // h1_RmuGen_vs_pt_barrel_stack->SetFillColor(kYellow); // h1_RmuGen_vs_pt_barrel_stack->SetXTitle("p_{T}^{GEN}"); for(int i=1; i<21; ++i) { h1_RchGen_vs_pt_barrel_stack->SetBinContent( i, h1_RchGen_vs_pt_barrel->GetBinContent(i) ); h1_RgammaGen_vs_pt_barrel_stack->SetBinContent( i, h1_RgammaGen_vs_pt_barrel->GetBinContent(i) ); h1_RnhGen_vs_pt_barrel_stack->SetBinContent( i, h1_RnhGen_vs_pt_barrel->GetBinContent(i) ); // h1_RmuGen_vs_pt_barrel_stack->SetBinContent( i, h1_RmuGen_vs_pt_barrel->GetBinContent(i) ); } THStack* stack3 = new THStack("stack3", ""); stack3->Add(h1_RchGen_vs_pt_barrel_stack); stack3->Add(h1_RgammaGen_vs_pt_barrel_stack); stack3->Add(h1_RnhGen_vs_pt_barrel_stack); // stack3->Add(h1_RmuGen_vs_pt_barrel_stack); stack3->Draw(); stack3->GetXaxis()->SetTitle("p_{T}^{GEN} [GeV/c]"); stack3->GetYaxis()->SetTitle("% of Jet Energy"); c2->cd(); stack3->Draw(); c2->SaveAs("Plots/genstack_vs_pt_barrel.eps"); TH1D* h1_RchGen_vs_pt_endcap = (TH1D*)inFile->Get("RchGen_vs_pt_endcap_PFItCone5"); TH1D* h1_RgammaGen_vs_pt_endcap = (TH1D*)inFile->Get("RgammaGen_vs_pt_endcap_PFItCone5"); TH1D* h1_RnhGen_vs_pt_endcap = (TH1D*)inFile->Get("RnhGen_vs_pt_endcap_PFItCone5"); // TH1D* h1_RmuGen_vs_pt_endcap = (TH1D*)inFile->Get("RmuGen_vs_pt_endcap_PFItCone5"); TH1D* h1_RchGen_vs_pt_endcap_stack = new TH1D("RchGen_vs_pt_endcap", "", nBins-2, Lower); h1_RchGen_vs_pt_endcap_stack->SetFillColor(kRed); h1_RchGen_vs_pt_endcap_stack->SetXTitle("p_{T}^{GEN}"); TH1D* h1_RgammaGen_vs_pt_endcap_stack = new TH1D("RgammaGen_vs_pt_endcap", "", nBins-2, Lower); h1_RgammaGen_vs_pt_endcap_stack->SetFillColor(kGreen); h1_RgammaGen_vs_pt_endcap_stack->SetXTitle("p_{T}^{GEN}"); TH1D* h1_RnhGen_vs_pt_endcap_stack = new TH1D("RnhGen_vs_pt_endcap", "", nBins-2, Lower); h1_RnhGen_vs_pt_endcap_stack->SetFillColor(kBlue); h1_RnhGen_vs_pt_endcap_stack->SetXTitle("p_{T}^{GEN}"); // TH1D* h1_RmuGen_vs_pt_endcap_stack = new TH1D("RmuGen_vs_pt_endcap", "", nBins-2, Lower); // h1_RmuGen_vs_pt_endcap_stack->SetFillColor(kYellow); // h1_RmuGen_vs_pt_endcap_stack->SetXTitle("p_{T}^{GEN}"); for(int i=1; i<21; ++i) { h1_RchGen_vs_pt_endcap_stack->SetBinContent( i, h1_RchGen_vs_pt_endcap->GetBinContent(i) ); h1_RgammaGen_vs_pt_endcap_stack->SetBinContent( i, h1_RgammaGen_vs_pt_endcap->GetBinContent(i) ); h1_RnhGen_vs_pt_endcap_stack->SetBinContent( i, h1_RnhGen_vs_pt_endcap->GetBinContent(i) ); //h1_RmuGen_vs_pt_endcap_stack->SetBinContent( i, h1_RmuGen_vs_pt_endcap->GetBinContent(i) ); } THStack* stack4 = new THStack("stack4", ""); stack4->Add(h1_RchGen_vs_pt_endcap_stack); stack4->Add(h1_RgammaGen_vs_pt_endcap_stack); stack4->Add(h1_RnhGen_vs_pt_endcap_stack); // stack4->Add(h1_RmuGen_vs_pt_endcap_stack); stack4->Draw(); stack4->GetXaxis()->SetTitle("p_{T}^{GEN} [GeV/c]"); stack4->GetYaxis()->SetTitle("% of Jet Energy"); c2->cd(); stack4->Draw(); c2->SaveAs("Plots/genstack_vs_pt_endcap.eps"); */ }
void setTDRStyle() { TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-DR"); gROOT->SetStyle("Plain"); gROOT->ForceStyle(); tdrStyle->SetFrameBorderMode(0); tdrStyle->SetCanvasBorderMode(0); tdrStyle->SetPadBorderMode(0); tdrStyle->SetPadBorderMode(0); // tdrStyle->SetFrameColor(0); tdrStyle->SetPadColor(0); tdrStyle->SetCanvasColor(0); tdrStyle->SetStatColor(0); tdrStyle->SetFillColor(0); tdrStyle->SetPaperSize(20,26); // tdrStyle->SetPadTopMargin(0.08); // tdrStyle->SetPadBottomMargin(0.14); tdrStyle->SetPadRightMargin(0.04); tdrStyle->SetPadLeftMargin(0.05); // tdrStyle->SetCanvasDefH(800); // tdrStyle->SetCanvasDefW(800); // tdrStyle->SetPadGridX(1); // tdrStyle->SetPadGridY(1); tdrStyle->SetPadTickX(1); tdrStyle->SetPadTickY(1); tdrStyle->SetTextFont(42); //132 tdrStyle->SetTextSize(0.09); tdrStyle->SetLabelFont(42,"xyz"); tdrStyle->SetTitleFont(42,"xyz"); tdrStyle->SetLabelSize(0.045,"xyz"); //0.035 tdrStyle->SetTitleSize(0.045,"xyz"); tdrStyle->SetTitleOffset(1.5,"y"); tdrStyle->SetTitleX(0.16); tdrStyle->SetTitleY(0.93); tdrStyle->SetTitleColor(1); tdrStyle->SetTitleTextColor(1); tdrStyle->SetTitleFillColor(0); tdrStyle->SetTitleBorderSize(1); tdrStyle->SetTitleFontSize(0.04); // tdrStyle->SetPadTopMargin(0.05); // tdrStyle->SetPadBottomMargin(0.13); // tdrStyle->SetPadLeftMargin(0.14); // tdrStyle->SetPadRightMargin(0.02); // use bold lines and markers tdrStyle->SetMarkerStyle(8); tdrStyle->SetHistLineWidth(3); tdrStyle->SetLineWidth(1); tdrStyle->SetOptTitle(kFALSE); tdrStyle->SetOptStat(0); tdrStyle->cd(); }
void setStyle(){ //Style// TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR"); // For the canvas: tdrStyle->SetCanvasBorderMode(0); tdrStyle->SetCanvasColor(kWhite); tdrStyle->SetCanvasDefH(600); //Height of canvas tdrStyle->SetCanvasDefW(600); //Width of canvas tdrStyle->SetCanvasDefX(0); //POsition on screen tdrStyle->SetCanvasDefY(0); // For the Pad: tdrStyle->SetPadBorderMode(0); tdrStyle->SetPadColor(kWhite); tdrStyle->SetPadGridX(false); tdrStyle->SetPadGridY(false); tdrStyle->SetGridColor(0); tdrStyle->SetGridStyle(3); tdrStyle->SetGridWidth(1); // For the frame: tdrStyle->SetFrameBorderMode(0); tdrStyle->SetFrameBorderSize(1); tdrStyle->SetFrameFillColor(0); tdrStyle->SetFrameFillStyle(0); tdrStyle->SetFrameLineColor(1); tdrStyle->SetFrameLineStyle(1); tdrStyle->SetFrameLineWidth(1); tdrStyle->SetPadTopMargin(0.05); tdrStyle->SetPadBottomMargin(0.13); tdrStyle->SetPadLeftMargin(0.16); tdrStyle->SetPadRightMargin(0.02); // For the Global title: tdrStyle->SetOptTitle(0); tdrStyle->SetTitleFont(42); tdrStyle->SetTitleColor(1); tdrStyle->SetTitleTextColor(1); tdrStyle->SetTitleFillColor(10); tdrStyle->SetTitleFontSize(0.05); // For the axis titles: tdrStyle->SetTitleColor(1, "XYZ"); tdrStyle->SetTitleFont(42, "XYZ"); tdrStyle->SetTitleSize(0.06, "XYZ"); tdrStyle->SetTitleXOffset(0.9); tdrStyle->SetTitleYOffset(0.9); // For the axis labels: tdrStyle->SetLabelColor(1, "XYZ"); tdrStyle->SetLabelFont(42, "XYZ"); tdrStyle->SetLabelOffset(0.007, "XYZ"); tdrStyle->SetLabelSize(0.05, "XYZ"); // For the axis: tdrStyle->SetAxisColor(1, "XYZ"); //tdrStyle->SetStripDecimals(kTRUE); tdrStyle->SetTickLength(0.03, "XYZ"); tdrStyle->SetNdivisions(510, "XYZ"); tdrStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame tdrStyle->SetPadTickY(1); tdrStyle->SetPaperSize(20.,20.); tdrStyle->SetHatchesLineWidth(5); tdrStyle->SetHatchesSpacing(0.05); tdrStyle->SetOptStat(0); tdrStyle->cd(); }
void SetStyle() { TStyle *MYStyle = new TStyle("Style","Style"); gStyle = MYStyle; // Canvas MYStyle->SetCanvasColor (0); MYStyle->SetCanvasBorderSize(10); MYStyle->SetCanvasBorderMode(0); MYStyle->SetCanvasDefH (700); MYStyle->SetCanvasDefW (700); MYStyle->SetCanvasDefX (100); MYStyle->SetCanvasDefY (100); // Pads MYStyle->SetPadColor (0); MYStyle->SetPadBorderSize (10); MYStyle->SetPadBorderMode (0); MYStyle->SetPadBottomMargin(0.13); MYStyle->SetPadTopMargin (0.08); MYStyle->SetPadLeftMargin (0.15); MYStyle->SetPadRightMargin (0.05); MYStyle->SetPadGridX (0); MYStyle->SetPadGridY (0); MYStyle->SetPadTickX (0); MYStyle->SetPadTickY (0); // Frames MYStyle->SetFrameFillStyle ( 0); MYStyle->SetFrameFillColor ( 0); MYStyle->SetFrameLineColor ( 1); MYStyle->SetFrameLineStyle ( 0); MYStyle->SetFrameLineWidth ( 1); MYStyle->SetFrameBorderSize(10); MYStyle->SetFrameBorderMode( 0); // Histograms MYStyle->SetHistFillColor(2); // MYStyle->SetHistFillStyle(0); MYStyle->SetHistLineColor(1); MYStyle->SetHistLineStyle(0); MYStyle->SetHistLineWidth(2); MYStyle->SetNdivisions(505); // Functions MYStyle->SetFuncColor(1); MYStyle->SetFuncStyle(0); MYStyle->SetFuncWidth(2); // Various MYStyle->SetMarkerStyle(20); MYStyle->SetMarkerColor(kBlack); MYStyle->SetMarkerSize (1.2); MYStyle->SetTitleSize (0.055,"X"); MYStyle->SetTitleOffset(1.050,"X"); MYStyle->SetLabelOffset(0.005,"X"); MYStyle->SetLabelSize (0.045,"X"); MYStyle->SetLabelFont (42 ,"X"); MYStyle->SetStripDecimals(kFALSE); MYStyle->SetTitleSize (0.055,"Y"); MYStyle->SetTitleOffset(1.400,"Y"); MYStyle->SetLabelOffset(0.010,"Y"); MYStyle->SetLabelSize (0.045,"Y"); MYStyle->SetLabelFont (42 ,"Y"); MYStyle->SetTextSize (0.055); MYStyle->SetTextFont (42); MYStyle->SetStatFont (42); MYStyle->SetTitleFont (42); MYStyle->SetTitleFont (42,"X"); MYStyle->SetTitleFont (42,"Y"); MYStyle->SetOptStat (0); MYStyle->SetPalette (1); return; }
void setNiceStyle() { gROOT->SetStyle("Plain"); // -------------------------------------------------- // define proper canvas style // -------------------------------------------------- TStyle *MyStyle = new TStyle ("MyStyle", "My style for nicer plots"); Float_t xoff = MyStyle->GetLabelOffset("X"), yoff = MyStyle->GetLabelOffset("Y"), zoff = MyStyle->GetLabelOffset("Z"); MyStyle->SetCanvasBorderMode ( 0 ); MyStyle->SetPadBorderMode ( 0 ); MyStyle->SetPadColor ( 0 ); MyStyle->SetCanvasColor ( 0 ); MyStyle->SetTitleColor ( 0 ); MyStyle->SetStatColor ( 0 ); MyStyle->SetTitleBorderSize ( 0 ); MyStyle->SetTitleFillColor ( 0 ); MyStyle->SetTitleH ( 0.07 ); MyStyle->SetTitleW ( 1.00 ); MyStyle->SetTitleFont ( 132 ); MyStyle->SetLabelOffset (1.5*xoff, "X"); MyStyle->SetLabelOffset (1.5*yoff, "Y"); MyStyle->SetLabelOffset (1.5*zoff, "Z"); MyStyle->SetTitleOffset (0.9, "X"); MyStyle->SetTitleOffset (0.9, "Y"); MyStyle->SetTitleOffset (0.9, "Z"); MyStyle->SetTitleSize (0.045, "X"); MyStyle->SetTitleSize (0.045, "Y"); MyStyle->SetTitleSize (0.045, "Z"); MyStyle->SetLabelFont (132, "X"); MyStyle->SetLabelFont (132, "Y"); MyStyle->SetLabelFont (132, "Z"); MyStyle->SetPalette(1); MyStyle->cd(); }
//------------------------------------------------------------------------------ void PlotAlignmentValidation::setNiceStyle() { TStyle *MyStyle = new TStyle ("MyStyle", "My style for nicer plots"); Float_t xoff = MyStyle->GetLabelOffset("X"), yoff = MyStyle->GetLabelOffset("Y"), zoff = MyStyle->GetLabelOffset("Z"); MyStyle->SetCanvasBorderMode ( 0 ); MyStyle->SetPadBorderMode ( 0 ); MyStyle->SetPadColor ( 0 ); MyStyle->SetCanvasColor ( 0 ); MyStyle->SetTitleColor ( 0 ); MyStyle->SetStatColor ( 0 ); MyStyle->SetTitleBorderSize ( 0 ); MyStyle->SetTitleFillColor ( 0 ); MyStyle->SetTitleH ( 0.07 ); MyStyle->SetTitleW ( 1.00 ); MyStyle->SetTitleFont ( 132 ); MyStyle->SetLabelOffset (1.5*xoff, "X"); MyStyle->SetLabelOffset (1.5*yoff, "Y"); MyStyle->SetLabelOffset (1.5*zoff, "Z"); MyStyle->SetTitleOffset (1.5, "X"); MyStyle->SetTitleOffset (1.2, "Y"); MyStyle->SetTitleOffset (0.9, "Z"); MyStyle->SetTitleSize (0.045, "X"); MyStyle->SetTitleSize (0.045, "Y"); MyStyle->SetTitleSize (0.045, "Z"); MyStyle->SetLabelFont (132, "X"); MyStyle->SetLabelFont (132, "Y"); MyStyle->SetLabelFont (132, "Z"); MyStyle->SetPalette(1); MyStyle->cd(); }