本文整理汇总了C++中KVNameValueList::GetDoubleValue方法的典型用法代码示例。如果您正苦于以下问题:C++ KVNameValueList::GetDoubleValue方法的具体用法?C++ KVNameValueList::GetDoubleValue怎么用?C++ KVNameValueList::GetDoubleValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KVNameValueList
的用法示例。
在下文中一共展示了KVNameValueList::GetDoubleValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initialize
void KVRangeYanezMaterial::Initialize()
{
KVIonRangeTableMaterial::Initialize();
if(IsCompound()){
fNelem=0;
iabso=-1;
TIter next(fComposition);
KVNameValueList* nvl;
while( (nvl = (KVNameValueList*)next()) ){
fAbsorb[fNelem].z = nvl->GetIntValue("Z");
fAbsorb[fNelem].a = nvl->GetIntValue("A");
fAbsorb[fNelem].w = nvl->GetDoubleValue("Ar*Weight");
fNelem++;
}
}
else if(IsMixture()){
fNelem=0;
iabso=-1;
TIter next(fComposition);
KVNameValueList* nvl;
while( (nvl = (KVNameValueList*)next()) ){
fAbsorb[fNelem].z = nvl->GetIntValue("Z");
fAbsorb[fNelem].a = nvl->GetIntValue("A");
fAbsorb[fNelem].w = nvl->GetDoubleValue("Ar*Weight");
fNelem++;
}
}
}
示例2: GetTGeoMaterial
TGeoMaterial* KVIonRangeTableMaterial::GetTGeoMaterial() const
{
// Create and return pointer to a TGeoMaterial or TGeoMixture (for compound materials)
// with the properties of this material.
// gGeoManager must exist.
TGeoMaterial* gmat = 0x0;
if (!gGeoManager) return gmat;
if (IsCompound()) {
gmat = new TGeoMixture(GetTitle(), GetComposition()->GetEntries(), GetDensity());
TIter next(GetComposition());
KVNameValueList* nvl;
while ((nvl = (KVNameValueList*)next())) {
KVNucleus n(nvl->GetIntValue("Z"), nvl->GetIntValue("A"));
TGeoElement* gel = gGeoManager->GetElementTable()->FindElement(n.GetSymbol("EL"));
float poids = nvl->GetDoubleValue("NormWeight");
((TGeoMixture*)gmat)->AddElement(gel, poids);
}
}
else {
gmat = new TGeoMaterial(GetTitle(), GetMass(), GetZ(), GetDensity());
}
// set state of material
if (IsGas()) gmat->SetState(TGeoMaterial::kMatStateGas);
else gmat->SetState(TGeoMaterial::kMatStateSolid);
return gmat;
}
示例3: Initialize
void KVIonRangeTableMaterial::Initialize()
{
// Correctly initialize material ready for use
// For compound or mixed materials, calculate normalised weights of components,
// effective Z and A, and molar weight of substance
fMoleWt = 0.;
if (IsCompound() || IsMixture()) {
// mixture or compound
// calculate molar weight and effective Z & A
fZmat = fAmat = 0;
TIter next(fComposition);
KVNameValueList* nvl;
Double_t totW = 0;
while ((nvl = (KVNameValueList*)next())) {
Double_t arw = nvl->GetDoubleValue("Ar*Weight");
Double_t poid = nvl->GetDoubleValue("Weight");
fMoleWt += arw;
totW += poid;
fZmat += poid * nvl->GetIntValue("Z");
fAmat += poid * nvl->GetIntValue("A");
}
fZmat /= totW;
fAmat /= totW;
next.Reset();
while ((nvl = (KVNameValueList*)next())) {
Double_t prop = nvl->GetDoubleValue("Weight");
nvl->SetValue("NormWeight", prop / totW);
}
}
else {
// isotopically-pure elemental material
// get mass of 1 mole of element
KVNucleus n(fZmat, fAmat);
fMoleWt = n.GetAtomicMass();
}
}
示例4: PrintComposition
void KVIonRangeTableMaterial::PrintComposition(ostream& output) const
{
// Print to stream the composition of this material, in a format compatible with the VEDALOSS parameter file.
if (IsCompound()) output << "COMPOUND";
else if (IsMixture()) output << "MIXTURE";
else output << "ELEMENT";
output << endl;
if (IsCompound() || IsMixture()) {
output << fComposition->GetEntries() << endl;
TIter next(fComposition);
KVNameValueList* nvl;
while ((nvl = (KVNameValueList*)next())) {
KVNucleus n(nvl->GetIntValue("Z"), nvl->GetIntValue("A"));
output << n.GetZ() << " " << n.GetA() << " " << nvl->GetIntValue("Natoms");
if (IsMixture()) output << " " << nvl->GetDoubleValue("Proportion");
output << endl;
}
}
}
示例5: Print
void KVIonRangeTableMaterial::Print(Option_t*) const
{
printf("Material : %s (%s) State : %s\n",
GetName(), GetSymbol(), fState.Data());
printf("\tEffective Z=%f, A=%f ", fZmat, fAmat);
if (IsGas()) printf(" Molar Weight = %f g.", fMoleWt);
else printf(" Density = %f g/cm**3", fDens);
printf("\n");
if (IsCompound()) printf("\tCompound material:\n");
else if (IsMixture()) printf("\tMixed material:\n");
if (IsCompound() || IsMixture()) {
TIter next(fComposition);
KVNameValueList* nvl;
while ((nvl = (KVNameValueList*)next())) {
KVNucleus n(nvl->GetIntValue("Z"), nvl->GetIntValue("A"));
printf("\t\tElement: %s Ar=%f g. Natoms=%d", n.GetSymbol(), n.GetAtomicMass(), nvl->GetIntValue("Natoms"));
if (IsMixture()) printf(" Proportion=%f", nvl->GetDoubleValue("Proportion"));
printf("\n");
}
}
printf("\n\n");
}