1 #ifndef ValueQuantity_h 2 #define ValueQuantity_h 6 #include "boost/unordered_map.hpp" 7 #include "boost/foreach.hpp" 66 const std::map<ValueQuantityType, std::string>
name_value = {
294 double min()
override {
return min_value.at(
_type);}
295 double max()
override {
return max_value.at(
_type);}
326 int nbins()
override {
return _flags.size();}
327 double min()
override {
return 0;}
328 double max()
override {
return _flags.size();}
333 std::vector<std::string> vnames;
334 for (std::vector<flag::Flag>::const_iterator
335 it=_flags.begin(); it!=_flags.end(); ++it)
336 vnames.push_back(it->_name);
360 double min()
override {
return 1;}
361 double max()
override {
return _n+1;}
381 int nbins()
override {
return _runs.size();}
382 double min()
override {
return 0;}
383 double max()
override {
return _runs.size();}
387 std::vector<std::string>
labels;
388 for (uint32_t
i=0;
i<_runs.size();
i++)
390 sprintf(name,
"%d", _runs[
i]);
391 labels.push_back(name);
398 for (uint32_t
i=0;
i<_runs.size();
i++)
407 <<
"run number doens't exist " <<
run;
431 int nbins()
override {
return _nevents;}
432 double min()
override {
return 0.5;}
433 double max()
override {
return _nevents+0.5;}
445 {this->
setup(vtypes);}
448 virtual void setup(std::vector<uint32_t>
const& vtypes)
450 std::cout <<
"SIZE = " << vtypes.size() << std::endl;
451 for (uint32_t
i=0;
i<vtypes.size();
i++)
452 _types.insert(std::make_pair((uint32_t)vtypes[
i], i));
456 return _types[(uint32_t)v];
463 int nbins()
override {
return _types.size();}
464 double min()
override {
return 0;}
465 double max()
override {
return _types.size();}
469 typedef boost::unordered_map<uint32_t, int>
TypeMap;
475 std::vector<std::string>
labels(_types.size());
476 std::cout <<
"SIZE = " << _types.size() << std::endl;
486 std::vector<uint32_t> vtypes;
489 vtypes.push_back(p.first);
492 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
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)
std::vector< Variable::Flags > flags
virtual void setup(std::vector< uint32_t > const &vtypes)
std::string ogtype2string(OrbitGapType type)
virtual void setLS(TH1 *o)
int getValue(int run) override
const std::map< ValueQuantityType, double > min_value
~ValueQuantity() override
std::string name() override
int getValue(int f) override
FlagQuantity * makeCopy() override
Container::value_type value_type
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
void setMax(double x) override
std::vector< std::string > getLabels() override
const std::map< ValueQuantityType, std::string > name_value
EventType * makeCopy() 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
LumiSection * makeCopy() 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