ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Attributes | Static Private Attributes | List of all members
TFCS1DFunctionHistogram Class Reference

#include <TFCS1DFunctionHistogram.h>

Inheritance diagram for TFCS1DFunctionHistogram:
Collaboration diagram for TFCS1DFunctionHistogram:

Public Member Functions

 TFCS1DFunctionHistogram ()
 
 TFCS1DFunctionHistogram (TH1 *hist, double)
 
void Initialize (TH1 *hist, double)
 
virtual double rnd_to_fct (double rnd) const
 Function gets random number rnd in the range [0,1) as argument and returns function value. More...
 
TH1 * vector_to_histo ()
 
double get_inverse (double rnd) const
 
void smart_rebin_loop (TH1 *hist, double)
 
double sample_from_histovalues (double)
 
const std::vector< float > & get_HistoBorders ()
 
const std::vector< float > & get_HistoContents ()
 
virtual void rnd_to_fct (float value[], const float rnd[]) const
 Function gets array of random numbers rnd[] in the range [0,1) as arguments and returns function value in array value. More...
 
virtual double rnd_to_fct (double rnd) const=0
 Function gets random number rnd in the range [0,1) as argument and returns function value. More...
 
virtual int ndim () const
 Return the number of dimensions for the function. More...
 
virtual void rnd_to_fct (float value[], const float rnd[]) const
 Function gets array of random numbers rnd[] in the range [0,1) as arguments and returns function value in array value. More...
 
virtual bool operator== (const TFCS1DFunction &ref) const
 The == operator compares the content of instances. More...
 
virtual std::size_t MemorySize () const
 Gives the total memory size, including the size of additional memory allocated inside the class. More...
 
bool msgLvl (const MSG::Level lvl) const
 Check whether the logging system is active at the provided verbosity level. More...
 
MsgStream & msg () const
 Return a stream for sending messages directly (no decoration) More...
 
MsgStream & msg (const MSG::Level lvl) const
 Return a decorated starting stream for sending messages. More...
 
MSG::Level level () const
 Retrieve output level. More...
 
virtual void setLevel (MSG::Level lvl)
 Update outputlevel. More...
 

Static Public Member Functions

static double linear (double y1, double y2, double x1, double x2, double x)
 
static double non_linear (double y1, double y2, double x1, double x2, double x)
 
static double get_maxdev (TH1 *, TH1D *)
 
static double get_change (TH1 *)
 
static TH1D * smart_rebin (TH1D *)
 
static std::unique_ptr< double[]> histo_to_array (TH1 *)
 
static double sample_from_histo (TH1 *hist, double)
 
static double get_maxdev (TH1 *, TH1 *)
 
static double CheckAndIntegrate1DHistogram (const TH1 *hist, std::vector< double > &integral_vec, int &first, int &last)
 
static TH1 *generate_histogram_random_slope ATLAS_NOT_THREAD_SAFE (int nbinsx=50, double xmin=0, double xmax=1, double zerothreshold=0.1)
 
static TH1 *generate_histogram_random_gauss ATLAS_NOT_THREAD_SAFE (int nbinsx=50, int ntoy=100000, double xmin=1, double xmax=5, double xpeak=1.5, double sigma=0.6)
 
static void unit_test ATLAS_NOT_THREAD_SAFE (TH1 *hist, TFCS1DFunction *rtof, int nrnd=1000000, TH1 *histfine=nullptr)
 
static std::string startMsg (MSG::Level lvl, const std::string &file, int line)
 Make a message to decorate the start of logging. More...
 

Protected Attributes

std::vector< float > m_HistoBorders
 
std::vector< float > m_HistoContents
 

Private Attributes

std::string m_nm
 Message source name. More...
 

Static Private Attributes

static boost::thread_specific_ptr< MsgStream > m_msg_tls ATLAS_THREAD_SAFE
 Do not persistify! More...
 

Detailed Description

Definition at line 13 of file TFCS1DFunctionHistogram.h.

Constructor & Destructor Documentation

◆ TFCS1DFunctionHistogram() [1/2]

