本文整理汇总了C++中TString::EqualTo方法的典型用法代码示例。如果您正苦于以下问题:C++ TString::EqualTo方法的具体用法?C++ TString::EqualTo怎么用?C++ TString::EqualTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TString
的用法示例。
在下文中一共展示了TString::EqualTo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: par2latex
TString par2latex(const TString& parname)
{
if (parname.EqualTo("lZ") ) return "par_{1}";
if (parname.EqualTo("dkg") ) return "par_{2}";
return "UNKNOWN PAR "+parname;
}
示例2: parmax
float parmax(const TString& parname)
{
if (parname.EqualTo("lZ") ) return 0.03;
if (parname.EqualTo("dkg") ) return 0.15;
return -999;
}
示例3: parinc
float parinc(const TString& parname)
{
if (parname.EqualTo("lZ") ) return 0.0006;
if (parname.EqualTo("dkg") ) return 0.003;
return -999;
}
示例4: LoadFileNamesToCompare
//_______________________________________________________________________
void LoadFileNamesToCompare(TString TrackpT ="0.3to1.0",TString Sys = "pPb"){
Int_t skip3to5pPb=0;
if(Sys.EqualTo("pp")){
nhistos=9;
}
else if(Sys.EqualTo("pPb")){
nhistos=6;
skip3to5pPb=3;
}
filenames=new TString[nhistos];
Printf(" -------------------> Adding %s in %s coll",TrackpT.Data(),Sys.Data());
if(Sys.EqualTo("pp")){
filenames[0] = Form("%s/CanvaAndVariedHisto%sDzeroPt3to5assocPt%s.root",inputdirectory.Data(),Sys.Data(),TrackpT.Data());
filenames[1] = Form("%s/CanvaAndVariedHisto%sDplusPt3to5assocPt%s.root",inputdirectory.Data(),Sys.Data(),TrackpT.Data());
filenames[2] = Form("%s/CanvaAndVariedHisto%sDstarPt3to5assocPt%s.root",inputdirectory.Data(),Sys.Data(),TrackpT.Data());
}
filenames[3-skip3to5pPb] = Form("%s/CanvaAndVariedHisto%sDzeroPt5to8assocPt%s.root",inputdirectory.Data(),Sys.Data(),TrackpT.Data());
filenames[4-skip3to5pPb] = Form("%s/CanvaAndVariedHisto%sDplusPt5to8assocPt%s.root",inputdirectory.Data(),Sys.Data(),TrackpT.Data());
filenames[5-skip3to5pPb] = Form("%s/CanvaAndVariedHisto%sDstarPt5to8assocPt%s.root",inputdirectory.Data(),Sys.Data(),TrackpT.Data());
filenames[6-skip3to5pPb] = Form("%s/CanvaAndVariedHisto%sDzeroPt8to16assocPt%s.root",inputdirectory.Data(),Sys.Data(),TrackpT.Data());
filenames[7-skip3to5pPb] = Form("%s/CanvaAndVariedHisto%sDplusPt8to16assocPt%s.root",inputdirectory.Data(),Sys.Data(),TrackpT.Data());
filenames[8-skip3to5pPb] = Form("%s/CanvaAndVariedHisto%sDstarPt8to16assocPt%s.root",inputdirectory.Data(),Sys.Data(),TrackpT.Data());
}
示例5: CreateTasks
/**
* Create our tasks. This uses the interpreter to make the object.
*
* @param mgr
*/
void CreateTasks(AliAnalysisManager* mgr)
{
Info("CreateTasks", "Loading code");
fRailway->LoadSource("FixPaths.C");
fRailway->LoadSource("AliAODSimpleHeader.C");
fRailway->LoadSource("AliAODTracklet.C");
fRailway->LoadSource("AliTrackletWeights.C");
fRailway->LoadSource("AliTrackletAODUtils.C");
fRailway->LoadSource("AliTrackletAODdNdeta.C");
// --- Create the task using interpreter -------------------------
Bool_t mc = fOptions.Has("mc");
if (!mc) mc = fRailway->IsMC();
Long_t ret =
gROOT->ProcessLine(Form("AliTrackletAODdNdeta::Create(%d,\"%s\")",mc,
fOptions.AsString("reweigh")));
AliAnalysisTaskSE* task = reinterpret_cast<AliAnalysisTaskSE*>(ret);
if (!task) return;
// --- Figure out the trigger options ----------------------------
TString trg = fOptions.Get("trig"); trg.ToUpper();
UInt_t sel = AliVEvent::kINT7;
if (trg.EqualTo("MB")) sel = AliVEvent::kMB;
else if (trg.EqualTo("V0AND")) sel = AliVEvent::kINT7;
else if (trg.EqualTo("V0OR")) sel = AliVEvent::kCINT5;
else if (trg.EqualTo("ANY")) sel = AliVEvent::kAny;
task->SelectCollisionCandidates(sel);
// --- Figure out calculation mode -------------------------------
TString calc = fOptions.Get("reweigh-calc"); calc.ToUpper();
UChar_t mcal = 0;
if (calc.BeginsWith("PROD")) mcal = 0;
else if (calc.BeginsWith("SQ")) mcal = 1;
else if (calc.BeginsWith("SUM")) mcal = 2;
else if (calc.BeginsWith("AV")) mcal = 3;
// --- Set various options on task -------------------------------
const char* defCent = DefaultCentBins();
FromOption(task, "CentralityMethod","cent", "V0M");
FromOption(task, "CentralityAxis", "cent-bins", defCent);
FromOption(task, "AbsMinCent", "abs-min-cent", -1.);
FromOption(task, "MaxNTracklet", "max-ntracklet", 6000.);
FromOption(task, "EtaAxis", "eta-bins", "r16:2");
FromOption(task, "IPzAxis", "ipz-bins", "u15");
FromOption(task, "DeltaCut", "delta-cut", 1.5);
FromOption(task, "TailDelta", "tail-delta", 5.);
FromOption(task, "TailMaximum", "tail-max", -1);
FromOption(task, "MaxDelta", "max-delta", 25.);
FromOption(task, "DPhiShift", "dphi-shift", 0.0045);
FromOption(task, "ShiftedDPhiCut", "shifted-dphi-cut",-1.);
FromOption(task, "WeightMask", "reweigh-mask", 0xFF);
FromOption(task, "WeightVeto", "reweigh-veto", 0x0);
SetOnTask (task, "WeightCalc", mcal);
FromOption(task, "WeightInverse", "reweigh-inv", false);
task->Print("");
}
示例6: ProcessEnvironment
//______________________________________________________________________________
void ProcessEnvironment()
{
//
// Collision system configuration
//
iCollisionType = kpp;
if (gSystem->Getenv("CONFIG_SYSTEM")) {
Bool_t valid = kFALSE;
for (Int_t icoll = 0; icoll < kNSystem; icoll++)
if (strcmp(gSystem->Getenv("CONFIG_SYSTEM"), CollisionSystem[icoll]) == 0) {
iCollisionType = icoll;
valid = kTRUE;
break;
}
if (!valid) {
printf(">>>>> Unknown collision system configuration: %s \n", gSystem->Getenv("CONFIG_SYSTEM"));
abort();
}
}
// // run number
// run_number = -1;
// if (gSystem->Getenv("CONFIG_RUN"))
// run_number = atoi(gSystem->Getenv("CONFIG_RUN"));
// if (run_number <= 0) {
// printf(">>>>> Invalid run number: %d \n", run_number);
// abort();
// }
//
// Setting this to kTRUE will disable some not needed analysis tasks for a muon_calo pass
//
isMuonOnly = kFALSE;
isMuonCalo = kFALSE;
if (gSystem->Getenv("CONFIG_QA"))
{
TString configstr = gSystem->Getenv("CONFIG_QA");
if (configstr.Contains("MuonOnly")) isMuonOnly = kTRUE;
else if (configstr.Contains("Muon")) isMuonCalo = kTRUE;
}
//
// Figure out the run_flag
//
run_flag = 1500;
if (gSystem->Getenv("CONFIG_YEAR"))
year = atoi(gSystem->Getenv("CONFIG_YEAR"));
if (gSystem->Getenv("CONFIG_PERIOD"))
periodName = gSystem->Getenv("CONFIG_PERIOD");
if(year<2015) run_flag =1100;
if(year<=2010) {
run_flag =1000;
if (periodName.EqualTo("LHC10h"))
run_flag = 1001;
}
}
示例7: GetDir
/**
* Get a directory
*
* @param in Input stream
* @param runNo The run number
* @param mc True for MC
*
* @return true on success
*/
Bool_t GetDir(std::istream& in, ULong_t runNo, Bool_t mc)
{
TString line;
TString tgt3("/catalogue/index.jsp");
do {
line.ReadLine(in);
// Info("", "line=%s", line.Data());
if (!line.Contains(tgt3)) continue;
if (fDebug) Info("", line);
Int_t tmp = mc ? line.Index(">")+1 : 0;
Int_t first = line.Index(">", tmp);
Int_t last = line.Index("<",first+1);
if (first == kNPOS || last == kNPOS) {
Error("GetDir", "Failed to get directory from %s", line.Data());
return false;
}
TString dir = line(first+1,last-first-1);
if (fDebug) Info("", "Got run %lu %s", runNo, dir.Data());
TString path, pass;
if (!GetPathPass(dir, runNo, path, pass)) return false;
if (fDebug) Info("", "Got run %lu %s %s", runNo,path.Data(),pass.Data());
if (fPath.IsNull()) fPath = path;
else if (!fPath.EqualTo(path)) {
Warning("GetDir", "Run %lu location %s not %s",
runNo, path.Data(), fPath.Data());
return false;
}
if (fPass.IsNull()) fPass = pass;
else if (!fPass.EqualTo(pass)) {
Warning("GetDir", "Run %lu pass %s not %s",
runNo, pass.Data(), fPass.Data());
return false;
}
break;
} while (!in.eof());
return true;
}
示例8: RunTrain
/**
* Function to run a train.
*
* @param name Name of the train.
* @param cls class name of train setup
* @param uri Exection URI
* @param opts Optons
*
* @return true on success
*
* @ingroup pwglf_forward_trains
*/
Bool_t RunTrain(const TString& name, const TString& cls,
const TUrl& uri, const TString& opts)
{
// Check for help
if (name.IsNull() || name.EqualTo("help", TString::kIgnoreCase) ||
cls.IsNull() || cls.EqualTo("help", TString::kIgnoreCase) ||
!uri.IsValid()) {
PlainUsage();
return true;
}
Bool_t verb = opts.Contains("verbose");
// Build our helpers
if (!BuildRailways(verb, false, true)) return false;
// Tokenize options
if (!opts.EndsWith(",")) opts.Append(",");
opts.Append("url=");
opts.Append(uri.GetUrl());
TObjArray* optList = opts.Tokenize(",");
return TrainSetup::Main(name, cls, optList, false);
}
示例9: parmin
float parmin(const TString& parname)
{
if (parname.EqualTo("cwww") ) return -20;
if (parname.EqualTo("ccw") ) return -20;
if (parname.EqualTo("cb") ) return -105;
if (parname.EqualTo("dg1z") ) return -0.15;
if (parname.EqualTo("dkz") ) return -0.1;
if (parname.EqualTo("lZ") ) return -0.075;
return -999;
}
示例10: par2latex
TString par2latex(const TString& parname)
{
if (parname.EqualTo("cwww") ) return "c_{WWW}/#Lambda^{2} (TeV^{-2})";
if (parname.EqualTo("ccw") ) return "c_{W}/#Lambda^{2} (TeV^{-2})";
if (parname.EqualTo("cb") ) return "c_{B}/#Lambda^{2} (TeV^{-2})";
if (parname.EqualTo("dg1z") ) return "#Deltag_{1}^{Z}";
if (parname.EqualTo("dkz") ) return "#Delta#kappa_{Z}";
if (parname.EqualTo("lZ") ) return "#lambda_{Z}";
return "UNKNOWN PAR "+parname;
}
示例11: parinc
float parinc(const TString& parname)
{
if (parname.EqualTo("cwww") ) return 0.4;
if (parname.EqualTo("ccw") ) return 0.6;
if (parname.EqualTo("cb") ) return 1.2;
if (parname.EqualTo("dg1z") ) return 0.0002;
if (parname.EqualTo("dkz") ) return 0.0002;
if (parname.EqualTo("lZ") ) return 0.0002;
return -999;
}
示例12: parmax
float parmax(const TString& parname)
{
if (parname.EqualTo("cwww") ) return 20;
if (parname.EqualTo("ccw") ) return 35;
if (parname.EqualTo("cb") ) return 150;
if (parname.EqualTo("dg1z") ) return 0.2;
if (parname.EqualTo("dkz") ) return 0.15;
if (parname.EqualTo("lZ") ) return 0.075;
return -999;
}
示例13: AddProcess
//------------------------------------------------------------------------------
// AddProcess
//------------------------------------------------------------------------------
void AddProcess(TString kind, TString filename)
{
TString fullname = inputdir + filename + ".root";
if (gSystem->AccessPathName(fullname))
{
printf(" [MVA::AddProcess] Cannot access %s\n", fullname.Data());
return;
}
TFile* file = new TFile(fullname, "read");
TTree* tree = (TTree*)file->Get("latino");
if (kind.EqualTo("signal"))
_signaltree = tree;
else
_mctree.push_back(tree);
}
示例14: findSubDirs
HistoTransform::SubDirectory* HistoTransform::findSubDirs(string subDirName, bool identical) {
if (identical && subDirName == "") {
SubDirectory* subDir = new SubDirectory();
subDir -> dir = m_inFile;
m_subDirs.push_back(subDir);
return subDir;
}
TKey* key;
TIter nextkey(m_inFile -> GetListOfKeys());
while ((key = (TKey*) nextkey())) {
TClass* cl = gROOT -> GetClass(key -> GetClassName());
if (!cl) continue;
if (cl -> InheritsFrom(TDirectory::Class())) {
TString name = key -> GetName();
if ((name.Contains(subDirName) && !identical) || name.EqualTo(subDirName)) {
cout << "INFO: found subdirectory '" << name.Data() << "'" << endl;
SubDirectory* subDir = new SubDirectory();
m_inFile -> cd(name);
subDir -> dir = gDirectory;
m_subDirs.push_back(subDir);
if (identical)
return subDir;
else
addBackground(subDir, "bkg");
}
}
}
if (m_subDirs.size() == 0 && !identical) {
cout << "INFO: no subdirectory found, using root directory" << endl;
SubDirectory* subDir = new SubDirectory();
subDir -> dir = m_inFile;
m_subDirs.push_back(subDir);
addBackground(subDir, "bkg");
return subDir;
}
if (identical) {
cout << "WARNING: subdirectory '" << subDirName << "' not found!" << endl;
}
return 0;
}
示例15: draw_from_trees
//.........这里部分代码省略.........
else {
c1->cd();
c1->SetLogy(plotLog);
}
// Draw hists
hs->Draw("hist");
hs->SetTitle(hmc_exp->GetTitle());
hs->GetXaxis()->SetTitle(httbar->GetXaxis()->GetTitle());
hs->GetYaxis()->SetTitle(ytitle);
hs->GetXaxis()->SetLabelSize(0.03);
hs->GetYaxis()->SetLabelSize(0.03);
if (plotData)
{
// hsingle_top->Draw("e1 same");
hs->GetXaxis()->SetLabelSize(0);
}
staterr->Draw("e2 same");
if (plotSig) {
ht1bbbb_1500_100->SetLineColor(2);
ht1bbbb_1500_100->SetLineWidth(4);
ht1bbbb_1500_100->SetFillColor(0);
ht1bbbb_1000_900->SetLineColor(2);
ht1bbbb_1000_900->SetLineWidth(4);
ht1bbbb_1000_900->SetLineStyle(7);
ht1bbbb_1000_900->SetFillColor(0);
ht1tttt_1500_100->SetLineColor(kGreen);
ht1tttt_1500_100->SetLineWidth(4);
ht1tttt_1500_100->SetFillColor(0);
ht1tttt_1200_800->SetLineColor(kGreen);
ht1tttt_1200_800->SetLineStyle(7);
ht1tttt_1200_800->SetLineWidth(4);
ht1tttt_1200_800->SetFillColor(0);
ht1qqqq_1400_100->SetLineColor(1006);
ht1qqqq_1400_100->SetLineWidth(4);
ht1qqqq_1400_100->SetFillColor(0);
ht1qqqq_1000_800->SetLineColor(1006);
ht1qqqq_1000_800->SetLineWidth(4);
ht1qqqq_1000_800->SetLineStyle(7);
ht1qqqq_1000_800->SetFillColor(0);
ht1bbbb_1500_100->Draw("hist same");
ht1bbbb_1000_900->Draw("hist same");
ht1tttt_1500_100->Draw("hist same");
ht1tttt_1200_800->Draw("hist same");
ht1qqqq_1400_100->Draw("hist same");
ht1qqqq_1000_800->Draw("hist same");
}
if (cut_low>0) line_low->Draw("same");
if (cut_high>0) line_high->Draw("same");
// Draw legends
leg1->Draw();
leg2->Draw();
TLatex * latex = new TLatex();
latex->SetNDC();
latex->SetTextAlign(12);
latex->SetTextFont(62);
latex->SetTextSize(0.042);
latex->DrawLatex(0.19, 0.89, "CMS Simulation");
latex->SetTextSize(0.03);
latex->DrawLatex(0.19, 0.84, "#sqrt{s} = 13 TeV, L = 4 fb^{-1}");
// Print
cout << "MakePlots(): Printing..." << endl;
c1->cd();
if (plot_title.EqualTo("default")) plot_title=plotdir+var;
gPad->Print(plotdir+plot_title+".pdf");
// Clean up
delete staterr;
delete leg1;
delete leg2;
delete latex;
// delete pave;
delete hs;
delete pad1;
delete pad2;
delete c1;
delete httbar;
delete hqcd;
delete hznn;
delete hwjets;
delete hsingle_top;
delete hother;
delete hmc_exp;
delete ht1bbbb_1500_100;
delete ht1bbbb_1000_900;
delete ht1tttt_1500_100;
delete ht1tttt_1200_800;
delete ht1qqqq_1400_100;
delete ht1qqqq_1000_800;
cout << "MakePlots(): DONE!" << endl;
return;
}