18 infile.open(
"./tutorials/hist/data/tprofile2poly_tutorial.data");
20 vector<pair<Double_t, Double_t>> allCoords;
22 while (infile >> a >> b) {
23 pair<Double_t, Double_t> coord(a, b);
24 allCoords.push_back(coord);
27 if (allCoords.size() % 3 != 0) {
28 cout <<
"[ERROR] Bad file" << endl;
33 for (
Int_t i = 0; i < allCoords.size(); i += 3) {
34 x[0] = allCoords[i + 0].first;
35 y[0] = allCoords[i + 0].second;
36 x[1] = allCoords[i + 1].first;
37 y[1] = allCoords[i + 1].second;
38 x[2] = allCoords[i + 2].first;
39 y[2] = allCoords[i + 2].second;
40 th2p->AddBin(3, x, y);
47 for (
int j = 0; j < numEvents; ++j) {
56 if (th2p->IsInsideBin(4, r1, r2)) val = rok - rbad1;
57 if (th2p->IsInsideBin(20, r1, r2)) val = rok - rbad2;
58 if (th2p->IsInsideBin(13, r1, r2)) val = rok + rbad1;
59 if (th2p->IsInsideBin(37, r1, r2)) val = rok + rbad2;
62 th2p->Fill(r1, r2, val);
63 avg->Fill(r1, r2, val);
64 err->Fill(r1, r2, val);
80 err->SetContentToError();
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 tprofile2polyRealisticModuleError(Int_t numEvents=1000000)
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
unsigned int r2[N_CITIES]
2D Histogram with Polygonal Bins