1 #ifndef ValueQuantity_h 2 #define ValueQuantity_h 6 #include "boost/unordered_map.hpp" 7 #include "boost/foreach.hpp" 64 const std::map<ValueQuantityType, std::string>
name_value = {
313 virtual int nbins() {
return _flags.size();}
314 virtual double min() {
return 0;}
315 virtual double max() {
return _flags.size();}
320 std::vector<std::string> vnames;
321 for (std::vector<flag::Flag>::const_iterator
322 it=_flags.begin(); it!=_flags.end(); ++it)
323 vnames.push_back(it->_name);
347 virtual double min() {
return 1;}
348 virtual double max() {
return _n+1;}
368 virtual int nbins() {
return _runs.size();}
369 virtual double min() {
return 0;}
370 virtual double max() {
return _runs.size();}
374 std::vector<std::string>
labels;
375 for (uint32_t
i=0;
i<_runs.size();
i++)
377 sprintf(name,
"%d", _runs[
i]);
378 labels.push_back(name);
385 for (uint32_t
i=0;
i<_runs.size();
i++)
394 <<
"run number doens't exist " <<
run;
418 virtual int nbins() {
return _nevents;}
419 virtual double min() {
return 0.5;}
420 virtual double max() {
return _nevents+0.5;}
432 {this->
setup(vtypes);}
435 virtual void setup(std::vector<uint32_t>
const& vtypes)
437 std::cout <<
"SIZE = " << vtypes.size() << std::endl;
438 for (uint32_t
i=0;
i<vtypes.size();
i++)
439 _types.insert(std::make_pair((uint32_t)vtypes[
i], i));
443 return _types[(uint32_t)v];
450 virtual int nbins() {
return _types.size();}
451 virtual double min() {
return 0;}
452 virtual double max() {
return _types.size();}
456 typedef boost::unordered_map<uint32_t, int>
TypeMap;
462 std::vector<std::string>
labels(_types.size());
463 std::cout <<
"SIZE = " << _types.size() << std::endl;
473 std::vector<uint32_t> vtypes;
476 vtypes.push_back(p.first);
479 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()
virtual int getValue(int x)
FlagQuantity(std::vector< flag::Flag > const &flags)
def setup(process, global_tag, zero_tesla=False)
std::vector< Variable::Flags > flags
virtual std::string name()
virtual void setup(std::vector< uint32_t > const &vtypes)
std::string ogtype2string(OrbitGapType type)
virtual void setLS(TH1 *o)
virtual LumiSection * makeCopy()
const std::map< ValueQuantityType, double > min_value
virtual std::string name()
virtual EventType * makeCopy()
virtual std::string name()
virtual int getValue(int run)
virtual std::vector< std::string > getLabels()
virtual std::string name()
Container::value_type value_type
boost::unordered_map< uint32_t, int > TypeMap
virtual void setMax(double x)
virtual uint32_t getBin(int run)
std::vector< flag::Flag > _flags
virtual uint32_t getBin(int l)
virtual int getValue(int v)
virtual ValueQuantity * makeCopy()
virtual int getValue(int f)
virtual uint32_t getBin(int f)
virtual double getValue(double x)
virtual std::vector< std::string > getLabels()
virtual FlagQuantity * makeCopy()
const std::map< ValueQuantityType, std::string > name_value
virtual uint32_t getBin(int v)
virtual void setBits(TH1 *o)
EventType(std::vector< uint32_t > const &vtypes)
const std::map< ValueQuantityType, double > max_value
RunNumber(std::vector< int > runs)
virtual QuantityType type()
virtual std::string name()
virtual std::vector< std::string > getLabels()
virtual int getValue(int l)