ATLAS Offline Software
Functions
Trigger/TrigAnalysis/TrigInDetAnalysisUser/Resplot/src/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 ( )

getCoefficientMap(label, EigenIdxList)

input value:

  1. label: falvor label in std::string format, could be one of B, C, T, Light
  2. EigenIdxList is user defined vector containing all eigenvector index that user interested in. output: Map of format map<string, map<string, float>> containing decomposition coefficient of the list of eigenvectors defined by EigenIdxList.

getCoefficients(label, evIdx)

input value:

  1. label: falvor label in std::string format, could be one of B, C, T, Light
  2. evIdx: The index of eigenvector user interested in. output value: vector of coefficient values. The order is the same as output given by getListOfOriginalNuisanceParameters()

getListOfOriginalNuisanceParameters(label)

input value:

  1. label: falvor label in std::string format, could be one of B, C, T, Light output value: List of original nuisance parameter names.

getNumEigenVectors(label)

input value:

  1. label: falvor label in std::string format, could be one of B, C, T, Light return value: number of eigen vectors used for chosen label. Return 0 if error occured.

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 
66  plot2.Finalise(Resplot::FitGaussian);
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 }
Random::uniform
static double uniform()
Definition: TrigAnalysis/TrigInDetAnalysisUser/Resplot/src/Random.h:40
Random
Definition: TrigAnalysis/TrigInDetAnalysisUser/Resplot/src/Random.h:26
Random::gauss
static double gauss()
Definition: TrigAnalysis/TrigInDetAnalysisUser/Resplot/src/Random.h:39
lumiFormat.i
int i
Definition: lumiFormat.py:85
Resplot::FitNull95
static TF1 * FitNull95(TH1D *s, double a=0, double b=0)
Definition: Resplot.cxx:1673
hist_file_dump.f
f
Definition: hist_file_dump.py:135
Resplot
Definition: Resplot.h:50
Resplot::FitGaussian
static TF1 * FitGaussian(TH1D *s, double a=-999, double b=-999)
Definition: Resplot.cxx:1025
MuonR4::SegmentFit::ParamDefs::x0
@ x0
MuonR4::SegmentFit::ParamDefs::y0
@ y0
Random::RandomBuilder
static Random & RandomBuilder()
Definition: TrigAnalysis/TrigInDetAnalysisUser/Resplot/src/Random.h:30
python.PyKernel.plot2
def plot2(classAndKey, valueX="$x", valueY="$x", criteria="True", nEvent=100)
Definition: PyKernel.py:525