16 TCanvas *
c2 =
new TCanvas(
"c2",
"Merge Individual moving charge plots", 800, 400);
37 for (
float i = minx; i < maxx; i += binsz) {
38 for (
float j = miny; j < maxy; j += binsz) {
39 tot_merge->AddBin(i, j, i + binsz, j + binsz);
40 for (
int l=0;
l<NUM_LS; ++
l) {
41 tot_avg_ls[
l].AddBin(i, j, i + binsz, j + binsz);
50 infile.open(
"./tutorials/hist/data/tprofile2poly_tutorial.data");
52 std::cout <<
" WE ARE AFTER LOADING DATA " << std::endl;
54 vector<pair<Double_t, Double_t>> allCoords;
56 while (infile >> a >> b) {
57 pair<Double_t, Double_t> coord(a, b);
58 allCoords.push_back(coord);
61 if (allCoords.size() % 3 != 0) {
62 cout <<
"[ERROR] Bad file" << endl;
67 for (
Int_t i = 0; i < allCoords.size(); i += 3) {
68 x[0] = allCoords[i + 0].first;
69 y[0] = allCoords[i + 0].second;
70 x[1] = allCoords[i + 1].first;
71 y[1] = allCoords[i + 1].second;
72 x[2] = allCoords[i + 2].first;
73 y[2] = allCoords[i + 2].second;
75 det_avg_merge->AddBin(3, x, y);
76 det_err_merge->AddBin(3, x, y);
78 for (
int l=0;
l<NUM_LS; ++
l) {
79 det_avg_ls[
l].AddBin(3, x, y);
83 std::cout <<
" WE ARE AFTER ADDING BINS " << std::endl;
94 for (
int i = 0; i <= NUM_LS-1; ++i) {
95 std::cout <<
"[In Progress] LumiSection " << i << std::endl;
96 for (
int j = 0; j < numEvents; ++j) {
111 if (r2 > 3. - yoffset1 && r2 < 8. - yoffset1 &&
112 r1 > 1. + xoffset1 && r1 < 5. + xoffset1 ) {
116 if (r2 > -10 + yoffset2 && r2 < -8 + yoffset2 &&
117 r1 > -6 + xoffset2 && r1 < 8 + xoffset2 ) {
121 tot_avg_ls[i].Fill(r1, r2, val);
122 det_avg_ls[i].Fill(r1, r2, val);
129 title =
"Global View: Avg in LS " + to_string(i);
130 tot_avg_ls[i].SetTitle(title.c_str());
131 tot_avg_ls[i].SetStats(
false);
132 tot_avg_ls[i].Draw(
"COLZ");
135 c1->
cd((i+1)+NUM_LS);
136 title =
"Detector View: Avg in LS " + to_string(i);
137 det_avg_ls[i].SetTitle(title.c_str());
138 det_avg_ls[i].SetStats(
false);
139 det_avg_ls[i].Draw(
"COLZ");
143 c1->
cd((i+1)+(NUM_LS*2));
144 title =
"Detector View: Error in LS " + to_string(i);
145 det_avg_ls[i].SetTitle(title.c_str());
146 det_avg_ls[i].SetStats(
false);
147 det_avg_ls[i].SetContentToError();
148 det_avg_ls[i].Draw(
"COLZ");
152 std::vector<TProfile2Poly*> tot_avg_v;
153 std::vector<TProfile2Poly*> det_avg_v;
154 for (
Int_t t=0; t<NUM_LS; t++){
155 tot_avg_v.push_back(&tot_avg_ls[t]);
156 det_avg_v.push_back(&det_avg_ls[t]);
159 std::cout <<
"[In Progress] Merging" << std::endl;
163 tot_merge->Merge(tot_avg_v);
165 title =
"Total average merge";
167 tot_merge->Draw(
"COLZ");
169 det_avg_merge->Merge(det_avg_v);
171 title =
"Detector average merge";
172 det_avg_merge->
SetTitle(title.c_str());
173 det_avg_merge->SetContentToAverage();
174 det_avg_merge->Draw(
"COLZ");
176 det_err_merge->Merge(det_avg_v);
178 title =
"Detector error merge";
179 det_err_merge->
SetTitle(title.c_str());
180 det_err_merge->SetContentToError();
181 det_err_merge->Draw(
"COLZ");
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
This is the base class for the ROOT Random number generators.
void tprofile2polyRealistic(Int_t numEvents=100000)
unsigned int r1[N_CITIES]
virtual void SetTitle(const char *title="")=0
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
virtual void Update()
Update canvas pad buffers.
unsigned int r2[N_CITIES]
2D Histogram with Polygonal Bins