1 #ifndef ValueQuantity_h 2 #define ValueQuantity_h 6 #include "boost/unordered_map.hpp" 70 const std::map<ValueQuantityType, std::string>
name_value = {
323 }
else if (x >
max()) {
334 }
else if (x >
max()) {
344 double min()
override {
return min_value.at(
_type); }
345 double max()
override {
return max_value.at(
_type); }
373 int nbins()
override {
return _flags.size(); }
374 double min()
override {
return 0; }
375 double max()
override {
return _flags.size(); }
377 uint32_t
getBin(
int f)
override {
return f + 1; }
379 std::vector<std::string> vnames;
380 for (std::vector<flag::Flag>::const_iterator it = _flags.begin(); it != _flags.end(); ++it)
381 vnames.push_back(it->_name);
400 double min()
override {
return 1; }
401 double max()
override {
return _n + 1; }
404 void setMax(
double x)
override { _n = x; }
422 int nbins()
override {
return (_n + _binning - 1) / _binning; }
423 double min()
override {
return 1; }
424 double max()
override {
return _n + 1; }
426 uint32_t
getBin(
int l)
override {
return (l + _binning - 1) / _binning; }
427 void setMax(
double x)
override { _n = x; }
441 int nbins()
override {
return _runs.size(); }
442 double min()
override {
return 0; }
443 double max()
override {
return _runs.size(); }
446 std::vector<std::string>
labels;
447 for (uint32_t
i = 0;
i < _runs.size();
i++) {
448 sprintf(name,
"%d", _runs[
i]);
449 labels.push_back(name);
455 for (uint32_t
i = 0;
i < _runs.size();
i++)
456 if (_runs[
i] == run) {
480 int nbins()
override {
return _nevents; }
481 double min()
override {
return 0.5; }
482 double max()
override {
return _nevents + 0.5; }
494 virtual void setup(std::vector<uint32_t>
const &vtypes) {
495 std::cout <<
"SIZE = " << vtypes.size() << std::endl;
496 for (uint32_t
i = 0;
i < vtypes.size();
i++)
497 _types.insert(std::make_pair((uint32_t)vtypes[
i], i));
499 int getValue(
int v)
override {
return _types[(uint32_t)v]; }
502 int nbins()
override {
return _types.size(); }
503 double min()
override {
return 0; }
504 double max()
override {
return _types.size(); }
508 typedef boost::unordered_map<uint32_t, int>
TypeMap;
513 std::vector<std::string>
labels(_types.size());
514 std::cout <<
"SIZE = " << _types.size() << std::endl;
515 for (
auto const &
v : _types) {
521 std::vector<uint32_t> vtypes;
522 for (
auto const &
p : _types) {
523 vtypes.push_back(
p.first);
526 std::sort(vtypes.begin(), vtypes.end());
ValueQuantity(ValueQuantityType type, bool isLog=false)
const std::map< ValueQuantityType, int > nbins_value
virtual void setBits(TH1 *o)
virtual std::string name()
std::string name() override
int getValue(int l) override
LumiSectionCoarse(int n, int binning)
uint32_t getBin(int run) override
FlagQuantity(std::vector< flag::Flag > const &flags)
std::vector< std::string > getLabels() override
uint32_t getBin(int v) override
void setBits(TH1 *o) override
def setup(process, global_tag, zero_tesla=False)
LumiSectionCoarse * makeCopy() override
std::vector< Variable::Flags > flags
virtual void setup(std::vector< uint32_t > const &vtypes)
virtual void setLS(TH1 *o)
int getValue(int run) override
const std::map< ValueQuantityType, double > min_value
uint32_t getBin(int l) override
~ValueQuantity() override
std::string name() override
int getValue(int f) override
FlagQuantity * makeCopy() override
boost::unordered_map< uint32_t, int > TypeMap
std::vector< flag::Flag > _flags
std::string name() override
int getValue(int x) override
int getValue(int v) override
std::string ogtype2string(constants::OrbitGapType type)
void setMax(double x) override
std::vector< std::string > getLabels() override
const std::map< ValueQuantityType, std::string > name_value
EventType * makeCopy() override
void setMax(double x) override
std::string name() override
EventType(std::vector< uint32_t > const &vtypes)
QuantityType type() override
int getValue(int l) override
uint32_t getBin(int l) override
const std::map< ValueQuantityType, double > max_value
std::string name() override
LumiSection * makeCopy() override
~LumiSectionCoarse() override
RunNumber(std::vector< int > runs)
std::vector< std::string > getLabels() override
uint32_t getBin(int f) override
ValueQuantity * makeCopy() override
double getValue(double x) override
std::string name() override