TFCS1DFunctionHistogram::TFCS1DFunctionHistogram ( )
inline

Definition at line 16 of file TFCS1DFunctionHistogram.h.

16 {};

◆ TFCS1DFunctionHistogram() [2/2]

TFCS1DFunctionHistogram::TFCS1DFunctionHistogram ( TH1 *  hist,
double  cut_maxdev 
)

Definition at line 16 of file TFCS1DFunctionHistogram.cxx.

16  {
17  Initialize(hist, cut_maxdev);
18 }

Member Function Documentation

◆ ATLAS_NOT_THREAD_SAFE() [1/3]

static TH1* generate_histogram_random_slope TFCS1DFunction::ATLAS_NOT_THREAD_SAFE ( int  nbinsx = 50,
double  xmin = 0,
double  xmax = 1,
double  zerothreshold = 0.1 
)
staticinherited

◆ ATLAS_NOT_THREAD_SAFE() [2/3]

static TH1* generate_histogram_random_gauss TFCS1DFunction::ATLAS_NOT_THREAD_SAFE ( int  nbinsx = 50,
int  ntoy = 100000,
double  xmin = 1,
double  xmax = 5,
double  xpeak = 1.5,
double  sigma = 0.6 
)
staticinherited

◆ ATLAS_NOT_THREAD_SAFE() [3/3]

static void unit_test TFCS1DFunction::ATLAS_NOT_THREAD_SAFE ( TH1 *  hist,
TFCS1DFunction rtof,
int  nrnd = 1000000,
TH1 *  histfine = nullptr 
)
staticinherited

◆ CheckAndIntegrate1DHistogram()

double TFCS1DFunction::CheckAndIntegrate1DHistogram ( const TH1 *  hist,
std::vector< double > &  integral_vec,
int &  first,
int &  last 
)
staticinherited

Definition at line 52 of file TFCS1DFunction.cxx.

53  {
55  Int_t nbins = hist->GetNbinsX();
56 
57  float integral = 0;
58  integral_vec.resize(nbins);
59  for (int ix = 1; ix <= nbins; ix++) {
60  float binval = hist->GetBinContent(ix);
61  if (binval < 0) {
62  // Can't work if a bin is negative, forcing bins to 0 in this case
63  double fraction = binval / hist->Integral();
64  if (TMath::Abs(fraction) > 1e-5) {
65  ATH_MSG_NOCLASS(logger, "Warning: bin content is negative in histogram "
66  << hist->GetName() << " : "
67  << hist->GetTitle() << " binval=" << binval
68  << " " << fraction * 100
69  << "% of integral=" << hist->Integral()
70  << ". Forcing bin to 0.");
71  }
72  binval = 0;
73  }
74  integral += binval;
75  integral_vec[ix - 1] = integral;
76  }
77 
78  for (first = 0; first < nbins; first++)
79  if (integral_vec[first] != 0)
80  break;
81  for (last = nbins - 1; last > 0; last--)
82  if (integral_vec[last] != integral)
83  break;
84  last++;
85 
86  if (integral <= 0) {
87  ATH_MSG_NOCLASS(logger, "Error: histogram "
88  << hist->GetName() << " : " << hist->GetTitle()
89  << " integral=" << integral << " is <=0");
90  }
91  return integral;
92 }

◆ get_change()

double TFCS1DFunctionHistogram::get_change ( TH1 *  histo)
static

Definition at line 151 of file TFCS1DFunctionHistogram.cxx.

151  {
152  // return the smallest change between 2 bin contents, but don't check the last
153  // bin, because that one never gets merged
154  double minchange = 100.0;
155  for (int b = 2; b < histo->GetNbinsX(); b++) {
156  double diff = histo->GetBinContent(b) - histo->GetBinContent(b - 1);
157  if (diff < minchange && diff > 0)
158  minchange = diff;
159  }
160 
161  return minchange;
162 }

◆ get_HistoBorders()

const std::vector<float>& TFCS1DFunctionHistogram::get_HistoBorders ( )
inline

