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


C++ TBranch::SetAutoDelete方法代码示例

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


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

示例1: TFile

MakeTrees::MakeTrees(TString const & outputFile, Int_t const f_layersNumber) : m_layersNumber(f_layersNumber){
	output = new TFile(outputFile, "RECREATE");

	int branchStyle = 1 ;
	TTree::SetBranchStyle(branchStyle);	
	TBranch *branch;		
		
	tracksTree = new TTree("Tracks","Tracks");
		branch = tracksTree->Branch("x0",  &v_T_x0, "x0/F" );	 branch->SetAutoDelete(kFALSE);
		branch = tracksTree->Branch("y0",  &v_T_y0, "y0/F" );	 branch->SetAutoDelete(kFALSE);
		branch = tracksTree->Branch("t0",  &v_T_t0, "t0/F" );	 branch->SetAutoDelete(kFALSE);
		branch = tracksTree->Branch("tan", &v_T_tan,"tan/F");	 branch->SetAutoDelete(kFALSE);
		branch = tracksTree->Branch("off", &v_T_off,"off/F");	 branch->SetAutoDelete(kFALSE);

	recoTree   = new TTree("Reco","Reco");
		branch = recoTree->Branch("reco",      &v_R_reco,      "reco/O" );		 branch->SetAutoDelete(kFALSE);
		branch = recoTree->Branch("nPoints",   &v_R_nPoints,   "nPoints/I" );		 branch->SetAutoDelete(kFALSE);
		branch = recoTree->Branch("slope",     &v_R_slope,     "slope/F" );		 branch->SetAutoDelete(kFALSE);
		branch = recoTree->Branch("offset",    &v_R_offset,    "offset/F" );		 branch->SetAutoDelete(kFALSE);
		branch = recoTree->Branch("theta",     &v_R_theta,     "theta/F" );		 branch->SetAutoDelete(kFALSE);
		branch = recoTree->Branch("slopeErr",  &v_R_slopeErr,  "slopeErr/F" );	 branch->SetAutoDelete(kFALSE);
		branch = recoTree->Branch("offsetErr", &v_R_offsetErr, "offsetErr/F" );	 branch->SetAutoDelete(kFALSE);
		branch = recoTree->Branch("thetaErr",  &v_R_thetaErr,  "thetaErr/F" );	 branch->SetAutoDelete(kFALSE);
		branch = recoTree->Branch("chi",       &v_R_chi,       "chi/F" );		 branch->SetAutoDelete(kFALSE);

	sensorsTree = std::vector<TTree *>();
	for(Int_t i = 0; i < m_layersNumber; i++){
		TString name = "Sensor_";
		name += i;
		sensorsTree.push_back( new TTree(name,name) );
			branch = sensorsTree.back()->Branch("real",     &v_S_real,     "real/F" );	 branch->SetAutoDelete(kFALSE);
			branch = sensorsTree.back()->Branch("blurry",   &v_S_blurry,   "blurry/F" );	 branch->SetAutoDelete(kFALSE);
			branch = sensorsTree.back()->Branch("observed", &v_S_observed, "observed/O" );	 branch->SetAutoDelete(kFALSE);
			branch = sensorsTree.back()->Branch("measured", &v_S_measured, "measured/F" );	 branch->SetAutoDelete(kFALSE);
			branch = sensorsTree.back()->Branch("isReco",   &v_S_isReco,   "isReco/O" );	 branch->SetAutoDelete(kFALSE);
			branch = sensorsTree.back()->Branch("recoVal",  &v_S_recoVal,  "recoVal/F" );	 branch->SetAutoDelete(kFALSE);
			branch = sensorsTree.back()->Branch("recoErr",  &v_S_recoErr,  "recoErr/F" );	 branch->SetAutoDelete(kFALSE);
	}
}
开发者ID:krzjanas,项目名称:SiDetectorExperiment,代码行数:39,代码来源:MakeTrees.cpp


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