本文整理汇总了C++中TString::IsNull方法的典型用法代码示例。如果您正苦于以下问题:C++ TString::IsNull方法的具体用法?C++ TString::IsNull怎么用?C++ TString::IsNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TString
的用法示例。
在下文中一共展示了TString::IsNull方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadAliROOT
/**
* Do some sanity checks, then load
*
* @return See ProofRailway::LoadAliROOT
*/
virtual Bool_t LoadAliROOT()
{
Bool_t enabPhys = true;
TString aliVer = gSystem->Getenv("VafAliRootVersion");
TString aliPhys = gSystem->Getenv("VafAliPhysicsVersion");
if (!aliVer.IsNull()) {
Info("VAFRailway::LoadAliROOT", "Using AliROOT=%s", aliVer.Data());
if (!aliPhys.IsNull()) {
Warning("VAFRailway::LoadAliROOT",
"AliPhysics not loaded, even though version %s was requested",
aliPhys.Data());
}
enabPhys = false;
}
else if (aliPhys.IsNull()) {
Error("VAFRailway::LoadAliROOT", "Neither AliROOT nor AliPhysics "
"versions specified, giving up");
return false;
}
else
Info("VAFRailway::LoadAliROOT", "Using AliPhysics=%s", aliPhys.Data());
fOptions.Set("alien");
return ProofRailway::LoadAliROOT();
}
示例2: RsnSetData
void RsnSetData(AliAnalysisAlien *plugin,TString dsConf,Int_t numRuns = 1000,Int_t numRunsSkip=0,Int_t maxRunsPerMaster = 1000) {
Bool_t dsFound = kTRUE;
Int_t nRunsPerMaster = 0;
Bool_t valid = kTRUE;
TString legoTrainPath = AliAnalysisManager::GetGlobalStr("rsnLegoTrainPath",valid);
if (gSystem->AccessPathName(dsConf.Data())) dsConf.Prepend(Form("%s/",legoTrainPath.Data()));
dsConf = gSystem->ExpandPathName(dsConf.Data());
if (dsConf.Contains(".txt")) {
ifstream in;
in.open(dsConf.Data());
if (!in.is_open()) Fatal("RsnSetData",Form("File %s was not found !!!",dsConf.Data()));
Printf("DS config file : %s",dsConf.Data());
TString line;
Bool_t isRun = kFALSE;
while (in.good())
{
in >> line;
if (line.IsNull()) continue;
if (line.Contains("BASE")) {
GetParameterFromConfig(line);
plugin->SetGridDataDir(line.Data());
Printf("BASE -> %s",line.Data());
continue;
}
if (line.Contains("PREFIX")) {
GetParameterFromConfig(line);
plugin->SetRunPrefix(line.Data());
Printf("PREFIX -> %s",line.Data());
continue;
}
if (line.Contains("DATA_PATTERN")) {
GetParameterFromConfig(line);
plugin->SetDataPattern(line.Data());
Printf("DATA_PATTERN -> %s",line.Data());
continue;
}
if (!line.CompareTo("RUNS")) {
isRun = kTRUE;
in >> line;
}
if (isRun) {
if (numRunsSkip>0) {
numRunsSkip--;
continue;
} else {
if (nRunsPerMaster < numRuns ) {
Printf("Adding RUN : %s",line.Data());
plugin->AddRunNumber(line.Data());
nRunsPerMaster++;
} else {
break;
}
}
}
}
示例3: SETUP_LoadLibraries
Bool_t SETUP_LoadLibraries(const TString &libs) {
// Loads a list of colon-separated libraries. Returns kTRUE on success, kFALSE
// if at least one library couldn't load properly. Does not check for double
// loads (but ROOT does).
TString l;
Ssiz_t from;
while ( libs.Tokenize(l, from, ":") ) {
if (l.IsNull()) continue;
if (!l.BeginsWith("lib")) l.Prepend("lib");
if (l.EndsWith(".so")) l.Remove(l.Length()-3, l.Length());
::Info(gMessTag.Data(), ">> Loading library %s...", l.Data());
if (gSystem->Load(l.Data()) < 0) {
::Error(gMessTag.Data(), "Error loading %s, aborting", l.Data());
return kFALSE; // failure
}
}
return kTRUE; // success
return 0;
}
示例4: fin
//------------------------------
void KVINDRADB_e475s::ReadCalibrations()
//------------------------------
{
ifstream finput;
if (!OpenCalibFile("CalibFile", finput)) {
Error("ReadCalibrations()", "Could not open file %s",
GetCalibFileName("CalibFile"));
return;
}
Info("ReadCalibrations()",
"Reading calibration parameters...");
TString sline;
TString stit;
TString calib_det,calib_gain,calib_file;
TObjArray *toks=NULL;
while (finput.good()) {
sline.ReadLine(finput);
if (!sline.IsNull()){
cout << sline << endl;
toks = sline.Tokenize(" ");
calib_det = ((TObjString*)(*toks)[0])->GetString();
calib_gain = ((TObjString*)(*toks)[1])->GetString();
calib_file = ((TObjString*)(*toks)[2])->GetString();
stit.Form("%s/%s",gDataSet->GetDataSetDir(),calib_file.Data());
ifstream fin(stit.Data());
ReadCalibFile(fin,calib_det,calib_gain);
fin.close();
}
}
finput.close();
}
示例5: while
vector <TString> OnlineConfig::SplitString(TString instring,TString delim)
{
// Utility to split up a string on the deliminator.
// returns a vector of strings.
vector <TString> v;
TString remainingString = instring;
TString tempstring = instring;
int i;
while (remainingString.Index(delim) != -1) {
i = remainingString.Index(delim);
tempstring.Remove(i);
v.push_back(tempstring);
remainingString.Remove(0,i+1);
while(remainingString.Index(delim) == 0) {
remainingString.Remove(0,1);
}
tempstring = remainingString;
}
while(tempstring.EndsWith(delim)) {
tempstring.Chop();
}
if(!tempstring.IsNull()) v.push_back(tempstring);
return v;
}
示例6: Ana
//__________________________________________________________________________
Bool_t Ana(const TString type = "per5", const Int_t run = 1, const Int_t nOfEvt = 1)
{
// Analyzes data from the AliEn data catalog
// Data Challenge identification
const TString kYear("2004") ;
const TString kProd("02") ;
const TString kVers("V4.01.Rev.00") ;
// get the LFN file name in the Grid catalogue ;
AliPHOSGridFile lfn ;
if (!lfn.IsConnected())
return kFALSE ;
lfn.SetPath(kYear, kProd, kVers, type) ;
lfn.SetRun(run) ;
//loop over the events
Int_t nevt, evt = 0 ;
for (nevt = 0 ; nevt < nOfEvt ; nevt++) {
evt++ ;
lfn.SetEvt(evt) ;
TString fileName = lfn.GetLFN() ;
if (fileName.IsNull()) {
nevt-- ;
continue ;
}
printf(">>>>>>>>>>>> Processing %s-%s/%s/%s : run # %d event # %d \n",
kYear.Data(), kProd.Data(), kVers.Data(), type.Data(), run, evt) ;
AnaESD(fileName) ;
}
return kTRUE ;
}
示例7: PlotDataResults
//_______________________________________
void PlotDataResults(const char* filenameData, const char* filenameMC="", Bool_t save=kFALSE)
{
if (!addToName.IsNull()) addToName.Prepend("-");
AliDielectronCFdraw d(filenameData);
AliDielectronCFdraw dCorr("corrCont","corrCont");
TString nameCorr(filenameMC);
if (!nameCorr.IsNull()) d.SetCFContainers(nameCorr.Data());
TFile f(filenameData);
TH1 *hStats=(TH1*)f.Get("hEventStat");
if (!f.IsOpen() || f.IsZombie() || !hStats) return;
hStats->SetDirectory(0);
f.Close();
Int_t stepFirst=0, stepAny=1, stepTOFmix=2;
gStyle->SetOptStat(0);
//Set common Ranges
d.SetRangeUser("Leg1_NclsTPC",70.,170.);
d.SetRangeUser("Leg2_NclsTPC",70.,170.);
d.SetRangeUser("Leg1_Pt",1.01,100000);
d.SetRangeUser("Leg2_Pt",1.01,100000);
d.SetRangeUser("Leg1_Eta",-0.899,0.899);
d.SetRangeUser("Leg2_Eta",-0.899,0.899);
d.SetRangeUser("Leg1_TPC_nSigma_Electrons",-3.,2.99);
d.SetRangeUser("Leg2_TPC_nSigma_Electrons",-3.,2.99);
d.SetRangeUser("Leg1_TPC_nSigma_Pions",3.51,20);
d.SetRangeUser("Leg2_TPC_nSigma_Pions",3.51,20);
d.SetRangeUser("Leg1_TPC_nSigma_Protons",3.01,20);
d.SetRangeUser("Leg2_TPC_nSigma_Protons",3.01,20);
// d.SetRangeUser("Pt",0,1000);
d.SetRangeUser("M",0.5,5.);
//============================
//SPD first
//
//--- Like sign subtraction
AliDielectronSignalBase *sigFirst=GetSignalLS(d,stepFirst);
SetStyle(sigFirst,"ITS First - Like Sign subtraction");
DrawSpectra(sigFirst,"cFirst",hStats,save);
//--- Like sign subtraction Arithmetic mean
AliDielectronSignalBase *sigFirstArith=GetSignalLS(d,stepFirst,AliDielectronSignalBase::kLikeSignArithm);
SetStyle(sigFirstArith,"ITS FirstArith - Like Sign subtraction");
DrawSpectra(sigFirstArith,"cFirstArith",hStats,save);
//============================
//SPD any
//
AliDielectronSignalBase *sigAny=GetSignalLS(d,stepAny);
SetStyle(sigAny,"ITS Any - Like Sign subtraction");
DrawSpectra(sigAny,"cAny",hStats,save);
//--- like sign with arithmetic mean
AliDielectronSignalBase *sigAnyArith=GetSignalLS(d,stepAny,AliDielectronSignalBase::kLikeSignArithm);
SetStyle(sigAnyArith,"ITS Any - Like Sign subtraction (Arithm. mean)");
DrawSpectra(sigAnyArith,"cAnyArith",hStats,save);
if (hStats) delete hStats;
}
示例8: GetJobUrl
/**
* Get the job url.
*
* @param name Production name
* @param mc Should be true for MC
* @param url On return, the job url
*
* @return true on success
*/
Bool_t GetJobUrl(const TString& name, Bool_t mc, TString& url)
{
url = "";
TString index("raw.jsp");
if (!Download((mc ? "job_details.jsp" : "production/raw.jsp"), index))
return false;
std::ifstream in(index.Data());
TString line;
TString tgt(Form("<td class=\"table_row\">%s</td>", name.Data()));
do {
line.ReadLine(in);
if (!line.Contains(tgt)) continue;
line.ReadLine(in);
Int_t first = line.Index("href=\"");
Int_t last = line.Index("\"", first+7);
url = line(first+6,last-first-6);
break;
} while (!in.eof());
in.close();
if (url.IsNull()) {
Error("GetJobUrl", "Production %s not found", name.Data());
return false;
}
return true;
}
示例9: main
//________________________________________________________________________________________
int main(int argc, char* argv[]) {
// Default options
bool isList = false;
TString outputdir = "TempOutput/";
int verbose = 0;
// Parse options
char ch;
while ((ch = getopt(argc, argv, "d:v:lh?")) != -1 ) {
switch (ch) {
case 'd': outputdir = TString(optarg); break;
case 'v': verbose = atoi(optarg); break;
case 'l': isList = true; break;
case '?':
case 'h': usage(0); break;
default:
cerr << "*** Error: unknown option " << optarg << std::endl;
usage(-1);
}
}
argc -= optind;
argv += optind;
// Check arguments
if( argc<1 ) {
usage(-1);
}
TChain *theChain = new TChain("analyze/Analysis");
for(int i = 0; i < argc; i++){
if( !isList ){
theChain->Add(argv[i]);
printf(" Adding file: %s\n",argv[i]);
} else {
TString rootFile;
ifstream is(argv[i]);
while(rootFile.ReadLine(is) && (!rootFile.IsNull())){
if(rootFile[0] == '#') continue;
theChain->Add(rootFile);
printf(" Adding file: %s\n", rootFile.Data());
}
}
}
cout << "--------------" << endl;
cout << "OutputDir is: " << outputdir << endl;
cout << "Verbose level is: " << verbose << endl;
cout << "Number of events: " << theChain->GetEntries() << endl;
cout << "--------------" << endl;
UserAnalyzer *tA = new UserAnalyzer(theChain);
tA->SetOutputDir(outputdir);
tA->SetVerbose(verbose);
tA->BeginJob();
tA->Loop();
tA->EndJob();
delete tA;
return 0;
}
示例10: CreateTasks
/**
* Create the tasks
*
* @param mgr Analysis manager
*/
void CreateTasks(AliAnalysisManager* mgr)
{
// --- Output file name ------------------------------------------
AliAnalysisManager::SetCommonFileName("forward_qa.root");
// --- Load libraries/pars ---------------------------------------
fRailway->LoadLibrary("PWGLFforward2");
// --- Set load path ---------------------------------------------
gROOT->SetMacroPath(Form("%s:$(ALICE_PHYSICS)/PWGLF/FORWARD/analysis2",
gROOT->GetMacroPath()));
// --- Check if this is MC ---------------------------------------
Bool_t mc = mgr->GetMCtruthEventHandler() != 0;
// --- Add the task ----------------------------------------------
if (!CoupleSECar("AddTaskForwardQA.C",
Form("%d,%d", mc, fOptions.Has("cent")),
AliVEvent::kAny))
Fatal("CreateTasks", "Failed to add ForwardQA task");
TString cor = "";
if (fOptions.Has("corr")) cor = fOptions.Get("corr");
if (!cor.IsNull()) {
fRailway->LoadAux(Form("%s/fmd_corrections.root",cor.Data()), true);
}
}
示例11: CompareResults
/**
* Compare results
*
* @param argv Commmand line parameters
*
* @relates Compare
* @ingroup pwglf_forward_tracklets
*/
void CompareResults(const char** argv)
{
TString newFile;
TString oldFile;
TString newTit("");
TString oldTit("");
const char** ptr = argv;
while ((*ptr)) {
TString argi = *ptr;
ptr++;
if (argi.Contains("help")) {
Printf("Usage: CompareResults AFILE BFILE [ATITLTE [BTITLE]]");
return;
}
if (argi.Contains("CompareResults.C")) continue;
if (argi.BeginsWith("-")) continue;
if (argi.EndsWith(".root")) {
if (newFile.IsNull()) newFile = argi;
else oldFile = argi;
}
else {
if (newTit.IsNull()) newTit = argi;
else oldTit = argi;
}
}
if (newTit.IsNull()) newTit = "New";
if (oldTit.IsNull()) oldTit = "Old";
CompareResults(newFile, oldFile, newTit, oldTit);
}
示例12: RegisterStorage
/**
* Register special putput storage
*
* @param url Url (root://host/full_path)
*
* @return true on success
*/
static Bool_t RegisterStorage(const TString& url)
{
if (url.IsNull()) {
Error("OutputUtilities::RegisterStorage", "No storage URI specified");
return false;
}
// Get the manager
AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager();
// Get the container
AliAnalysisDataContainer* cont = mgr->GetCommonOutputContainer();
if (!cont) {
Warning("OutputUtilities::RegisterStorage",
"No common output container defined");
return false;
}
TString u(url);
if (u.EqualTo("auto")) {
if (!StartXrootd(u)) {
Warning("OutputUtilities::RegisterStorage",
"Couldn't start the XRootD server");
return false;
}
}
cont->SetSpecialOutput();
mgr->SetSpecialOutputLocation(u);
return true;
}
示例13: ilceve_init
void ilceve_init(const TString& cdburi = "local://$ILC_ROOT/OCDB",
const TString& path = ".", Int_t event=0,
const Text_t* esdfile = 0,
const Text_t* aodfile = 0,
const Text_t* rawfile = 0,
Bool_t assert_runloader = kFALSE,
Bool_t assert_esd = kFALSE,
Bool_t assert_aod = kFALSE,
Bool_t assert_raw = kFALSE)
{
if (cdburi.IsNull() && ! IlcCDBManager::Instance()->IsDefaultStorageSet())
{
gEnv->SetValue("Root.Stacktrace", "no");
Fatal("ilceve_init.C", "OCDB path MUST be specified as the first argument.");
}
Info("ilceve_init", "Adding standard macros.");
TString hack = gSystem->pwd(); // Problem with TGFileBrowser cding
ilceve_init_import_macros();
gSystem->cd(hack);
TEveUtil::AssertMacro("VizDB_scan.C");
gSystem->ProcessEvents();
IlcEveEventManager::SetESDFileName(esdfile);
IlcEveEventManager::SetRawFileName(rawfile);
IlcEveEventManager::SetCdbUri(cdburi);
IlcEveEventManager::SetAssertElements(assert_runloader, assert_esd,
assert_aod, assert_raw);
// Open event
if (path.BeginsWith("alien:") || ! cdburi.BeginsWith("local:"))
{
if (gGrid != 0)
{
Info("ilceve_init", "TGrid already initializied. Skiping checks and initialization.");
}
else
{
Info("ilceve_init", "AliEn requested - connecting.");
if (gSystem->Getenv("GSHELL_ROOT") == 0)
{
Error("ilceve_init", "AliEn environment not initialized. Aborting.");
gSystem->Exit(1);
}
if (TGrid::Connect("alien") == 0)
{
Error("ilceve_init", "TGrid::Connect() failed. Aborting.");
gSystem->Exit(1);
}
}
}
Info("ilceve_init", "Opening event %d from '%s' ...", event, path.Data());
TString name("Event"); // CINT has trouble with direct "Event".
new IlcEveEventManager(name, path, event);
gEve->AddEvent(IlcEveEventManager::GetMaster());
}
示例14: parseAndSet_b
inline void parseAndSet_b(const TString& input, TString arg, bool& value) {
TString newval = parseArg(input, arg);
if (!newval.IsNull()) {
if (newval.IsBin()) value = newval.Atoi();
else if (newval == "true") value = true;
else if (newval == "false") value = false;
}
}
示例15: fullName
void
DrawPlot::drawEventPlot(const TString& pluginName, const TString& histName, const bool normalise, const bool plotZeroApe){
TString* plugin = new TString(pluginName.Copy());
if(!plugin->IsNull())plugin->Append("/");
std::stringstream ss_sector;
ss_sector<<*plugin<<"EventVariables/"<<histName;
const TString fullName(ss_sector.str().c_str());
this->printHist(fullName, histName, normalise, plotZeroApe);
}