Definition at line 37 of file TFCS1DFunctionHistogram.h.

37 { return m_HistoBorders; };

◆ get_HistoContents()

const std::vector<float>& TFCS1DFunctionHistogram::get_HistoContents ( )
inline

Definition at line 38 of file TFCS1DFunctionHistogram.h.

38 { return m_HistoContents; };

◆ get_inverse()

double TFCS1DFunctionHistogram::get_inverse ( double  rnd) const

Definition at line 260 of file TFCS1DFunctionHistogram.cxx.

260  {
261 
262  double value = 0.;
263 
264  if (rnd < m_HistoContents[0]) {
265  double x1 = m_HistoBorders[0];
266  double x2 = m_HistoBorders[1];
267  double y1 = 0;
268  double y2 = m_HistoContents[0];
269  double x = non_linear(y1, y2, x1, x2, rnd);
270  value = x;
271  } else {
272  // find the first HistoContent element that is larger than rnd:
273  vector<float>::const_iterator larger_element =
274  std::upper_bound(m_HistoContents.begin(), m_HistoContents.end(), rnd);
275  size_t index = larger_element - m_HistoContents.begin();
276  if (index >= m_HistoContents.size()) {
277  --index;
278  }
279  double y = m_HistoContents[index];
280  double x1 = m_HistoBorders[index];
281  double x2 = m_HistoBorders[index + 1];
282  double y1 = m_HistoContents[index - 1];
283  double y2 = y;
284  if ((index + 1) == (m_HistoContents.size() - 1)) {
285  x2 = m_HistoBorders[m_HistoBorders.size() - 1];
286  y2 = m_HistoContents[m_HistoContents.size() - 1];
287  }
288  double x = non_linear(y1, y2, x1, x2, rnd);
289  value = x;
290  }
291 
292  return value;
293 }

◆ get_maxdev() [1/2]

double TFCS1DFunction::get_maxdev ( TH1 *  h_input1,
TH1 *  h_approx1 
)
staticinherited

Definition at line 21 of file TFCS1DFunction.cxx.

21  {
22  TH1D *h_input = (TH1D *)h_input1->Clone("h_input");
23  TH1D *h_approx = (TH1D *)h_approx1->Clone("h_approx");
24 
25  double maxdev = 0.0;
26 
27  // normalize the histos to the same area:
28  double integral_input = h_input->Integral();
29  double integral_approx = 0.0;
30  for (int b = 1; b <= h_input->GetNbinsX(); b++)
31  integral_approx +=
32  h_approx->GetBinContent(h_approx->FindBin(h_input->GetBinCenter(b)));
33  h_approx->Scale(integral_input / integral_approx);
34 
35  double ymax = h_approx->GetBinContent(h_approx->GetNbinsX()) -
36  h_approx->GetBinContent(h_approx->GetMinimumBin());
37  for (int i = 1; i <= h_input->GetNbinsX(); i++) {
38  double val = fabs(h_approx->GetBinContent(
39  h_approx->FindBin(h_input->GetBinCenter(i))) -
40  h_input->GetBinContent(i)) /
41  ymax;
42  if (val > maxdev)
43  maxdev = val;
44  }
45 
46  delete h_input;
47  delete h_approx;
48 
49  return maxdev * 100.0;
50 }

◆ get_maxdev() [2/2]

double TFCS1DFunctionHistogram::get_maxdev ( TH1 *  h_in,
TH1D *  h_out 
)
static

Definition at line 139 of file TFCS1DFunctionHistogram.cxx.

139  {
140 
141  double maxdev = 0;
142  for (int i = 1; i <= h_in->GetNbinsX(); i++) {
143  int bin = h_out->FindBin(h_in->GetBinCenter(i));
144  double val = fabs(h_out->GetBinContent(bin) - h_in->GetBinContent(i));
145  if (val > maxdev)
146  maxdev = val;
147  }
148  return maxdev;
149 }

◆ histo_to_array()

std::unique_ptr< double[]> TFCS1DFunctionHistogram::histo_to_array ( TH1 *  hist)
static

