18#include "macro/run/bmnloadlibs.C"
29 if (fileNameMC ==
"" || fileNameEx ==
"") {
30 cout <<
"Files need to be specified!" << endl;
34 Int_t ClusterSizeThr = 0;
47 chainMC->
Add(fileNameMC.
Data());
49 printf(
"#recorded MC entries = %lld\n", NEventsMC);
55 chainEx->
Add(fileNameEx.
Data());
57 printf(
"#recorded Exp entries = %lld\n", NEventsEx);
63 chainDST->
Add(fileNameDST.
Data());
65 printf(
"#recorded Track entries = %lld\n", NEventsDST);
77 printf(
"rescaling func created\n");
79 TString title =
"GEM MC Rescaled";
80 TH1D* hGemMC =
new TH1D(
"mc", title, xBins, xLow, xUp);
82 TH1D* hGemEx =
new TH1D(
"digs", title, xBins, xLow, xUp);
83 title =
"GEM Exp Hits' Digits";
84 TH1D* hGemExHits =
new TH1D(
"digs-hits", title, xBins, xLow, xUp);
85 title =
"GEM Exp Cluster Signal Lower";
86 TH1D* hGemExCS =
new TH1D(
"cluster-signal-upper", title, xBins, xLow, xUp);
87 title =
"GEM Exp Tracks' Digits";
88 TH1D* hGemExTracks =
new TH1D(
"digs-tracks", title, xBins, xLow, xUp);
89 vector<TH1D*> hGemCluster;
91 title =
"GEM Cluster Size";
92 TH1D* h =
new TH1D(
Form(
"gem csize %.d",
i), title, xBins, xLow, 1000);
93 hGemCluster.push_back(h);
96 for (
Long64_t iEv = 0; iEv < NEventsEx; ++iEv) {
107 hGemEx->
Fill(signal);
116 if (csize < hGemCluster.size())
123 const vector<BmnLink> links =
match.GetLinks();
126 for (
const BmnLink& link : links) {
128 printf(
"Warning in event %lld hit %d! Hits Link index out of range! index = %d entries %d\n", iEv,
133 if (strcmp(dig->
GetName(),
""))
155 const vector<BmnLink> links =
match.GetLinks();
156 for (
const BmnLink& link : links) {
158 printf(
"Warning in event %lld!Tracks Link index out of range! index = %d entries %d\n",
170 printf(
"Exp histograms filled\n");
172 title =
"GEM-rescaled";
188 for (
Long64_t iEv = 0; iEv < NEventsMC; ++iEv) {
199 hGemMC->
Fill(signal);
202 printf(
"MC histogram filled\n");
206 auto legend =
new TLegend(0.6, 0.65, 0.8, 0.9);
207 legend->SetHeader(
"The Legend",
"C");
208 legend->AddEntry(hGemEx,
"All digits");
210 legend->AddEntry(hGemExCS,
"Cluster signal lower");
212 legend->AddEntry(hGemMC,
"MC rescaled by all exp digits");
215 can->Print(
Form(
"%s-th-%.1f-cs-%d-Lower-2m2m.pdf",
can->GetName(), lowThr, ClusterSizeThr));
219 auto legendCluster =
new TLegend(0.6, 0.65, 0.8, 0.9);
220 for (
Int_t i = 0;
i < nCSize;
i++) {
221 hGemCluster[
i]->SetLineColor(cols[
i]);
222 hGemCluster[
i]->Draw(
i == 0 ?
"" :
"same");
223 legendCluster->AddEntry(hGemCluster[
i], hGemCluster[
i]->GetName());
225 legendCluster->Draw();
226 can->Print(
Form(
"%s-cluster-Lower.pdf",
can->GetName()));
235 delete legendCluster;
void DrawBar(UInt_t iEv, UInt_t nEv)
#define R__ADD_INCLUDE_PATH(PATH)
char * Form(const char *fmt,...)
R__EXTERN TStyle * gStyle
Int_t GetClusterSizeInLowerLayer()
Double_t GetStripTotalSignalInLowerLayer()
Strip layer characteristics of the hit (total signal, cluster size, strip position as the cluster mea...
Int_t GetGemTrackIndex() const
Accessors.
BmnMatch GetDigitNumberMatch()
Class BmnStripDigit Base class for strip detector digits.
Double_t GetStripSignal()
Int_t GetNHits() const
Accessors.
Int_t GetHitIndex(Int_t iHit) const
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)
Long64_t GetEntries() const override
Int_t GetEntry(Long64_t entry=0, Int_t getall=0) override
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
virtual TH1 * DrawNormalized(Option_t *option="", Double_t norm=1) const
virtual void SetMaximum(Double_t maximum=-1111)
void Draw(Option_t *option="") override
virtual Int_t Fill(const char *name, Double_t w)
virtual void SetMinimum(Double_t minimum=-1111)
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 * GetName() const override
virtual void SetName(const char *name)
Int_t GetEntriesFast() const
TObject * At(Int_t idx) const override
TObject * UncheckedAt(Int_t i) const
const char * Data() const
void rescaleAmplitude(TString fileNameMC, TString fileNameEx, TString fileNameDST)
rescaleAmplitudes Example of ADC signal rescaling procedures for GEM strip digits