32 , std::string legend1, std::string legend2
33 , std::string plotTitle1, std::string plotTitle2, std::string plotTitle3
34 , std::string pdfTitle){
43 bool setLimitPlotLogScale =
true;
44 std::string xAxisTitle =
"E [GeV]"; std::string yAxisTitle =
"Events";
60 c1->SetLogy(setLimitPlotLogScale);
62 c1->SetRightMargin(0.02);
63 c1->SetTopMargin(0.02);
68 const Double_t axis_x[2] = {lowerXLimit,upperXLimit};
69 const Double_t axis_y[2] = {lowerYLimit,upperYLimit};
86 auto legend =
new TLegend(legendXPos,legendYPos,legendXPos+legendXWidth,legendYPos+legendYHeight);
87 legend->SetFillStyle(0);
88 legend->SetBorderSize(0);
89 legend->SetTextSize(fontSize);
90 legend->AddEntry(gr1,legend1.c_str(),
"L");
91 legend->AddEntry(gr2,legend2.c_str(),
"L");
98 TLatex* tex_Title =
new TLatex(plotTitleXPos,plotTitleYPos-0*shiftY,plotTitle1.c_str());
103 TLatex* tex_Title2 =
new TLatex(plotTitleXPos,plotTitleYPos-1*shiftY,plotTitle2.c_str());
108 TLatex* tex_Title3 =
new TLatex(plotTitleXPos,plotTitleYPos-2*shiftY,plotTitle3.c_str());
126 gPad->Print(pdfTitle.c_str());
135 const Int_t nPoints = 1000;
137 Double_t xStepSize = (xMaximum-xMinimum)/nPoints;
142 Double_t y_nonRelBW[nPoints], y_relBW[nPoints];
154 Double_t yMinimum = std::numeric_limits<Double_t>::max();
156 for (
Int_t i=0;i<nPoints;i++) {
157 Double_t currentX = xMinimum+i*xStepSize;
162 if (y_nonRelBW[i]<yMinimum){yMinimum = y_nonRelBW[i];}
163 if (y_relBW[i]<yMinimum){yMinimum = y_relBW[i];}
166 plotTwoTGraphs(
x, y_nonRelBW, y_relBW, nPoints
168 , yMinimum/4, yMaximum*4
169 ,
"NonRel BW",
"Rel BW"
170 ,
"Comparing BW",
"M = " + std::to_string(
int(
round(median))) +
" GeV",
"#Gamma = " + std::to_string(
int(
round(
width))) +
" GeV"
171 ,
"BW_M"+std::to_string(
int(
round(median)))+
"_Gamma" + std::to_string(
int(
round(
width))) +
".pdf)"
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char y1
R__EXTERN TStyle * gStyle
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title.
virtual void SetLabelSize(Float_t size=0.04)
Set size of axis labels.
virtual void SetTitleSize(Float_t size=0.04)
Set size of axis title.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
virtual void SetRangeUser(Double_t ufirst, Double_t ulast)
Set the viewing range for the axis from ufirst to ulast (in user coordinates, that is,...
A TGraph is an object made of two arrays X and Y with npoints each.
void Draw(Option_t *chopt="") override
Draw this graph with its current attributes.
TAxis * GetXaxis() const
Get x axis of the graph.
TAxis * GetYaxis() const
Get y axis of the graph.
void SetTitle(const char *title="") override
Change (i.e.
To draw Mathematical Formula.
This class displays a legend box (TPaveText) containing several legend entries.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
virtual void SetNDC(Bool_t isNDC=kTRUE)
Set NDC mode on if isNDC = kTRUE, off otherwise.
RVec< PromoteType< T > > round(const RVec< T > &v)
Double_t BreitWigner(Double_t x, Double_t mean=0, Double_t gamma=1)
Calculates a Breit Wigner function with mean and gamma.
Double_t BreitWignerRelativistic(Double_t x, Double_t median=0, Double_t gamma=1)
Calculates a Relativistic Breit Wigner function with median and gamma.