CMS 3D CMS Logo

OutPVtrends.h
Go to the documentation of this file.
1 #ifndef ALIGNMENT_OFFLINEVALIDATION_OUTPVTRENDS_H_
2 #define ALIGNMENT_OFFLINEVALIDATION_OUTPVTRENDS_H_
3 
4 #include "TArrow.h"
5 #include "TAxis.h"
6 #include "TCanvas.h"
7 #include "TF1.h"
8 #include "TFile.h"
9 #include "TGaxis.h"
10 #include "TGraph.h"
11 #include "TGraphAsymmErrors.h"
12 #include "TGraphErrors.h"
13 #include "TH1F.h"
14 #include "TH2F.h"
15 #include "TLatex.h"
16 #include "TLegend.h"
17 #include "TList.h"
18 #include "TMath.h"
19 #include "TObjArray.h"
20 #include "TObjString.h"
21 #include "TPad.h"
22 #include "TPaveText.h"
23 #include "TProcPool.h"
24 #include "TProfile.h"
25 #include "TROOT.h"
26 #include "TStyle.h"
27 #include "TSystem.h"
28 #include "TSystemDirectory.h"
29 #include "TSystemFile.h"
30 #include <TStopwatch.h>
31 #include <algorithm>
32 #include <bitset>
33 #include <fstream>
34 #include <functional>
35 #include <iostream>
36 #include <iterator>
37 #include <map>
38 #include <sstream>
39 #include <vector>
40 
44 typedef std::map<TString, std::vector<double> > alignmentTrend;
45 
46 // auxilliary struct to store
47 // histogram features
48 struct unrolledHisto {
49  double m_y_min;
50  double m_y_max;
51  unsigned int m_n_bins;
52  std::vector<double> m_bincontents;
53 
55  m_y_min = 0.;
56  m_y_max = 0.;
57  m_n_bins = 0;
58  m_bincontents.clear();
59  } // first constructor empty
60 
61  unrolledHisto(const double &y_min,
62  const double &y_max,
63  const unsigned int &n_bins,
64  const std::vector<double> &bincontents) {
65  m_y_min = y_min;
66  m_y_max = y_max;
67  m_n_bins = n_bins;
68  m_bincontents = bincontents;
69  } //look, a constructor
70 
71  double get_y_min() { return m_y_min; }
72 
73  double get_y_max() { return m_y_max; }
74 
75  unsigned int get_n_bins() { return m_n_bins; }
76 
77  std::vector<double> get_bin_contents() { return m_bincontents; }
78 
79  double get_integral() {
80  double ret(0.);
81  for (const auto &binc : m_bincontents) {
82  ret += binc;
83  }
84  return ret;
85  }
86 };
87 
88 struct outPVtrends {
119  // empty constructor
120  outPVtrends() { init(); }
121 
122  int m_index;
123  std::vector<double> m_runs;
144  std::map<TString, std::vector<unrolledHisto> > m_dxyVect;
145  std::map<TString, std::vector<unrolledHisto> > m_dzVect;
146 
147  void init() {
148  m_index = -1;
149  m_runs.clear();
150 
151  m_dxyPhiMeans.clear();
152  m_dxyPhiChi2.clear();
153  m_dxyPhiKS.clear();
154  m_dxyPhiHi.clear();
155  m_dxyPhiLo.clear();
156 
157  m_dxyEtaMeans.clear();
158  m_dxyEtaChi2.clear();
159  m_dxyEtaKS.clear();
160  m_dxyEtaHi.clear();
161  m_dxyEtaLo.clear();
162 
163  m_dzPhiMeans.clear();
164  m_dzPhiChi2.clear();
165  m_dzPhiKS.clear();
166  m_dzPhiHi.clear();
167  m_dzPhiLo.clear();
168 
169  m_dzEtaMeans.clear();
170  m_dzEtaChi2.clear();
171  m_dzEtaKS.clear();
172  m_dzEtaHi.clear();
173  m_dzEtaLo.clear();
174 
175  m_dxyVect.clear();
176  m_dzVect.clear();
177  }
178 };
179 
180 #if defined(__ROOTCLING__)
181 #pragma link C++ class std::map < TString, std::vector < double>> + ;
182 #pragma link C++ class std::map < TString, std::vector < unrolledHisto>> + ;
183 #pragma link C++ class outPVtrends + ;
184 #pragma link C++ class unrolledHisto + ;
185 
186 #endif
187 
188 #endif // ALIGNMENT_OFFLINEVALIDATION_OUTPVTRENDS_H_
Structure outPVtrends Contains the ensemble of all the alignmentTrends built by the functor...
Definition: OutPVtrends.h:88
alignmentTrend m_dxyEtaMeans
Definition: OutPVtrends.h:129
std::map< TString, std::vector< unrolledHisto > > m_dzVect
Definition: OutPVtrends.h:145
alignmentTrend m_dzEtaKS
Definition: OutPVtrends.h:141
ret
prodAgent to be discontinued
std::map< TString, std::vector< unrolledHisto > > m_dxyVect
Definition: OutPVtrends.h:144
unsigned int m_n_bins
Definition: OutPVtrends.h:51
double m_y_min
Definition: OutPVtrends.h:49
alignmentTrend m_dzPhiChi2
Definition: OutPVtrends.h:135
double m_y_max
Definition: OutPVtrends.h:50
std::vector< double > m_runs
Definition: OutPVtrends.h:123
double get_integral()
Definition: OutPVtrends.h:79
alignmentTrend m_dxyPhiMeans
Definition: OutPVtrends.h:124
alignmentTrend m_dxyPhiChi2
Definition: OutPVtrends.h:125
alignmentTrend m_dzPhiMeans
Definition: OutPVtrends.h:134
double get_y_max()
Definition: OutPVtrends.h:73
double get_y_min()
Definition: OutPVtrends.h:71
alignmentTrend m_dxyPhiKS
Definition: OutPVtrends.h:126
alignmentTrend m_dxyPhiHi
Definition: OutPVtrends.h:127
alignmentTrend m_dxyEtaLo
Definition: OutPVtrends.h:133
std::map< TString, std::vector< double > > alignmentTrend
Definition: OutPVtrends.h:44
alignmentTrend m_dzEtaLo
Definition: OutPVtrends.h:143
alignmentTrend m_dzPhiLo
Definition: OutPVtrends.h:138
unsigned int get_n_bins()
Definition: OutPVtrends.h:75
std::vector< double > get_bin_contents()
Definition: OutPVtrends.h:77
unrolledHisto(const double &y_min, const double &y_max, const unsigned int &n_bins, const std::vector< double > &bincontents)
Definition: OutPVtrends.h:61
alignmentTrend m_dzPhiHi
Definition: OutPVtrends.h:137
void init()
Definition: OutPVtrends.h:147
alignmentTrend m_dzEtaMeans
Definition: OutPVtrends.h:139
alignmentTrend m_dzEtaHi
Definition: OutPVtrends.h:142
alignmentTrend m_dxyEtaChi2
Definition: OutPVtrends.h:130
alignmentTrend m_dxyEtaKS
Definition: OutPVtrends.h:131
alignmentTrend m_dxyEtaHi
Definition: OutPVtrends.h:132
alignmentTrend m_dzEtaChi2
Definition: OutPVtrends.h:140
std::vector< double > m_bincontents
Definition: OutPVtrends.h:52
alignmentTrend m_dxyPhiLo
Definition: OutPVtrends.h:128
alignmentTrend m_dzPhiKS
Definition: OutPVtrends.h:136