Definition at line 25 of file TFCS1DFunctionHistogram.cxx.

25  {
26 
27  TH1D *h_clone = (TH1D *)hist->Clone("h_clone");
28  h_clone->Scale(1.0 / h_clone->Integral());
29 
30  auto histoVals = std::make_unique<double[]>(h_clone->GetNbinsX());
31  histoVals[0] = h_clone->GetBinContent(1);
32  for (int i = 1; i < h_clone->GetNbinsX(); i++) {
33  histoVals[i] = histoVals[i - 1] + h_clone->GetBinContent(i + 1);
34  }
35  delete h_clone;
36  return histoVals;
37 }

◆ Initialize()

void TFCS1DFunctionHistogram::Initialize ( TH1 *  hist,
double  cut_maxdev 
)

Definition at line 20 of file TFCS1DFunctionHistogram.cxx.

20  {
21  smart_rebin_loop(hist, cut_maxdev);
22 }

◆ level()

MSG::Level ISF_FCS::MLogging::level ( ) const
inlineinherited

Retrieve output level.

Definition at line 201 of file MLogging.h.

201 { return msg().level(); }

◆ linear()

double TFCS1DFunctionHistogram::linear ( double  y1,
double  y2,
double  x1,
double  x2,
double  x 
)
static

Definition at line 230 of file TFCS1DFunctionHistogram.cxx.

231  {
232  double x = -1;
233 
234  double eps = 0.0000000001;
235  if ((y2 - y1) < eps)
236  x = x1;
237  else {
238  double m = (y2 - y1) / (x2 - x1);
239  double n = y1 - m * x1;
240  x = (y - n) / m;
241  }
242 
243  return x;
244 }

◆ MemorySize()

virtual std::size_t TFCSFunction::MemorySize ( ) const
inlinevirtualinherited

Gives the total memory size, including the size of additional memory allocated inside the class.

Reimplemented in TFCS2DFunctionTemplateHistogram< Txvec, Tyvec, Tz, Trandom >, and TFCS1DFunctionTemplateHistogram< Txvec, Ty, Trandom >.

Definition at line 19 of file TFCSFunction.h.

19 { return sizeof(*this); };

◆ msg() [1/2]

MsgStream & ISF_FCS::MLogging::msg ( ) const
inlineinherited

Return a stream for sending messages directly (no decoration)

Definition at line 231 of file MLogging.h.

231  {
232  MsgStream *ms = m_msg_tls.get();
233  if (!ms) {
234  ms = new MsgStream(Athena::getMessageSvc(), m_nm);
235  m_msg_tls.reset(ms);
236  }
237  return *ms;
238 }

◆ msg() [2/2]

MsgStream & ISF_FCS::MLogging::msg ( const MSG::Level  lvl) const
inlineinherited

Return a decorated starting stream for sending messages.

Definition at line 240 of file MLogging.h.

240  {
241  return msg() << lvl;
242 }

◆ msgLvl()

bool ISF_FCS::MLogging::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Check whether the logging system is active at the provided verbosity level.

Definition at line 222 of file MLogging.h.

222  {
223  if (msg().level() <= lvl) {
224  msg() << lvl;
225  return true;
226  } else {
227  return false;
228  }
229 }

◆ ndim()

virtual int TFCS1DFunction::ndim ( ) const
inlinevirtualinherited

Return the number of dimensions for the function.

Reimplemented from TFCSFunction.

Definition at line 22 of file TFCS1DFunction.h.

22 { return 1; };

◆ non_linear()

double TFCS1DFunctionHistogram::non_linear ( double  y1,
double  y2,
double  x1,
double  x2,
double  x 
)
static

Definition at line 246 of file TFCS1DFunctionHistogram.cxx.

247  {
248  double x = -1;
249  double eps = 0.0000000001;
250  if ((y2 - y1) < eps)
251  x = x1;
252  else {
253  double b = (x1 - x2) / (sqrt(y1) - sqrt(y2));
254  double a = x1 - b * sqrt(y1);
255  x = a + b * sqrt(y);
256  }
257  return x;
258 }

