当前位置: 首页>>代码示例>>C++>>正文


C++ TString::ToLower方法代码示例

本文整理汇总了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());
}
开发者ID:fiveisgreen,项目名称:FNAL_Crane,代码行数:25,代码来源:format_plots_data_main.C

示例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());
  }
  //
}
开发者ID:ktf,项目名称:AliPhysics,代码行数:31,代码来源:SaveCanvas.C

示例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;
	  }
	}
    }
  }
}
开发者ID:krafczyk,项目名称:AMS,代码行数:27,代码来源:GausBF.C

示例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);
  }
}
开发者ID:ktf,项目名称:AliPhysics,代码行数:61,代码来源:runAlien.C

示例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;
}
开发者ID:alisw,项目名称:AliRoot,代码行数:26,代码来源:TaskBuzzer.C

示例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);
  }
开发者ID:ktf,项目名称:AliPhysics,代码行数:20,代码来源:TrackletdNdetaTrain.C

示例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;
}
开发者ID:affablelochan,项目名称:DataAnalysis,代码行数:12,代码来源:rdphi_v1.C

示例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;
}
开发者ID:musinsky,项目名称:AliRsnLite,代码行数:53,代码来源:AddAMEventMixingTest.C

示例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;
}
开发者ID:isando3,项目名称:ThetaScripts,代码行数:52,代码来源:write_test_theta_file.C

示例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;
}
开发者ID:ktf,项目名称:AliPhysics,代码行数:39,代码来源:RunALICE.C

示例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;
}
开发者ID:GiuseppePast,项目名称:kaliveda,代码行数:13,代码来源:KVIVReconIdent.cpp

示例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;
}
开发者ID:akaboth,项目名称:temp_event_display,代码行数:16,代码来源:hyperk_esd_html_summary.C

示例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;
}
开发者ID:cjpl,项目名称:rome,代码行数:16,代码来源:ROMETree.cpp

示例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();
}
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:19,代码来源:TDSPMultiEcho.cpp

示例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;
}
开发者ID:12345ieee,项目名称:cmg-cmssw,代码行数:20,代码来源:GFHistManager.C


注:本文中的TString::ToLower方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。