本文整理汇总了C++中TString::ToLower方法的典型用法代码示例。如果您正苦于以下问题:C++ TString::ToLower方法的具体用法?C++ TString::ToLower怎么用?C++ TString::ToLower使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TString
的用法示例。
在下文中一共展示了TString::ToLower方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SaveCanvas
void SaveCanvas(TCanvas * c, string fileNameAndDir, string FileTypes){
/*
Supply a canvas, a name you'd like the file to have (possibly prefixed by a directory),
and a string containing the names of file extensons. The default is to save as .C, .root, .pdf, .jpg, .gif, .png, and .eps
The filetype string is case insensitive.
For example
SaveCanvas(myCanvas, "plots/mycanvas")
saves canvas in dir plots as mycanvas.C, mycanvas.root, mycanvas.jpg
all types are saved.
SaveCanvas(myCanvas, "mycanvas","jpgif")
saves the canvas as mycanvas.jpg and mycanvas.gif
*/
TString TFileTypes = FileTypes;
TFileTypes.ToLower();
string lc_types = TFileTypes.Data();
if(lc_types.find("c")!=string::npos) c->SaveAs((char*)(fileNameAndDir+".C").c_str());
if(lc_types.find("root")!=string::npos) c->SaveAs((char*)(fileNameAndDir+".root").c_str());
if(lc_types.find("pdf")!=string::npos) c->SaveAs((char*)(fileNameAndDir+".pdf").c_str());
if(lc_types.find("jpg")!=string::npos) c->SaveAs((char*)(fileNameAndDir+".jpg").c_str());
if(lc_types.find("gif")!=string::npos) c->SaveAs((char*)(fileNameAndDir+".gif").c_str());
if(lc_types.find("png")!=string::npos) c->SaveAs((char*)(fileNameAndDir+".png").c_str());
if(lc_types.find("eps")!=string::npos) c->SaveAs((char*)(fileNameAndDir+".eps").c_str());
}
示例2: SaveCanvas
void SaveCanvas(TCanvas* canv,const char* path="canv",const Option_t *option="ecg")
{
TString name;
TString opt = option; opt.ToLower();
//
TString name0 = path;
if (name0.IsNull()) name0 = "defCanv";
//
TFrame* fr = GetFrame();
if (fr) fr->SetBorderMode(0);
if (opt.Contains("c")) {
name = name0; name+=".C";
canv->Print(name.Data());
}
//
if (opt.Contains("e")) {
name = name0; name+=".eps";
canv->Print(name.Data());
}
//
if (opt.Contains("g")) {
name = name0; name+=".gif";
canv->Print(name.Data());
}
//
if (opt.Contains("p")) {
name = name0; name+=".ps";
canv->Print(name.Data());
}
//
}
示例3: Print
void GausBF::Print(Option_t *option) const
{
TString sopt = option; sopt.ToLower();
if (sopt == "dump") {
for (Int_t i = 0; i < Ns1*Ns9*Np; i++) {
cout << Form(" %10.3e,", _par[i]);
if (i%6 == 5) cout << endl;
}
cout << endl;
}
if (sopt.BeginsWith("p")) {
TString ss = sopt(1, 2);
if (ss.IsDigit()) {
Int_t ip = ss.Atoi();
if (0 <= ip && ip < Np)
for (Int_t i = 0; i < Ns1; i++) {
for (Int_t j = 0; j < Ns9; j++) {
AMSPoint p1 = GetP1(i);
AMSPoint p9 = GetP9(j);
cout << Form("%3d %3d %6.2f %6.2f %7.2f %7.2f %10.3e",
i, j, p1.x(), p1.y(),
p9.x(), p9.y(), _par[(i*Ns9+j)*Np+ip]) << endl;
}
}
}
}
}
示例4: runAlien
//___________________________________________________________
void runAlien(TString data, TString mode = "test", Bool_t MC = kFALSE){
if(!gSystem->Getenv("ALICE_ROOT")){
printf("AliRoot has to be initialized\n");
return;
}
// check for valid modes
const int kModes = 5;
TString allowed_modes[kModes] = {"proof", "prooftest", "test", "full", "submit"};
Bool_t isValid = kFALSE;
mode.ToLower();
for(int imode = 0; imode < kModes; imode++){
if(!mode.CompareTo(allowed_modes[imode])) isValid = kTRUE;
}
if(!isValid){
printf("invalid analysis mode selected\n");
return;
}
analysis_mode = mode;
Bool_t proofmode = mode.Contains("proof");
// libraries to be loaded
gSystem->Load("libANALYSIS");
gSystem->Load("libANALYSISalice");
gSystem->Load("libCORRFW");
gSystem->Load("libPWGhfe");
// Create Analysis Manager
AliAnalysisManager *runAnalysis = new AliAnalysisManager("Heavy Flavour Electron Analysis");
runAnalysis->SetCommonFileName(output_file.Data());
runAnalysis->SetInputEventHandler(new AliESDInputHandler);
if(MC) runAnalysis->SetMCtruthEventHandler(new AliMCEventHandler);
AliAnalysisAlien *alienhandler = CreateAlienHandler(proofmode);
printf("alienhandler %p\n", alienhandler);
runAnalysis->SetGridHandler(alienhandler);
//return;
// Specify input (runs or dataset)
if(!proofmode){
// Query sample ID and runs
TString sample;
TArrayI listofruns;
DecodeDataString(data, sample, listofruns);
AddInput(alienhandler, sample, listofruns, MC);
} else {
alienhandler->SetProofDataSet(data);
}
// Add Tasks
gROOT->LoadMacro(Form("%s/OADB/macros/AddTaskPhysicsSelection.C", gSystem->Getenv("ALICE_ROOT")));
gROOT->LoadMacro(Form("%s/PWG3/hfe/macros/AddTaskHFE.C", gSystem->Getenv("ALICE_ROOT")));
AddTaskPhysicsSelection(MC);
AddTaskHFE(); // @TODO: MC and PbPb flag to be fixed
// Run Analysis
TString anamode = proofmode ? "proof" : "grid";
if(runAnalysis->InitAnalysis()){
runAnalysis->PrintStatus();
runAnalysis->StartAnalysis(anamode);
}
}
示例5: CreateChain
//________________________________________________________________________________
TChain* CreateChain(const char *xmlfile, const char *type)
{
// Create a chain using url's from xml file
TString treename = type;
treename.ToLower();
treename += "Tree";
printf("***************************************\n");
printf(" Getting chain of trees %s\n", treename.Data());
printf("***************************************\n");
TGridCollection *coll = gGrid->OpenCollection(xmlfile);
if (!coll) {
::Error("CreateChain", "Cannot create an AliEn collection from %s", xmlfile);
return NULL;
}
TChain *chain = new TChain(treename);
coll->Reset();
while (coll->Next()) {
chain->Add(coll->GetTURL(""));
}
if (!chain->GetNtrees()) {
::Error("CreateChain", "No tree found from collection %s", xmlfile);
return NULL;
}
return chain;
}
示例6: CreateInputHandler
/**
* Create the input handler. This is overwritten from the base
* class to allow using AliESDInputHandlerRP for rec. points., and
* AliMixInputEventHandler if requested.
*
* @param type Type of analysis
* @param needRec if true, also get rec-points
*
* @return The input handler
*/
AliVEventHandler* CreateInputHandler(UShort_t type, Bool_t needRec=false)
{
TString recMode = fOptions.AsString("reconstruct");
recMode.ToLower();
Bool_t needRP = (recMode.Contains("nor") ||
recMode.Contains("inj") ||
recMode.Contains("rot") || needRec);
// Info("CreateInputHandler", "Will create for %d (%d)", type, needRP);
return TrainSetup::CreateInputHandler(type, needRP);
}
示例7: string_true_false
bool rdphi::string_true_false(TString tf)
{
tf.ToLower();
bool b = false;
if ( tf == "true" ){
b = true;
}
else if ( tf != "false" ) {
throw(" option value must be \"true\" or \"false\" ");
}
return b;
}
示例8: AddAMEventMixingTest
Bool_t AddAMEventMixingTest(TString analysisSource = "proof", TString analysisMode = "test",TString input="aod",TString inputMC="", TString postfix = "",TString idStr="0")
{
Bool_t useEventMixingPar = 1;
Int_t usePhysSel = 1;
Bool_t useMC = !inputMC.CompareTo("mc");
input.ToLower();
// ALICE stuff
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) { Printf("Error[AddAMEventMixingTest] mgr is null !!!"); return kFALSE; }
AliAnalysisGrid *analysisPlugin = mgr->GetGridHandler();
if (!analysisPlugin) { Printf("Error[AddAMEventMixingTest] : analysisPlugin is null !!!"); return kFALSE; }
TString myAdditionalLibs;
if (useEventMixingPar) { AliAnalysisAlien::SetupPar("EventMixing"); myAdditionalLibs += " EventMixing.par"; }
else { gSystem->Load("libEventMixing.so"); myAdditionalLibs += " libEventMixing.so"; }
gROOT->LoadMacro("AliAnalysisTaskEx02.cxx++g");
analysisPlugin->SetAnalysisSource("AliAnalysisTaskEx02.cxx+");
myAdditionalLibs+=" AliAnalysisTaskEx02.h AliAnalysisTaskEx02.cxx";
analysisPlugin->SetAdditionalLibs(myAdditionalLibs.Data());
AliMultiInputEventHandler *multiInputHandler = mgr->GetInputEventHandler();
if (usePhysSel && !input.CompareTo("esd")) {
gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
AddTaskPhysicsSelection(useMC);
// maybe we can put it in $ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C
AliMultiInputEventHandler *multiIH = dynamic_cast<AliMultiInputEventHandler *>(mgr->GetInputEventHandler());
if (multiIH){
AliESDInputHandler *esdIH = dynamic_cast<AliESDInputHandler *>(multiIH->GetFirstInputEventHandler());
if (esdIH) esdIH->SetEventSelection(multiIH->GetEventSelection());
AliAODInputHandler *aodIH = dynamic_cast<AliAODInputHandler *>(multiIH->GetFirstInputEventHandler());
if (aodIH) aodIH->SetEventSelection(multiIH->GetEventSelection());
}
}
// add mixing handler (uncomment to turn on Mixnig)
gROOT->LoadMacro("AddMixingHandler.C");
AddMixingHandler(multiInputHandler, input, useMC,postfix);
// load and run AddTask macro
gROOT->LoadMacro("AddEventMixingTestTask.C");
AddEventMixingTestTask(input, useMC, postfix);
return kTRUE;
}
示例9: get_sample_name
TString get_sample_name(TString name)
{
TObjArray* arr = name.Tokenize(".");
TString out = ((TObjString*)arr->At(arr->GetEntries()-2))->GetString();
out.ReplaceAll("_JER_up", "");
out.ReplaceAll("_JER_down", "");
out.ReplaceAll("_JEC_up", "");
out.ReplaceAll("_JEC_down", "");
out.ReplaceAll("_PU_down", "");
out.ReplaceAll("_PU_up", "");
out.ReplaceAll("_LJets_up", "");
out.ReplaceAll("_LJets_down", "");
out.ReplaceAll("_BJets_up", "");
out.ReplaceAll("_BJets_down", "");
out.ReplaceAll("_MuonSF_down", "");
out.ReplaceAll("_MuonSF_up", "");
out.ReplaceAll("_BJets_down", "");
out.ReplaceAll("_BJets_down", "");
out.ReplaceAll("_matching_down", "");
out.ReplaceAll("_matching_up", "");
out.ReplaceAll("_scale_down", "");
out.ReplaceAll("_scale_up", "");
out.ToLower();
out.ReplaceAll("dyjets_50toinf", "zlight");
out.ReplaceAll("dyjets", "zlight");
out.ReplaceAll("dy", "zlight");
out.ReplaceAll("wjets_bflavor", "wb");
out.ReplaceAll("wjets_cflavor", "wc");
out.ReplaceAll("wjets_lflavor", "wlight");
//out.ReplaceAll("tt", "ttbar");
if (out.Contains("zp")){
TString temp = out;
temp.ReplaceAll("zp","");
temp.ReplaceAll("p", ".");
TObjArray* arr2 = temp.Tokenize("w");
TString nom = ((TObjString*)arr2->At(1))->GetString();
TString denom = ((TObjString*)arr2->At(0))->GetString();
cout << "nom = " << nom << " denom = " << denom << endl;
Int_t p = (100*nom.Atof())/denom.Atof();
cout << "p = " << p << endl;
out = TString::Format("zp %d w %d p",denom.Atoi(), p);
out.ReplaceAll(" ", "");
}
return out;
}
示例10: CreateInputHandlers
Bool_t CreateInputHandlers(TString input,TString inputMC,Bool_t useAODOut=kFALSE,Bool_t useMultiHandler=kTRUE) {
input.ToLower();
inputMC.ToLower();
Bool_t useMC = !inputMC.CompareTo("mc");
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) { Printf("Error [CreateInputHandlers] : mgr is null !!!"); return kFALSE; }
if (useMultiHandler) {
AliMultiInputEventHandler *inputHandler = new AliMultiInputEventHandler();
if (!input.CompareTo("esd")) {
Printf("Adding ESD Input Handler ...");
inputHandler->AddInputEventHandler(new AliESDInputHandler());
if (useMC) inputHandler->AddInputEventHandler(new AliMCEventHandler());
} else if (!input.CompareTo("aod")) {
inputHandler->AddInputEventHandler(new AliAODInputHandler());
}
mgr->SetInputEventHandler(inputHandler);
} else {
if (!input.CompareTo("esd")) {
mgr->SetInputEventHandler(new AliESDInputHandler());
if (useMC) mgr->SetMCtruthEventHandler(new AliMCEventHandler());
} else if (!input.CompareTo("aod")) {
mgr->SetInputEventHandler(new AliAODInputHandler());
}
}
if (useAODOut) {
AliAODHandler *aodHandler = new AliAODHandler();
aodHandler->SetOutputFileName("AliAOD.root");
mgr->SetOutputEventHandler(aodHandler);
}
return kTRUE;
}
示例11: InitAnalysis
void KVIVReconIdent::InitAnalysis(void)
{
TString dt;
dt = gDataSet->GetDataSetEnv("KVIVReconIdent.DataToAnalyse", "INDRA VAMOS");
dt.ToLower();
Info("InitAnalysis", "Analysing data of %s", dt.Data());
if (dt.Contains("indra")) SetBit(kINDRAdata);
if (dt.Contains("vamos")) SetBit(kVAMOSdata);
if (TestBit(kINDRAdata)) cout << "INDRA" << endl;
if (TestBit(kVAMOSdata)) cout << "VAMOS" << endl;
}
示例12: HtmlObjTable
//______________________________________________________________________________
HtmlObjTable *HtmlSummary::AddTable(const char *name, Int_t nfields,
Bool_t exp, Option_t *option)
{
// Add a new table in our list of tables.
TString opt = option;
opt.ToLower();
HtmlObjTable *table = new HtmlObjTable(name, nfields, exp);
fNTables++;
if (opt.Contains("first"))
fObjTables->AddFirst(table);
else
fObjTables->Add(table);
return table;
}
示例13: AutoSave
//______________________________________________________________________________
Long64_t ROMETree::AutoSave(Option_t *option)
{
Long64_t ret = 0;
if (fAutoSaveSize > 0 && isWrite() && fTree && fTree->GetCurrentFile()) {
ret = fTree->AutoSave(option);
#if (ROOT_VERSION_CODE > ROOT_VERSION(4,4,2))
fLastSaveSize = fTree->GetCurrentFile()->GetBytesWritten();
#else
fLastSaveSize = static_cast<Long64_t>(fTree->GetCurrentFile()->GetBytesWritten());
#endif
TString opt = option;
opt.ToLower();
}
return ret;
}
示例14: Draw
void TDSPMultiEcho::Draw(Option_t *o, Double_t x0, Double_t x1, UInt_t num) {
TString opt = o;
opt.ToLower();
Ssiz_t pos;
if ((pos = opt.Index("multi"))!= kNPOS) {
opt.Remove(pos,5);
TMultiGraph *m = MultiGraph(NULL,x0,x1,num);
m->Draw(o);
m->GetXaxis()->SetTitle("#tau / #mu s");
gPad->Update();
return;
}
TGraph *a = Graph(NULL,x0,x1,num);
a->Draw(o);
a->GetXaxis()->SetTitle("#tau / #mu s");
gPad->Update();
}
示例15: MinOfHist
//________________________________________________________
Double_t GFHistManager::MinOfHist(const TH1* h) const
{
// Take bin with min content, subtract error and returns (no *1.05 applied!),
// but cares that - together with an error bar - another bin might be lower...
// If the hists option contains nothing about errors: error is NOT subtracted!
TString option = h->GetOption();
option.ToLower();
option.ReplaceAll("same", 0);
const Int_t minBin = h->GetMinimumBin();
Double_t result = h->GetBinContent(minBin);
if(option.Contains('e') || (h->GetSumw2N() && !option.Contains("hist"))){
for(Int_t bin = 1; bin <= h->GetNbinsX(); ++bin){ //FIXME: for 2/3D: loop over y/z!
result = TMath::Min(result, (h->GetBinContent(bin) - h->GetBinError(bin)));
}
}
return result;
}