◆ operator==()

virtual bool TFCS1DFunction::operator== ( const TFCS1DFunction ref) const
inlinevirtualinherited

The == operator compares the content of instances.

The implementation in the base class only returns true for a comparison with itself

Reimplemented in TFCS1DFunctionInt32Histogram.

Definition at line 36 of file TFCS1DFunction.h.

36  {
37  return this == &ref;
38  };

◆ rnd_to_fct() [1/4]

double TFCS1DFunctionHistogram::rnd_to_fct ( double  rnd) const
virtual

Function gets random number rnd in the range [0,1) as argument and returns function value.

Implements TFCS1DFunction.

Definition at line 223 of file TFCS1DFunctionHistogram.cxx.

223  {
224 
225  double value2 = get_inverse(rnd);
226 
227  return value2;
228 }

◆ rnd_to_fct() [2/4]

virtual double TFCS1DFunction::rnd_to_fct

Function gets random number rnd in the range [0,1) as argument and returns function value.

◆ rnd_to_fct() [3/4]

void TFCS1DFunction::rnd_to_fct

Function gets array of random numbers rnd[] in the range [0,1) as arguments and returns function value in array value.

For a n-dimensional function, value and rnd should both have n elements.

Definition at line 27 of file TFCS1DFunction.cxx.

17  {
18  value[0] = rnd_to_fct(rnd[0]);
19 }

◆ rnd_to_fct() [4/4]

void TFCS1DFunction::rnd_to_fct ( float  value[],
const float  rnd[] 
) const
virtualinherited

Function gets array of random numbers rnd[] in the range [0,1) as arguments and returns function value in array value.

For a n-dimensional function, value and rnd should both have n elements.

Implements TFCSFunction.

Definition at line 17 of file TFCS1DFunction.cxx.

17  {
18  value[0] = rnd_to_fct(rnd[0]);
19 }

◆ sample_from_histo()

double TFCS1DFunctionHistogram::sample_from_histo ( TH1 *  hist,
double  random 
)
static

Definition at line 39 of file TFCS1DFunctionHistogram.cxx.

39  {
40 
41  auto histoVals = histo_to_array(hist);
42  double value = 0.0;
43  int chosenBin =
44  (int)TMath::BinarySearch(hist->GetNbinsX(), histoVals.get(), random);
45  value = hist->GetBinCenter(chosenBin + 2);
46 
47  // cleanup
48 
49  return value;
50 }

◆ sample_from_histovalues()

double TFCS1DFunctionHistogram::sample_from_histovalues ( double  random)

Definition at line 52 of file TFCS1DFunctionHistogram.cxx.

52  {
53  double value = 0.0;
54 
55  TH1 *hist = vector_to_histo();
56  hist->SetName("hist");
57  auto histoVals = histo_to_array(hist);
58  int chosenBin =
59  (int)TMath::BinarySearch(hist->GetNbinsX(), histoVals.get(), random);
60  value = hist->GetBinCenter(chosenBin + 2);
61 
62  return value;
63 }

◆ setLevel()

void ISF_FCS::MLogging::setLevel ( MSG::Level  lvl)
virtualinherited

Update outputlevel.

Definition at line 105 of file MLogging.cxx.

105  {
106  lvl = (lvl >= MSG::NUM_LEVELS) ? MSG::ALWAYS
107  : (lvl < MSG::NIL) ? MSG::NIL
108  : lvl;
109  msg().setLevel(lvl);
110 }

◆ smart_rebin()

TH1D * TFCS1DFunctionHistogram::smart_rebin ( TH1D *  h_input)
static

Definition at line 164 of file TFCS1DFunctionHistogram.cxx.

