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


C++ TDirectory::GetList方法代码示例

本文整理汇总了C++中TDirectory::GetList方法的典型用法代码示例。如果您正苦于以下问题:C++ TDirectory::GetList方法的具体用法?C++ TDirectory::GetList怎么用?C++ TDirectory::GetList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TDirectory的用法示例。


在下文中一共展示了TDirectory::GetList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: renameFolders

void renameFolders(TString inputFile, TString outputFile, TString originalDirectory, TString newDirectory) 
{
  TFile f1(inputFile);
  TFile *f2 = new TFile(outputFile,"update");
  
  f1.cd(originalDirectory);
  TDirectory *old = gDirectory;
  old->ReadAll();
  
  f2->cd();
  f2->mkdir(newDirectory);
  f2->cd(newDirectory);
  old->GetList()->Write();
  f2->Close();
}
开发者ID:luigicalligaris,项目名称:HiggsAnalysis-HiggsToTauTau-auxiliaries,代码行数:15,代码来源:renameFolders.C

示例2: looperCR2lep


//.........这里部分代码省略.........

	int yGen_total = 0;
	int yGen_unique = 0;
	int yGen_filter = 0;
	int yGen_vtx = 0;
	int yGen_1goodlep = 0;
	int yGen_lepSel = 0;
	int yGen_2lepveto = 0;
	int yGen_trkVeto = 0;
	int yGen_tauVeto = 0;
	int yGen_2lepCR = 0;
	int yGen_njets = 0;
	int yGen_1bjet = 0;
	int yGen_METcut = 0;
	int yGen_MTcut = 0;
	int yGen_dPhi = 0;
	int yGen_chi2 = 0;

	////////////////////////////////////////////////////////////////////
	// Set up data-specific filters

	if( mySample->IsData() ) {
		set_goodrun_file_json( "reference-files/Cert_271036-284044_13TeV_23Sep2016ReReco_Collisions16_JSON.txt" );
		duplicate_removal::clear_list();
	}


	/////////////////////////////////////////////////////////////////////

	// Loop over events to Analyze
	unsigned int nEventsTotal = 0;
	unsigned int nEventsChain = chain->GetEntries();
	if( nEvents >= 0 ) nEventsChain = nEvents;
	TObjArray *listOfFiles = chain->GetListOfFiles();
	TIter fileIter(listOfFiles);
	TFile *currentFile = 0;

	// File Loop
	while ( (currentFile = (TFile*)fileIter.Next()) ) {

		// Get File Content
		TFile file( currentFile->GetTitle() );
		TString filename = file.GetName();
		TTree *tree = (TTree*)file.Get("t");
		if(fast) TTreeCache::SetLearnEntries(10);
		if(fast) tree->SetCacheSize(128*1024*1024);
		cms3.Init(tree);

		// Load event weight histograms
		TH2F* hNEvts = (TH2F*)file.Get("histNEvts");
		TH3D* hCounterSMS = (TH3D*)file.Get("h_counterSMS");
		TH1D* hCounter = (TH1D*)file.Get("h_counter");
		myHelper.Setup( isFastsim, hCounter, hNEvts, hCounterSMS );

		// Reset zeroing histograms
		for( int i=0; i<nSigRegs; i++ ) {
			for( int j=0; j<=nVariations; j++ ) {
				h_bkgtype[i][j]->Reset();
				h_evttype[i][j]->Reset();
			}
		}
		h_yields->Reset();

		// Loop over Events in current file
		if( nEventsTotal >= nEventsChain ) continue;
		unsigned int nEventsTree = tree->GetEntriesFast();
开发者ID:dsklein,项目名称:StopLooper,代码行数:67,代码来源:looperCR2lep.C

示例3: Loop


//.........这里部分代码省略.........
		// check the pt resolution for the muons
		//if (mumu && (l1_ptErr/l1_pt > 0.1 || l2_ptErr/l2_pt > 0.1)) continue;
		
		// Z mass window
		if (fabs(ll_m - 91.) > 15.) continue;
		compteur[2]++; 
		
		// b-tagging
		isThereBJet = 0;
		
		for (int i = 0; i < jn; i++) {
			jet_eta = 0.5*log((jn_en[i]+jn_pz[i])/(jn_en[i]-jn_pz[i]));
			jet_pt = sqrt(jn_px[i]*jn_px[i] + jn_py[i]*jn_py[i]);
			if(fabs(jet_eta) < 2.4 && jet_pt > 30. && jn_btag1[i] >= 2) {
				isThereBJet = 1;
				i = jn;
			}
		}
		if (isThereBJet) continue;
		compteur[3]++;
	
		// check pt of the Z candidate
		if (ll_pt < 25) continue;
		compteur[4]++;	
		
		// reject events with more than 2 leptons
		if (ln > 0){
			if (abs(ln_id[0]) == 11 && sqrt(ln_px[0]*ln_px[0]+ln_py[0]*ln_py[0])>10. ) continue;
			if (abs(ln_id[0]) == 13 ) continue;
		}
		compteur[5]++;		
		
		// check the isolation of the leptons
		if (mumu && (l1_CRI > 0.15 || l2_CRI > 0.15)) continue;
		else if (ee && (l1_CRI > 0.15 || l2_CRI > 0.15)) continue;
		compteur[6]++;		
	
		
				
		// pt minimum for each lepton
		if (l1_pt < 20 || l2_pt < 20) continue;
		compteur[7]++;
		

	
		// Fill histos
		if (ee){
			hee_llMass->Fill(ll_m, finWeight);
			hee_llPt->Fill(ll_pt, finWeight);
			hee_l1Eta->Fill(l1_eta, finWeight);
			hee_l2Eta->Fill(l2_eta, finWeight);
			hee_l1Pt->Fill(l1_pt, finWeight);
			hee_l2Pt->Fill(l2_pt, finWeight);
			hee_MET1Pt->Fill(met1_pt, finWeight);
			compteurEE++;
		}
		else if (mumu){
			hmumu_llMass->Fill(ll_m, finWeight);
			hmumu_llPt->Fill(ll_pt, finWeight);
			hmumu_l1Eta->Fill(l1_eta, finWeight);
			hmumu_l2Eta->Fill(l2_eta, finWeight);
			hmumu_l1Pt->Fill(l1_pt, finWeight);
			hmumu_l2Pt->Fill(l2_pt, finWeight);
			hmumu_MET1Pt->Fill(met1_pt, finWeight);
			compteurMuMu++;
		} 

			
	}


	// display histogram
	
	hee_llMass->SetXTitle("M_{ll}  (GeV)");
	hee_l1Pt->SetXTitle("p_{t}  (GeV)");
	hee_l2Pt->SetXTitle("p_{t}  (GeV)");
	hee_MET1Pt->SetXTitle("MET1  (GeV)");
	hee_l1Eta->SetXTitle("#eta");
	hee_l2Eta->SetXTitle("#eta");
	
	hmumu_llMass->SetXTitle("M_{ll}  (GeV)");
	hmumu_l1Pt->SetXTitle("p_{t}  (GeV)");
	hmumu_l2Pt->SetXTitle("p_{t}  (GeV)");
	hmumu_MET1Pt->SetXTitle("MET1  (GeV)");
	hmumu_l1Eta->SetXTitle("#eta");
	hmumu_l2Eta->SetXTitle("#eta");
	
	
	dir->GetList()->Write();
	file->Close();
	dir->GetList()->Delete();

	cout << endl;	
	for (int i = 0; i<8; i++){
		cout <<" compteur  "<<i<< "  " <<  compteur[i] << endl;
	}
	cout << endl;
	cout << "compteurEE = " << compteurEE << "  compteurMuMu = " << compteurMuMu << endl;

}
开发者ID:ECALELFS,项目名称:usercode,代码行数:101,代码来源:higgsAna.c


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