7 vector<TString> targets;
8 targets.push_back(it0->first);
21 targets.push_back(tar1);
24 if (targets.size() > 1) {
25 for (
auto it2 : targets)
26 commonCuts.insert(it2);
28 uniqueCuts.insert(targets.at(0));
38 set<TString> commonCuts;
39 set<TString> uniqueCuts;
43 cout <<
"Targets with the same cuts ..." << endl;
44 for (
auto it : commonCuts)
48 cout <<
"Targets with unique cuts ..." << endl;
49 for (
auto it : uniqueCuts)
53 TH1F* hSpectraAll =
new TH1F(
"massSpectrumAll",
"massSpectrumAll", 75,
xLow,
xUp);
68 Form(
"Invariant mass: #Lambda^{0} #rightarrow #pi^{-} + p (%s)",
fTarget.at(0).Data()));
71 cout <<
"nFiles# " << fList.size() << endl;
76 for (
auto it = fList.begin(); it != fList.end(); it++) {
88 pair<Double_t, Double_t> T = make_pair(-1., -1.);
89 pair<Double_t, Double_t> B = make_pair(-1., -1.);
103 pair<Double_t, Double_t> T = make_pair(-1., -1.);
104 pair<Double_t, Double_t> B = make_pair(-1., -1.);
111 hSpectraAll->
Draw(
"PE1X0");
115 targs += it.first +
" ";
117 hSpectraAll->
SetTitle(
Form(
"Invariant mass: #Lambda^{0} #rightarrow #pi^{-} + p (%s)", targs.
Data()));
118 DrawH(hSpectraAll, mean, sigma, T, B, commonCuts.size());
120 c->
SaveAs(
"allTargets.pdf");
121 d->SaveAs(
"allTargets_sepView.pdf");
154 new TH1F(
Form(
"P_{t} = [%G, %G] GeV/c", pt0, pt1),
Form(
"P_{t} = [%G, %G] GeV/c", pt0, pt1), 75,
xLow,
xUp);
161 hSpectraY[
iY] =
new TH1F(
Form(
"Y = [%G, %G]", y0, y1),
Form(
"Y = [%G, %G]", y0, y1), 75,
xLow,
xUp);
168 map<Int_t, vector<TH1F>> pathBinsPt[2];
169 map<Int_t, vector<TH1F>> pathBinsY[2];
172 for (
size_t iList = 0; iList < lists.size(); iList++) {
184 for (
auto dst = lists.at(iList).begin(); dst != lists.at(iList).end(); dst++) {
195 pathBinsPt[iList][distance(
fPathBins.begin(), path)] = tmp;
201 pathBinsY[iList][distance(
fPathBins.begin(), path)] = tmp;
205 vector<SdeltaS> data;
209 pair<Double_t, Double_t> T = make_pair(-1., -1.);
210 pair<Double_t, Double_t> B = make_pair(-1., -1.);
212 for (
size_t iList = 0; iList < lists.size(); iList++) {
213 for (
auto pathBin : pathBinsPt[iList]) {
214 Int_t bin = pathBin.first;
215 vector<TH1F>
vec = pathBin.second;
234 Double_t errTotRelNom =
TMath::Sqrt((dS / (T.second - B.second)) * (dS / (T.second - B.second))
235 + (dB / B.second) * (dB / B.second));
238 ss.
dSet = (iList) ?
"DATA" :
"MC";
241 ss.
s =
Int_t(T.second - B.second);
242 ss.
ds =
Int_t(errTotRelNom * (T.second - B.second));
244 data.emplace_back(std::move(ss));
248 for (
auto pathBin : pathBinsY[iList]) {
249 Int_t bin = pathBin.first;
250 vector<TH1F>
vec = pathBin.second;
268 Double_t errTotRelNom =
TMath::Sqrt((dS / (T.second - B.second)) * (dS / (T.second - B.second))
269 + (dB / B.second) * (dB / B.second));
272 ss.
dSet = (iList) ?
"DATA" :
"MC";
275 ss.
s =
Int_t(T.second - B.second);
276 ss.
ds =
Int_t(errTotRelNom * (T.second - B.second));
278 data.emplace_back(std::move(ss));
284 const Int_t nSets = 2;
287 for (
Int_t iSet = 0; iSet < nSets; iSet++)
298 Form(
"%G < P_{t} < %G [GeV/c]; Path [cm]; N_{#Lambda}",
min,
max), nBins, xMin, xMax);
302 Form(
"(%G - %G)", bin->second.first, bin->second.second));
312 for (
Int_t iSet = 0; iSet < nSets; iSet++)
322 Form(
"%G < Y < %G; Path [cm]; N_{#Lambda}",
min,
max), nBins, xMin, xMax);
326 Form(
"(%G - %G)", bin->second.first, bin->second.second));
341 Int_t path = it.pathBin;
358 gStyle->SetTitleFontSize(0.1);
360 gStyle->SetPaintTextFormat(
"4.3f");
375 TH1F* hMc = pathPt[0][iPt];
376 TH1F* hData = pathPt[1][iPt];
388 for (
Int_t iBin = 1; iBin < pathPt[0][iPt]->
GetNbinsX() + 1; iBin++)
389 pathPt[0][iPt]->SetBinContent(iBin, (dataSum / mcSum) * pathPt[0][iPt]->GetBinContent(iBin));
397 pathPt[0][iPt]->
Draw(
"PE1X0");
403 pathPt[1][iPt]->
Draw(
"PE1X0same");
419 TH1F* hData = pathY[1][
iY];
432 pathY[0][
iY]->SetBinContent(iBin, (dataSum / mcSum) * pathY[0][
iY]->GetBinContent(iBin));
440 pathY[0][
iY]->
Draw(
"PE1X0");
446 pathY[1][
iY]->
Draw(
"PE1X0same");
455 c->
SaveAs(
"nLambdaPathBins.pdf");
462 for (
auto tar : targets)
484 new TH1F(
Form(
"P_{t} = [%G, %G] GeV/c", pt0, pt1),
Form(
"P_{t} = [%G, %G] GeV/c", pt0, pt1), 75,
xLow,
xUp);
491 hSpectraY[
iY] =
new TH1F(
Form(
"Y = [%G, %G]", y0, y1),
Form(
"Y = [%G, %G]", y0, y1), 75,
xLow,
xUp);
494 vector<TString> fList;
499 cout <<
"nFiles# " << fList.size() << endl;
503 for (
auto it = fList.begin(); it != fList.end(); it++) {
511 gStyle->SetTitleFontSize(0.1);
513 gStyle->SetPaintTextFormat(
"4.3f");
535 hSpectraPt[iPt]->GetXaxis()->SetTitle(
"M_{(p + #pi^{-})}, GeV/c^{2}");
536 hSpectraPt[iPt]->GetXaxis()->SetTitleOffset(-1);
540 hSpectraPt[iPt]->GetXaxis()->SetNdivisions(5);
541 hSpectraPt[iPt]->GetYaxis()->SetNdivisions(5);
542 hSpectraPt[iPt]->GetYaxis()->SetLabelOffset(0.01);
543 hSpectraPt[iPt]->GetXaxis()->SetLabelSize(0.06);
544 hSpectraPt[iPt]->GetYaxis()->SetLabelSize(0.06);
545 hSpectraPt[iPt]->GetXaxis()->SetTitleSize(0.05);
546 hSpectraPt[iPt]->GetYaxis()->SetTitleSize(0.05);
547 hSpectraPt[iPt]->GetXaxis()->SetTitleOffset(0.85);
548 hSpectraPt[iPt]->GetYaxis()->SetTitleOffset(1.5);
552 pair<Double_t, Double_t> T = make_pair(-1., -1.);
553 pair<Double_t, Double_t> B = make_pair(-1., -1.);
559 delete hSpectraPt[iPt]->GetListOfFunctions()->FindObject(
"f");
560 delete hSpectraPt[iPt]->GetListOfFunctions()->FindObject(
"f2");
569 Double_t errTotRelNom =
TMath::Sqrt((dS / (T.second - B.second)) * (dS / (T.second - B.second))
570 + (dB / B.second) * (dB / B.second));
576 Form(
"Numb. of #Lambda^{0} = (%d #pm %d) ",
Int_t(T.second - B.second),
577 Int_t(errTotRelNom * (T.second - B.second))));
608 pair<Double_t, Double_t> T = make_pair(-1., -1.);
609 pair<Double_t, Double_t> B = make_pair(-1., -1.);
615 delete hSpectraY[
iY]->GetListOfFunctions()->FindObject(
"f");
616 delete hSpectraY[
iY]->GetListOfFunctions()->FindObject(
"f2");
624 Double_t errTotRelNom =
TMath::Sqrt((dS / (T.second - B.second)) * (dS / (T.second - B.second))
625 + (dB / B.second) * (dB / B.second));
631 Form(
"Numb. of #Lambda^{0} = (%d #pm %d) ",
Int_t(T.second - B.second),
632 Int_t(errTotRelNom * (T.second - B.second))));
653 pair<Double_t, Double_t> T,
654 pair<Double_t, Double_t> B,
682 legend->
AddEntry(
"",
Form(
"Numb. of #Lambda^{0} = %d, (%d)",
Int_t(T.first - B.first),
Int_t(T.second - B.second)),
685 "",
Form(
"S / B = %4.3f, (%4.3f)", (T.first - B.first) / B.first, (T.second - B.second) / B.second), 0);
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
char * Form(const char *fmt,...)
R__EXTERN TStyle * gStyle
map< Int_t, pair< Double_t, Double_t > > fSdeltaS_PtBinMap
map< TString, BmnParticlePairCut * > fTargCutsMap
void DrawH(TH1F *, Double_t, Double_t, pair< Double_t, Double_t >, pair< Double_t, Double_t >, Int_t si=1)
vector< TString > fMcList
map< Int_t, pair< Double_t, Double_t > > fSdeltaS_YBinMap
vector< TString > fDataList
map< TString, TString > fTrigEffData
void targetListsByCutsEstablished(set< TString > &, set< TString > &)
vector< TString > createFilelist()
Double_t deltaB(TF1 *f, TFitResultPtr fitRes)
map< Int_t, pair< Double_t, Double_t > > fPathBins
vector< TString > fInFiles
void ReadFile(TString, BmnParticlePairCut *cut0=nullptr, TClonesArray *triggEffInfo=nullptr, Double_t pathMin=0., Double_t pathMax=0.)
TFitResultPtr fitSpectrum(TH1F *)
vector< TString > fTarget
map< Int_t, pair< Double_t, Double_t > > fYBinMap
map< Int_t, pair< Double_t, Double_t > > fPtBinMap
virtual void SetTitleOffset(Float_t offset=1)
virtual void SetLabelSize(Float_t size=0.04)
virtual void SetLabelOffset(Float_t offset=0.005)
virtual void SetTitleSize(Float_t size=0.04)
virtual void SetNdivisions(Int_t n1, Int_t n2, Int_t n3, Bool_t optim=kTRUE)
virtual void SetLineWidth(Width_t lwidth)
virtual void SetLineColor(Color_t lcolor)
virtual void SetMarkerColor(Color_t mcolor=1)
virtual void SetMarkerStyle(Style_t mstyle=1)
virtual void SetMarkerSize(Size_t msize=1)
virtual void SetLeftMargin(Float_t leftmargin)
virtual void SetTextFont(Font_t tfont=62)
virtual void SetTextSize(Float_t tsize=1)
virtual void SetBinLabel(Int_t bin, const char *label)
void CenterTitle(Bool_t center=kTRUE)
virtual void SetRangeUser(Double_t ufirst, Double_t ulast)
TVirtualPad * cd(Int_t subpadnumber=0) override
virtual Bool_t Add(const TH1 *h, const TH1 *h2, Double_t c1=1, Double_t c2=1)
void SetTitle(const char *title) override
virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const
virtual Int_t GetNbinsX() const
virtual void SetBinError(Int_t bin, Double_t error)
void Draw(Option_t *option="") override
virtual void SetBinContent(Int_t bin, Double_t content)
TList * GetListOfFunctions() const
virtual Double_t GetBinContent(Int_t bin) const
TObject * Clone(const char *newname="") const override
TLatex * DrawLatex(Double_t x, Double_t y, const char *text)
void Draw(Option_t *option="") override
TLegendEntry * AddEntry(const char *name, const char *label="", Option_t *option="lpf")
TObject * FindObject(const char *name) const override
TObject * Clone(const char *newname="") const override
virtual void SetTitle(const char *title="")
void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0) override
void SaveAs(const char *filename="", Option_t *option="") const override
const char * Data() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual void SetNDC(Bool_t isNDC=kTRUE)
Double_t Sqrt(Double_t x)