164  {
165 
166  TH1D *h_out1 = (TH1D *)h_input->Clone("h_out1");
167 
168  // get the smallest change
169  double change = get_change(h_out1) * 1.00001;
170 
171  vector<double> content;
172  vector<double> binborder;
173 
174  binborder.push_back(h_out1->GetXaxis()->GetXmin());
175 
176  int merged = 0;
177  int skip = 0;
178  int secondlastbin_merge = 0;
179  for (int b = 1; b < h_out1->GetNbinsX() - 1; b++) // never touch the last bin
180  {
181  double thisBin = h_out1->GetBinContent(b);
182  double nextBin = h_out1->GetBinContent(b + 1);
183  double width = h_out1->GetBinWidth(b);
184  double nextwidth = h_out1->GetBinWidth(b + 1);
185  double diff = fabs(nextBin - thisBin);
186  if (!skip && (diff > change || merged)) {
187  binborder.push_back(h_out1->GetBinLowEdge(b + 1));
188  content.push_back(thisBin);
189  }
190  skip = 0;
191  if (diff <= change && !merged) {
192  double sum = thisBin * width + nextBin * nextwidth;
193  double sumwidth = width + nextwidth;
194  binborder.push_back(h_out1->GetBinLowEdge(b + 2));
195  content.push_back(sum / sumwidth);
196  merged = 1;
197  skip = 1;
198  if (b == (h_out1->GetNbinsX() - 2))
199  secondlastbin_merge = 1;
200  }
201  } // for b
202  if (!secondlastbin_merge) {
203  binborder.push_back(h_out1->GetBinLowEdge(h_out1->GetNbinsX()));
204  content.push_back(h_out1->GetBinContent(h_out1->GetNbinsX() - 1));
205  }
206  binborder.push_back(h_out1->GetXaxis()->GetXmax());
207  content.push_back(h_out1->GetBinContent(h_out1->GetNbinsX()));
208 
209  double *bins = new double[content.size() + 1];
210  for (unsigned int i = 0; i < binborder.size(); i++)
211  bins[i] = binborder[i];
212 
213  TH1D *h_out2 = new TH1D("h_out2", "h_out2", content.size(), bins);
214  for (unsigned int b = 1; b <= content.size(); b++)
215  h_out2->SetBinContent(b, content[b - 1]);
216 
217  delete[] bins;
218  delete h_out1;
219 
220  return h_out2;
221 }

◆ smart_rebin_loop()

void TFCS1DFunctionHistogram::smart_rebin_loop ( TH1 *  hist,
double  cut_maxdev 
)

Definition at line 80 of file TFCS1DFunctionHistogram.cxx.

80  {
81 
82  m_HistoContents.clear();
83  m_HistoBorders.clear();
84 
85  double change =
86  get_change(hist) * 1.000001; // increase slighlty for comparison of floats
87 
88  double maxdev = -1;
89 
90  TH1D *h_input = (TH1D *)hist->Clone("h_input");
91  TH1D *h_output = nullptr;
92 
93  int i = 0;
94  while (1) {
95 
96  TH1D *h_out;
97  if (i == 0) {
98  h_out = (TH1D *)h_input->Clone("h_out");
99  } else {
100  h_out = smart_rebin(h_input);
101  h_out->SetName("h_out");
102  }
103 
104  maxdev = get_maxdev(hist, h_out);
105  maxdev *= 100.0;
106 
107  if (i % 100 == 0)
108  ATH_MSG_INFO("Iteration nr. " << i << " -----> change " << change
109  << " bins " << h_out->GetNbinsX()
110  << " -> maxdev=" << maxdev);
111 
112  if (maxdev < cut_maxdev && h_out->GetNbinsX() > 5 && i < 1000) {
113  delete h_input;
114  h_input = (TH1D *)h_out->Clone("h_input");
115  change = get_change(h_input) * 1.000001;
116  delete h_out;
117  i++;
118  } else {
119  h_output = (TH1D *)h_input->Clone("h_output");
120  delete h_out;
121  break;
122  }
123  }
124 
125  ATH_MSG_INFO("Info: Rebinned histogram has " << h_output->GetNbinsX()
126  << " bins.");
127 
128  // store:
129 
130  for (int b = 1; b <= h_output->GetNbinsX(); b++)
131  m_HistoBorders.push_back((float)h_output->GetBinLowEdge(b));
132  m_HistoBorders.push_back((float)h_output->GetXaxis()->GetXmax());
133 
134  for (int b = 1; b < h_output->GetNbinsX(); b++)
135  m_HistoContents.push_back(h_output->GetBinContent(b));
136  m_HistoContents.push_back(1);
137 }

