BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
testBmnZdcBScanner.C
Go to the documentation of this file.
1R__ADD_INCLUDE_PATH($VMCWORKDIR)
2#include "macro/run/bmnloadlibs.C"
3
4void testBmnZdcBScanner(Int_t runId = 3977, UInt_t eventId = 1)
5{
6
7 TChain mChain("bmndata");
8
9 TString inp = TString::Format("/nica/mpd22/bmnDigits_RUN7/bmn_run%d_digi.root", runId);
10 mChain.Add(inp.Data());
11 TClonesArray* pArrayOfBmnZDCDigit = new TClonesArray("BmnZDCDigit");
12 mChain.SetBranchAddress("ZDC", &pArrayOfBmnZDCDigit);
13 mChain.GetEntry(eventId);
14
16 app.SetEventData(pArrayOfBmnZDCDigit);
17 app.AddSimDigit("/lhep/users/pnaleks/mpd12/sim/ArAl/digi/ArAl_3.2AGeV_mb_03_run7_digi.root");
18 app.SetSimScale(30e3);
19 app.SetScanWidth(5000);
20 app.SetShowProgress(1);
21
22 printf("\nScan E...\n");
23 TH1D* hBE = app.Scan('E');
24 printf("\n...Done\nScan M\n");
25 TH1D* hBM = app.Scan('M');
26 printf("\n...Done\n");
27
28 TCanvas* C = new TCanvas();
29
30 hBE->Scale(1. / hBE->GetEntries());
31 hBM->Scale(1. / hBM->GetEntries());
32
33 TH1D* hBEM = new TH1D();
34 (*hBEM) = (*hBE) * (*hBM);
35 hBEM->Scale(1. / hBEM->Integral());
36 hBEM->SetName("hBEM");
37
38 TString title = TString::Format("b-spectra (Run:%d Ev:%u)", runId, eventId);
39 hBEM->SetTitle(title.Data());
40 hBEM->SetXTitle("b, (fm)");
41 hBEM->SetLineColor(4);
42 hBEM->SetLineWidth(4);
43 hBEM->Rebin(2);
44 hBEM->Draw("hist");
45
46 hBE->SetLineColor(2);
47 hBE->SetLineWidth(2);
48 hBE->Rebin(2);
49 hBE->Draw("hist same");
50
51 hBM->SetLineColor(6);
52 hBM->SetLineWidth(2);
53 hBM->Rebin(2);
54 hBM->Draw("hist same");
55}
int Int_t
unsigned int UInt_t
#define R__ADD_INCLUDE_PATH(PATH)
void SetSimScale(Double_t scale)
virtual TH1D * Scan(char mode)
void SetShowProgress(Bool_t show)
void SetEventData(TClonesArray *pArrayOfBmnZDCDigit, Double_t scale=1.)
void AddSimDigit(const char *fileName)
void SetScanWidth(UInt_t entries)
virtual void SetLineWidth(Width_t lwidth)
virtual void SetLineColor(Color_t lcolor)
Int_t SetBranchAddress(const char *bname, T **add, TBranch **ptr=nullptr)
virtual Int_t Add(const char *name, Long64_t nentries=TTree::kMaxEntries)
Int_t GetEntry(Long64_t entry=0, Int_t getall=0) override
void SetTitle(const char *title) override
virtual void SetXTitle(const char *title)
void Draw(Option_t *option="") override
virtual Double_t GetEntries() const
virtual TH1 * Rebin(Int_t ngroup=2, const char *newname="", const Double_t *xbins=nullptr)
void SetName(const char *name) override
virtual Double_t Integral(Int_t binx1, Int_t binx2, Option_t *option="") const
virtual void Scale(Double_t c1=1, Option_t *option="")
const char * Data() const
static TString Format(const char *fmt,...)
void testBmnZdcBScanner(Int_t runId=3977, UInt_t eventId=1)