3 #include "CLHEP/Units/GlobalSystemOfUnits.h" 14 :
Name(name),SymbolName(symbol),
Value(value)
67 return (
this == &right);
74 return (
this != &right);
92 for (
size_t j=0;j<units.size();j++)
93 { name=units[j]->GetName(); symbol=units[j]->GetSymbol();
94 if(str==name||str==symbol)
95 return units[j]->GetValue();
98 std::cout <<
"Warning from CocoaUnitDefinition::GetValueOf(" << str <<
")." 99 <<
" The unit " << str <<
" does not exist in UnitsTable." 100 <<
" Return Value = 0." << std::endl;
112 for (
size_t j=0;j<units.size();j++)
113 { name=units[j]->GetName(); symbol=units[j]->GetSymbol();
114 if(str==name||str==symbol)
118 std::cout <<
"Warning from CocoaUnitDefinition::GetCategory(" << str <<
")." 119 <<
" The unit " << str <<
" does not exist in UnitsTable." 120 <<
" Return category = None" << std::endl;
255 std::cout <<
"\n ----- The Table of Units ----- \n";
265 :
Name(name),UnitsList(),NameMxLen(0),SymbMxLen(0)
300 return (
this == &right);
307 return (
this != &right);
326 size_t nbCat = theUnitsTable.size();
329 ((i<nbCat)&&(theUnitsTable[i]->
GetName()!=category)) i++;
331 {
std::cout <<
" CocoaBestUnit: the category " << category
332 <<
" does not exist !!" << nbCat << std::endl;
341 if(category ==
"Length" ) {
354 size_t nbCat = theUnitsTable.size();
357 ((i<nbCat)&&(theUnitsTable[i]->
GetName()!=category)) i++;
359 {
std::cerr <<
" CocoaBestUnit: the category " << category
360 <<
" does not exist." << std::endl;
366 Value[0] = value.x();
367 Value[1] = value.y();
368 Value[2] = value.z();
384 ALIint ksup(-1), kinf(-1);
392 for (
size_t k=0;
k<List.size();
k++)
399 if ((ratio>=1.)&&(ratio<rsup)) {rsup=
ratio; ksup=
k;}
400 if ((ratio< 1.)&&(ratio>rinf)) {rinf=
ratio; kinf=
k;}
404 ALIint index=ksup;
if(index==-1) index=kinf;
if(index==-1) index=0;
407 {flux << a.
Value[j]/(List[
index]->GetValue()) <<
" ";}
409 std::ios::fmtflags oldform = flux.flags();
411 flux.setf(std::ios::left,std::ios::adjustfield);
412 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)