本文整理汇总了C++中TAxis::SetLimits方法的典型用法代码示例。如果您正苦于以下问题:C++ TAxis::SetLimits方法的具体用法?C++ TAxis::SetLimits怎么用?C++ TAxis::SetLimits使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TAxis
的用法示例。
在下文中一共展示了TAxis::SetLimits方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetLimits
//______________________________________________________________________________
void ArgusHistoDisplay::SetLimits(TGraph *g)
{
const Int_t n = g->GetN();
if (n<=1) {
return;
}
int i;
double xmin, xmax, ymin, ymax;
double *x;
double *y;
x = g->GetX();
y = g->GetY();
xmin = xmax = x[0];
ymin = ymax = y[0];
for (i=1;i<n;i++) {
if (xmin>x[i])
xmin = x[i];
if (xmax<x[i])
xmax = x[i];
if (ymin>y[i])
ymin = y[i];
if (ymax<y[i])
ymax = y[i];
}
if (xmin<xmax && ymin<ymax) {
g->SetMinimum(ymin-(ymax-ymin)/10.);
g->SetMaximum(ymax+(ymax-ymin)/10.);
TAxis *axis = g->GetXaxis();
if(axis) {
axis->SetLimits(xmin, xmax);
}
}
}
示例2: Draw_ALICEMid_JPsi_RaaVsNpart
void Draw_ALICEMid_JPsi_RaaVsNpart(TLegend *lgd)
{
//ALICE MID rapidity
int nbinsALICEMid=3;
Double_t NPartALICEMid[3]={357,193,46};
Double_t ErrNPartALICEMid[3]={0};
Double_t RaaALICEMid[3] = {0.82,0.65,0.73};
Double_t SystErrALICEMid[3] = {0.15,0.10,0.16};
TGraphErrors *grRaaALICEMid = new TGraphErrors(nbinsALICEMid, NPartALICEMid, RaaALICEMid, ErrNPartALICEMid, SystErrALICEMid);
grRaaALICEMid->SetMarkerStyle(20);
grRaaALICEMid->SetMarkerColor(2);
//grRaaALICEMid->SetLineColor(2);
grRaaALICEMid->GetYaxis()->SetRangeUser(0,1.5);
TAxis *Xaxis = grRaaALICEMid->GetXaxis();
Xaxis->SetLimits(0.,430.0);
grRaaALICEMid->GetXaxis()->SetTitle("N_{Part}");
grRaaALICEMid->GetYaxis()->SetTitle("R_{AA}");
grRaaALICEMid->Draw("Psame");
//TLatex *tb= new TLatex;
//tb->SetNDC();
//tb->SetTextAlign(12);
//tb->SetTextColor(1);
//tb->SetTextSize(0.040);
//tb->DrawLatex(0.55,0.90,"PbPb #sqrt{s_{NN}} = 2.76 TeV");
//tb->DrawLatex(0.22,0.16,"J/#psi #rightarrow #mu^{+} #mu^{-}, p_{T}^{J/#psi} > 0.0 GeV/c");
//tb->DrawLatex(0.55,0.85,"p_{T}^{J/#psi} > 0.0 GeV/c");
TLine *lh3 = new TLine(0.0,1.0,420,1.0);
lh3->SetLineColor(1);
lh3->SetLineStyle(1);
lh3->SetLineWidth(1.5);
lh3->Draw("same");
TBox *RaaJPsiALICEMidSys[12];
for(int j=0;j<3;j++){
RaaJPsiALICEMidSys[j] = new TBox(NPartALICEMid[j]-3, RaaALICEMid[j]-SystErrALICEMid[j], NPartALICEMid[j]+3, RaaALICEMid[j]+SystErrALICEMid[j]);
}
for(int j=0;j<3;j++){
RaaJPsiALICEMidSys[j]->SetFillStyle(0000);
RaaJPsiALICEMidSys[j]->SetLineColor(2);
RaaJPsiALICEMidSys[j]->Draw("same");
}
TBox *ALICEMidGlobalSysJPsi;
ALICEMidGlobalSysJPsi = new TBox(385-5, 1 - 0.26, 385+5, 1 + 0.26);
ALICEMidGlobalSysJPsi->SetFillStyle(3001);
ALICEMidGlobalSysJPsi->SetLineColor(2);
ALICEMidGlobalSysJPsi->SetFillColor(2);
ALICEMidGlobalSysJPsi->Draw("same");
lgd->AddEntry(grRaaALICEMid,"ALICE Data p_{T}^{J/#psi} > 0.0 GeV/c, |y^{J/#psi}| #leq 1.0","P");
}
示例3: Draw_CMS_JPsi_RaaVsRap
void Draw_CMS_JPsi_RaaVsRap(TLegend *lgd)
{
//=============== CMS Raa Vs Rap Data ===============================================================//
//AvpT 10.92,9.65,8.92
int nbinsRapCMS=3;
Double_t RapCMSD[3]={0.6,1.4,2.0};
Double_t ErrRapCMS[3]={0.6,0.2,0.4};
Double_t RaaRapCMS[3] = {0.31,0.33,0.36};
Double_t RaaRapStatErrCMS[3] = {0.02,0.03,0.03};
Double_t RaaRapSystErrCMS[3] = {0.03,0.04,0.04};
TGraphErrors *grRaaRapCMS = new TGraphErrors(nbinsRapCMS, RapCMSD, RaaRapCMS, ErrRapCMS, RaaRapStatErrCMS);
grRaaRapCMS->SetMarkerStyle(20);
grRaaRapCMS->SetMarkerColor(2);
grRaaRapCMS->GetYaxis()->SetRangeUser(0,1.5);
grRaaRapCMS->GetXaxis()->SetTitle("|y|");
grRaaRapCMS->GetYaxis()->SetTitle("R_{AA}");
TAxis *XaxisgrRaaRapCMS = grRaaRapCMS->GetXaxis();
XaxisgrRaaRapCMS->SetLimits(0.0,2.4);
grRaaRapCMS->Draw("AP");
TLine *lh_grRaaRapCMS = new TLine(0.0,1.0,2.4,1.0);
lh_grRaaRapCMS->SetLineColor(1);
lh_grRaaRapCMS->SetLineStyle(1);
lh_grRaaRapCMS->SetLineWidth(1.5);
lh_grRaaRapCMS->Draw("same");
TLatex *tb= new TLatex;
tb->SetNDC();
tb->SetTextAlign(12);
tb->SetTextColor(1);
tb->SetTextSize(0.040);
tb->DrawLatex(0.20,0.20,"Pb+Pb #sqrt{s_{NN}} = 2.76 TeV");
tb->DrawLatex(0.20,0.15,"J/#psi #rightarrow #mu^{+} #mu^{-}, p_{T}^{J/#psi} > 6.5 GeV/c");
TBox *RaaRapJPsiCMSSys[4];
for(int j=0;j<3;j++){
RaaRapJPsiCMSSys[j] = new TBox(RapCMSD[j]-0.05, RaaRapCMS[j]-RaaRapSystErrCMS[j], RapCMSD[j]+0.05, RaaRapCMS[j]+RaaRapSystErrCMS[j]);
}
for(int j=0;j<3;j++){
RaaRapJPsiCMSSys[j]->SetFillStyle(0000);
RaaRapJPsiCMSSys[j]->SetLineColor(2);
RaaRapJPsiCMSSys[j]->Draw("same");
}
TBox *CMSGlobalSysJPsiRap;
CMSGlobalSysJPsiRap = new TBox(0.2-0.05, 1 - 0.05, 0.2+0.05, 1 + 0.05);
CMSGlobalSysJPsiRap->SetFillStyle(3001);
CMSGlobalSysJPsiRap->SetLineColor(2);
CMSGlobalSysJPsiRap->SetFillColor(2);
CMSGlobalSysJPsiRap->Draw("same");
lgd->AddEntry(grRaaRapCMS,"CMS Data", "P");
}
示例4: SetLimits
//______________________________________________________________________________
void ROMETGraphErrors::SetLimits()
{
Double_t rwxmin,rwxmax, rwymin, rwymax, dx, dy;
ComputeRange(rwxmin, rwymin, rwxmax, rwymax);
if (rwxmin == rwxmax) rwxmax += 1.;
if (rwymin == rwymax) rwymax += 1.;
dx = 0.1 * (rwxmax - rwxmin);
dy = 0.1 * (rwymax - rwymin);
fMinimum = rwymin - dy;
fMaximum = rwymax + dy;
TAxis *axis = GetXaxis();
if(axis) {
axis->SetLimits(rwxmin - dx, rwxmax + dx);
}
}
示例5: Draw_CMS_JPsi_RaaVspT
void Draw_CMS_JPsi_RaaVspT(TLegend *legend_ratio)
{
int nbinsPtCMS=4;
Double_t PtCMSD[4]={7.31,8.97,11.32,16.52};
Double_t ErrPtCMS[4]={0};
Double_t RaaPtCMS[4] = {0.35,0.34,0.34,0.29};
Double_t RaaPtStatErrCMS[4] = {0.09,0.03,0.03,0.04};
Double_t RaaPtSystErrCMS[4] = {0.04,0.04,0.03,0.03};
TGraphErrors *grRaaPtCMS = new TGraphErrors(nbinsPtCMS, PtCMSD, RaaPtCMS, ErrPtCMS, RaaPtStatErrCMS);
grRaaPtCMS->SetMarkerStyle(21);
grRaaPtCMS->SetMarkerColor(kRed+1);
grRaaPtCMS->SetMarkerSize(1.3);
//grRaaPtCMS->SetFillColor(kRed);
grRaaPtCMS->SetLineColor(1);
grRaaPtCMS->GetYaxis()->SetRangeUser(0,1.5);
grRaaPtCMS->GetXaxis()->SetTitle("p_{T}(GeV/c)");
grRaaPtCMS->GetYaxis()->SetTitle("R_{AA}");
TLine *lh5 = new TLine(0.0,1.0,20.0,1.0);
lh5->SetLineColor(1);
lh5->SetLineStyle(1);
lh5->SetLineWidth(1.5);
TLatex *tb= new TLatex;
tb->SetNDC();
tb->SetTextAlign(12);
tb->SetTextColor(1);
tb->SetTextSize(0.040);
TBox *RaaPtJPsiCMSSys[4];
for(int j=0;j<4;j++){
RaaPtJPsiCMSSys[j] = new TBox(PtCMSD[j]-0.4, RaaPtCMS[j]-RaaPtSystErrCMS[j], PtCMSD[j]+0.4, RaaPtCMS[j]+RaaPtSystErrCMS[j]);
}
for(int j=0;j<4;j++){
RaaPtJPsiCMSSys[j]->SetFillStyle(1001);
RaaPtJPsiCMSSys[j]->SetFillColor(kPink+1);
RaaPtJPsiCMSSys[j]->SetLineColor(1);
}
TBox *CMSGlobalSysJPsiPt;
//CMSGlobalSysJPsiPt = new TBox(27.0-1.0, 1 - 0.075, 27.0+1.0, 1 + 0.075);
CMSGlobalSysJPsiPt = new TBox(19.165,0.923,19.948,1.067);
CMSGlobalSysJPsiPt->SetFillStyle(3001);
CMSGlobalSysJPsiPt->SetLineColor(2);
CMSGlobalSysJPsiPt->SetFillColor(2);
TAxis *XaxisgrRaaPtCMS = grRaaPtCMS->GetXaxis();
XaxisgrRaaPtCMS->SetLimits(0.0,20.0);
grRaaPtCMS->Draw("AP");
for(int j=0;j<4;j++) RaaPtJPsiCMSSys[j]->Draw("same");
grRaaPtCMS->Draw("Psame");
CMSGlobalSysJPsiPt->Draw("same");
tb->SetTextSize(0.030);
//tb->DrawLatex(0.20,0.20,"PbPb #sqrt{s_{NN}} = 2.76 TeV");
tb->DrawLatex(0.71476,0.91289,"J/#psi #rightarrow #mu^{+} #mu^{-}");
lh5->Draw("same");
//legend_ratio->AddEntry(grRaaPtCMS,"PbPb #sqrt{s_{NN}} = 2.76 TeV and Au-Au #sqrt{s_{NN}} = 0.2 TeV", "");
legend_ratio->AddEntry(grRaaPtCMS,"Pb+Pb #sqrt{s_{NN}} = 2.76 TeV", "");
legend_ratio->AddEntry(grRaaPtCMS,"Prompt J/#psi CMS: |y| < 2.4", "P");
//legend_ratio->AddEntry(grRaaPtCMS,"PbPb #sqrt{s_{NN}} = 2.76 TeV and Au-Au #sqrt{s_{NN}} = 0.2 TeV", "");
//legend_ratio->AddEntry(grRaaPtCMS,"CMS: J/#psi #rightarrow #mu^{+} #mu^{-}, |y| < 2.4 & p_{T}^{J/#psi} > 6.5 GeV/c", "P");
//legend_ratio->AddEntry(grRaaPtCMS,"CMS: J/#psi #rightarrow #mu^{+} #mu^{-}, |y| < 2.4 & p_{T}^{J/#psi} > 6.5 GeV/c", "P");
}
示例6: drawFigure7
//.........这里部分代码省略.........
ymax = 0.09;
}
else if (parameter.Contains("dk0"))
{
xtitle = "#Deltag^{Z}_{1}";
ytitle = "#lambda";
xmin = -0.059;
xmax = 0.059;
ymin = -0.037;
ymax = 0.052;
}
// Read the input file
//----------------------------------------------------------------------------
TFile* file = new TFile("rootfiles/contours_" + parameter + "_2Dpol2.root", "read");
TGraph* cont_exp_68 = (TGraph*)file->Get("cont_exp_68");
TGraph* cont_exp_95 = (TGraph*)file->Get("cont_exp_95");
TGraph* cont_exp_99 = (TGraph*)file->Get("cont_exp_99");
TGraph* cont_obs_95 = (TGraph*)file->Get("cont_obs_95");
TGraph* bestFit = (TGraph*)file->Get("bestFit");
bestFit->SetMarkerSize(1.5);
bestFit->SetMarkerStyle(34);
TGraph* g_large = new TGraph(2);
g_large->SetPoint(0, -1.0, 1.0);
g_large->SetPoint(1, 1.0, 1.0);
// Draw
//----------------------------------------------------------------------------
TCanvas* canvas = new TCanvas("canvas", "canvas");
TMultiGraph* mg = new TMultiGraph();
mg->Add(cont_exp_68);
mg->Add(cont_exp_95);
mg->Add(cont_exp_99);
mg->Add(cont_obs_95);
mg->Add(bestFit, "p");
mg->Add(g_large);
mg->Draw("ac");
mg->SetMinimum(ymin);
mg->SetMaximum(ymax);
// Axis labels
//----------------------------------------------------------------------------
TAxis* xaxis = mg->GetXaxis();
TAxis* yaxis = mg->GetYaxis();
xaxis->SetLabelFont ( 42);
xaxis->SetLabelOffset( 0.01);
xaxis->SetLabelSize ( 0.05);
xaxis->SetNdivisions ( 505);
xaxis->SetTitle (xtitle);
xaxis->SetTitleFont ( 42);
xaxis->SetTitleOffset( 1.2);
xaxis->SetTitleSize ( 0.05);
xaxis->SetLimits(xmin, xmax);
yaxis->SetLabelFont ( 42);
yaxis->SetLabelOffset( 0.01);
yaxis->SetLabelSize ( 0.05);
yaxis->SetNdivisions ( 505);
yaxis->SetTitle (ytitle);
yaxis->SetTitleFont ( 42);
yaxis->SetTitleOffset( 1.6);
yaxis->SetTitleSize ( 0.05);
canvas->Modified();
// Legend
//----------------------------------------------------------------------------
Double_t x0 = 0.580;
Double_t y0 = 0.755;
DrawTLegend(x0 - 0.36, y0 + 2.*(_yoffset+0.001), (TH1F*)cont_exp_68, " Expected 68% CL", "l");
DrawTLegend(x0 - 0.36, y0 + 1.*(_yoffset+0.001), (TH1F*)cont_exp_95, " Expected 95% CL", "l");
DrawTLegend(x0, y0 + 2.*(_yoffset+0.001), (TH1F*)cont_exp_99, " Expected 99% CL", "l");
DrawTLegend(x0, y0 + 1.*(_yoffset+0.001), (TH1F*)cont_obs_95, " Observed 95% CL", "l");
DrawTLegend(x0, y0, (TH1F*)bestFit, " Best fit", "p");
// Finish it
//----------------------------------------------------------------------------
DrawTLatex(_cmsTextFont, 0.190, 0.94, 0.055, 11, "CMS");
// DrawTLatex(_extraTextFont, 0.315, 0.94, 0.030, 11, "Preliminary");
DrawTLatex(_lumiTextFont, 0.940, 0.94, 0.040, 31, "19.6 fb^{-1} (8 TeV)");
canvas->SaveAs("pdf/lZ_dkg_2dlimit_" + parameter + "_2Dpol2_deltaNLL.pdf");
canvas->SaveAs("png/lZ_dkg_2dlimit_" + parameter + "_2Dpol2_deltaNLL.png");
}
示例7: Plotting
//.........这里部分代码省略.........
bool muMiTMOneStaTight;
bool muMiHighPurity;
int nx = 14, ny = 15000;
//double xBins[22] = {0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,30.0}; //19
double xBins[15] = {3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,15.0,18.0,22.0,30.0}; //19
//double xBins[4] = {3.0,6.5,12.0,30.0}; //19
//double xBins[6] = {6.5,9.0,12.0,15.0,20.0,30.0}; //19
//double xBins[13] = {6.5,7.0,8.0,9.0,10.0,11.0,12.0,13.0,15.0,18.0,21.0,24.0,30.0}; //13
//double xBins[8] = {6.0,9.0,12.0,15.0,18.0,21.0,24.0,30.0}; //19
//TH2D *hPR2D = new TH2D("hPR2D","hPR2D",nx,xBins,ny,-5.0,10.0);
//TH1F *hPR = new TH1F("hPR","hPR;Inv_mass",100,-2.5,3.2);
TH1F *hPR = new TH1F("hPR","hPR;p_{T}",nx,xBins);
//TH1F *hPR = new TH1F("hPR","hPR;l_{J/#psi} (mm);counts",1500,-5,10);
hPR->Sumw2();
hPR->SetLineColor(1);
//TH1F *hPRfunc = new TH1F("hPRfunc","hPRfunc;Inv_mass",100,-2.8,3.2);
TH1F *hPRfunc = new TH1F("hPRfunc","hPRfunc;p_{T}",nx,xBins);
//TH1F *hPRfunc = new TH1F("hPRfunc","hPRfunc;l_{J/#psi} (mm);counts",1500,-5,10);
hPRfunc->Sumw2();
hPRfunc->SetLineColor(2);
//TH1F* hPRCut = (TH1F*) hPR->Clone("hPRCut");
TFile *Fitfile = new TFile("Plots/2015/3D/ctauFit/Jpsi_pp_eff_0.9_Rap_1.6-2.4_Pt_3.0-30.0.root");
TGraph *FitGr = (TGraph*)Fitfile->Get("Graph");
TF1 *func1 = (TF1*)FitGr->GetFunction("FitFn");
new TCanvas;
TAxis *XaxctauFW = FitGr->GetXaxis();
XaxctauFW->SetLimits(0.0,30.0);
TAxis *YaxctauFW = FitGr->GetYaxis();
YaxctauFW->SetLimits(0.0,0.1);
FitGr->GetXaxis()->SetRangeUser(0.0,30.0);
FitGr->GetYaxis()->SetRangeUser(0.0,0.1);
//FitGr->Draw("AP");
//FitGr->Draw();
func1->Draw();
initOniaTree(iTree);
Long64_t nentries = iTree->GetEntries();
nentries = 500000;
cout<<"Total Entries in data Tree "<<" "<<nentries<< "====="<<endl;
Long64_t nbytes = 0, nb = 0;
for (Long64_t jentry=0; jentry<nentries;jentry++) {
nb = iTree->GetEntry(jentry);
for (int iQQ=0; iQQ<Reco_QQ_size; iQQ++) {
TLorentzVector *qq4mom = (TLorentzVector*) Reco_QQ_4mom->At(iQQ);
TLorentzVector *qq4mupl = (TLorentzVector*) Reco_QQ_mupl_4mom->At(iQQ);
TLorentzVector *qq4mumi = (TLorentzVector*) Reco_QQ_mumi_4mom->At(iQQ);
invariantMass = qq4mom->M();
JpsiPt = qq4mom->Pt();
JpsiRap = qq4mom->Rapidity();
muPlPt = qq4mupl->Pt();
muMiPt = qq4mumi->Pt();
muPlEta = qq4mupl->Eta();
muMiEta = qq4mumi->Eta();
QQctau3D = Reco_QQ_ctau3D[iQQ];
示例8: genPngClsExpBarrel100
//.........这里部分代码省略.........
double wpDef;
double clsWpDef;
ifstream wpChannel;
rolls.open("data/Barrel.txt");
rolls>>rollName;
while (!rolls.eof()){
//Being charged the working point per channel associated with the current roll
/* wpChannel.open(("results/"+rollName+"/wpChannel.txt").c_str());
wpChannel>>wpDef;
cout<<"wpDef= "<<wpDef<<endl;
wpChannel.close();
*/
//Being charged the run data for the current roll
runsData.open(("results/"+rollName+"/runsData.txt").c_str());
for (int n=0;n<runsAmmount;n++){
runsData>>HV[n]>>EFF[n]>>ERR[n]>>EXP[n]>>CLS[n];
//The first three runs (lower high voltage) are not plotted
if (n>2){
hv[n-3]=HV[n];
cls[n-3]=CLS[n];
}
}
runsData.close();
///////////////////////////////// The error in this cases is defined in this way, this is something that must be improved
for(int n=0;n<runsAmmount;n++){
if (n>2){
exc[n-3]=0.0001;
ecls[n-3] = 0.0001;
}
}
//////////////////////////////////////////////////////
//Being charged the fit data obtained for the current roll
hvcls = new TGraphErrors(runsHavingInAccount, hv, cls, exc, ecls);
cout<<rollName;
fitData.open(("results/"+rollName+"/fitDataCLS.txt").c_str());
fitData>>ca>>cb>>chi2>>wp>>clswp>>wpDef>>clsWpDef;
cout<<ca<<" "<<cb<<" "<<wp<<" "<<clswp<<endl;
fitData.close();
f1 = new TF1("f1",expFunc,8.5,9.9,2); //3 es el numero de parametros del fit//
f1->SetParameter(0, ca);
f1->SetParameter(1, cb);//
//Being made the plot of Working Point and Knee
knee = wp - 0.100;
clsknee=expFuncAMano(knee,ca,cb);
hvc[0]=wp - 0.100;
hvc[1]=wp;
CLSc[0]=clsknee;
CLSc[1]=clswp;
TGraph *gr2 = new TGraph(2,hvc,CLSc);
//Being made the plot of Working Point per Channel
wpCh[0]=wpDef;
clsWpCh[0]=clsWpDef;
TGraph *gr4 = new TGraph(1,wpCh,clsWpCh);
//Being made the plot of the sigmoid
for (int k=0; k<P; k++){
x[k]=xmin+k*(xmax-xmin)/(P-1);
y[k]=expFuncAMano(x[k],ca,cb);
x[k]=x[k];
}
TGraph *gr3 = new TGraph(200,x,y);
//Being set plot parameters
hvcls->SetLineColor(kRed);
hvcls->SetMarkerStyle(20);
hvcls->SetMarkerSize(2.0);
hvcls->SetMinimum(-0.01);
hvcls->SetMaximum(6);
TAxis *axis = hvcls->GetXaxis();
axis->SetLimits(8.5,9.9);
hvcls->SetTitle(("CLS vs HV_Eff " + rollName).c_str());
hvcls->GetXaxis()->SetTitle("HV_Eff(kV)");
hvcls->GetYaxis()->SetTitle("CLS");
hvcls->Draw("AP");
gr3->SetLineColor(kBlue);
gr3->Draw("C");// superimpose the second graph by leaving out the axis option "A"
gr2->SetMarkerStyle(28);
gr2->SetMarkerSize(3);
gr2->SetLineColor(kBlue);
gr2->Draw("P");
gr4->SetMarkerStyle(24);
gr4->SetMarkerSize(5);
gr4->SetLineColor(kRed);
gr4->Draw("P");
//Being stored the plot as png file
gSystem->mkdir(("results/"+rollName).c_str());
c1->SaveAs(("results/"+rollName+"/CLSvsHV.png").c_str());
c1->Clear();
//}
rolls>>rollName;
}
exit(0);
}
示例9: Loop
//.........这里部分代码省略.........
cout <<" i = " << i
<<" pt interval = " << pt[i] <<" - " << pt[i+1]
<<" ntrkreco[i] = " << ntrkreco[i]
<<" ntrkrecor[i] = " << ntrkrecor[i]
<<" ntrk[i] = " << ntrk[i]
<<" eff = " << trkeff[i] << endl;
// <<" responce = " << responceVSptF[i] << endl;
}
}
// calculate efficiency vs Eta and full graph
cout <<" Efficiency vs Eta " << endl;
for(Int_t i = 0; i < netabins; i++) {
if(ntrketa[i] > 0) {
trketaeff[i] = 1.*ntrketareco[i]/ntrketa[i];
etrketaeff[i] = sqrt( trketaeff[i]*(1.-trketaeff[i])/ntrketa[i] );
responceVSetaF[i] = responceVSeta[i]/ntrketarecor[i];
cout <<" i = " << i
<<" eta interval = " << eta[i] <<" - " << eta[i+1]
<<" ntrketareco[i] = " << ntrketareco[i]
<<" ntrketa[i] = " << ntrketa[i]
<<" eff = " << trketaeff[i]
<<" responce = " << responceVSetaF[i] << endl;
}
}
// create graph
// vs pT
setTDRStyle(1,0);
TCanvas* c1 = new TCanvas("X","Y",1);
TGraph *grpt = new TGraphErrors(nptbins,ptgr,trkeff,eptgr,etrkeff);
TAxis* xaxis = grpt->GetXaxis();
grpt->GetXaxis()->SetTitle("p_{T}, GeV");
grpt->GetYaxis()->SetTitle("track finding efficiency");
xaxis->SetLimits(0.8,50.);
grpt->SetMarkerStyle(21);
grpt->SetMaximum(0.9);
grpt->SetMinimum(0.6);
grpt->Draw("AP");
TLatex *t = new TLatex();
t->SetTextSize(0.042);
// TLegend *leg = new TLegend(0.5,0.2,0.7,0.35,NULL,"brNDC");
// leg->SetFillColor(10);
// leg->AddEntry(grpt,"#pi ^{+} and #pi ^{-}","P");
// leg->Draw();
t->DrawLatex(1.,0.85,"CMSSW169, single #pi ^{+} and #pi ^{-}. |#eta ^{#pi}|< 2.5");
c1->SaveAs("trkeff_vs_pt.gif");
c1->SaveAs("trkeff_vs_pt.eps");
setTDRStyle(0,0);
// vs Eta
TCanvas* c2 = new TCanvas("X","Y",1);
TGraph *greta = new TGraphErrors(netabins,etagr,trketaeff,eetagr,etrketaeff);
TAxis* xaxis = greta->GetXaxis();
greta->GetXaxis()->SetTitle("#eta");
greta->GetYaxis()->SetTitle("track finding efficiency");
xaxis->SetLimits(0.0,2.4);
greta->SetMarkerStyle(21);
greta->SetMaximum(1.0);
greta->SetMinimum(0.50);
greta->Draw("AP");
TLatex *t = new TLatex();
t->SetTextSize(0.042);
// TLegend *leg = new TLegend(0.5,0.2,0.7,0.35,NULL,"brNDC");
// leg->SetFillColor(10);
// leg->AddEntry(greta,"#pi ^{+} and #pi ^{-}","P");
// leg->Draw();
示例10: Loop
//.........这里部分代码省略.........
Float_t leakage[netabins], eleakage[netabins];
Float_t MeanNotInter[netabins], MeanErrorNotInter[netabins];
Float_t MeanInter[netabins], MeanErrorInter[netabins];
for(Int_t ih=0; ih < netabins; ih++) {
// hEnTrkNotInter[ih]->Write();
// hEnTrkInter[ih]->Write();
MeanNotInter[ih] = hEnTrkNotInter[ih]->GetMean();
MeanErrorNotInter[ih] = hEnTrkNotInter[ih]->GetMeanError();
MeanInter[ih] = hEnTrkInter[ih]->GetMean();
MeanErrorInter[ih] = hEnTrkInter[ih]->GetMeanError();
leakage[ih] = MeanInter[ih]/MeanNotInter[ih];
eleakage[ih] = leakage[ih] *
sqrt( (MeanErrorNotInter[ih]/MeanNotInter[ih])*(MeanErrorNotInter[ih]/MeanNotInter[ih]) +
(MeanErrorInter[ih]/MeanInter[ih])*(MeanErrorInter[ih]/MeanInter[ih]));
cout <<" ieta = " << ih <<" MeanNotInter = " << MeanNotInter[ih] <<" +/- " << MeanErrorNotInter[ih]
<<" MeanInter = " << MeanInter[ih] <<" +/- " << MeanErrorInter[ih]
<<" leakage = " << leakage[ih] <<" +/- " << eleakage[ih] << endl;
}
TGraph *gleak = new TGraphErrors(netabins,etagr,leakage, eetagr,eleakage);
TGraph *eMeanNotInter = new TGraphErrors(netabins,etagr,MeanNotInter, eetagr,MeanErrorNotInter);
TGraph *eMeanInter = new TGraphErrors(netabins,etagr,MeanInter, eetagr,MeanErrorInter);
// vs Eta
setTDRStyle(0,0);
TCanvas* c3 = new TCanvas("X","Y",1);
c3->Divide(1,2);
c3->cd(1);
TAxis* xaxis = eMeanNotInter->GetXaxis();
eMeanNotInter->GetXaxis()->SetTitle("#eta");
eMeanNotInter->GetYaxis()->SetTitle("calo E_{T}^{raw reco} in cone 0.5/p_{T}^{MC}");
xaxis->SetLimits(0.0,2.4);
eMeanNotInter->SetMarkerStyle(21);
// eMeanNotInter->SetMaximum(0.95);
// eMeanNotInter->SetMinimum(0.55);
eMeanNotInter->SetMaximum(1.);
eMeanNotInter->SetMinimum(0.);
eMeanNotInter->Draw("AP");
eMeanInter->SetMarkerStyle(24);
eMeanInter->Draw("P");
TLatex *t = new TLatex();
t->SetTextSize(0.08);
t->DrawLatex(0.2,0.9,"CMSSW_1_6_9");
TLegend *leg = new TLegend(0.2,0.2,0.8,0.4,NULL,"brNDC");
leg->SetFillColor(10);
leg->AddEntry(eMeanNotInter,"recontructed tracks 2 < p_{T}^{#pi^{#pm}} < 10 GeV","P");
leg->AddEntry(eMeanInter,"not reconstructed tracks 2 < p_{T}^{#pi^{#pm}} < 10 GeV","P");
leg->Draw();
c3->cd(2);
TAxis* xaxis = gleak->GetXaxis();
gleak->GetXaxis()->SetTitle("#eta");
gleak->GetYaxis()->SetTitle("ratio = <E_{T for lost tracks}^{raw reco} / E_{T for found tracks}^{raw reco}>");
xaxis->SetLimits(0.0,2.4);
gleak->SetMarkerStyle(21);
gleak->SetMaximum(1.0);
// leak->SetMinimum(0.7);
gleak->SetMinimum(0.5);
gleak->Draw("AP");
TLatex *t = new TLatex();
t->SetTextSize(0.08);
// t->DrawLatex(0.1,0.75,"<E_{T for lost tracks}^{raw reco} / E_{T for found tracks}^{raw reco}> for p_{T}^{#pi^{#pm}} >2 GeV");
c3->SaveAs("eMean_vs_eta_pt2-10.gif");
c3->SaveAs("eMean_vs_eta_pt2-10.eps");
示例11: finalSpectra
//.........这里部分代码省略.........
int centralMarker=29;
int minbiasMarker=8;
int peripheralMarker=22;
int hMinusMarker=21;
int ua1Marker=4;
// central
//
gCentral=removeXErrors(gCentralX);
gCentral->SetMinimum(yMin); gCentral->SetMaximum(yMax);
gCentral->SetMarkerStyle(centralMarker);
gCentral->SetMarkerSize(markerSize+.2);
gCentral->Draw("ap");
strcpy(txt,"1/p_{T} d^{2}N^{(h^{-}+h^{+})/2}/dp_{T}d#eta #cbar_{|#eta|<0.5}(GeV/c)^{-2}");
// yaxis
axis=gCentral->GetYaxis();
axis->SetTitle(txt);
axis->SetTitleSize(titleSize);
axis->SetTitleOffset(yTitleOffset);
axis->SetLabelSize(labelSize);
// xaxis
axis=gCentral->GetXaxis();
axis->SetTitle("p_{T} (GeV/c)");
axis->SetTitleSize(titleSize);
axis->SetTitleOffset(xTitleOffset);
axis->SetLabelOffset(0.003);
axis->SetLabelSize(labelSize);
axis->SetLimits(xMin,xMax);
// low pt central
gCentralLowPt->SetMarkerStyle(centralMarker);
gCentralLowPt->SetMarkerSize(markerSize);
gCentralLowPt->Draw("p");
// draw bin widths
// drawAxisBins(gCentralX,tickSize,yMax);
// TLine* line=new TLine;
// line->DrawLineNDC((2/6)*(1./.8)+.1,.8,2/6*(1./.8)+.1 ,.9);
// minbias
//
// remove x errors
gMinbias=removeXErrors(gMinbiasX);
gMinbias->SetMarkerStyle(minbiasMarker);
gMinbias->SetMarkerSize(markerSize);
gMinbias->Draw("p");
gMinbiasLowPt->SetMarkerStyle(minbiasMarker);
gMinbiasLowPt->SetMarkerSize(markerSize);
gMinbiasLowPt->Draw("p");
// peripheral
//
// remove x errors
gPeripheral=removeXErrors(gPeripheralX);