本文整理汇总了C++中TString::Atoll方法的典型用法代码示例。如果您正苦于以下问题:C++ TString::Atoll方法的具体用法?C++ TString::Atoll怎么用?C++ TString::Atoll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TString
的用法示例。
在下文中一共展示了TString::Atoll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetSize
/**
* Get the size of a given run
*
* @param in Input stream
* @param runNo Run number to search for
* @param mc True for simulations
* @param minSize Least size
*
* @return true on success
*/
Bool_t GetSize(std::istream& in, ULong_t runNo,
Bool_t mc, ULong_t minSize=100000)
{
TString line;
TString tgt2(mc ? "table_row_right" : "ESDs size");
Int_t cnt = 0;
do {
line.ReadLine(in);
if (!line.Contains(tgt2)) continue;
cnt++;
if (mc && cnt < 3) continue;
if (!mc) line.ReadLine(in);
if (fDebug) Info("", line);
TString ssiz;
if (mc) {
Int_t first = line.Index(">");
Int_t last = line.Index("<",first+1);
if (first == kNPOS || last == kNPOS) {
Error("GetDir", "Failed to get directory from %s", line.Data());
return false;
}
ssiz = line(first+1, last-first-1);
}
else {
for (Int_t i = 0; i < line.Length(); i++) {
if (line[i] == '<') break;
if (line[i] == ' ' || line[i] == '\t' || line[i] == ',') continue;
ssiz.Append(line[i]);
}
}
Long_t size = ssiz.Atoll();
if (fDebug) Info("", "Got run %lu %lu" , runNo, size);
if (size < 0) {
Error("GetSize", "Failed to extract size for run %lu", runNo);
return false;
}
if (ULong_t(size) < minSize) {
Warning("GetSize","Run %lu does not have enough events %lu",runNo,size);
return false;
}
break;
} while (!in.eof());
return true;
}
示例2: GetRuns
/**
* Get list of runs associated with production
*
* @param url The production URL
* @param mc True of MC
* @param minSize Least size of runs to use
*
* @return true on success
*/
Bool_t GetRuns(const TString& url, Bool_t mc, ULong_t minSize)
{
TString index("job");
if (!Download(Form("%s%s", (mc ? "" : "raw/"), url.Data()), index))
return false;
std::ifstream in(index.Data());
TString tgt1(mc ? "window.open" : "runDetails");
TString line = "";
do {
line.ReadLine(in);
if (!line.Contains(tgt1)) continue;
Int_t first = -1;
Int_t last = -1;
if (!mc) {
first = line.Index(tgt1);
last = line.Index(")", first+tgt1.Length()+1);
}
else {
Int_t tmp = line.Index(">");
first = line.Index(">", tmp+1);
last = line.Index("<", first);
}
if (first == kNPOS || last == kNPOS) {
Error("GetDir", "Failed to get directory from %s", line.Data());
return false;
}
first += (mc ? 1 : tgt1.Length()+1);
last -= first;
TString srun = line(first, last);
ULong_t runNo = srun.Atoll();
if (fDebug) Info("", "Got run %lu (%s)", runNo, srun.Data());
if (!GetSize(in, runNo, mc, minSize)) continue;
if (!GetDir(in, runNo, mc)) continue;
if (!fRuns.IsNull()) fRuns.Append(",");
fRuns.Append(Form("%lu", runNo));
} while (!in.eof());
in.close();
if (fRuns.IsNull()) return false;
return true;
}