本文整理汇总了C++中KVString类的典型用法代码示例。如果您正苦于以下问题:C++ KVString类的具体用法?C++ KVString怎么用?C++ KVString使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KVString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: next_ps
void KVINDRAUpDater_e475s::SetPedestals(KVDBRun* kvrun)
{
KVRList *param_list = kvrun->GetLinks("Pedestals");
if (!param_list)
return;
if (!param_list->GetSize())
return;
KVDetector *det;
KVDBParameterSet *kvps;
TIter next_ps(param_list);
KVString str;
Double_t pied_value;
// Setting all pedestal values available
while ((kvps = (KVDBParameterSet *) next_ps())) { // boucle sur les parametres
str = kvps->GetName();
if ( (det = gIndra->GetDetector(str.Data())) ){
pied_value = kvps->GetParameter(1);
det->SetPedestal(kvps->GetTitle(),pied_value);
} //detector found
} //boucle sur les parameters
}
示例2: Update
//___________________________________________________________________________________________
void KVIntegerList::Update()
{
//protected method, Mise a jour du nom de la partition (via SetName()), de sa longueur (fLength)
//Le bit kHastobeComputed es mis à 0 pour indiquer que la mise à jour a été faite
//
KVString snom = "", stamp = "";
for (Int_t ii = fLimiteRegle; ii >= 0; ii -= 1) {
Int_t contenu = fRegle->At(ii);
if (contenu > 0) {
//Formattage du nom de la partition
stamp.Form("%d", ii);
snom += stamp;
if (contenu > 1) {
stamp.Form("(%d)", contenu);
snom += stamp;
}
snom += " ";
}
}
if (snom != "") snom.Remove(snom.Length() - 1);
SetName(snom.Data());
fLength = snom.Length();
SetBit(kHastobeComputed, kFALSE);
}
示例3: ReadHeader
Bool_t KVSimReader_SMF_asym::ReadHeader(){
KVString snom;
Int_t res = ReadLineAndCheck(1," ");
switch (res){
case 0:
return kFALSE;
case 1:
snom.Form("%s",GetReadPar(0).Data());
snom.ReplaceAll("evt_","");
//Info("ReadHeader","lecture %d",snom.Atoi());
nv->SetValue("event_number",snom.Atoi());
break;
default:
return kFALSE;
}
res = ReadLineAndCheck(1," ");
switch (res){
case 0:
return kFALSE;
case 1:
nv->SetValue("ndes",GetIntReadPar(0));
ndes = 0;
return kTRUE;
default:
return kFALSE;
}
}
示例4: SanitizeJobName
const Char_t* KV_CCIN2P3_GE::GetJobName() const
{
//Returns name of batch job, either during submission of batch jobs or when an analysis
//task is running in batch mode (access through gBatchSystem global pointer).
//
//In multi-job mode, the job name is generated from the base name set by SetJobName()
//plus the extension "_Rxxxx-yyyy" with "xxxx" and "yyyy" the number of the first and last run
//which will be analysed by the current job.
//
// Depending on the batch system, some sanitization of the jobname may be required
// e.g. to remove "illegal" characters from the jobname. This is done by SanitizeJobName()
// before the jobname is returned.
if (!fAnalyser) {
//stand-alone batch submission ?
fCurrJobName = fJobName;
}
else {
//replace any special symbols with their current values
fCurrJobName = fAnalyser->ExpandAutoBatchName(fJobName.Data());
if (MultiJobsMode() && !fAnalyser->BatchMode()) {
KVString tmp;
if (fCurrJobRunList.GetNValues() > 1)
tmp.Form("_R%d-%d", fCurrJobRunList.First(), fCurrJobRunList.Last());
else
tmp.Form("_R%d", fCurrJobRunList.First());
fCurrJobName += tmp;
}
}
SanitizeJobName();
return fCurrJobName.Data();
}
示例5: GetIngValue
//________________________________________________________________
Double_t KVCaloBase::GetIngValue(KVString name)
{
//return the value of a name given ingredient
//if it is not defined return 0
if (!nvl_ing->HasParameter(name.Data())) return 0;
return nvl_ing->GetDoubleValue(name.Data());
}
示例6: wrkdir
void KV_CCIN2P3_GE::ChangeDefJobOpt(KVDataAnalyser* da)
{
// PRIVATE method called by SubmitTask() at moment of job submission.
// Depending on the current environment, the default job submission options
// may be changed by this method.
//
// This method overrides and augments KVBatchSystem::ChangeDefJobOpt (which
// changes the options as a function of the type of analysis task).
// Here we add the CCIN2P3-specific case where the job is launched from a directory
// on the /sps/ semi-permanent storage facility, or if the data being analysed is
// stored in a repository on /sps/. In this case we need to add
// the option '-l u_sps_indra' to the 'qsub' command (if not already in the
// default job options)
//
KVBatchSystem::ChangeDefJobOpt(da);
KVString taskname = da->GetAnalysisTask()->GetName();
KVString rootdir = da->GetRootDirectoryOfDataToAnalyse();
Bool_t repIsSPS = rootdir.BeginsWith("/sps/");
KVString wrkdir(gSystem->WorkingDirectory());
KVString oldoptions(GetDefaultJobOptions());
if (!oldoptions.Contains("sps")) {
Bool_t NeedToAddSPS = wrkdir.Contains("/sps/");
if ((NeedToAddSPS || repIsSPS)) {
oldoptions += " -l sps=1";
SetDefaultJobOptions(oldoptions.Data());
Info("ChangeDefJobOpt",
"Your job is being launched from /sps/... zone.\nTherefore the ressource 'sps' has been declared and the number of jobs which can be treated concurrently will be limited.");
}
}
}
示例7: Info
void KVSimDir::AnalyseDirectory()
{
// Read contents of directory given to ctor.
// Each ROOT file will be analysed by AnalyseFile().
Info("AnalyseDirectory", "Analysing %s...", GetDirectory());
fSimData.Clear();
fFiltData.Clear();
//loop over files in current directory
TSystemDirectory thisDir(".", GetDirectory());
TList* fileList = thisDir.GetListOfFiles();
TIter nextFile(fileList);
TSystemFile* aFile = 0;
while ((aFile = (TSystemFile*)nextFile())) {
if (aFile->IsDirectory()) continue;
KVString fileName = aFile->GetName();
if (!fileName.EndsWith(".root")) continue; /* skip non-ROOT files */
AnalyseFile(fileName);
}
delete fileList;
}
示例8: Warning
//___________________________________________________________________________________________
void KVValues::DefineAdditionalValue(KVString name, KVString expr)
{
if (HasParameter(name.Data())) {
Warning("DefineAdditionalValue", "le nom de variable %s est deja utilise", name.Data());
return;
}
KVString expr2 = expr;
KVNumberList* nl = TransformExpression(expr2);
if (nl) {
if (nl->IsEmpty()) {
Warning("DefineAdditionalValue", "la KVNumberList est vide #%s#", nl->GetList());
}
else {
if (AddFormula(name, expr2)) {
LinkParameters(nl);
ComputeAdditionalValues(kval_add - 1, kval_add);
}
}
}
else {
Error("DefineAdditionalValue", "La traduction de l'expression %s a echouee", expr.Data());
}
}
示例9: KVIonRangeTable
KVRangeYanez::KVRangeYanez()
: KVIonRangeTable("RANGE",
"Interface to Range dE/dx and range library (Ricardo Yanez)")
{
// Default constructor
// Predefined materials are created based on the contents of the file(s) whose
// names are given as values of the variable KVRangeYanez.PredefMaterials.
// A default file is specified in the main .kvrootrc file.
// If you want to add your own definitions, just put in your .kvrootrc:
//+RANGE.PredefMaterials: myfile1.dat
//+RANGE.PredefMaterials: myfile2.dat
// If you want to override the default definitions:
//RANGE.PredefMaterials: myfile1.dat
//+RANGE.PredefMaterials: myfile2.dat
KVString DataFilePaths = gEnv->GetValue("RANGE.PredefMaterials", "");
DataFilePaths.Begin(" ");
KVString nextPath;
KVString lastPath;
while (!DataFilePaths.End()) {
nextPath = DataFilePaths.Next();
if (nextPath == lastPath) break; //check for double occurrence of last file : TEnv bug?
lastPath = nextPath;
ReadPredefinedMaterials(nextPath);
}
}
示例10: job
void KV_CCIN2P3_GE::ChooseJobDisk()
{
KVString tmp = "";
cout << "Enter max scratch disk per job (xKB/xMB/xGB) ["
<< fDefJobDisk.Data() << "] : ";
cout.flush();
tmp.ReadToDelim(cin);
SetJobDisk(tmp.Data());
}
示例11: while
//___________________________________________________________________________________________
void KVValues::init_val_base()
{
//protected method
//Mise en correspondance du noms des differentes valeurs a calculees
//et de leur position dans le tableau values
// Ex:
// nom_valeurs -> id_valeurs -> values[id_valeurs]
KVString lname = "MIN MAX";
lname.Begin(" ");
kval_base = 0; //variables de base disponibles
kval_tot = 0; //nombre de variables totales disponibles
while (!lname.End()) {
KVString tamp = lname.Next();
SetValue(tamp.Data(), kval_tot++);
}
kdeb = kval_tot; //ici pos_deb=2 (par defaut)
KVString smoment;
for (Int_t mm = 0; mm <= kordre_mom_max; mm += 1) { //Ex: moment_max = 3
smoment.Form("SUM%d", mm);
SetValue(smoment.Data(), kval_tot++);
}
kval_base = kval_tot; //ici nbase=6 (par defaut)
values = new Double_t[knbre_val_max];
init_val();
}
示例12: ReadFromAsciiFile
void KVTGIDGrid::ReadFromAsciiFile(ifstream& gridfile)
{
// Read grid and parameters of LTG fit used to generate grid in gridfile.
KVIDGraph::ReadFromAsciiFile(gridfile);
KVString line;
if (fPar->GetIntValue("HasTGID")) {
line.ReadLine(gridfile);
if (line.BeginsWith("++KVTGID")) fTGID = KVTGID::ReadFromAsciiFile(GetName(), gridfile);
}
FindAxisLimits();
}
示例13: AddFormula
//___________________________________________________________________________________________
Bool_t KVValues::AddFormula(KVString name, KVString expr)
{
TFormula* fm = new TFormula(name.Data(), expr.Data());
if (fm->GetExpFormula().IsNull()) {
Warning("AddFormula", "%s considere comme nulle", expr.Data());
return kFALSE;
delete fm;
}
kform_add->Add(fm);
SetValue(name.Data(), kval_tot++);
kval_add += 1;
return kTRUE;
}
示例14: Info
void KVINDRA::SetPinLasersForCsI()
{
// Sets the KVCsI::fPinLaser member of each CsI detector with the number of the
// pin laser associated for the stability control of these detectors.
//
// We look for a file with the following format:
//
// CSI_0101 1
// CSI_0102 1
// CSI_0103 1
// CSI_0104 1
// etc.
//
// i.e. 'name of CsI detector' 'number of pin laser (1-8)'
// Comment lines must begin with '#'
//
// The default name of this file is defined in .kvrootrc by
//
// INDRADB.CsIPinCorr: CsI_PILA.dat
//
// Dataset-specific version can be specified:
//
// INDRA_e999.INDRADB.CsIPinCorr: CorrCsIPin_2054.dat
//
// This file should be in the directory corresponding to the current dataset,
// i.e. in $KVROOT/KVFiles/name_of_dataset
ifstream pila_file;
if (gDataSet->OpenDataSetFile(gDataSet->GetDataSetEnv("INDRADB.CsIPinCorr", ""), pila_file)) {
Info("SetPinLasersForCsI", "Setting correspondance CsI-PinLaser using file %s.",
gDataSet->GetDataSetEnv("INDRADB.CsIPinCorr", ""));
// read file, set correspondance
KVString line;
line.ReadLine(pila_file);
while (pila_file.good()) {
if (!line.BeginsWith("#")) {
line.Begin(" ");
KVString detname = line.Next(kTRUE);
KVCsI* det = (KVCsI*)GetDetector(detname.Data());
Int_t pila = line.Next(kTRUE).Atoi();
if (det) {
det->SetPinLaser(pila);
}
}
line.ReadLine(pila_file);
}
pila_file.close();
}
else {
Info("SetPinLasersForCsI", "File %s not found. Correspondance Csi-PinLaser is unknown.",
gDataSet->GetDataSetEnv("CsIPinCorr", ""));
}
}
示例15: ExpandAutoBatchName
const Char_t* KVINDRAReconDataAnalyser::ExpandAutoBatchName(const Char_t* format)
{
//Replace any 'special' symbols in "format" with their current values
//
// $Date : current date and time
// $System : name of system to be analysed
// $User : name of user
// $UserClass or $Selector : name of user's analysis class (KVSelector)
// $DataSelector : name of user's data selector (KVDataSelector)
static KVString tmp;
tmp = KVDataAnalyser::ExpandAutoBatchName(format);
tmp.ReplaceAll("$Selector", GetUserClass());
tmp.ReplaceAll("$DataSelector", GetKVDataSelector());
return tmp.Data();
}