corrected histogram generation
This commit is contained in:
parent
5c7b4a457c
commit
b3807450b1
@ -298,18 +298,17 @@ int main(int argc, char *argv[])
|
|||||||
cout << endl << ">> calculate all the histo_i(t) ..." << endl;
|
cout << endl << ">> calculate all the histo_i(t) ..." << endl;
|
||||||
|
|
||||||
// calculate the histograms
|
// calculate the histograms
|
||||||
PIntVector idata;
|
vector<PDoubleVector> histo;
|
||||||
vector<PIntVector> histo;
|
|
||||||
for (UInt_t i=0; i<asym.size(); i++) { // loop over all histos
|
for (UInt_t i=0; i<asym.size(); i++) { // loop over all histos
|
||||||
for (Int_t j=0; j<noOfChannels; j++) { // loop over time
|
for (Int_t j=0; j<noOfChannels; j++) { // loop over time
|
||||||
if (j < t0[i])
|
if (j < t0[i])
|
||||||
dval = bkg[i];
|
dval = bkg[i];
|
||||||
else
|
else
|
||||||
dval = N0[i]*TMath::Exp(-timeResolution*(j-t0[i])/tau_mu)*(1.0+asymmetry[i][j])+bkg[i];
|
dval = N0[i]*TMath::Exp(-timeResolution*(j-t0[i])/tau_mu)*(1.0+asymmetry[i][j])+bkg[i];
|
||||||
idata.push_back((int)dval);
|
ddata.push_back(dval);
|
||||||
}
|
}
|
||||||
histo.push_back(idata);
|
histo.push_back(ddata);
|
||||||
idata.clear();
|
ddata.clear();
|
||||||
cout << endl << ">> histo " << i+1 << "/" << asym.size() << " done ...";
|
cout << endl << ">> histo " << i+1 << "/" << asym.size() << " done ...";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -340,6 +339,33 @@ int main(int argc, char *argv[])
|
|||||||
TH1F *hh;
|
TH1F *hh;
|
||||||
TString name, title;
|
TString name, title;
|
||||||
for (UInt_t i=0; i<asym.size(); i++) {
|
for (UInt_t i=0; i<asym.size(); i++) {
|
||||||
|
name = "casym";
|
||||||
|
name += i;
|
||||||
|
title = "asym";
|
||||||
|
title += i;
|
||||||
|
chist = new TCanvas(name.Data(), title.Data(), 10, 10, 800, 600);
|
||||||
|
chist->Show();
|
||||||
|
|
||||||
|
name = "hh";
|
||||||
|
name += i;
|
||||||
|
title = "asym";
|
||||||
|
title += i;
|
||||||
|
hh = new TH1F(name.Data(), title.Data(), noOfChannels,
|
||||||
|
-timeResolution/2.0, (noOfChannels+0.5)*timeResolution);
|
||||||
|
for (Int_t j=0; j<noOfChannels; j++) {
|
||||||
|
hh->SetBinContent(j, asymmetry[i][j]);
|
||||||
|
}
|
||||||
|
hh->Draw("*H HIST");
|
||||||
|
|
||||||
|
tf.WriteTObject(chist);
|
||||||
|
|
||||||
|
if (hh)
|
||||||
|
delete hh;
|
||||||
|
if (chist)
|
||||||
|
delete chist;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (UInt_t i=0; i<histo.size(); i++) {
|
||||||
name = "chist";
|
name = "chist";
|
||||||
name += i;
|
name += i;
|
||||||
title = "histo";
|
title = "histo";
|
||||||
@ -354,7 +380,7 @@ int main(int argc, char *argv[])
|
|||||||
hh = new TH1F(name.Data(), title.Data(), noOfChannels,
|
hh = new TH1F(name.Data(), title.Data(), noOfChannels,
|
||||||
-timeResolution/2.0, (noOfChannels+0.5)*timeResolution);
|
-timeResolution/2.0, (noOfChannels+0.5)*timeResolution);
|
||||||
for (Int_t j=0; j<noOfChannels; j++) {
|
for (Int_t j=0; j<noOfChannels; j++) {
|
||||||
hh->SetBinContent(j, asymmetry[i][j]);
|
hh->SetBinContent(j, histo[i][j]);
|
||||||
}
|
}
|
||||||
hh->Draw("*H HIST");
|
hh->Draw("*H HIST");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user