3 #include "CLHEP/Units/GlobalSystemOfUnits.h" 16 :
Name(name), SymbolName(symbol),
Value(value) {
79 for (
size_t j = 0;
j < units.size();
j++) {
80 name = units[
j]->GetName();
81 symbol = units[
j]->GetSymbol();
82 if (str == name || str == symbol)
83 return units[
j]->GetValue();
86 std::cout <<
"Warning from CocoaUnitDefinition::GetValueOf(" << str <<
")." 87 <<
" The unit " << str <<
" does not exist in UnitsTable." 88 <<
" Return Value = 0." << std::endl;
100 for (
size_t j = 0;
j < units.size();
j++) {
101 name = units[
j]->GetName();
102 symbol = units[
j]->GetSymbol();
103 if (str == name || str == symbol)
107 std::cout <<
"Warning from CocoaUnitDefinition::GetCategory(" << str <<
")." 108 <<
" The unit " << str <<
" does not exist in UnitsTable." 109 <<
" Return category = None" << std::endl;
240 std::cout <<
"\n ----- The Table of Units ----- \n";
261 if (
this != &right) {
291 if (theUnitsTable.empty())
293 size_t nbCat = theUnitsTable.size();
295 while ((i < nbCat) && (theUnitsTable[i]->
GetName() != category))
298 std::cout <<
" CocoaBestUnit: the category " << category <<
" does not exist !!" << nbCat << std::endl;
309 if (category ==
"Length") {
321 size_t nbCat = theUnitsTable.size();
323 while ((i < nbCat) && (theUnitsTable[i]->
GetName() != category))
326 std::cerr <<
" CocoaBestUnit: the category " << category <<
" does not exist." << std::endl;
332 Value[0] = value.x();
333 Value[1] = value.y();
334 Value[2] = value.z();
347 ALIint ksup(-1), kinf(-1);
354 for (
size_t k = 0;
k < List.size();
k++) {
370 if ((ratio >= 1.) && (ratio < rsup)) {
374 if ((ratio < 1.) && (ratio > rinf)) {
388 flux << a.
Value[
j] / (List[
index]->GetValue()) <<
" ";
391 std::ios::fmtflags oldform = flux.flags();
393 flux.setf(std::ios::left, std::ios::adjustfield);
394 flux << std::setw(len) << List[
index]->GetSymbol();
std::vector< CocoaUnitDefinition * > CocoaUnitsContainer
ALIint operator!=(const CocoaUnitDefinition &) const
CocoaUnitsContainer UnitsList
static ALIstring GetCategory(const ALIstring &)
static void BuildUnitsTable()
CocoaUnitsCategory(const ALIstring &name)
static CocoaUnitsTable & GetUnitsTable()
ALIint operator!=(const CocoaUnitsCategory &) const
const ALIstring & GetName() const
CocoaUnitsCategory & operator=(const CocoaUnitsCategory &)
std::ostream & operator<<(std::ostream &flux, CocoaBestUnit a)
static void PrintUnitsTable()
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
U second(std::pair< T, U > const &p)
CocoaUnitDefinition(const ALIstring &name, const ALIstring &symbol, const ALIstring &category, ALIdouble value)
const ALIstring & GetName() const
CocoaUnitDefinition & operator=(const CocoaUnitDefinition &)
Abs< T >::type abs(const T &t)
reco::JetExtendedAssociation::JetExtendedData Value
CocoaBestUnit(ALIdouble internalValue, const ALIstring &category)
std::vector< CocoaUnitsCategory * > CocoaUnitsTable
static CocoaUnitsTable theUnitsTable
ALIint operator==(const CocoaUnitsCategory &) const
static ALIdouble GetValueOf(const ALIstring &)
ALIint operator==(const CocoaUnitDefinition &) const
TString units(TString variable, Char_t axis)
constexpr long double joule(6.24150e+12)
Basic3DVector unit() const