ATLAS Offline Software
Loading...
Searching...
No Matches
main.cxx File Reference
#include <cmath>
#include <vector>
#include "TFile.h"
#include "TStyle.h"
#include "TMath.h"
#include "Resplot.h"
#include "Random.h"
Include dependency graph for Trigger/TrigAnalysis/TrigInDetAnalysisUser/Resplot/src/main.cxx:

Go to the source code of this file.

Functions

int main ()

Detailed Description

Author
mark sutton
Date
Fri 11 Jan 2019 07:41:27 CET

Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration

Definition in file Trigger/TrigAnalysis/TrigInDetAnalysisUser/Resplot/src/main.cxx.

Function Documentation

◆ main()

int main ( )

Definition at line 23 of file Trigger/TrigAnalysis/TrigInDetAnalysisUser/Resplot/src/main.cxx.

23 {
24
25 std::cout << "main()" << std::endl;
26
27 TFile f("out.root", "recreate");
28
29
30 int Nxbins = 10;
31 double xlimitlo = -10;
32 double xlimithi = 10;
33
34 int Nybins = 300;
35 double ylimitlo = -30;
36 double ylimithi = 30;
37
38
39 Resplot plot1("plot1", Nxbins, xlimitlo, xlimithi, Nybins, ylimitlo, ylimithi );
40 Resplot plot2("plot2", Nxbins, xlimitlo, xlimithi, Nybins, ylimitlo, ylimithi );
41
42 std::cout << "running" << std::endl;
43
45
46
47 // loop over some "events"
48 for ( int i=0 ; i<10000 ; i++ ) {
49
50 if ( (i%1000)==0 ) std::cout << "process event " << i << std::endl;
51
52 double x0 = 20*rnd.uniform()-10;
53 double y0 = (2+x0*x0/20)*rnd.gauss();
54
55 plot1.Fill(x0, y0);
56 plot2.Fill(x0, y0);
57
58 }
59
60 std::cout << "finalising" << std::endl;
61
62 plot1.Finalise(Resplot::FitNull95);
63
64 std::cout << __LINE__ << std::endl;
65
67
68 plot1.Write();
69 plot2.Write();
70
71
72 f.Write();
73
74
75 std::cout << "closing f" << std::endl;
76 f.Close();
77
78
79 std::cout << "operations" << std::endl;
80
81 return 0;
82}
static TRandom * rnd
static TF1 * FitGaussian(TH1D *s, double a=-999, double b=-999)
Definition Resplot.cxx:1024
static TF1 * FitNull95(TH1D *s, double a=0, double b=0)
Definition Resplot.cxx:1672
plot2(classAndKey, valueX="$x", valueY="$x", criteria="True", nEvent=100)
Definition PyKernel.py:524