本文整理汇总了C++中TClonesArray::BypassStreamer方法的典型用法代码示例。如果您正苦于以下问题:C++ TClonesArray::BypassStreamer方法的具体用法?C++ TClonesArray::BypassStreamer怎么用?C++ TClonesArray::BypassStreamer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TClonesArray
的用法示例。
在下文中一共展示了TClonesArray::BypassStreamer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tclwrite
void tclwrite(Int_t split)
{
// Generate a Tree with a TClonesArray
// The array can be split or not
TFile f("tcl.root","recreate");
f.SetCompressionLevel(1); //try level 2 also
TTree T("T","test tcl");
TClonesArray *arr = new TClonesArray("TLine");
TClonesArray &ar = *arr;
T.Branch("tcl",&arr,256000,split);
//By default a TClonesArray is created with its BypassStreamer bit set.
//However, because TLine has a custom Streamer, this bit was reset
//by TTree::Branch above. We set again this bit because the current
//version of TLine uses the automatic Streamer.
//BypassingStreamer saves space and time.
arr->BypassStreamer();
for (Int_t ev=0;ev<10000;ev++) {
ar.Clear();
Int_t nlines = Int_t(gRandom->Gaus(50,10));
if(nlines < 0) nlines = 1;
for (Int_t i=0;i<nlines;i++) {
Float_t x1 = gRandom->Rndm();
Float_t y1 = gRandom->Rndm();
Float_t x2 = gRandom->Rndm();
Float_t y2 = gRandom->Rndm();
new(ar[i]) TLine(x1,y1,x2,y2);
}
T.Fill();
}
T.Print();
T.Write();
}