本文整理汇总了C++中TLine::SetLineStyle方法的典型用法代码示例。如果您正苦于以下问题:C++ TLine::SetLineStyle方法的具体用法?C++ TLine::SetLineStyle怎么用?C++ TLine::SetLineStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TLine
的用法示例。
在下文中一共展示了TLine::SetLineStyle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: plotr0vstheta
void plotr0vstheta(){
TFile *f;
int isSum=0;
if(isSum==0){
f = TFile::Open("mergedV_Prod.root");
}
else{
f = TFile::Open("mergedV_Sum.root");
}
int xbin=0;
// TVectorD* vecVmean = (TVectorD*)f->Get(Form("D_%d/Vmean",xbin));
TVectorD* vecV = (TVectorD*)f->Get(Form("D_%d/D_0/r01",xbin));
double *V = vecV->GetMatrixArray();
double Vmean = getmean(V,ntheta);
double theta[ntheta];
for(int itheta=0;itheta<ntheta;itheta++){
theta[itheta]=itheta*TMath::Pi()/ntheta/nn;
}
int maxper10 = findmaxper(V,ntheta,Vmean);
double maxper = (double)(maxper10+2)/10;
TGraph *gV2theta = new TGraph(ntheta,theta,V);
gV2theta->SetTitle("");
gV2theta->GetXaxis()->SetTitle("#theta");
gV2theta->GetYaxis()->SetTitle("r_{0}");
gV2theta->GetYaxis()->SetTitleOffset(1.1);
gV2theta->GetXaxis()->SetTitleSize(0.04);
gV2theta->GetYaxis()->SetTitleSize(0.04);
gV2theta->SetMarkerStyle(20);
gV2theta->SetMarkerSize(1.3);
gV2theta->SetMarkerColor(1);
gV2theta->SetLineColor(1);
gV2theta->SetMinimum(Vmean*(1-maxper*1.5));
gV2theta->SetMaximum(Vmean*(1+maxper*1.5));
gV2theta->Draw("AP");
TLine *lup = new TLine(gV2theta->GetXaxis()->GetXmin(),Vmean*(1+maxper), gV2theta->GetXaxis()->GetXmax(),Vmean*(1+maxper));
TLine *ldown = new TLine(gV2theta->GetXaxis()->GetXmin(),Vmean*(1-maxper), gV2theta->GetXaxis()->GetXmax(),Vmean*(1-maxper));
TLine *l = new TLine(gV2theta->GetXaxis()->GetXmin(),Vmean, gV2theta->GetXaxis()->GetXmax(),Vmean);
l->SetLineStyle(2);
lup->SetLineStyle(2);
ldown->SetLineStyle(2);
l->SetLineWidth(1.2);
lup->SetLineWidth(1.2);
ldown->SetLineWidth(1.2);
TLatex *tl = new TLatex();
// tl->SetNDC();
tl->SetTextFont(42);
tl->SetTextSize(0.04);
// tl->SetBorderStyle(0);
tl->DrawLatex(0,Vmean*(1+maxper),Form("mean up %.f%%",maxper*100));
tl->DrawLatex(0,Vmean*(1-maxper),Form("mean down %.f%%",maxper*100));
tl->DrawLatex(1,0.2,Form("Multiplicity %d to %d",120,150));
l->Draw("same");
lup->Draw("same");
ldown->Draw("same");
if(isSum==0)c1->SaveAs("hr0theta_Prod.png");
else c1->SaveAs("hr0theta_Sum.png");
}
示例2: DrawInsituCorr_vs_Pt
void DrawInsituCorr_vs_Pt(Str jetAlgo) {
myJES = new JetCalibrationTool(jetAlgo,_jesFile);
TH1F *h = new TH1F("","",100,15,2500);
h->SetXTitle("Jet p_{T}");
h->SetYTitle("Residual correction for data only");
h->SetMaximum(1.1); h->SetMinimum(0.85);
h->Draw();
TLine *l = new TLine();
l->SetLineWidth(2); l->SetLineColor(kGray+2); l->SetLineStyle(4);
l->DrawLine(16,1,2400,1);
for (int i=0;i<6;++i) {
double eta=4.0*i/5;
Graph *g = GetInsituGraphVsPt(eta);
FormatGraph(g,i); g->Draw("PL");
double x=0.52, y=0.3-0.05*i;
if (i>2) { x=0.74; y=0.3-0.05*(i-3); }
DrawLabel(Form("#eta = %.1f",eta),x,y,i);
}
l->SetLineWidth(2);
l->SetLineColor(kGray+2);
l->SetLineStyle(1);
tex->SetNDC(); tex->SetTextAlign(12);
//tex->DrawLatex(0.18,0.975,myJES->AbsoluteJES_Description());
tex->DrawLatex(0.18,0.9,GetJetDesc(jetAlgo));
}
示例3: DrawInsituCorr_vs_Eta
void DrawInsituCorr_vs_Eta(Str jetAlgo) {
Nbins=sizeof(Ebins)/sizeof(double);
myJES = new JetCalibrationTool(jetAlgo,_jesFile);
TH1F *h = new TH1F("","",100,-4.8,4.8);
h->SetXTitle("Jet #eta_{det}");
h->SetYTitle("Residual correction for data only");
h->SetMaximum(1.1); h->SetMinimum(0.85);
h->Draw();
TLine *l = new TLine();
l->SetLineWidth(2); l->SetLineColor(kGray+2); l->SetLineStyle(4);
l->DrawLine(-4.65,1,4.65,1);
for (int i=0;i<Nbins;++i) {
Graph *g = GetInsituGraph(Ebins[i]);
FormatGraph(g,i); g->Draw("PL");
double x=0.52, y=0.3-0.05*i;
if (i>2) { x=0.74; y=0.3-0.05*(i-3); }
DrawLabel(Form("p_{T} = %.0f GeV",Ebins[i]),x,y,i);
}
l->SetLineWidth(2);
l->SetLineColor(kGray+2);
l->SetLineStyle(1);
tex->SetNDC(); tex->SetTextAlign(12);
//tex->DrawLatex(0.18,0.975,myJES->AbsoluteJES_Description());
tex->DrawLatex(0.18,0.9,GetJetDesc(jetAlgo));
}
示例4: PlotMinEtFromSim
void PlotMinEtFromSim(Bool_t isPhos = kFALSE){
gStyle->SetOptTitle(0);
gStyle->SetOptStat(0);
gStyle->SetOptFit(0);
Float_t min = 0;
float max = 1;
TString filename, detname;
if(isPhos){
min = 0.655;
max = 0.785;
detname = "PHOS";
filename = "rootFiles/LHC11a10a_bis/Et.ESD.simPbPb.PHOS.LHC11a10a_bis.Run139465.root";
}
else{
min = 0.58;
max = 0.725;
filename = "rootFiles/LHC11a10a_bis/Et.ESD.simPbPb.EMCal.LHC11a10a_bis.Run139465.root";
detname = "EMCal";
}
TFile *f = TFile::Open(filename, "READ");
TList *l = dynamic_cast<TList*>(f->Get("out1"));
TH1F *fHistSimulatedGammaEnergyAboveThreshold = l->FindObject("fHistSimulatedGammaEnergyAboveThreshold");
TH1F *fHistSimulatedGammaEnergy = l->FindObject("fHistSimulatedGammaEnergy");
SetStyles(fHistSimulatedGammaEnergyAboveThreshold,20,TColor::kRed);
fHistSimulatedGammaEnergyAboveThreshold->Divide(fHistSimulatedGammaEnergy);
TCanvas *c1 = new TCanvas("c1","Simulation",600,400);
c1->SetTopMargin(0.02);
c1->SetRightMargin(0.03);
c1->SetLeftMargin(0.11745);
c1->SetBottomMargin(0.11745);
c1->SetBorderSize(0);
c1->SetFillColor(0);
c1->SetFillColor(0);
c1->SetBorderMode(0);
c1->SetFrameFillColor(0);
c1->SetFrameBorderMode(0);
fHistSimulatedGammaEnergyAboveThreshold->SetMaximum(max +0.1);
fHistSimulatedGammaEnergyAboveThreshold->SetMinimum(min-0.1);
fHistSimulatedGammaEnergyAboveThreshold->GetXaxis()->SetTitle("Centrality bin");
fHistSimulatedGammaEnergyAboveThreshold->GetYaxis()->SetTitle("f_{minEt}");
fHistSimulatedGammaEnergyAboveThreshold->GetYaxis()->SetLabelSize(0.06);
fHistSimulatedGammaEnergyAboveThreshold->GetXaxis()->SetLabelSize(0.06);
fHistSimulatedGammaEnergyAboveThreshold->GetYaxis()->SetTitleSize(0.06);
fHistSimulatedGammaEnergyAboveThreshold->GetXaxis()->SetTitleSize(0.06);
fHistSimulatedGammaEnergyAboveThreshold->Draw();
TLine *lineMin = new TLine(-0.5,min,19.5,min);
lineMin->Draw();
TLine *lineMax = new TLine(-0.5,max,19.5,max);
lineMax->Draw();
lineMin->SetLineColor(TColor::kBlue);
lineMax->SetLineColor(TColor::kBlue);
lineMin->SetLineStyle(2);
lineMax->SetLineStyle(2);
TString outfile = "/tmp/MinEtFromSim"+detname+".png";
c1->SaveAs(outfile.Data());
}
示例5: AddAnalysisMarkers
void RangePlotter::AddAnalysisMarkers(int a_iPanelIndex, SignalAnalyzer::AnalysisMarkers& a_analysisMarkers)
{
m_pCanvas->cd(a_iPanelIndex + 1);
// printf("pulse threshold: %f\n", a_analysisMarkers.GetPulseThreshold().Continuous());
TLine* pulseThresholdLine = new TLine(0, a_analysisMarkers.GetPulseThreshold().Continuous(), m_vpMultiGraph[a_iPanelIndex]->GetXaxis()->GetXmax(), a_analysisMarkers.GetPulseThreshold().Continuous());
pulseThresholdLine->SetLineStyle(2);
pulseThresholdLine->SetBit(kCanDelete);
// printf("edge threshold: %f\n", a_analysisMarkers.GetEdgeThreshold().Continuous());
TLine* edgeThresholdLine = new TLine(0, a_analysisMarkers.GetEdgeThreshold().Continuous(), m_vpMultiGraph[a_iPanelIndex]->GetXaxis()->GetXmax(), a_analysisMarkers.GetEdgeThreshold().Continuous());
edgeThresholdLine->SetLineStyle(2);
edgeThresholdLine->SetBit(kCanDelete);
/* int i = 0;
for (auto& it: a_analysisMarkers.m_vChannelsEdgeAndMinimum)
{
int color = ((TGraph*) m_vpMultiGraph[a_iPanelIndex]->GetListOfGraphs()->At(i))->GetLineColor();
float fYMin = m_vpMultiGraph[a_iPanelIndex]->GetYaxis()->GetXmin();
float fYMax = m_vpMultiGraph[a_iPanelIndex]->GetYaxis()->GetXmax();
if (std::get<EDGE_THRES_INDEX>(it).Exists())
{
TMarker* markerMin = new TMarker(std::get<MIN_PULSE_INDEX>(it).GetX(), std::get<MIN_PULSE_INDEX>(it).GetY(), 22);
markerMin->SetMarkerColor(color);
markerMin->SetMarkerSize(2);
markerMin->Draw();
TBox* pulseWindow = new TBox(std::get<EDGE_THRES_INDEX>(it).GetX(), fYMin, std::get<EDGE_THRES_INDEX>(it).GetX() + a_analysisMarkers.GetExpectedPulseWidth().Continuous(), fYMax);
pulseWindow->SetFillColor(color);
pulseWindow->SetFillStyle(3004);
pulseWindow->Draw();
}
i++;
}
*/
if (Configuration::Instance().TagPrimaryPulseStep())
{
for (auto& it: a_analysisMarkers.m_vChannelsWithPulse)
{
m_vpGraph[it]->SetLineWidth(3);
}
}
if (Configuration::Instance().ShowEdgeThresholdMarkerStep())
{
pulseThresholdLine->Draw();
}
if (Configuration::Instance().ShowPulseThresholdMarkerStep())
{
edgeThresholdLine->Draw();
}
m_pCanvas->Update();
}
示例6: plotV2vstheta
void plotV2vstheta(){
gStyle->SetOptFit(1);
gStyle->SetOptStat(0);
gStyle->SetOptTitle(0);
gStyle->SetErrorX(0);
int xbin = 0;
TFile *f = new TFile("mergedV_Prod.root");
TVectorD *vecV = (TVectorD*)f->Get(Form("D_%d/V"));
TVectorD *vecdeltaV = (TVectorD*)f->Get(Form("D_%d/deltaV"));
TVectorD *vecVmean = (TVectorD*)f->Get(Form("Vmean"));
double *V = vecV->GetMatrixArray();
double *deltaV = vecdeltaV->GetMatrixArray();
double *Vmean = vecVmean->GetMatrixArray();
double theta[ntheta];
for(int itheta=0;itheta<ntheta;itheta++){
theta[itheta]=itheta*TMath::Pi()/ntheta/nn;
}
TH1D *hFrame = new TH1D("","",300,-1,2);
hFrame->GetXaxis()->SetTitle("#theta");
hFrame->GetYaxis()->SetTitle("referenceV_{2}");
hFrame->GetXaxis()->SetTitleSize(0.04);
hFrame->GetYaxis()->SetTitleSize(0.04);
hFrame->GetXaxis()->SetRangeUser(-0.1,1.5);
hFrame->SetMaximum(0.055);
hFrame->SetMinimum(0.045);
hFrame->Draw();
TGraphErrors *gr = new TGraphErrors(ntheta,theta,V,0,deltaV);
gr->SetMarkerSize(1.2);
gr->SetMarkerStyle(20);
gr->Draw("Psame");
TLine *l = new TLine(0,inV2,1.4,inV2);
l->SetLineStyle(2);
l->Draw("same");
c1->Print("V2vstheta.png");
}
示例7: DrawFitValue
void DrawFitValue( TH2* frame, Double_t mean, Double_t err )
{
Int_t DarkColor = TColor::GetColor( "#115000" );
Int_t LightColor = TColor::GetColor( "#bdff66" );
Double_t xmin = mean - err;
Double_t xmax = mean + err;
Double_t ymin = frame->GetYaxis()->GetXmin();
Double_t ymax = frame->GetYaxis()->GetXmax();
Double_t x[5] = { xmin, xmin, xmax, xmax, xmin };
Double_t y[5] = { ymin, ymax, ymax, ymin, ymin };
TGraph *box = new TGraph( 5, x, y );
box->SetLineColor( DarkColor );
box->SetFillColor( LightColor );
box->Draw("F");
TLine* louter = new TLine;
TLine* linner = new TLine;
louter->SetLineWidth( 1 );
louter->SetLineColor( DarkColor );
linner->SetLineWidth( 1 );
linner->SetLineStyle( 3 );
linner->SetLineColor( DarkColor );
louter->DrawLine( xmin, ymin, xmin, ymax );
louter->DrawLine( xmax, ymin, xmax, ymax );
linner->DrawLine( mean, ymin, mean, ymax );
}
示例8: DrawJMS_vs_Eta
void DrawJMS_vs_Eta(Str jetAlgo) {
double massEbins[] = {50, 100, 250, 500, 750, 1500};
double massNbins = sizeof(massEbins)/sizeof(double);
myJES = new JetCalibrationTool(jetAlgo,_jesFile);
TH1F *h = new TH1F("","",100,-4.8,4.8);
h->SetXTitle("Jet #eta_{det}"); h->SetYTitle("Jet mass response");
h->SetMaximum(1.4); h->SetMinimum(0.6);
h->Draw();
TLine *l = new TLine();
l->SetLineWidth(2); l->SetLineColor(kGray+2); l->SetLineStyle(4);
l->DrawLine(-4.65,1,4.65,1);
for (int i=0;i<massNbins;++i) {
Graph *g = GetJMSGraph(massEbins[i]);
FormatGraph(g,i);
g->Draw("PL");
double x=0.52, y=0.3-0.05*i;
if (i>2) { x=0.74; y=0.3-0.05*(i-3); }
DrawLabel(Form("E = %.0f GeV",massEbins[i]),x,y,i);
}
tex->SetNDC(); tex->SetTextAlign(12);
tex->DrawLatex(0.18,0.975,myJES->AbsoluteJES_Description());
tex->DrawLatex(0.18,0.9,jetAlgo);
}
示例9: drawline
void drawline(double xpos, int colour, int style)
{
TLine *line = new TLine(xpos,0,xpos,15);
line->SetLineStyle(style);
line->SetLineColor(colour);
line->Draw();
}
示例10: myBoxText
void myBoxText(Double_t x, Double_t y,Double_t boxsize,Int_t mcolor,char *text)
{
Double_t tsize=0.06;
TLatex l; l.SetTextAlign(12); //l.SetTextSize(tsize);
l.SetNDC();
l.DrawLatex(x,y,text);
Double_t y1=y-0.25*tsize;
Double_t y2=y+0.25*tsize;
Double_t x2=x-0.3*tsize;
Double_t x1=x2-boxsize;
printf("x1= %f x2= %f y1= %f y2= %f \n",x1,x2,y1,y2);
TPave *mbox= new TPave(x1,y1,x2,y2,0,"NDC");
mbox->SetFillColor(mcolor);
mbox->SetFillStyle(1001);
mbox->Draw();
TLine mline;
mline.SetLineWidth(4);
mline.SetLineColor(1);
mline.SetLineStyle(1);
Double_t y_new=(y1+y2)/2.;
mline.DrawLineNDC(x1,y_new,x2,y_new);
}
示例11: Drawtrackeff
void Drawtrackeff(){
gStyle->SetOptStat(kFALSE);
TString type="eta";
TCanvas *c1 = new TCanvas("c1","c1",600,600);
TH1D* heff = Draw(type,1,20);
TH1D* hFrame = new TH1D("","",2030,-3,200);
hFrame->SetTitle("");
if(type=="pt"){
c1->SetLogx();
// c1->SetLogy();
hFrame->GetXaxis()->SetTitle("p_{T}");
hFrame->GetXaxis()->SetRangeUser(0,200);
}
else if(type=="eta"){
hFrame->GetXaxis()->SetTitle("#eta");
hFrame->GetXaxis()->SetRangeUser(-3,3);
}
hFrame->GetYaxis()->SetRangeUser(0,1);
hFrame->GetYaxis()->SetTitle("tracking efficiency");
hFrame->GetYaxis()->SetTitleOffset(1.1);
TLegend *leg = new TLegend(0.3,0.75,0.85,0.88);
leg->SetBorderSize(0);
leg->SetFillColor(0);
leg->SetTextSize(0.025);
TLine *l = new TLine(hFrame->GetXaxis()->GetXmin(),1,hFrame->GetXaxis()->GetXmax(),1);
l->SetLineStyle(2);
l->SetLineWidth(1.2);
hFrame->Draw();
heff->Draw("Psame");
l->Draw("same");
//leg->Draw("same");
c1->Print(Form("trackeff_%s.png",type.Data()));
}
示例12: TPTiming
void TPTiming ()
{
TAxis * ax = TPMatchEmul2D->GetZaxis() ;
ax->SetRangeUser(-1,6) ;
TCanvas* canv = new TCanvas("canv", "canv") ;
canv->SetLogz(0) ;
gStyle->SetOptStat(10) ;
int color[10]= {1,10,3,4,5,6,7,8,9,2} ;
gStyle->SetPalette(7, color) ;
TPMatchEmul2D->GetXaxis()->SetTitle("Phi index");
TPMatchEmul2D->GetYaxis()->SetTitle("Eta index");
TPMatchEmul2D->Draw("colz") ;
TH2I * label = new TH2I("label", "",72, 1, 73, 38, -19, 19) ;
label->SetMarkerSize(0.6);
label->SetBit(kCanDelete);
for (int x=3 ; x<73 ; x+=4) {
for (int y=21; y<=37; y++) {
int towernb = 4*(y-21)+1 ;
label->SetBinContent(x-1, y, towernb) ; //EB+
label->SetBinContent(x, 40-y, towernb) ; //EB-
}
}
label->Draw("same text") ;
TLatex txt;
txt.SetTextSize(0.02);
TLine line;
line.SetLineColor(1) ;
line.SetLineStyle(1) ;
line.SetLineWidth(1) ;
TAxis* xAxis = TPMatchEmul2D->GetXaxis();
TAxis* yAxis = TPMatchEmul2D->GetYaxis();
// draw SM borders and numbers
float sm ;
for (int i=0; i<36 ; i++ ) {
if (i<18) {
sm = 4*i+3 ;
line.DrawLine(sm, 1, sm, 18) ;
txt.SetTextAlign(32);
txt.DrawText(sm-1+0.3, -17.7, Form("-%d",i+1));
}
else {
sm = 4*(i-18)+3 ;
line.DrawLine(sm, 0, sm, -17) ;
txt.SetTextAlign(12);
txt.DrawText(sm-2+0.3, 18.5, Form("+%d",i-17));
}
}
line.DrawLine(1, 0, 73, 0) ;
line.DrawLine(1, -17, 73, -17) ;
line.DrawLine(1, 1, 73, 1) ;
line.DrawLine(1, 18, 73, 18) ;
}
示例13: PlotBF
void HiggsPlot::PlotBF(int iDecay, double tBmH_max, double BF_max){
if(iDecay<0 || iDecay>2) {cout<<"iDecay must be 0, 1 or 2"<<endl; return;}
styles style; style.setPadsStyle(-1); style.setDefaultStyle();
int nBins = 1000;
TString hName, epsName = "public_html/Higgs_BF_TEMP_BaBar.eps", label, Llabel, Rlabel;
TString yTitle[] = {"BF(B#rightarrow#tau#nu) (10^{-5})", "R(D)", "R(D*)"};
TString TagDecay[] = {"BF", "R(D)", "R(D*)"};
TCanvas can;
TH1F *hBF[2];
for(int his=0; his<1; his++) {
hName = "hBF"; hName += his;
hBF[his] = new TH1F(hName,"",nBins,0,tBmH_max);
}
double tBmH, BF[2];
for(int bin=1; bin<=nBins; bin++){
tBmH = hBF[0]->GetBinCenter(bin);
Compute(tBmH,BF,iDecay);
hBF[0]->SetBinContent(bin, BF[0]);
hBF[0]->SetBinError(bin, BF[1]);
}
hBF[0]->SetFillColor(2); hBF[0]->SetLineColor(2);
hName += "1";
hBF[1] = static_cast<TH1F*>(hBF[0]->Clone(hName));
for(int bin=1; bin<=nBins; bin++)hBF[1]->SetBinError(bin,0);
hBF[1]->SetFillColor(0);hBF[1]->SetLineColor(1); hBF[1]->SetLineWidth(2);
TBox box; box.SetLineColor(4);box.SetFillColor(4);
TLine line; line.SetLineStyle(1); line.SetLineColor(4); line.SetLineWidth(3);
if(BF_max>0) hBF[0]->SetMaximum(BF_max);
hBF[0]->Draw("e3");
box.SetFillStyle(3002);
box.DrawBox(0,Measurement[iDecay][0]-Measurement[iDecay][1],
tBmH_max,Measurement[iDecay][0]+Measurement[iDecay][1]);
line.DrawLine(0,Measurement[iDecay][0],tBmH_max,Measurement[iDecay][0]);
hBF[0]->Draw("e3 same");
hBF[1]->Draw("c same");
Compute(0,BF,iDecay);
label = "#splitline{"; label += TagDecay[iDecay]; label += "_{SM} = ";
if(iDecay==0){
label+="(";label+=RoundNumber(BF[0],1); label+=" #pm ";
label+=RoundNumber(BF[1],1); label+=")#times10^{-5}}{BF_{exp} = (";
label+=RoundNumber(Measurement[iDecay][0],1); label+=" #pm ";
label+=RoundNumber(Measurement[iDecay][1],1); label+=")#times10^{-5}}";
Llabel = ""; Rlabel = label;
} else {
label+=RoundNumber(BF[0],3); label+=" #pm ";
label+=RoundNumber(BF[1],3); label+="}{"; label += TagDecay[iDecay]; label += "_{exp} = ";
label+=RoundNumber(Measurement[iDecay][0],3); label+=" #pm ";
label+=RoundNumber(Measurement[iDecay][1],3); label+="}";
Rlabel = ""; Llabel = label;
}
style.setTitles(hBF[0],"tan#beta/m_{H^{+}} (GeV^{-1})",yTitle[iDecay],Llabel,Rlabel);
epsName.ReplaceAll("TEMP",DecayName[iDecay]);
can.SaveAs(epsName);
for(int his=0; his<2; his++) hBF[his]->Delete();
}
示例14: plotV2vstheta
void plotV2vstheta(){
TFile *f;
if(isSum==0){
f = TFile::Open("mergedV_Prod.root");
}
else{
f = TFile::Open("mergedV_Sum.root");
}
int xbin=0;
TVectorD* vecVmean = (TVectorD*)f->Get(Form("D_%d/Vmean",xbin));
TVectorD* vecV = (TVectorD*)f->Get(Form("D_%d/D_0/V",xbin));
double Vmean = (*vecVmean)[0];
cout<<Vmean<<endl;
double *V = vecV->GetMatrixArray();
double theta[ntheta];
for(int itheta=0;itheta<ntheta;itheta++){
theta[itheta]=itheta*TMath::Pi()/ntheta/nn;
cout<<V[itheta]<<endl;
}
TGraph *gV2theta = new TGraph(ntheta,theta,V);
gV2theta->SetMarkerStyle(20);
gV2theta->SetMarkerSize(1.3);
gV2theta->SetMarkerColor(1);
gV2theta->SetLineColor(1);
gV2theta->SetMinimum(Vmean*0.98);
gV2theta->SetMaximum(Vmean*1.02);
gV2theta->Draw("AP");
TLine *lup = new TLine(gV2theta->GetXaxis()->GetXmin(),Vmean*1.01, gV2theta->GetXaxis()->GetXmax(),Vmean*1.01);
TLine *ldown = new TLine(gV2theta->GetXaxis()->GetXmin(),Vmean*0.99, gV2theta->GetXaxis()->GetXmax(),Vmean*0.99);
TLine *l = new TLine(gV2theta->GetXaxis()->GetXmin(),Vmean, gV2theta->GetXaxis()->GetXmax(),Vmean);
l->SetLineStyle(2);
lup->SetLineStyle(2);
ldown->SetLineStyle(2);
l->SetLineWidth(1.2);
lup->SetLineWidth(1.2);
ldown->SetLineWidth(1.2);
l->Draw("same");
lup->Draw("same");
ldown->Draw("same");
if(isSum==0)c1->SaveAs("hV2theta_Prod.png");
else c1->SaveAs("hV2theta_Sum.png");
}
示例15: plotV2vsflow
void plotV2vsflow(){
gStyle->SetOptFit(kFALSE);
gStyle->SetOptStat(kFALSE);
TCanvas *c1 = new TCanvas("c1","c1",600,600);
TLegend *leg = new TLegend(0.2,0.1,0.4,0.4);
leg->SetTextSize(0.05);
leg->SetBorderSize(0);
leg->SetFillColor(0);
const int ninflow = 6;
int xbin=0;
TString dir;
double V2_Prod[ninflow],V2err_Prod[ninflow];
const int mult = 150;
TF1 *PtDistr = new TF1("PtDistr","0.03*(exp (-(x/0.594540))+0.00499506*exp (-(x/1.89391)))", 0.3,6.0); //Real Data
TF1 *V2vsPt = new TF1("V2vsPt","((x/3.31699)^2.35142/(1+(x/3.49188)^3.54429))*(.00005+(1/x)^1.50600)",0.3,6.0);
TF1 *V2 = new TF1("V2","0.03*(exp (-(x/0.594540))+0.00499506*exp (-(x/1.89391)))*((x/3.31699)^2.35142/(1+(x/3.49188)^3.54429))*(.00005+(1/x)^1.50600)",0.3,6.0);
double InV2 = V2->Integral(0.3,6.0)/PtDistr->Integral(0.3,6.0);
double inV2[ninflow]={};
for(int i=0;i<ninflow;i++){
inV2[i] = InV2 * i / 5 ;
dir=Form("pPbDataV20%dm%d",i,mult);
TFile *mergedV_Prod = TFile::Open(Form("%s/mergedV_Prod.root",dir.Data()));
if(i==)
TFile *mergedV_Prod = TFile::Open(Form("%s/mergedV_Sum.root",dir.Data()));
TVectorD *vecMult = (TVectorD*)mergedV_Prod->Get("totmultall");
TVectorD *vecNevent = (TVectorD*)mergedV_Prod->Get("Nevent");
TVectorD *vecV2_Prod=(TVectorD*)mergedV_Prod->Get(Form("Vmean",xbin));
TVectorD *vecV2err_Prod=(TVectorD*)mergedV_Prod->Get(Form("deltaVmean",xbin));
V2_Prod[i]=(*vecV2_Prod)[xbin];
V2err_Prod[i]=(*vecV2err_Prod)[xbin];
cout<<inV2[i]<<endl;
// V2sp[i]=InV2/V2_Prod[i];
// V2spError[i]=InV2/V2_Prod[i]/V2_Prod[i]*(*vecV2err_Prod)[xbin];
// cout<<V2sp[i]<<"pm"<<V2spError[i]<<"\t";
}
V2_Prod[1]=0;
cout<<endl<<InV2<<endl;
TH1D* hFrame = new TH1D("","",2000,-1,1);
hFrame->GetXaxis()->SetRangeUser(0., 0.08);
hFrame->GetYaxis()->SetRangeUser(0., 0.08);
hFrame->Draw();
TGraphErrors *grProd=new TGraphErrors(ninflow,inV2,V2_Prod,0,V2err_Prod);
grProd->SetMarkerColor(1);
grProd->SetMarkerSize(1.6);
grProd->SetLineColor(1);
grProd->SetMarkerStyle(20);
hFrame->GetXaxis()->SetTitle("Input V2");
hFrame->GetYaxis()->SetTitle("Calc V2");
hFrame->Draw();
grProd->Draw("Psame");
TLine *l = new TLine(0,0,0.06,0.06);
l->SetLineStyle(2);
l->Draw("same");
c1->SaveAs("V2vsflow.gif");
}