本文整理汇总了C++中string::GetListOfKeys方法的典型用法代码示例。如果您正苦于以下问题:C++ string::GetListOfKeys方法的具体用法?C++ string::GetListOfKeys怎么用?C++ string::GetListOfKeys使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类string
的用法示例。
在下文中一共展示了string::GetListOfKeys方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawComparisonXSecSyst
void DrawComparisonXSecSyst(void){
struct STestFunctor {
bool operator()(TObject *aObj) {
cout<<aObj->GetTitle()<<endl;
//cout<<"pippo"<<endl;
//comparisonJetMCData(aObj->GetTitle,1);
return true;
}
};
treeBKG_->Branch("bckg_leadingJetPt",&bckg_leadingJetPt);
treeBKG_->Branch("bckg_2leadingJetPt",&bckg_2leadingJetPt);
treeBKG_->Branch("bckg_3leadingJetPt",&bckg_3leadingJetPt);
treeBKG_->Branch("bckg_4leadingJetPt",&bckg_4leadingJetPt);
treeBKG_->Branch("bckg_JetMultiplicity",&bckg_JetMultiplicity);
gROOT->Reset();
gROOT->ForceStyle();
gROOT->LoadMacro("tdrStyle.C++");
tdrStyle();
// Recupero l'informazione sul numero di eventi processati per singolo MC
dataNumEvents = numEventsPerStep(datafile, "demo");
zNumEvents = numEventsPerStep(mcfile, "demo");
ttNumEvents = numEventsPerStep(back_ttbar, "demo");
wNumEvents = numEventsPerStep(back_w, "demo");
wzEvents = numEventsPerStep(WZ, "demo");
zzEvents = numEventsPerStep(ZZ, "demo");
wwEvents = numEventsPerStep(WW, "demo");
// ---------------------------------------------------
string direc="/gpfs/cms/data/2011/Observables/";
//string direc=plotpath;
if (isAngularAnalysis){
mcfile=direc+"MC_zjets"+version;
back_w=direc+"MC_wjets"+version;
back_ttbar=direc+"MC_ttbar"+version;
WW=direc+"MC_diW"+version;
ZZ=direc+"MC_siZ"+version;
WZ=direc+"MC_diWZ"+version;
datafile=direc+"DATA"+version;
}
TFile *mcf = TFile::Open(mcfile.c_str()); //MC file
mcf->cd("validationJEC/");
TDirectory *dir=gDirectory;
TList *mylist=(TList*)dir->GetListOfKeys();
TIter iter(mylist);
// Use TIter::Next() to get each TObject mom owns.
TObject* tobj = 0;
string tmpname;
// input and output files
string FileName(outfilename);
//FileName += ".root";
OutputFile = TFile::Open(FileName.c_str() , "RECREATE" ) ;
int i=0; // solo di servizio quando debuggo...
while ( (tobj = iter.Next()) ) {
gROOT->Reset();
gROOT->ForceStyle();
tdrStyle();
gStyle->SetPadRightMargin(0.15);
string name=tobj->GetName();
TString temp = (TString)name;
//int num=tobj->GetUniqueID();
if(temp.Contains("weight")){
mcf = TFile::Open(mcfile.c_str());
TFile *ttbarf = TFile::Open(back_ttbar.c_str());
TFile *wf = TFile::Open(back_w.c_str());
TFile *wzf = TFile::Open(WZ.c_str());
TFile *zzf = TFile::Open(ZZ.c_str());
TFile *wwf = TFile::Open(WW.c_str());
TCanvas * Canvweight = new TCanvas("Canvweight","Canvweight",0,0,800,600);
//if (Canv) delete Canv;
//Canv = new TCanvas("Canv","Canv",0,0,800,600);
gPad->SetLogy(1);
//---- weights
mcf->cd("validationJEC");
TH1F* mc;
gDirectory->GetObject(name.c_str(),mc);
if(mc){
mc->SetFillColor(kRed);
mc->GetXaxis()->SetRangeUser(0.,12.);
mc->SetMinimum(1.);
mc->Draw();
zwemean = mc->GetMean();
tmpname=plotpath+name+"-zjets.png";
Canvweight->Print(tmpname.c_str());
}
//---- weights
//.........这里部分代码省略.........