ATLAS Offline Software
TrigHisto2D_v1.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef xAODTrigMinBias_TrigHisto2D_V1_H
6 #define xAODTrigMinBias_TrigHisto2D_V1_H
7 
9 
10 namespace xAOD {
11 
12  namespace TrigHistoCutType {
13  enum CutTypeEnum {
20  }
21 // class MsgStream;
22 
23  class TrigHisto2D_v1 : public SG::AuxElement {
24  public:
26 
29 
31  TrigHisto2D_v1(unsigned int nbins_x, float min_x, float max_x, unsigned int nbins_y, float min_y, float max_y);
36  const std::vector<float>& contents() const;
37 
38  unsigned int nbinsX() const;
39 
41  float minX()const ;
42 
44  float maxX() const;
45 
48  unsigned int nbinsY() const;
49 
51  float minY() const;
52 
54  float maxY() const;
55 
57  void initialize(unsigned int nbins_x, float min_x, float max_x, unsigned int nbins_y, float min_y, float max_y);
58 
60  void fill(float value_x, float value_y, float weight);
61 
63  //double sumEntries(float value_x, float value_y, int cutType);
64 
66  // it's not very efficient ;/
67  std::vector<float> profileX() const;
68 
70  std::vector<float> profileY() const;
71 
73  double sumEntries(float value_x, float value_y, int cutType) const;
74 
76  void clear();
77 
79  void dump();
80 
81 // void setMsgStream(MsgStream&);
82 
84  void setContents(const std::vector<float> &cont);
85 
86  void setMinX(float val);
87 
88  void setMaxX(float val);
89 
91  void setNbinsX(unsigned int nx);
92 
93  void setMinY(float val);
94 
95  void setMaxY(float val);
96 
98  void setNbinsY(unsigned int ny);
99 
100  private:
102  unsigned int findBinX(float val) const;
103 
105  unsigned int findBinY(float val) const;
106 
108  static const int EXTRA_BINS=2;
109 
110  /*width of x bins*/
111  float m_binWidthX = 0.0F;
112 
113  /*width of y bins*/
114  float m_binWidthY = 0.0F;
115  };
116 
117 }
118 
119 #endif
xAOD::TrigHistoCutType::BELOW_X_BELOW_Y
@ BELOW_X_BELOW_Y
Definition: TrigHisto2D_v1.h:16
xAOD::TrigHisto2D_v1::m_binWidthX
float m_binWidthX
Definition: TrigHisto2D_v1.h:111
xAOD::TrigHistoCutType::ABOVE_X_ABOVE_Y
@ ABOVE_X_ABOVE_Y
Definition: TrigHisto2D_v1.h:19
xAOD::TrigHisto2D_v1::TrigHisto2D_v1
TrigHisto2D_v1()
Definition: TrigHisto2D_v1.cxx:16
xAOD::TrigHisto2D_v1::findBinX
unsigned int findBinX(float val) const
returns x bin index
Definition: TrigHisto2D_v1.cxx:171
xAOD::TrigHistoCutType::CutTypeEnum
CutTypeEnum
Definition: TrigHisto2D_v1.h:13
xAOD::TrigHisto2D_v1::profileY
std::vector< float > profileY() const
Collapse the x-axis and return a profile from the y-axis.
Definition: TrigHisto2D_v1.cxx:98
SG::AuxElement
Base class for elements of a container that can have aux data.
Definition: AuxElement.h:483
xAOD::TrigHisto2D_v1::maxX
float maxX() const
Return the maximum along the x-axis.
xAOD::TrigHisto2D_v1::setMinY
void setMinY(float val)
xAOD::TrigHisto2D_v1::nbinsX
unsigned int nbinsX() const
xAOD::TrigHisto2D_v1::setMinX
void setMinX(float val)
xAOD::TrigHisto2D_v1::findBinY
unsigned int findBinY(float val) const
returns y bin index
Definition: TrigHisto2D_v1.cxx:189
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::TrigHisto2D_v1::setContents
void setContents(const std::vector< float > &cont)
contents setter
xAOD::TrigHistoCutType::ABOVE_X
@ ABOVE_X
Definition: TrigHisto2D_v1.h:15
xAOD::TrigHisto2D_v1::sumEntries
double sumEntries(float value_x, float value_y, int cutType) const
Sum the number of entries within the cut range.
Definition: TrigHisto2D_v1.cxx:111
xAOD::TrigHisto2D_v1::setMaxX
void setMaxX(float val)
xAOD::TrigHisto2D_v1::setNbinsY
void setNbinsY(unsigned int ny)
NbinsY setter.
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
xAOD::TrigHisto2D_v1::initialize
void initialize(unsigned int nbins_x, float min_x, float max_x, unsigned int nbins_y, float min_y, float max_y)
creates empty histogram
Definition: TrigHisto2D_v1.cxx:37
xAOD::TrigHisto2D_v1::setMaxY
void setMaxY(float val)
xAOD::TrigHistoCutType::BELOW_X_ABOVE_Y
@ BELOW_X_ABOVE_Y
Definition: TrigHisto2D_v1.h:18
xAOD::TrigHisto2D_v1::~TrigHisto2D_v1
~TrigHisto2D_v1()
Destructor.
Definition: TrigHisto2D_v1.cxx:25
xAOD::TrigHisto2D_v1::nbinsY
unsigned int nbinsY() const
Return the number of bins along the y-axis, not including the under and overflow.
TrigHistoCutType
Definition: TrigHisto.h:12
xAOD::TrigHisto2D_v1::minY
float minY() const
Return the minimum along the y-axis.
xAOD::TrigHisto2D_v1::m_binWidthY
float m_binWidthY
Definition: TrigHisto2D_v1.h:114
xAOD::TrigHisto2D_v1::setNbinsX
void setNbinsX(unsigned int nx)
NbinsX setter.
xAOD::TrigHisto2D_v1::minX
float minX() const
Return the minimum along the x-axis.
xAOD::TrigHistoCutType::ABOVE_X_BELOW_Y
@ ABOVE_X_BELOW_Y
Definition: TrigHisto2D_v1.h:17
xAOD::TrigHisto2D_v1::dump
void dump()
dump() function, for testing
Definition: TrigHisto2D_v1.cxx:214
xAOD::TrigHisto2D_v1::profileX
std::vector< float > profileX() const
Sum the number of entries within the cut range.
Definition: TrigHisto2D_v1.cxx:85
xAOD::TrigHisto2D_v1::fill
void fill(float value_x, float value_y, float weight)
fill histogram
Definition: TrigHisto2D_v1.cxx:73
xAOD::TrigHistoCutType::BELOW_X
@ BELOW_X
Definition: TrigHisto2D_v1.h:14
xAOD::TrigHisto2D_v1::maxY
float maxY() const
Return the maximum along the y-axis.
xAOD::TrigHisto2D_v1::EXTRA_BINS
static const int EXTRA_BINS
additional bins for underflow and overflow bins
Definition: TrigHisto2D_v1.h:108
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
xAOD::TrigHisto2D_v1::clear
void clear()
clear m_contents vector
Definition: TrigHisto2D_v1.cxx:207
xAOD::TrigHisto2D_v1
Definition: TrigHisto2D_v1.h:23
AuxElement.h
Base class for elements of a container that can have aux data.
xAOD::TrigHisto2D_v1::contents
const std::vector< float > & contents() const
Fill a 2D histogram.