本文整理汇总了C++中TString::Copy方法的典型用法代码示例。如果您正苦于以下问题:C++ TString::Copy方法的具体用法?C++ TString::Copy怎么用?C++ TString::Copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TString
的用法示例。
在下文中一共展示了TString::Copy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dir
void
DrawPlot::drawPlot(const TString& pluginName, const TString& histName, const bool normalise, const bool plotZeroApe){
TString* plugin = new TString(pluginName.Copy());
if(!plugin->IsNull())plugin->Append("/");
for(unsigned int iSector=1; ; ++iSector){
std::stringstream ss_sectorName, ss_sector;
ss_sectorName<<"Sector_"<<iSector;
ss_sector<<*plugin<<ss_sectorName.str()<<"/";
TDirectory* dir(0);
//std::cout<<"Sector: "<<ss_sector.str()<<"\n";
dir = (TDirectory*)designFile_->TDirectory::GetDirectory(ss_sector.str().c_str());
if(!dir)break;
TH1* SectorName(0);
designFile_->GetObject((ss_sector.str()+"z_name;1").c_str(), SectorName);
const TString sectorName(SectorName ? SectorName->GetTitle() : ss_sectorName.str().c_str());
TTree* baselineTree(0);
if(histName=="h_residualWidthX1"){baselineTree = baselineTreeX_;}
else if(histName=="h_residualWidthY1"){baselineTree = baselineTreeY_;}
if(baselineTree){
std::stringstream ss_branch;
ss_branch<<"Ape_Sector_"<<iSector;
TBranch* branch(0);
branch = baselineTree->GetBranch(ss_branch.str().c_str());
if(branch){
double delta0(999.);
branch->SetAddress(&delta0);
branch->GetEntry(0);
delta0_ = new double(std::sqrt(delta0));
}
else delta0_ = 0;
}
else delta0_ = 0;
if(histName=="h_entriesX" || histName=="h_entriesY" ||
histName=="h_ResX" || histName=="h_ResY" ||
histName=="h_NorResX" || histName=="h_NorResY")ss_sector<<"Results/";
ss_sector<<histName;
const TString fullName(ss_sector.str().c_str());
this->printHist(fullName, histName.Copy().Append("_").Append(sectorName), normalise, plotZeroApe);
if(delta0_)delete delta0_;
}
}
示例2: 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);
}
示例3: analyzer
void analyzer(TString infilename="numH.gst.root")
{
TString weightfilename = infilename.Copy();
TString outfilename = infilename.Copy();
weightfilename.ReplaceAll("gst","rewght");
outfilename.ReplaceAll("gst","hists");
cout << "Input file: " << infilename << endl;
cout << "Weight file: " << weightfilename << endl;
cout << "Output file: " << outfilename << endl;
TFile * infile = new TFile(infilename);
TTree * tree = (TTree *) infile->Get("gst");
tree->AddFriend("weights",weightfilename);
//tree->Print();
TFile * outfile = new TFile(outfilename,"RECREATE");
//////////////////////////////////////////////
Int_t neu, fspl, tgt, Z, A, hitnuc, hitqrk, resid;
tree->SetBranchAddress("neu",&neu);
tree->SetBranchAddress("fspl",&fspl);
tree->SetBranchAddress("tgt",&tgt);
tree->SetBranchAddress("Z",&Z);
tree->SetBranchAddress("A",&A);
tree->SetBranchAddress("hitnuc",&hitnuc);
tree->SetBranchAddress("hitqrk",&hitqrk);
tree->SetBranchAddress("resid",&resid);
Bool_t sea, qel, mec, res, dis, coh, dfr, imd, imdanh, singlek, nuel, em, cc, nc, charm;
tree->SetBranchAddress("sea",&sea);
tree->SetBranchAddress("qel",&qel);
tree->SetBranchAddress("mec",&mec);
tree->SetBranchAddress("res",&res);
tree->SetBranchAddress("dis",&dis);
tree->SetBranchAddress("coh",&coh);
tree->SetBranchAddress("dfr",&dfr);
tree->SetBranchAddress("imd",&imd);
tree->SetBranchAddress("imdanh",&imdanh);
tree->SetBranchAddress("singlek",&singlek);
tree->SetBranchAddress("nuel",&nuel);
tree->SetBranchAddress("em",&em);
tree->SetBranchAddress("cc",&cc);
tree->SetBranchAddress("nc",&nc);
tree->SetBranchAddress("charm",&charm);
Double_t xs, ys, ts, Q2s, Ws, x, y, t, Q2, W, EvRF, Ev, En, El, sumKEf, calresp0;
tree->SetBranchAddress("xs",&xs);
tree->SetBranchAddress("ys",&ys);
tree->SetBranchAddress("ts",&ts);
tree->SetBranchAddress("Q2s",&Q2s);
tree->SetBranchAddress("Ws",&Ws);
tree->SetBranchAddress("x",&x);
tree->SetBranchAddress("y",&y);
tree->SetBranchAddress("t",&t);
tree->SetBranchAddress("Q2",&Q2);
tree->SetBranchAddress("W",&W);
tree->SetBranchAddress("EvRF",&EvRF);
tree->SetBranchAddress("Ev",&Ev);
tree->SetBranchAddress("En",&En);
tree->SetBranchAddress("El",&El);
tree->SetBranchAddress("sumKEf",&sumKEf);
tree->SetBranchAddress("calresp0",&calresp0);
Int_t nfp, nfn, nfpip, nfpim, nfpi0, nfkp, nfkm, nfk0, nfem, nfother;
tree->SetBranchAddress("nfp",&nfp);
tree->SetBranchAddress("nfn",&nfn);
tree->SetBranchAddress("nfpip",&nfpip);
tree->SetBranchAddress("nfpim",&nfpim);
tree->SetBranchAddress("nfpi0",&nfpi0);
tree->SetBranchAddress("nfkp",&nfkp);
tree->SetBranchAddress("nfkm",&nfkm);
tree->SetBranchAddress("nfk0",&nfk0);
tree->SetBranchAddress("nfem",&nfem);
tree->SetBranchAddress("nfother",&nfother);
Int_t nip, nin, nipip, nipim, nipi0, nikp, nikm, nik0, niem, niother;
tree->SetBranchAddress("nip",&nip);
tree->SetBranchAddress("nin",&nin);
tree->SetBranchAddress("nipip",&nipip);
tree->SetBranchAddress("nipim",&nipim);
tree->SetBranchAddress("nipi0",&nipi0);
tree->SetBranchAddress("nikp",&nikp);
tree->SetBranchAddress("nikm",&nikm);
tree->SetBranchAddress("nik0",&nik0);
tree->SetBranchAddress("niem",&niem);
tree->SetBranchAddress("niother",&niother);
Float_t xsec;
tree->SetBranchAddress("weights.xsec",&xsec);
//////////////////////////////////////////////
TH1::SetDefaultSumw2();
//.........这里部分代码省略.........