本文整理汇总了C++中TStyle类的典型用法代码示例。如果您正苦于以下问题:C++ TStyle类的具体用法?C++ TStyle怎么用?C++ TStyle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TStyle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: main
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;
}
开发者ID:simoneg90,项目名称:BTFAnalysis,代码行数:35,代码来源:drawPositionAnalysis.cpp
示例2: draw2ndJet
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");
}
}
开发者ID:amarini,项目名称:pandolf,代码行数:26,代码来源:draw2ndJet.C
示例3: drawTracks
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");
}
开发者ID:pandolf,项目名称:JetMETCorrections,代码行数:59,代码来源:drawTrackRatio.C
示例4: PlotHistsNhitsPerModule
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
开发者ID:ANSH0712,项目名称:cmssw,代码行数:56,代码来源:PlotFromMillepedeRes.C
示例5: drawPtSpectrum
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");
}
开发者ID:amarini,项目名称:pandolf,代码行数:55,代码来源:drawPtSpectrum.C
示例6: MWLPlot
MWLPlot() {
_legendTextSize = 0.048;
_axisLabelSize = 0.08;
_titleOffset = 1.4;
TStyle *ls = LatinoStyle();
ls->SetCanvasDefH (794);
ls->SetTitleFontSize (0.045);
ls->SetTitleY (0.830);
}
开发者ID:HuguesBrun,项目名称:WWAnalysis,代码行数:11,代码来源:DivPlot.C
示例7: placeholder
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);
}
开发者ID:awhitbeck,项目名称:usercode-JHU,代码行数:15,代码来源:trackSplitPlot.C
示例8: drawRxResolutions
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);
}
开发者ID:amarini,项目名称:pandolf,代码行数:22,代码来源:drawRxResolutions.C
示例9: drawProjections
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");
}
开发者ID:amarini,项目名称:pandolf,代码行数:22,代码来源:drawProjections.C
示例10: main
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;
}
开发者ID:CeF3TB,项目名称:BTFAnalysis,代码行数:37,代码来源:drawPositionAnalysis.cpp
示例11: SetTMVAStyle
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);
}
开发者ID:CeF3TB,项目名称:BTFAnalysis,代码行数:69,代码来源:tmvaglob.C
示例12: tdrGrid
// 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);
}
开发者ID:errai-,项目名称:jetscripts,代码行数:6,代码来源:tdrstyle_mod14old.C
示例13: roc_plot
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);
//.........这里部分代码省略.........
开发者ID:zdemirag,项目名称:exo-higgs,代码行数:101,代码来源:roc_plot.C
示例14: main
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")
*/
//.........这里部分代码省略.........
开发者ID:ald77,项目名称:csa14,代码行数:101,代码来源:draw_from_trees.cpp
示例15: setTDRStyle
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();
}
开发者ID:Andrej-CMS,项目名称:cmssw,代码行数:79,代码来源:drawHFTime.C
示例16: setDefaultStyle
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();
}
开发者ID:aashaqshah,项目名称:cmssw-1,代码行数:40,代码来源:setDefaultStyle.C
示例17: TStyle
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:
//.........这里部分代码省略.........
开发者ID:mxrguspxrt,项目名称:kbfi,代码行数:101,代码来源:Plotter.C
示例18: blinding_study
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",
//.........这里部分代码省略.........
开发者ID:dimatteo,项目名称:MitMonoPhoton_Backup,代码行数:101,代码来源:blinding_study.C
示例19: setTDRStyle
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->S
|
请发表评论