◆ startMsg()

std::string ISF_FCS::MLogging::startMsg ( MSG::Level  lvl,
const std::string &  file,
int  line 
)
staticinherited

Make a message to decorate the start of logging.

Print a message for the start of logging.

Definition at line 116 of file MLogging.cxx.

116  {
117  int col1_len = 20;
118  int col2_len = 5;
119  int col3_len = 10;
120  auto last_slash = file.find_last_of('/');
121  int path_len = last_slash == std::string::npos ? 0 : last_slash;
122  int trim_point = path_len;
123  int total_len = file.length();
124  if (total_len - path_len > col1_len)
125  trim_point = total_len - col1_len;
126  std::string trimmed_name = file.substr(trim_point);
127  const char *LevelNames[MSG::NUM_LEVELS] = {
128  "NIL", "VERBOSE", "DEBUG", "INFO", "WARNING", "ERROR", "FATAL", "ALWAYS"};
129  std::string level = LevelNames[lvl];
130  std::string level_string = std::string("(") + level + ") ";
131  std::stringstream output;
132  output << std::setw(col1_len) << std::right << trimmed_name << ":"
133  << std::setw(col2_len) << std::left << line << std::setw(col3_len)
134  << std::right << level_string;
135  return output.str();
136 }

◆ vector_to_histo()

TH1 * TFCS1DFunctionHistogram::vector_to_histo ( )

Definition at line 65 of file TFCS1DFunctionHistogram.cxx.

