本文整理汇总了C++中TGraphErrors::SetTitle方法的典型用法代码示例。如果您正苦于以下问题:C++ TGraphErrors::SetTitle方法的具体用法?C++ TGraphErrors::SetTitle怎么用?C++ TGraphErrors::SetTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TGraphErrors
的用法示例。
在下文中一共展示了TGraphErrors::SetTitle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gyieldsp
//.........这里部分代码省略.........
7.206486,
6.824632,
6.594841,
6.406375,
6.079494,
5.746822,
5.225105,
4.165823,
2.787035};
Double_t Graph0_fehx3021[10] = {
0.2,
0.25,
0.25,
0.25,
0.25,
0.25,
0.25,
0.25,
0.25,
0.2};
Double_t Graph0_fehy3021[10] = {
5.988963,
6.218694,
6.307709,
6.368316,
5.847823,
5.655323,
5.083818,
4.561256,
3.722445,
2.542957};
TGraphAsymmErrors *grae = new TGraphAsymmErrors(10,Graph0_fx3021,Graph0_fy3021,Graph0_felx3021,Graph0_fehx3021,Graph0_fely3021,Graph0_fehy3021);
grae->SetName("Graph0");
grae->SetTitle("Graph");
Int_t ci; // for color index setting
TColor *color; // for color definition with alpha
ci = TColor::GetColor("#ffff00");
grae->SetFillColor(ci);
ci = TColor::GetColor("#ff0000");
grae->SetLineColor(ci);
grae->SetLineWidth(4);
grae->SetMarkerStyle(20);
grae->SetMarkerSize(0);
TH1F *Graph_Graph3021 = new TH1F("Graph_Graph3021","Graph",100,-2.5,2.5);
Graph_Graph3021->SetMinimum(0);
Graph_Graph3021->SetMaximum(140);
Graph_Graph3021->SetDirectory(0);
Graph_Graph3021->SetStats(0);
Graph_Graph3021->SetLineStyle(0);
Graph_Graph3021->SetMarkerStyle(20);
Graph_Graph3021->GetXaxis()->SetNdivisions(505);
Graph_Graph3021->GetXaxis()->SetLabelFont(42);
Graph_Graph3021->GetXaxis()->SetLabelOffset(0.007);
Graph_Graph3021->GetXaxis()->SetLabelSize(0);
Graph_Graph3021->GetXaxis()->SetTitleSize(0.07142857);
Graph_Graph3021->GetXaxis()->SetTitleOffset(1.1);
Graph_Graph3021->GetXaxis()->SetTitleFont(42);
Graph_Graph3021->GetYaxis()->SetTitle("d#sigma (W^{+}#rightarrow#font[12]{l}^{+}#nu) / d#eta_{lab} [nb]");
Graph_Graph3021->GetYaxis()->SetLabelFont(42);
Graph_Graph3021->GetYaxis()->SetLabelOffset(0.007);
Graph_Graph3021->GetYaxis()->SetLabelSize(0.07142857);
Graph_Graph3021->GetYaxis()->SetTitleSize(0.07142857);
Graph_Graph3021->GetYaxis()->SetTitleOffset(1.05);
示例2: phi2
//.........这里部分代码省略.........
hs->Add(hbkg6);
hs->Add(hbkg8);
hs->Add(hbkg4);
hs->Add(hbkg9);
hs->Add(hbkg10);
hs->Add(hbkg11);
hs->Add(hbkg12);
hs->Add(hbkg2);
hs->Add(hbkg5);
hs->Add(hbkg3);
hs->Add(hbkg1);
TH1F *hsum = (TH1F*)hbkg1->Clone("hsum");
hsum->Add(hbkg2);
hsum->Add(hbkg3);
hsum->Add(hbkg4);
hsum->Add(hbkg5);
hsum->Add(hbkg6);
hsum->Add(hbkg7);
hsum->Add(hbkg8);
hsum->Add(hbkg9);
hsum->Add(hbkg10);
hsum->Add(hbkg11);
hsum->Add(hbkg12);
hs->SetMaximum(1000000);
hs->SetMinimum(0.1);
hs->SetTitle("");
hs->Draw("HIST");
hsum->SetMarkerStyle(1);
hsum->SetFillColor(kGray+3);
hsum->SetFillStyle(3002);
hsum->Draw("same e2");
h2->Draw("same hist");
h3->Draw("same hist");
h4->Draw("same hist");
h1->Draw("same hist");
h5->Draw("same hist");
h6->Draw("same hist");
h7->Draw("same hist");
hdata->Draw("same E1");
hs->GetXaxis()->SetLabelOffset(999);
hs->GetYaxis()->SetTitle("Events/0.4");
hs->GetYaxis()->SetTitleOffset(1.2);
gPad->Modified();
leg->AddEntry(hdata,"Data","lep");
leg->AddEntry(hbkg1,"#gamma #gamma","f");
leg->AddEntry(h1,"m_{Z'} = 600 GeV","l");
leg->AddEntry(hbkg2,"Drell Yann","f");
leg->AddEntry(hbkg3,"#gamma + Jets","f");
leg->AddEntry(h2,"m_{Z'} = 800 GeV","l");
示例3: if
v8233pt_compare()
{
gROOT->Reset();
gROOT->SetStyle("MyStyle");
MyStyle->SetPadLeftMargin(0.25);
MyStyle->SetTitleOffset(4.5,"y");
// gROOT->LoadMacro("v2pt_12cen_MyDef.C");
// gROOT->LoadMacro("MyDef.C");
gStyle->SetTextFont(43);
gStyle->SetLabelFont(43,"x");
gStyle->SetLabelFont(43,"y");
gStyle->SetLabelFont(43,"z");
gStyle->SetTitleFont(43,"x");
gStyle->SetTitleFont(43,"y");
gStyle->SetTitleFont(43,"z");
gStyle->SetEndErrorSize(0);
double textsize = 19;
//int mcol[8]={kRed,kMagenta,kBlue,kCyan,kGreen,kYellow,kOrange,kGray};
int mcol[8]={kRed,kOrange+1,kBlue,kGreen+1,kCyan,kYellow,kOrange,kGray};
int mcol2[4]={6,2,4,8};
//int msty[8][2]={{20,20},{25,24},{22,22},{28,26},{29,30},{33,27},{34,28},{20,24}};
int msty[8][2]={{20,20},{21,24},{22,29},{23,30},{24,30},{25,27},{28,28},{30,24}};
//float msiz[8]={1.11,0.9,1.2,1.24,1.5,1,1,1};
float msiz[8]={1.11,1.0,1.5,1.2,1.2,1.2,1.2,1.6};
float msiz2[4]={1.5,1.5,1.5,1.5};
//
// arrays
//
const int Mfiles=50;
int ndp[Mfiles];
char *cfn[Mfiles];
char *cft[Mfiles];
const int Mpoints=40;
double xa[Mfiles][Mpoints],xe[Mfiles][Mpoints];
double ya[Mfiles][Mpoints],ye[Mfiles][Mpoints];
double nxa[Mfiles][Mpoints],nxe[Mfiles][Mpoints];
double nya[Mfiles][Mpoints],nye[Mfiles][Mpoints];
double aexl[Mfiles][Mpoints],aexh[Mfiles][Mpoints];
double aeyl[Mfiles][Mpoints],aeyh[Mfiles][Mpoints];
double ra[Mfiles][Mpoints],re[Mfiles][Mpoints];
const int Mpads=14;
char *htit[Mpads];
char *atit[Mpads][3];
double ptit[Mpads][2];
double hxmin[Mpads],hxmax[Mpads];
double hymin[Mpads],hymax[Mpads];
double lxmin[Mpads],lxmax[Mpads];
double lymin[Mpads],lymax[Mpads];
//
// Data input
//
char *cjob="v2pt_12cen_4x3";
int i=-1;
// histogram parameter
htit[0]="0-5%";
htit[1]="5-10%";
htit[2]="10-15%";
htit[3]="15-20%";
htit[4]="20-25%";
htit[5]="25-30%";
htit[6]="30-35%";
htit[7]="35-40%";
htit[8]="40-50%";
htit[9]="50-60%";
htit[10]="60-70%";
htit[11]="70-80%";
for (int ip=0;ip<Mpads;ip++)
{
// hxmin[ip]=0.0; hxmax[ip]=11.9;
hxmin[ip]=0.0001; hxmax[ip]=10.8;
hymin[ip]=0.0001; hymax[ip]=0.049;
lxmin[ip]=0.08; lxmax[ip]=0.35;
lymin[ip]=0.4; lymax[ip]=0.65;
ptit[ip][0]=5.0; ptit[ip][1]=0.04;// position legends
atit[ip][0]="p_{T} (GeV/c)"; atit[ip][1]="v_{8}{#Psi_{233}}";
}
//
// Read data and create vector files
//
double tmp;
const int nw=12;
const int npt=15;
//.........这里部分代码省略.........
示例4: main
//.........这里部分代码省略.........
// select on beam activity and gain and goodquality
if ((techL1Bit[40]+techL1Bit[41])==0) continue;
if (gainSwitch) continue; // reject pulses beyond G12
if (goodcluster == false) continue;
//if all good -> cluster shape eval
double numeratorIEtaIEta = 0;
double numeratorIEtaIPhi = 0;
double numeratorIPhiIPhi = 0;
double denominator = 0;
for (int xx = 0; xx < 5; ++xx)
for (int yy = 0; yy < 5; ++yy)
{
double dEta = fabs(xx - 2) - meanDEta;
//double w = std::max(0.0, w0 + log(ecalRecHitMatrix[ihit][xx][yy] / e_5x5));
double w = std::max(0.0, log(ecalRecHitMatrix[ihit][xx][yy] / e_5x5));
denominator += w;
numeratorIEtaIEta += w * dEta*dEta;
}
double covIEtaIEta = 0.01745*0.01745 * numeratorIEtaIEta / denominator;
double sigmaIEtaIEta = sqrt(covIEtaIEta);
sigmaIEtaIEtaDistr->Fill(sigmaIEtaIEta);
// graphs
gsample = new TGraphErrors();
sprintf(gtitle,"shape_Run%d_Evt%d",runId,eventId );
sprintf(gname,"shape_%d",ievt);
gsample->SetName(gname);
gsample->SetTitle(gtitle);
float ped = (ecalDigis[ihit][0] + ecalDigis[ihit][1] + ecalDigis[ihit][2])/3;
int imax = 0;
int maxAmpl = 0;
int ithr = 0;
for (int isample = 0; isample < 10 ; isample++)
{
// cerca il primo sample sopra soglia per definire il range di FIT
if (ecalDigis[ihit][isample] >= ped+7.)
ithr = isample;
if (ecalDigis[ihit][isample] >= maxAmpl)
{
imax = isample;
maxAmpl = ecalDigis[ihit][isample] ;
}
gsample->SetPoint(isample, double(isample)*25.,ecalDigis[ihit][isample]);
gsample->SetPointError(isample,0.,0.9);
}
//tengo solo se il primo sopra soglia e' il quarto o il quinto
//if (ithr > 4 || ithr < 3) continue;
// fit functions
//Ecal Shape with FLOATING phase TB shape
//TF1 *fpulseShape = new TF1("fpulseShape",pulseShape,ithr*25-5.,240.,3);
TF1 *fpulseShape = new TF1("fpulseShape",pulseShape,0.,240.,3);
fpulseShape->SetLineColor(3);
if (ecalRecHitS4oS1[ihit]>0.95) fpulseShape->SetLineColor(2);
fpulseShape->SetParName(0,"Ped");
示例5: postprocessing
//.........这里部分代码省略.........
sysUncertaintyJECError[i] = TMath::Sqrt(TMath::Power(1./(2.*yMC[i]),2)*(TMath::Power(yJECErrorUp[i],2)+TMath::Power(yJECErrorLow[i],2))+TMath::Power(std::abs(yJECUp[i]-yJECLow[i])/(2.*TMath::Power(yMC[i],2)),2)*TMath::Power(yMCError[i],2));
cout<<"enclosing JER!"<<endl<<endl<<endl;
}
else{
if(std::abs(1-yJECUp[i]/yMC[i]) > std::abs(1-yJECLow[i]/yMC[i])) {
sysUncertaintyJEC[i] = std::abs((yJECUp[i]-yMC[i])/2.)/yMC[i];
sysUncertaintyJECError[i] = TMath::Sqrt(TMath::Power(1./(2.*yMC[i]),2)*TMath::Power(yJECErrorUp[i],2)+TMath::Power(yJECUp[i]/(2*TMath::Power(yMC[i],2)),2)*TMath::Power(yMCError[i],2));
}
else{
sysUncertaintyJEC[i] = std::abs((yJECLow[i]-yMC[i]))/2./yMC[i];
sysUncertaintyJECError[i] = TMath::Sqrt(TMath::Power(1./(2.*yMC[i]),2)*TMath::Power(yJECErrorLow[i],2)+TMath::Power(yJECLow[i]/(2*TMath::Power(yMC[i],2)),2)*TMath::Power(yMCError[i],2));
}
cout<<"NOT enclosing JER!"<<endl<<endl;
cout<<"yMCError["<<i<<"] = "<<yMCError[i]<<endl;
cout<<"yJECErrorUp["<<i<<"] = "<<yJECErrorUp[i]<<endl;
cout<<"yJECErrorLow["<<i<<"] = "<<yJECErrorLow[i]<<endl<<endl<<endl<<endl;
}
cout<<"sysUncertaintyJECError[i] = "<<sysUncertaintyJECError[i]<<endl;
}
TCanvas *cJEC3 = new TCanvas("cJEC3",etaString,200,10,500,500);
cJEC3 -> SetLeftMargin(0.17);
cJEC3 -> cd();
TGraphErrors* sysUncertaintyFinal = new TGraphErrors(numEntries,xJECUp,sysUncertaintyJEC,xJECErrorUp,sysUncertaintyJECError);
TF1* f1 = new TF1("name","pol0",0,600);
sysUncertaintyFinal -> Fit("name","");
cout<<endl<<"chi2 = "<<f1 -> GetChisquare()<<endl<<endl;
sysUncertaintyFinal -> SetTitle("Final Relative JEC Uncertainty");
sysUncertaintyFinal -> GetXaxis()->SetTitle("p_{T}^{#gamma}");
sysUncertaintyFinal -> GetYaxis()->SetTitleOffset(1.5);
sysUncertaintyFinal -> GetYaxis()->SetTitle("rel. Uncertainty");
sysUncertaintyFinal -> SetMarkerStyle(22);
sysUncertaintyFinal -> SetMaximum(0.1);
sysUncertaintyFinal -> SetMarkerSize(1);
sysUncertaintyFinal -> SetMarkerColor(1);
sysUncertaintyFinal -> SetLineColor(1);
sysUncertaintyFinal -> Draw("AP");
TLatex* info = new TLatex();
char legname[100] = {0};
info->SetTextFont(132);
info-> SetNDC();
info->SetTextSize(0.040);
sprintf(legname,"#splitline{#chi^{2} = %4.2f}{dof = %i}",f1 -> GetChisquare(),f1 -> GetNDF());
info->DrawLatex(0.60,0.80,legname);
delete info;
info = new TLatex();
info->SetTextFont(132);
info-> SetNDC();
info->SetTextSize(0.040);
sprintf(legname,"#splitline{sys Uncer. = %4.3f}{stat Error = %4.3f}",f1 -> GetParameter(0),f1 -> GetParError(0));
info->DrawLatex(0.60,0.6,legname);
TGraphErrors* JECsysUp = new TGraphErrors(numEntries,xJECUp,yJECsysUp,xJECErrorUp,yJECErrorsysUp);
TGraphErrors* JECsysLow = new TGraphErrors(numEntries,xJECLow,yJECsysLow,xJECErrorLow,yJECErrorsysLow);
TCanvas *cJEC = new TCanvas("cJEC",etaString,200,10,500,500);
cJEC -> SetLeftMargin(0.17);
示例6: DeltaPhi
//.........这里部分代码省略.........
hbkg12->SetLineColor(kBlack);
hs->Add(hbkg7);
hs->Add(hbkg6);
hs->Add(hbkg8);
hs->Add(hbkg4);
hs->Add(hbkg9);
hs->Add(hbkg10);
hs->Add(hbkg11);
hs->Add(hbkg12);
hs->Add(hbkg2);
hs->Add(hbkg5);
hs->Add(hbkg3);
hs->Add(hbkg1);
cout<<"check4"<<endl;
TH1F *hsum = (TH1F*)hbkg1->Clone("hsum");
hsum->Add(hbkg2);
hsum->Add(hbkg3);
hsum->Add(hbkg4);
hsum->Add(hbkg9);
hsum->Add(hbkg10);
hsum->Add(hbkg11);
hsum->Add(hbkg12);
hsum->Add(hbkg5);
hsum->Add(hbkg6);
hsum->Add(hbkg7);
hsum->Add(hbkg8);
hdata->SetMaximum(5000);
// hs->SetMinimum(0.0001);
hdata->SetTitle("");
hdata->Draw("e1");
hsum->SetMarkerStyle(1);
hsum->SetFillColor(kGray+3);
hsum->SetFillStyle(3002);
hs->Draw("same hist");
hsum->Draw("same e2");
h2->Draw("same hist");
h3->Draw("same hist");
h4->Draw("same hist");
h1->Draw("same hist");
h5->Draw("same hist"); //only for 15ns samples
h6->Draw("same hist"); //only for 15ns samples
h7->Draw("same hist"); //only for 15ns samples
hdata->Draw("same e1");
hdata->GetXaxis()->SetLabelOffset(999);
hdata->GetYaxis()->SetTitle("Events/0.4");
hdata->GetYaxis()->SetTitleOffset(1.6);
hdata->GetYaxis()->SetTitle("Events/0.23 GeV");
gPad->Modified();
/*leg->AddEntry(h1,"m_{#chi} = 1 GeV","l");
leg->AddEntry(h2,"m_{#chi} = 10 GeV","l");
leg->AddEntry(h3,"m_{#chi} = 100 GeV","l");
leg->AddEntry(h4,"m_{#chi} = 1000 GeV","l");*/
示例7: plotPatDep
//.........这里部分代码省略.........
TTree *slugTree = f->Get("slug");
gStyle->SetOptStat("neMmRr");
gStyle->SetOptFit(1);
gStyle->SetStatW(0.32);
//----------------------------------------------------------------------------------------
//CHARGE ASYMMETRY
TCanvas *cCharge = new TCanvas("cCharge","Pattern History Study: qwk_charge",1400,1100);
cCharge->Divide(3,4);
for (Int_t i=0; i<7; i++){
histoCharge[i] = new TH1F(Form("%s",plotTitles[i].Data()),"",100,0,0);
cCharge->cd(histPos[i]);
histoCharge[i]->SetDirectory(0);
slugTree->Draw(Form("1e6*asym_qwk_charge>>slug%i_q_%s",slugNum,plotTitles[i].Data()),Form("%s && ErrorFlag==0 && asym_qwk_charge_Device_Error_Code==0",cutList[i].Data()));
TH1F *htemp = (TH1F*)gPad->GetPrimitive(Form("slug%i_q_%s",slugNum,plotTitles[i].Data()));
aqCorr[i] = htemp->GetMean();
aqErr[i] = htemp->GetMeanError();
}
cCharge->cd(10);
patAsymMean[0] = aqCorr[2]; patAsymErr[0] = aqErr[2];
patAsymMean[1] = aqCorr[3]; patAsymErr[1] = aqErr[3];
patAsymMean[2] = aqCorr[5]; patAsymErr[2] = aqErr[5];
patAsymMean[3] = aqCorr[6]; patAsymErr[3] = aqErr[6];
TGraphErrors *grp = new TGraphErrors(4,patType,patAsymMean,patTypeErr,patAsymErr);
grp->SetMarkerStyle(21);
grp->Draw("ap");
grp->Fit("pol0");
grp->SetTitle("Asymmetry per pattern: --, -+ +- ++");
grp->GetYaxis()->SetTitle("Asymmetry (ppm)");
grp->GetYaxis()->SetTitleOffset(1.3);
grp->GetXaxis()->SetTitle("Pattern");
cCharge->Update(); cCharge->Modified();
if(saveFile){
cCharge->SaveAs(Form("%s/%i_charge_%s.png",plotDir.Data(),slugNum,asymType.Data()));
}
//----------------------------------------------------------------------------------------
//DEVICE
TCanvas *cDet = new TCanvas("cDet",Form("Pattern History Study: %s",device.Data()),1400,1100);
cDet->Divide(3,4);
for (Int_t i=0; i<7; i++){
histoDet[i] = new TH1F(Form("%s",plotTitles[i].Data()),"",100,0,0);
cDet->cd(histPos[i]);
histoDet[i]->SetDirectory(0);
slugTree->Draw(Form("1e6*%s_%s>>slug%i_det_%s",asymType.Data(),device.Data(),slugNum,plotTitles[i].Data()),Form("%s && ErrorFlag==0 && asym_%s_Device_Error_Code==0",cutList[i].Data(),device.Data()));
TH1F *htemp = (TH1F*)gPad->GetPrimitive(Form("slug%i_det_%s",slugNum,plotTitles[i].Data()));
detPatMean[i] = htemp->GetMean();
detPatErr[i] = htemp->GetMeanError();
}
cDet->cd(10);
patAsymMean[0] = detPatMean[2]; patAsymErr[0] = detPatErr[2];
patAsymMean[1] = detPatMean[3]; patAsymErr[1] = detPatErr[3];
patAsymMean[2] = detPatMean[5]; patAsymErr[2] = detPatErr[5];
patAsymMean[3] = detPatMean[6]; patAsymErr[3] = detPatErr[6];
示例8: Significance_auto
//.........这里部分代码省略.........
}// end if
// find the highest significance
int hightest_bin =-9;
double highest_sig=-99;
for(int i=0;i<Nbins; i++)
{
double temp = vy_significance[i] + vy_significance_erry[i];
if(temp > highest_sig){highest_sig = temp; hightest_bin = i;}
}
cout<<endl;
cout<< "Zprime_mass[k]: " << Zprime_mass[k] << endl;
cout<<"hightest_bin : "<< hightest_bin << endl;
cout<<"highest_sig : "<<highest_sig << endl;
cout<<"vx[hightest_bin] : "<< vx[hightest_bin] <<endl;
cout<<"sig: "<< vy_significance[hightest_bin] <<" +/- "<< vy_significance_erry[hightest_bin] << endl;
cout<<endl;
// draw the TGraphError
c1[k]->cd();
TGraphErrors *gr = new TGraphErrors(Nbins , vx , vy_significance, vy_significance_errx, vy_significance_erry );
TGraphErrors *gr_eff = new TGraphErrors(Nbins , vx , vy_sig_eff, vy_sig_eff_errx, vy_sig_eff_erry );
TGraphErrors *gr_background_eff = new TGraphErrors(Nbins , vx , vy_background_eff, vy_background_eff_errx, vy_background_eff_erry );
// draw setting
gr->GetYaxis()->SetRangeUser(0, 1.1);
gr->SetTitle(c1_title);
// gr->GetXaxis()->SetTitle("Minimum p_{T} threshold of leading electron [ GeV]");
gr->GetXaxis()->SetTitle("| delta eta |");
gr->SetLineColor(2);
gr_eff->SetLineColor(kBlue);
gr_background_eff->SetLineColor(kGreen+2);
gr->SetLineStyle(1);
gr_eff->SetLineStyle(1);
gr_background_eff->SetLineStyle(1);
gr->SetLineWidth(3);
gr_eff->SetLineWidth(3);
gr_background_eff->SetLineWidth(3);
gr->SetMarkerColor(2);
gr_eff->SetMarkerColor(kBlue);
gr_background_eff->SetMarkerColor(kGreen+2);
gr->SetMarkerStyle(4);
gr_eff->SetMarkerStyle(5);
gr_background_eff->SetMarkerStyle(8);
gr->SetMarkerSize(1);
gr_eff->SetMarkerSize(1);
gr_background_eff->SetMarkerSize(1);
gr->Draw("ALP");
gr_eff->Draw("same lp");
gr_background_eff->Draw("same lp");
leg->AddEntry( gr , leg_name1 ,"pl");
示例9: dumpWPsAntiElectronDiscr
//.........这里部分代码省略.........
std::vector<workingPointEntryType> workingPoints = readWorkingPoints(inputFileName, wpTreeName, categories);
std::vector<graphWrapperType*> graphWrappers;
for ( std::vector<workingPointEntryType>::iterator workingPoint = workingPoints.begin();
workingPoint != workingPoints.end(); ++workingPoint ) {
bool isInTargetSignalEfficiencies = false;
for ( std::vector<double>::const_iterator targetSignalEfficiency = targetSignalEfficiencies.begin();
targetSignalEfficiency != targetSignalEfficiencies.end(); ++targetSignalEfficiency ) {
if ( TMath::Abs(workingPoint->targetSignalEfficiency_ - (*targetSignalEfficiency)) < 0.003 ) isInTargetSignalEfficiencies = true;
}
if ( isInTargetSignalEfficiencies ) {
std::cout << "targetSignalEfficiency = " << workingPoint->targetSignalEfficiency_ << ":" << std::endl;
std::cout << " Pt = " << workingPoint->minPt_ << ".." << workingPoint->maxPt_ << std::endl;
for ( std::vector<int>::const_iterator category = categories.begin();
category != categories.end(); ++category ) {
std::cout << " category #" << (*category) << ": cut = " << workingPoint->cuts_[*category] << std::endl;
}
std::cout << " S = " << workingPoint->S_ << ", B = " << workingPoint->B_ << " --> S/B = " << (workingPoint->S_/workingPoint->B_) << std::endl;
std::cout << std::endl;
for ( std::vector<int>::const_iterator category = categories.begin();
category != categories.end(); ++category ) {
graphWrapperType* graphWrapper_matched = 0;
for ( std::vector<graphWrapperType*>::const_iterator graphWrapper = graphWrappers.begin();
graphWrapper != graphWrappers.end(); ++graphWrapper ) {
if ( TMath::Abs((*graphWrapper)->targetSignalEfficiency_ - workingPoint->targetSignalEfficiency_) < 1.e-6 && (*graphWrapper)->category_ == (*category) ) {
graphWrapper_matched = (*graphWrapper);
}
}
if ( !graphWrapper_matched ) {
graphWrapper_matched = new graphWrapperType();
graphWrapper_matched->targetSignalEfficiency_ = workingPoint->targetSignalEfficiency_;
graphWrapper_matched->category_ = (*category);
graphWrappers.push_back(graphWrapper_matched);
}
// if ( workingPoint->minPt_ == 0. ) {
// // CV: use constant cut on BDT output in low Pt region dominated by SM Drell -> Yan ee background
// graphWrapper_matched->x_.push_back(workingPoint->minPt_);
// graphWrapper_matched->y_.push_back(workingPoint->cuts_[*category]);
// graphWrapper_matched->x_.push_back(workingPoint->maxPt_);
// graphWrapper_matched->y_.push_back(workingPoint->cuts_[*category]);
// } else if ( workingPoint->minPt_ >= 400. ) {
// graphWrapper_matched->x_.push_back(400.);
// graphWrapper_matched->y_.push_back(workingPoint->cuts_[*category]);
// } else {
double avPt = 0.5*(workingPoint->minPt_ + workingPoint->maxPt_);
graphWrapper_matched->xLow_.push_back(workingPoint->minPt_);
graphWrapper_matched->xUp_.push_back(workingPoint->maxPt_);
graphWrapper_matched->x_.push_back(avPt);
graphWrapper_matched->y_.push_back(workingPoint->cuts_[*category]);
// }
}
}
}
TFile* outputFile = new TFile("dumpWPsAntiElectronDiscr.root", "RECREATE");
for ( std::vector<graphWrapperType*>::const_iterator graphWrapper = graphWrappers.begin();
graphWrapper != graphWrappers.end(); ++graphWrapper ) {
unsigned int numPoints = (*graphWrapper)->x_.size();
assert((*graphWrapper)->y_.size() == numPoints);
TGraphErrors* graph = new TGraphErrors(numPoints);
std::string graphName = Form("eff%1.0fcat%i", (*graphWrapper)->targetSignalEfficiency_*100., (*graphWrapper)->category_);
std::string graphTitle = Form("Category #%i (target signal efficiency = %1.0f %%)", (*graphWrapper)->category_, (*graphWrapper)->targetSignalEfficiency_*100.);
graph->SetName(graphName.data());
graph->SetTitle(graphTitle.data());
for ( unsigned int iPoint = 0; iPoint < numPoints; ++iPoint ) {
double xLow = (*graphWrapper)->xLow_[iPoint];
double xUp = (*graphWrapper)->xUp_[iPoint];
double x = (*graphWrapper)->x_[iPoint];
double y = (*graphWrapper)->y_[iPoint];
if ( xUp >= 1.e+6 ) xUp = 1000.;
graph->SetPoint(iPoint, 0.5*(xUp + xLow), y);
graph->SetPointError(iPoint, 0.5*(xUp - xLow), 0.);
}
graph->SetMarkerStyle(20);
graph->SetMarkerColor(1);
graph->SetLineColor(1);
graph->SetLineWidth(1);
graph->GetXaxis()->SetTitle("Pt");
graph->GetYaxis()->SetTitle("cut value");
graph->GetYaxis()->SetRangeUser(-1., 1.);
graph->Write();
}
delete outputFile;
for ( std::vector<graphWrapperType*>::const_iterator it = graphWrappers.begin();
it != graphWrappers.end(); ++it ) {
delete (*it);
}
}
示例10: make1DLimit
void make1DLimit(TString combine_dir,TString type= "WH",bool blind=true){
//TString combine_dir = "test_runSusyHgg/signalInj_sms_ChiWH_0_175/";
TGraph obser( (200-125)/25 );
TGraph graph( (200-125)/25 );
TGraphAsymmErrors error( (200-125)/25 );
TGraph obser_r( (200-125)/25 );
TGraph graph_r( (200-125)/25 );
TGraphAsymmErrors error_r( (200-125)/25 );
TGraphErrors* theo = 0;
if(type=="WH") theo = getTheoXSec("xsecs/CharginoNeutralino.txt");
else theo = getTheoXSec("xsecs/Higgsino_ElectroHiggs.txt");
//else theo = getTheoXSec("/home/amott/HggApp/SusyHgg/xsecs/Higgsino.txt");
for(int m=125;m<=200;m+=25) {
int i=(m-125)/25;
TFile limit_file(Form("%s/higgsCombineChi%s_0_%d.Asymptotic.mH120.root",combine_dir.Data(),type.Data(),m) );
TTree *limit_tree = (TTree*)limit_file.Get("limit");
TTreeFormula limit_form("get_limit","limit",limit_tree);
limit_tree->GetEntry(1);
float down = limit_form.EvalInstance();
limit_tree->GetEntry(2);
float exp = limit_form.EvalInstance();
limit_tree->GetEntry(3);
float up = limit_form.EvalInstance();
limit_tree->GetEntry(5);
float obs = limit_form.EvalInstance();
if(i==0) m+=5; //first point is actually at m=130
graph.SetPoint(i,float(m),exp);
error.SetPoint(i,float(m),exp);
error.SetPointError(i,0,0,exp-down,up-exp);
graph_r.SetPoint(i,float(m),exp/theo->Eval(m));
error_r.SetPoint(i,float(m),exp/theo->Eval(m));
error_r.SetPointError(i,0,0,(exp-down)/theo->Eval(m),(up-exp)/theo->Eval(m));
obser.SetPoint(i,float(m),obs);
obser_r.SetPoint(i,float(m),obs/theo->Eval(m));
if(i==0) m-=5;
}
TCanvas cv;
cv.SetLogy();
cv.SetGrid(1,1);
theo->SetMaximum(1e2);
theo->SetMinimum(1e-2);
theo->GetYaxis()->SetLabelSize(0.05);
theo->GetYaxis()->SetTitleSize(0.06);
theo->GetYaxis()->SetTitleOffset(0.8);
theo->GetYaxis()->SetTitle("95% CL #sigma upper limit (pb)");
theo->GetXaxis()->SetTitle("m_{chargino} (GeV)");
if(type=="HH") theo->GetXaxis()->SetTitle("m_{neutralino} (GeV)");
theo->SetFillColor(kBlue);
theo->SetLineStyle(kDotted);
theo->SetLineWidth(1);
error.SetMaximum(1e2);
error.SetMinimum(1e-2);
error.GetYaxis()->SetLabelSize(0.04);
error.GetYaxis()->SetTitleSize(0.06);
error.GetYaxis()->SetTitleOffset(0.8);
error.GetXaxis()->SetLabelSize(0.04);
error.GetXaxis()->SetTitleSize(0.05);
error.GetXaxis()->SetTitleOffset(0.9);
error.GetYaxis()->SetTitle("95% CL #sigma upper limit (pb)");
error.GetXaxis()->SetTitle("m_{chargino} (GeV)");
if(type=="HH") error.GetXaxis()->SetTitle("m_{neutralino} (GeV)");
error.SetFillColor(kGreen);
error.SetTitle("");
error.Draw("A3");
theo->SetTitle("");
theo->Draw("3C");
graph.SetLineStyle(kDashed);
graph.SetLineWidth(0.09);
graph.SetTitle("");
graph.Draw("C");
obser.SetLineStyle(1);
obser.SetLineWidth(1.2);
obser.SetTitle("");
if(!blind) obser.Draw("C");
TLegend leg(0.65,0.65,0.89,0.89);
leg.SetFillColor(0);
leg.SetBorderSize(0);
leg.AddEntry(&graph,"expected","l");
leg.AddEntry(&error,"expected #pm1#sigma","F");
leg.AddEntry(theo,"theoretical","f");
if(!blind) leg.AddEntry(&obser,"observed","l");
leg.Draw("SAME");
TLatex latex;
latex.SetNDC();
//.........这里部分代码省略.........
示例11: paraPull_alpha_FT_EFF_extrapolation_2TeV_2Lep_plots_All
void paraPull_alpha_FT_EFF_extrapolation_2TeV_2Lep_plots_All()
{
//=========Macro generated from canvas: c1/alpha_FT_EFF_extrapolation
//========= (Sun Nov 22 20:19:02 2015) by ROOT version6.02/12
TCanvas *c1 = new TCanvas("c1", "alpha_FT_EFF_extrapolation",0,22,1000,600);
gStyle->SetOptStat(0);
c1->Range(-4.125,-0.9756589,37.125,1.048929);
c1->SetFillColor(0);
c1->SetBorderMode(0);
c1->SetBorderSize(2);
c1->SetGridx();
c1->SetGridy();
c1->SetFrameBorderMode(0);
c1->SetFrameBorderMode(0);
TH1F *NuisanceParameterFreed23 = new TH1F("NuisanceParameterFreed23","alpha_FT_EFF_extrapolation",33,0,33);
NuisanceParameterFreed23->SetMinimum(-0.7732002);
NuisanceParameterFreed23->SetMaximum(0.84647);
NuisanceParameterFreed23->SetStats(0);
Int_t ci; // for color index setting
TColor *color; // for color definition with alpha
ci = TColor::GetColor("#000099");
NuisanceParameterFreed23->SetLineColor(ci);
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(1,"XS_ttbar");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(2,"EG_SCALE_ALL");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(3,"FT_EFF_Eigen_C_0");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(4,"Luminosity");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(5,"XS_st");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(6,"FT_EFF_Eigen_B_1");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(7,"XS_Zc");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(8,"MUONS_ID");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(9,"FT_EFF_Eigen_C_1");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(10,"FT_EFF_Eigen_C_3");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(11,"MUON_EFF_TrigSystUncertainty");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(12,"XS_Zl");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(13,"EL_EFF_ID_TotalCorrUncertainty");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(14,"FT_EFF_Eigen_B_0");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(15,"FT_EFF_Eigen_B_2");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(16,"EL_EFF_Iso_TotalCorrUncertainty");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(17,"EL_EFF_Reco_TotalCorrUncertainty");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(18,"MUONS_SCALE");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(19,"MUON_ISO_STAT");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(20,"MUON_EFF_STAT");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(21,"MUON_EFF_SYS");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(22,"MUON_EFF_TrigStatUncertainty");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(23,"FT_EFF_Eigen_Light_1");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(24,"FT_EFF_Eigen_Light_2");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(25,"EG_RESOLUTION_ALL");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(26,"XS_diboson");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(27,"FT_EFF_Eigen_Light_4");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(28,"FT_EFF_Eigen_Light_3");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(29,"MUON_ISO_SYS");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(30,"XS_Zb");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(31,"MUONS_MS");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(32,"FT_EFF_Eigen_C_2");
NuisanceParameterFreed23->GetXaxis()->SetBinLabel(33,"FT_EFF_Eigen_Light_0");
NuisanceParameterFreed23->GetXaxis()->SetLabelFont(42);
NuisanceParameterFreed23->GetXaxis()->SetLabelSize(0.035);
NuisanceParameterFreed23->GetXaxis()->SetTitleSize(0.035);
NuisanceParameterFreed23->GetXaxis()->SetTitleFont(42);
NuisanceParameterFreed23->GetYaxis()->SetTitle("#theta_{fit} - #theta_{initial}/#Delta#theta");
NuisanceParameterFreed23->GetYaxis()->SetLabelFont(42);
NuisanceParameterFreed23->GetYaxis()->SetLabelSize(0.035);
NuisanceParameterFreed23->GetYaxis()->SetTitleSize(0.035);
NuisanceParameterFreed23->GetYaxis()->SetTitleFont(42);
NuisanceParameterFreed23->GetZaxis()->SetLabelFont(42);
NuisanceParameterFreed23->GetZaxis()->SetLabelSize(0.035);
NuisanceParameterFreed23->GetZaxis()->SetTitleSize(0.035);
NuisanceParameterFreed23->GetZaxis()->SetTitleFont(42);
NuisanceParameterFreed23->Draw("hist");
Double_t _fx1023[35] = {
1.22802e-312,
0.5,
1.5,
2.5,
3.5,
4.5,
5.5,
6.5,
7.5,
8.5,
9.5,
10.5,
11.5,
12.5,
13.5,
14.5,
15.5,
16.5,
17.5,
18.5,
19.5,
20.5,
21.5,
22.5,
23.5,
24.5,
25.5,
//.........这里部分代码省略.........
开发者ID:AlexanderMorton,项目名称:NP_Prun,代码行数:101,代码来源:paraPull_alpha_FT_EFF_extrapolation_2TeV_2Lep_plots_All.C
示例12: apt_all
void apt_all(){
//=========Macro generated from canvas: MyCanvas/My Canvas
//========= (Thu Dec 3 18:47:52 2009) by ROOT version5.25/04
gROOT->Reset();
gROOT->ProcessLine(".x rootlogon.C");
gStyle->SetTitleYOffset(1.5);
TCanvas *MyCanvas = new TCanvas("MyCanvas", "My Canvas",0,0,550,600);
MyCanvas->SetLogx();
double msize = 2;
TH1D *hDist = new TH1D("hDist","hDist",20,9,10000);
hDist->GetXaxis()->SetRange(1,20);
hDist->SetMinimum(0.3);
//hDist->SetMaximum(0.7);
hDist->SetMaximum(0.6);
hDist->SetLineStyle(0);
hDist->GetXaxis()->SetTitle("#sqrt{s} [GeV]");
hDist->GetYaxis()->SetTitle("#LTp_{T}#GT [GeV/c]");
hDist->GetXaxis()->CenterTitle();
hDist->GetYaxis()->CenterTitle();
hDist->GetYaxis()->SetNdivisions(510);
hDist->Draw("");
// Fit function
//TF1 *func = new TF1("func","0.426-0.0198*log(x^2)+0.00156*log(x^2)^2",18,100000);
//TF1 *func = new TF1("func","0.430-0.0207*log(x^2)+0.00161*log(x^2)^2",18,100000);
TF1 *func = new TF1("func","0.425-0.0197*log(x^2)+0.00156*log(x^2)^2",18,100000);
func->SetLineColor(1);
func->SetLineWidth(2.0);
func->Draw("same");
// ============================= ISR
// OK, from http://www.slac.stanford.edu/spires/find/hep/www?j=NUPHA,B84,269
TGraphErrors *gre = new TGraphErrors(4);
gre->SetName("Graph");
gre->SetTitle("Graph");
gre->SetMarkerStyle(28);
gre->SetMarkerSize(msize);
gre->SetPoint(0,23.32,0.362);// plab = 289
gre->SetPointError(0,0,0.004); // errors are not verified!
gre->SetPoint(1,30.59,0.364);// plab = 498
gre->SetPointError(1,0,0.00497238);
gre->SetPoint(2,44.61,0.366); // plab = 1060
gre->SetPointError(2,0,0.00478821);
gre->SetPoint(3,53.06,0.368); // plab = 1500
gre->SetPointError(3,0,0.00497238);
TH1F *Graph1 = new TH1F("Graph1","Graph",100,19.03788,56.0634);
Graph1->SetMinimum(0.3551011);
Graph1->SetMaximum(0.374549);
gre->SetHistogram(Graph1);
gre->Draw("pz");
TGraph* gre01 = gre->Clone("gre01");
gre01->SetMarkerStyle(0);
// gre01->Draw("pzsame");
// ============================= UA1
// OK, from http://dx.doi.org/10.1016/0550-3213(90)90493-W
gre = new TGraphErrors(7);
gre->SetName("Graph");
gre->SetTitle("Graph");
gre->SetMarkerStyle(3);
gre->SetMarkerSize(msize);
gre->SetPoint(0,200,0.392);
gre->SetPointError(0,0,0.003);
gre->SetPoint(1,260,0.404);
gre->SetPointError(1,0,0.004);
gre->SetPoint(2,380,0.408);
gre->SetPointError(2,0,0.004);
gre->SetPoint(3,500,0.419);
gre->SetPointError(3,0,0.004);
gre->SetPoint(4,620,0.426);
gre->SetPointError(4,0,0.004);
gre->SetPoint(5,790,0.435);
gre->SetPointError(5,0,0.004);
gre->SetPoint(6,900,0.447);
gre->SetPointError(6,0,0.003);
TH1F *Graph2 = new TH1F("Graph2","Graph",100,131.4964,972.7974);
Graph2->SetMinimum(0.3826521);
Graph2->SetMaximum(0.4560221);
gre->SetHistogram(Graph2);
gre->Draw("pz");
TGraph* gre02 = gre->Clone("gre02");
gre02->SetMarkerStyle(0);
//.........这里部分代码省略.........
示例13: BSA_InCoherent_xB
void BSA_InCoherent_xB()
{
//=========Macro generated from canvas: c16/Incoherent channe
//========= (Tue Aug 21 12:00:25 2018) by ROOT version6.09/01
TCanvas *c16 = new TCanvas("c16", "Incoherent channe",0,0,1200,400);
gStyle->SetOptFit(1);
c16->Range(0,0,1,1);
c16->SetFillColor(0);
c16->SetBorderMode(0);
c16->SetBorderSize(2);
c16->SetLeftMargin(0.025);
c16->SetRightMargin(0.02325581);
c16->SetFrameBorderMode(0);
// ------------>Primitives in pad: c16_1
TPad *c16_1 = new TPad("c16_1", "Incoherent channe_1",0,0,0.262936,0.9);
c16_1->Draw();
c16_1->cd();
c16_1->Range(-29.34641,-0.4888889,350.2581,0.4);
c16_1->SetFillColor(0);
c16_1->SetBorderMode(0);
c16_1->SetBorderSize(2);
c16_1->SetGridx();
c16_1->SetGridy();
c16_1->SetRightMargin(0);
c16_1->SetTopMargin(0);
c16_1->SetFrameBorderMode(0);
c16_1->SetFrameBorderMode(0);
TMultiGraph *multigraph = new TMultiGraph();
multigraph->SetName("");
multigraph->SetTitle("0.12<x_{B}<0.21 ");
Double_t Graph_fx1134[9] = {
24.14331,
62.70082,
96.14623,
141.7289,
180.8857,
220.5862,
258.7856,
303.3336,
334.7288};
Double_t Graph_fy1134[9] = {
0.1330996,
-0.03883743,
0.1388413,
0.2120595,
0.03749243,
-0.09129921,
-0.1273289,
-0.1643618,
0.03103783};
Double_t Graph_fex1134[9] = {
0,
0,
0,
0,
0,
0,
0,
0,
0};
Double_t Graph_fey1134[9] = {
0.07077824,
0.06445297,
0.05939535,
0.06833722,
0.08559024,
0.08401363,
0.06136237,
0.05845869,
0.08718727};
TGraphErrors *gre = new TGraphErrors(9,Graph_fx1134,Graph_fy1134,Graph_fex1134,Graph_fey1134);
gre->SetName("Graph");
gre->SetTitle("Graph");
gre->SetFillColor(1);
Int_t ci; // for color index setting
TColor *color; // for color definition with alpha
ci = TColor::GetColor("#00ff00");
gre->SetMarkerColor(ci);
gre->SetMarkerStyle(21);
TH1F *Graph_Graph1134 = new TH1F("Graph_Graph1134","Graph",100,0,365.7873);
Graph_Graph1134->SetMinimum(-0.2731422);
Graph_Graph1134->SetMaximum(0.3307184);
Graph_Graph1134->SetDirectory(0);
Graph_Graph1134->SetStats(0);
ci = TColor::GetColor("#000099");
Graph_Graph1134->SetLineColor(ci);
Graph_Graph1134->GetXaxis()->SetLabelFont(42);
Graph_Graph1134->GetXaxis()->SetLabelSize(0.035);
Graph_Graph1134->GetXaxis()->SetTitleSize(0.035);
Graph_Graph1134->GetXaxis()->SetTitleFont(42);
Graph_Graph1134->GetYaxis()->SetLabelFont(42);
Graph_Graph1134->GetYaxis()->SetLabelSize(0.035);
Graph_Graph1134->GetYaxis()->SetTitleSize(0.035);
Graph_Graph1134->GetYaxis()->SetTitleFont(42);
//.........这里部分代码省略.........
示例14: cetaflatHEM3t
void cetaflatHEM3t(int nIterN=1, double Ethr1=4, double Ethr2=150) {
gStyle->SetOptLogz(0);
gStyle->SetMarkerSize(0.7);
gStyle->SetMarkerStyle(20);
gStyle->SetPadGridX(0);
gStyle->SetPadGridY(0);
gStyle->SetTitleOffset(1.7,"Y");
gStyle->SetTitleOffset(0.9,"X");
//gStyle->SetPadRightMargin(0.12);
gStyle->SetPadTopMargin(0.06);
gStyle->SetPadRightMargin(0.03);
gStyle->SetPadLeftMargin(0.2);
//gStyle->SetNdivisions(516);
gStyle->SetStatH(0.09);
gStyle->SetStatW(0.3);
gStyle->SetTitleW(0.4);
gStyle->SetTitleX(0.3);
gStyle->SetOptStat(0);
//gStyle->SetOptStat(1111111);
gROOT->ForceStyle();
char ctit[145];
static const double theHBHEEtaBounds[] = { 0.000, 0.087, 0.087*2, 0.087*3, 0.087*4,
0.087*5, 0.087*6, 0.087*7, 0.087*8, 0.087*9,
0.087*10, 0.087*11, 0.087*12, 0.087*13, 0.087*14,
0.087*15, 0.087*16, 0.087*17, 0.087*18, 0.087*19,
1.74, 1.83, 1.93, 2.043, 2.172,
2.332, 2.5, 2.65, 2.868, 3.000
};
static const double theHFEtaBounds[] = { 2.853, 2.964, 3.139, 3.314, 3.489, 3.664, 3.839,
4.013, 4.191, 4.363, 4.538, 4.716, 4.889, 5.191
};
// ---------------- Histos input --------------------------------------
char ftit[145];
//sprintf(ftit,"%s","phi43val2012A");
//sprintf(ftit,"%s","phi2012A_May");
//sprintf(ftit,"%s","phiSym524_2012AB");
//sprintf(ftit,"%s","phiSym524newGain_2012AB");
//sprintf(ftit,"%s","phiSym524newGain_2012ABC");
sprintf(ftit,"%s","phiSym533Corr45Gain507_2012D");
sprintf(ctit,"/home/vodib/beam12/intercal/%s.root",ftit);
TFile *fila = new TFile (ctit);
cout<<"File= "<<ctit<<endl;
TH1F *hcounter = new TH1F(*((TH1F*)fila->Get("phaseHF/hcounter")));
cout<<"Stat= "<<hcounter->GetBinContent(2)<<endl;
cout<<"E within: "<<Ethr1<<" - "<<Ethr2<<endl;
TH2F* hmapP = new TH2F("hmapP","E HEM;i#eta;i#phi",14,-29.5,-15.5,72,0,72);
TH2F* hmapP0 = new TH2F("hmapP0","E0 HEM;i#eta;i#phi",14,-29.5,-15.5,72,0,72);
TH2F* hmapPc = new TH2F("hmapPc","corr HEM;i#eta;i#phi",14,-29.5,-15.5,72,0,72);
hmapPc->Sumw2();
TH1F *hcorr1D = new TH1F("hcorr1D","Corr",150,0.5,2);
TH1F *ht = new TH1F("ht","ht",20000,0,5e7);
TH1F *htx = new TH1F("htx","htx",20000,0,5e5);
TH1F *htr = new TH1F("htr","htr",5000,0,3);
/* HE mapping:
if (ieta==16 && depth<3) continue;
if (ieta==17 && depth>1) continue;
if (ieta>17 && ieta<27 && depth==3) continue;
if (ieta==29 && depth==3) continue;
if (ieta>20 && iphi%2==0) continue; */
TH1F *hdatP[14][72], *hdatPx[14][72];
for (int ii=0; ii<14; ii++) for (int jj=0; jj<72; jj++) {
sprintf(ctit,"h%d_%d",ii+16,jj+1);
hdatP[ii][jj] = new TH1F(ctit,ctit,10000,0,250);
}
TCanvas *cx[400];
TSpline5 *tt;
Double_t x,y,rPL,rPS,mLE,mSE,ermean,rms;
Double_t xx[4000],yy[4000];
Int_t nELP, nESP, nIter=0;
Double_t mcorrL,scorrL,mcorrS,scorrS,erLP,erSP,rLP,drLP,rSP,corrL,corrS,dcorrL,dcorrS;
double mLEphi[14];
TCanvas *ccxx = new TCanvas("ccxx","ccxx",0,400,800,400);
ccxx->Divide(2,1);
for (int ii=0; ii<14; ii++) {
int ieta=-(ii+16);
mLE=mSE=0; // ------------------for initial condition
int nmLE=0, nmSE=0;
ht->Reset();
htx->Reset();
for (int ll=0; ll<72; ll++) {
int iphi=ll+1;
if (abs(ieta)!=16 && abs(ieta)!=27 && abs(ieta)!=28) continue;
if (abs(ieta)>20 && iphi%2==0) continue;
//.........这里部分代码省略.........
示例15: DrawNCLUSTER
void DrawNCLUSTER()
{
//=========Macro generated from canvas: r1/Energy
//========= (Fri Apr 6 17:14:48 2012) by ROOT version5.28/00g
TCanvas *r1 = new TCanvas("r1", "Ncluster",12,24,550,741);
gStyle->SetOptStat(0);
gStyle->SetOptTitle(0);
gStyle->SetFrameLineWidth(1);
r1->Range(0,0,1,1);
r1->SetFillColor(0);
r1->SetBorderMode(0);
r1->SetBorderSize(0);
r1->SetTickx(1);
r1->SetTicky(1);
r1->SetLeftMargin(0.16);
r1->SetRightMargin(0.01);
r1->SetTopMargin(0.0256917);
r1->SetBottomMargin(0.07692308);
r1->SetFrameBorderMode();
// ------------>Primitives in pad: r1_1
TPad *r1_1 = new TPad("r1_1", "Energy_1",0.02,0.37,0.95,0.99);
r1_1->Draw();
r1_1->cd();
r1_1->Range(-19,0.01,95,95);
r1_1->SetFillColor(0);
r1_1->SetBorderMode(0);
r1_1->SetBorderSize(2);
r1_1->SetTickx(1);
r1_1->SetTicky(1);
r1_1->SetLeftMargin(0.16);
r1_1->SetRightMargin(0.01);
r1_1->SetTopMargin(0.02);
r1_1->SetBottomMargin(0);
r1_1->SetFrameBorderMode(0);
r1_1->SetFrameBorderMode(0);
TH1D *he = new TH1D("he"," ",55,0,55);
he->SetMinimum(0.01);
he->SetMaximum(70);
he->SetStats(0);
he->GetXaxis()->SetTitle("E_{beam} [GeV]");
he->GetXaxis()->SetLabelFont(43);
he->GetXaxis()->SetLabelSize(0);
he->GetXaxis()->SetTitleFont(43);
he->GetXaxis()->SetTitleSize(0);
he->GetYaxis()->SetTitle("<N_{cluster}>");
he->GetYaxis()->SetLabelFont(43);
he->GetYaxis()->SetTitleSize(30);
he->GetYaxis()->SetLabelSize(20);
he->GetYaxis()->SetTitleFont(43);
he->GetYaxis()->SetTitleOffset(1.7);
he->GetZaxis()->SetLabelFont(42);
he->GetZaxis()->SetTitleSize(0.05);
he->GetZaxis()->SetTitleFont(42);
he->Draw("");
std::vector<result> resultData=readTXT(std::string("ncluster_augsep2012_electron.txt"));
TGraphErrors *gre = new TGraphErrors(resultData.size());
gre->SetName("Graph");
gre->SetTitle("Graph");
gre->SetLineColor(1);
gre->SetFillStyle(1);
gre->SetFillColor(1);
gre->SetLineWidth(2);
gre->SetMarkerColor(1);
gre->SetMarkerStyle(34);
gre->SetMarkerSize(1.2);
for(unsigned int i=0; i<resultData.size(); i++){
gre->SetPoint(i,resultData.at(i).ebeam,resultData.at(i).ncluster);
gre->SetPointError(i,0,resultData.at(i).nclusterError);
}
TH1F *Graph_Graph3 = new TH1F("Graph_Graph3","Graph",100,0,87.5);
Graph_Graph3->SetMinimum(0);
Graph_Graph3->SetMaximum(1193.483);
Graph_Graph3->SetDirectory(0);
Graph_Graph3->SetStats(0);
Graph_Graph3->GetXaxis()->SetLabelFont(42);
Graph_Graph3->GetXaxis()->SetTitleSize(0.05);
Graph_Graph3->GetXaxis()->SetTitleFont(42);
Graph_Graph3->GetYaxis()->SetLabelFont(42);
Graph_Graph3->GetYaxis()->SetTitleSize(0.05);
Graph_Graph3->GetYaxis()->SetTitleFont(42);
Graph_Graph3->GetZaxis()->SetLabelFont(42);
Graph_Graph3->GetZaxis()->SetTitleSize(0.05);
Graph_Graph3->GetZaxis()->SetTitleFont(42);
gre->SetHistogram(Graph_Graph3);
gre->Draw("p");
std::vector<result> resultFTFP=readTXT(std::string("ncluster_ftfp_bert_hp_electron.txt"));
gre = new TGraphErrors(resultFTFP.size());
gre->SetName("Graph");
gre->SetTitle("Graph");
gre->SetFillColor(kRed-3);
gre->SetMarkerColor(kRed-3);
gre->SetLineWidth(2);
gre->SetMarkerStyle(20);
for(unsigned int i=0; i<resultFTFP.size(); i++){
//.........这里部分代码省略.........