本文整理汇总了C++中KVString::Data方法的典型用法代码示例。如果您正苦于以下问题:C++ KVString::Data方法的具体用法?C++ KVString::Data怎么用?C++ KVString::Data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KVString
的用法示例。
在下文中一共展示了KVString::Data方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init_val_base
//___________________________________________________________________________________________
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();
}
示例2: BuildTelescope
KVINDRATelescope* KVINDRA::BuildTelescope(const Char_t* prefix, Int_t module)
{
// Build telescope from infos in file "$KVROOT/KVFiles/data/indra-struct.[dataset].env"
//Info("BuildTelescope", "Building telescope %s",name);
KVINDRATelescope* kvt = new KVINDRATelescope;
KVString telescopes = fStrucInfos.GetValue(Form("%s.Telescope", prefix), "");
telescopes.Begin(" ");
KVString name;
while (!telescopes.End()) {
name = telescopes.Next();
KVNumberList mods = fStrucInfos.GetValue(Form("%s.Telescope.%s.Modules", prefix, name.Data()), "1-100");
if (mods.Contains(module)) break;
}
KVString detectors = fStrucInfos.GetValue(Form("INDRA.Telescope.%s.Detectors", name.Data()), "");
Double_t aziwidth = fStrucInfos.GetValue(Form("INDRA.Telescope.%s.AziWidth", name.Data()), 1.0);
Double_t dist = fStrucInfos.GetValue(Form("%s.Dist", prefix), 0.0);
kvt->SetDistance(dist);
detectors.Begin(" ");
Int_t idet = 1;
while (!detectors.End()) {
KVString detector = detectors.Next();
detector.Begin("()");
KVString dettype = detector.Next();
Double_t detthick = detector.Next().Atof();
KVDetector* det = KVDetector::MakeDetector(Form("%s.%s", fDataSet.Data(), dettype.Data()), detthick);
kvt->Add(det);
Double_t depth = fStrucInfos.GetValue(Form("INDRA.Telescope.%s.Depth.%s", name.Data(), dettype.Data()), 0.);
kvt->SetDepth(idet, depth);
idet++;
}
kvt->SetAzimuthalWidth(aziwidth);
return kvt;
}
示例3: 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());
}
示例4: DefineAdditionalValue
//___________________________________________________________________________________________
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());
}
}
示例5: Error
void KVDP2toCsIGridConvertor::ReadGammaFile(const Char_t* gammafile)
{
ifstream gamfile;
gamfile.open(gammafile);
if (!gamfile.good()) {
Error(KV__ERROR(ReadGammaFile),
"Problem reading file %s", gammafile);
return;
}
KVString s;
s.ReadLine(gamfile);
while (gamfile.good()) {
if (s == "") {
s.ReadLine(gamfile);
continue;
}
if (!s.BeginsWith('#')) { //'#' sign signals comments
int ring, modu, frun, lrun;
if (sscanf(s.Data(), "%d %d %d %d", &ring, &modu, &frun, &lrun) !=
4) {
Error(KV__ERROR(ReadGammaFile), "Problem reading file %s\nLast line read: %s",
gammafile, s.Data());
return;
};
//get grid for this ring,mod
TString name;
name.
Form
("CsI R-L Grid First run=%d Last run=%d Ring min=%d Ring max=%d Mod min=%d Mod max=%d",
frun, lrun, ring, ring, modu, modu);
KVIDGrid* grid = (KVIDGrid*)fGrids->FindObject(name.Data());
if (!grid) {
Error(KV__ERROR(ReadGammaFile), "Can't find grid %s", name.Data());
}
int npoints;
gamfile >> npoints;
//found gamma line
KVIDLine* line = 0;
if (grid) {
line = grid->NewLine("ok");
line->SetName("gamma_line");
line->Set(npoints);
grid->Add("ok", line);
}
//read in points
for (int i = 0; i < npoints; i++) {
Double_t x, y;
gamfile >> x >> y;
if (grid)
line->SetPoint(i, x, y);
}
}
s.ReadLine(gamfile);
}
示例6: SetProperties
//________________________________________________________________
Bool_t KVFAZIADetector::SetProperties()
{
// detector name are assumed to be defined as
// SI2-T2-Q2-B001
// CSI-T2-Q2-B001
// SI1-T1-Q1-B001
//
KVString tmp;
KVString sname(GetName());
sname.Begin("-");
SetLabel(sname.Next());
gFazia->AddDetectorLabel(GetLabel());
tmp = sname.Next(); tmp.ReplaceAll("T",""); fTelescope = tmp.Atoi();
tmp = sname.Next(); tmp.ReplaceAll("Q",""); fQuartet = tmp.Atoi();
tmp = sname.Next(); tmp.ReplaceAll("B",""); fBlock = tmp.Atoi();
KVSignal* sig=0;
//"QH1", "I1", "QL1", "Q2", "I2", "Q3
if (fSignals)
delete fSignals;
fSignals = new KVList(kTRUE);
KVString lsignals="";
if ( !strcmp(GetLabel(),"SI1") ) { lsignals="QH1,I1,QL1"; }
else if ( !strcmp(GetLabel(),"SI2" ) ) { lsignals="Q2,I2"; }
else if ( !strcmp(GetLabel(),"CSI" ) ) { lsignals="Q3"; }
else{
Warning("SetProperties","Unknown label \"%s\" for this detector : %s\n",GetLabel(),GetName());
lsignals="";
}
lsignals.Begin(",");
while ( !lsignals.End() )
{
KVString ssig = lsignals.Next();
if (ssig.BeginsWith("Q")){
sig = new KVChargeSignal(ssig.Data());
}
else if (ssig.BeginsWith("I")){
sig = new KVCurrentSignal(ssig.Data());
}
else{
Warning("unknown format signal detectorlabel=%s, signal=%s\n",GetLabel(),ssig.Data());
sig = new KVSignal(ssig.Data(),"unknown");
}
sig->LoadPSAParameters(GetLabel());
sig->SetDetectorName(GetName());
fSignals->Add(sig);
}
return kTRUE;
}
示例7: 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;
}
示例8: SetPartition
//___________________________________________________________________________________________
void KVIntegerList::SetPartition(const Char_t* par)
{
//protected method, utilisée par le Streamer qui utilise le champ fName de la classe TNamed
//voir également KVIntegerList::DeducePartitionFromTNamed
KVString st(par);
st.Begin(" ");
TObjArray* toks = 0;
while (!st.End()) {
KVString tamp = st.Next();
Int_t val;
Int_t freq;
if (tamp.Contains("(")) {
if (!tamp.Contains(")")) {
Warning("SetPartition", "%s ->pb de coherence dans les parentheses", tamp.Data());
return;
} else {
toks = tamp.Tokenize("(");
val = ((TObjString*)toks->At(0))->GetString().Atoi();
freq = ((TObjString*)toks->At(1))->GetString().Atoi();
delete toks;
}
} else {
val = tamp.Atoi();
freq = 1;
}
Add(val, freq);
}
}
示例9: ParseOptions
void KVEventSelector::ParseOptions()
{
// Analyse comma-separated list of options given to TTree::Process
// and store all "option=value" pairs in fOptionList.
// Options can then be accessed using IsOptGiven(), GetOptString(), etc.
//
// BranchName=xxxx : change name of branch in TTree containing data
// EventsReadInterval=N: print "+++ 12345 events processed +++" every N events
//
// This method is called by SlaveBegin
//
fOptionList.Clear(); // clear list
KVString option = GetOption();
option.Begin(",");
while (!option.End()) {
KVString opt = option.Next();
opt.Begin("=");
KVString param = opt.Next();
KVString val=opt.Next();
while(!opt.End()){
val+="=";
val+=opt.Next();
}
SetOpt(param.Data(), val.Data());
}
fOptionList.Print();
// check for branch name
if(IsOptGiven("BranchName")) SetBranchName(GetOpt("BranchName"));
// check for events read interval
if(IsOptGiven("EventsReadInterval")) SetEventsReadInterval(GetOpt("EventsReadInterval").Atoi());
}
示例10: 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
}
示例11: 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);
}
示例12: SetNameOfDetectors
void KVFAZIA::SetNameOfDetectors(KVEnv& env)
{
for (Int_t bb = fStartingBlockNumber; bb < fNblocks; bb += 1) {
for (Int_t qq = 1; qq <= 4; qq += 1) {
for (Int_t tt = 1; tt <= 4; tt += 1) {
fDetectorLabels.Begin(",");
while (!fDetectorLabels.End()) {
KVString sdet = fDetectorLabels.Next();
env.SetValue(
Form("BLOCK_%d_QUARTET_%d_%s-T%d", bb, qq, sdet.Data(), tt),
Form("%s-T%d-Q%d-B%03d", sdet.Data(), tt, qq, bb)
);
}
}
}
}
}
示例13: BuildGeometry
void KVINDRA::BuildGeometry()
{
// Construction of INDRA detector array.
// Uses infos in file $KVROOT/KVFiles/data/indra_struct.[dataset].env
// or $KVROOT/KVFiles/data/indra_struct.env
// if no dataset-specific file found
TString path = Form("indra-struct.%s.env", fDataSet.Data());
TString path2;
SearchKVFile(path.Data(), path2, "data");
if (path2 == "") {
path = "indra-struct.env";
SearchKVFile(path.Data(), path2, "data");
}
fStrucInfos.ReadFile(path2, kEnvAll);
KVString lruns = fStrucInfos.GetValue("AddOnForRuns", "");
//test if additional geometrical specification exists
if (lruns != "") {
lruns.Begin(",");
while (!lruns.End()) {
KVString sruns = lruns.Next();
KVNumberList nlr(sruns.Data());
//the current run needs specific geometry
if (nlr.Contains(fCurrentRun)) {
path = fStrucInfos.GetValue(sruns.Data(), "");
Info("BuildGeometry", "Additional geometry for run=%d in file #%s#", fCurrentRun, path.Data());
SearchKVFile(path.Data(), path2, "data");
if (path2 == "") {
Warning("BuildGeometry", "fichier %s inconnu", path.Data());
}
else {
fStrucInfos.ReadFile(path2, kEnvChange);
}
}
}
}
SetName(fStrucInfos.GetValue("INDRA.Name", ""));
SetTitle(fStrucInfos.GetValue("INDRA.Title", ""));
KVString layers = fStrucInfos.GetValue("INDRA.Layers", "");
layers.Begin(" ");
while (!layers.End()) BuildLayer(layers.Next());
}
示例14: 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());
}
示例15: GetPedestals
//________________________________________________________________________________________
TGraph* KVINDRA::GetPedestals(const Char_t* det_signal, const Char_t* det_type, Int_t ring_number, Int_t
run_number)
{
//Renvoie sous forme de TGraph (en fonction du numero de module)
//les piedestaux du signal (det_signal) asssocies aux detecteurs de type (det_type)
//qui sont presents dans la couronne ring_number pour un numero de run donne (si run_number==-1)
//on suppose que gIndra->SetParameters(xxx) a ete fait en amont
//L'utilisateur doit effacer ce TGraph tout seul comme un grand apres usage
//Une recherche sur l existence ou non du graph permet d eviter des boucles inutiles
//Si l appel est reitere
if (run_number != -1 || run_number != Int_t(GetCurrentRunNumber()))
SetParameters(run_number);
KVSeqCollection* sltype = 0;
KVSeqCollection* slring = 0;
TGraph* gr_ped = 0;
KVString sgraph;
sgraph.Form("KVPed_%s_%s_%d_%d", det_signal, det_type, ring_number, GetCurrentRunNumber());
if ((gr_ped = (TGraph*)gROOT->FindObject(sgraph.Data()))) return gr_ped;
if ((sltype = GetDetectors()->GetSubListWithMethod(det_type, "GetType"))) {
KVString sring;
sring.Form("%d", ring_number);
if ((slring = sltype->GetSubListWithMethod(sring, "GetRingNumber"))) {
gr_ped = new TGraph();
gr_ped->SetName(sgraph.Data());
for (Int_t mm = 0; mm < slring->GetEntries(); mm += 1) {
gr_ped->SetPoint(gr_ped->GetN(),
((KVINDRADetector*)slring->At(mm))->GetModuleNumber(),
((KVDetector*)slring->At(mm))->GetPedestal(det_signal));
}
delete slring;
return gr_ped;
}
delete sltype;
}
return 0;
}