65  {
66 
67  double *bins = new double[m_HistoBorders.size()];
68  for (unsigned int i = 0; i < m_HistoBorders.size(); i++)
69  bins[i] = m_HistoBorders[i];
70 
71  TH1 *h_out = new TH1D("h_out", "h_out", m_HistoBorders.size() - 1, bins);
72  for (int b = 1; b <= h_out->GetNbinsX(); b++)
73  h_out->SetBinContent(b, m_HistoContents[b - 1]);
74 
75  delete[] bins;
76 
77  return h_out;
78 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

boost::thread_specific_ptr<MsgStream> m_msg_tls ISF_FCS::MLogging::ATLAS_THREAD_SAFE
inlinestaticprivateinherited

Do not persistify!

MsgStream instance (a std::cout like with print-out levels)

Definition at line 215 of file MLogging.h.

◆ m_HistoBorders

std::vector<float> TFCS1DFunctionHistogram::m_HistoBorders
protected

Definition at line 41 of file TFCS1DFunctionHistogram.h.

◆ m_HistoContents

std::vector<float> TFCS1DFunctionHistogram::m_HistoContents
protected

Definition at line 42 of file TFCS1DFunctionHistogram.h.

◆ m_nm

std::string ISF_FCS::MLogging::m_nm
privateinherited

Message source name.

Definition at line 211 of file MLogging.h.


The documentation for this class was generated from the following files:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
ISF_FCS::MLogging
Cut down AthMessaging.
Definition: MLogging.h:176
checkFileSG.line
line
Definition: checkFileSG.py:75
TFCS1DFunctionHistogram::rnd_to_fct
virtual double rnd_to_fct(double rnd) const
Function gets random number rnd in the range [0,1) as argument and returns function value.
Definition: TFCS1DFunctionHistogram.cxx:223
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
integral
double integral(TH1 *h)
Definition: computils.cxx:57
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
index
Definition: index.py:1
ISF_FCS::MLogging::level
MSG::Level level() const
Retrieve output level.
Definition: MLogging.h:201
TFCS1DFunctionHistogram::vector_to_histo
TH1 * vector_to_histo()
Definition: TFCS1DFunctionHistogram.cxx:65
plotmaker.hist
hist
Definition: plotmaker.py:148
plotBeamSpotCompare.x2
x2
Definition: plotBeamSpotCompare.py:218
TFCS1DFunction::rnd_to_fct
virtual void rnd_to_fct(float value[], const float rnd[]) const
Function gets array of random numbers rnd[] in the range [0,1) as arguments and returns function valu...
Definition: TFCS1DFunction.cxx:17
bin
Definition: BinsDiffFromStripMedian.h:43
mc.diff
diff
Definition: mc.SFGenPy8_MuMu_DD.py:14
TFCS1DFunctionHistogram::smart_rebin
static TH1D * smart_rebin(TH1D *)
Definition: TFCS1DFunctionHistogram.cxx:164
athena.value
value
Definition: athena.py:124
TFCS1DFunctionHistogram::m_HistoContents
std::vector< float > m_HistoContents
Definition: TFCS1DFunctionHistogram.h:42
TFCS1DFunctionHistogram::smart_rebin_loop
void smart_rebin_loop(TH1 *hist, double)
Definition: TFCS1DFunctionHistogram.cxx:80
x
#define x
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
SCT_CalibAlgs::nbins
@ nbins
Definition: SCT_CalibNumbers.h:10
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
makeTRTBarrelCans.y1
tuple y1
Definition: makeTRTBarrelCans.py:15
grepfile.content
string content
Definition: grepfile.py:56
TFCS1DFunctionHistogram::get_change
static double get_change(TH1 *)
Definition: TFCS1DFunctionHistogram.cxx:151
ISF_FCS::MLogging::msg
MsgStream & msg() const
Return a stream for sending messages directly (no decoration)
Definition: MLogging.h:231
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
TrigConf::MSGTC::ALWAYS
@ ALWAYS
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:29
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
makeTRTBarrelCans.y2
tuple y2
Definition: makeTRTBarrelCans.py:18
TFCS1DFunctionHistogram::non_linear
static double non_linear(double y1, double y2, double x1, double x2, double x)
Definition: TFCS1DFunctionHistogram.cxx:246
ISF_FCS::MLogging::m_nm
std::string m_nm
Message source name.
Definition: MLogging.h:211
file
TFile * file
Definition: tile_monitor.h:29
plotting.yearwise_luminosity_vs_mu.bins
bins
Definition: yearwise_luminosity_vs_mu.py:30
TFCS1DFunctionHistogram::m_HistoBorders
std::vector< float > m_HistoBorders
Definition: TFCS1DFunctionHistogram.h:38
TFCS1DFunctionHistogram::get_maxdev
static double get_maxdev(TH1 *, TH1D *)
Definition: TFCS1DFunctionHistogram.cxx:139
merge.output
output
Definition: merge.py:17
TrigConf::MSGTC::NUM_LEVELS
@ NUM_LEVELS
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:30
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
DeMoScan.index
string index
Definition: DeMoScan.py:364
a
TList * a
Definition: liststreamerinfos.cxx:10
ATH_MSG_NOCLASS
#define ATH_MSG_NOCLASS(logger_name, x)
Definition: MLogging.h:52
y
#define y
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
ref
const boost::regex ref(r_ef)
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
DeMoScan.first
bool first
Definition: DeMoScan.py:536
TFCS1DFunctionHistogram::histo_to_array
static std::unique_ptr< double[]> histo_to_array(TH1 *)
Definition: TFCS1DFunctionHistogram.cxx:25
TFCS1DFunctionHistogram::Initialize
void Initialize(TH1 *hist, double)
Definition: TFCS1DFunctionHistogram.cxx:20
TrigConf::MSGTC::NIL
@ NIL
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:22
skip
bool skip
Definition: TrigGlobEffCorrValidation.cxx:190
plotBeamSpotCompare.histo
histo
Definition: plotBeamSpotCompare.py:415
TFCS1DFunctionHistogram::get_inverse
double get_inverse(double rnd) const
Definition: TFCS1DFunctionHistogram.cxx:260
python.iconfTool.gui.pad.logger
logger
Definition: pad.py:14
ymax
double ymax
Definition: listroot.cxx:64