22 initialize(nbins_x, min_x, max_x, nbins_y, min_y, max_y);
37 void
TrigHisto2D_v1::
initialize(
unsigned int nbins_x,
float min_x,
float max_x,
unsigned int nbins_y,
float min_y,
float max_y){
75 unsigned int ibin_x =
findBinX(value_x);
76 unsigned int ibin_y =
findBinY(value_y);
82 acc_contents(*this).at(ibin)+= weight;
113 unsigned int ibin, ibin_x, ibin_y, ibin_x_selected, ibin_y_selected;
119 ibin_x_selected =
findBinX(value_x);
122 ibin_y_selected =
findBinY(value_y);
132 for(ibin_x = 0; ibin_x <= ibin_x_selected; ibin_x++) {
133 for(ibin_y = 0; ibin_y <= ibin_y_selected; ibin_y++) {
134 ibin = ibin_y*(
nbinsX()+2) + ibin_x;
135 entries += acc_contents(*this).at(ibin);
141 for(ibin_y = 0; ibin_y <= ibin_y_selected; ibin_y++) {
143 entries += acc_contents(*this).at(ibin);
148 for(ibin_x = 0; ibin_x <= ibin_x_selected; ibin_x++) {
151 entries += acc_contents(*this).at(ibin);
159 entries += acc_contents(*this).at(ibin);
173 unsigned int ibin = 0;
178 else if( !(value <
maxX()) ) {
191 unsigned int ibin = 0;
196 else if( !(value <
maxY()) ) {
210 for(std::vector<float>::iterator contents_iter = acc_contents(*this).begin(); contents_iter !=acc_contents(*this).end(); ++contents_iter)
217 std::cout<<
"Dump contets vector of size:: "<<acc_contents(*this).size()<<std::endl;
218 for(
unsigned int i = 0 ; i < acc_contents(*this).size(); i++)
219 std::cout<<acc_contents(*this).at(i)<<
" ";
220 std::cout<<std::endl;
222 std::cout<<
"NbinX:: "<<
nbinsX()<<
"\tRangeX:: ["<<
minX()<<
","<<
maxX()<<
"]"<<std::endl;
223 std::cout<<
"NbinY:: "<<
nbinsY()<<
"\tRangeY:: ["<<
minY()<<
","<<
maxY()<<
"]"<<std::endl;
227 std::cout<<std::endl;
232 std::cout<<std::endl;
#define AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of primitive auxiliary properties.
#define AUXSTORE_OBJECT_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of complex auxiliary properties.
void makePrivateStore()
Create a new (empty) private store for this object.
bool hasStore() const
Return true if this object has an associated store.
SG::Accessor< T, ALLOC > Accessor
AuxElement()
Default constructor.
void setNbinsX(unsigned int nx)
NbinsX setter.
double sumEntries(float value_x, float value_y, int cutType) const
Sum the number of entries within the cut range.
unsigned int findBinY(float val) const
returns y bin index
float maxY() const
Return the maximum along the y-axis.
unsigned int nbinsY() const
Return the number of bins along the y-axis, not including the under and overflow.
float maxX() const
Return the maximum along the x-axis.
void fill(float value_x, float value_y, float weight)
fill histogram
std::vector< float > profileY() const
Collapse the x-axis and return a profile from the y-axis.
~TrigHisto2D_v1()
Destructor.
void setContents(const std::vector< float > &cont)
contents setter
void clear()
clear m_contents vector
void dump()
dump() function, for testing
static const int EXTRA_BINS
additional bins for underflow and overflow bins
unsigned int findBinX(float val) const
returns x bin index
float minX() const
Return the minimum along the x-axis.
std::vector< float > profileX() const
Sum the number of entries within the cut range.
float minY() const
Return the minimum along the y-axis.
void setNbinsY(unsigned int ny)
NbinsY setter.
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
unsigned int nbinsX() const
void contents(std::vector< std::string > &keys, TDirectory *td, const std::string &directory, const std::string &pattern, const std::string &path)
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.