#include "TFile.h" #include "TTree.h" void nt(){ ////////////////////////////////////////////////////////// // This file has been automatically generated // (Sat Oct 07 16:26:19 2006 by ROOT version5.13/03) // from TTree nt/Leap raw data // found on file: test.root ////////////////////////////////////////////////////////// TFile *f2 = new TFile("test2.root","recreate"); //f2->SetCompressionLevel(0); TTree *T = new TTree("T","test w"); //Declaration of leaves types UInt_t rhits_nx0; UInt_t rhits_nx1; UInt_t rhits_ny0; UInt_t rhits_ny1; UInt_t rhits_nu0; UInt_t rhits_nu1; UShort_t x0[6]; UShort_t x1[5]; UShort_t y0[7]; UShort_t y1[6]; UShort_t u0[7]; UShort_t u1[5]; Float_t v; Double_t pulse; Float_t erate; Short_t xstage; Short_t ystage; Short_t zstage; Float_t Vbias; Float_t VFront; Float_t ErateT; Float_t P; Float_t Ibias; UShort_t Thresh_tx0; UShort_t Thresh_tx1; UShort_t Thresh_ty0; UShort_t Thresh_ty1; UShort_t Thresh_tu0; UShort_t Thresh_tu1; UShort_t UpperThresh_tux; UShort_t UpperThresh_tuy; UShort_t UpperThresh_tuu; Short_t Walk_wx0; Short_t Walk_wx1; Short_t Walk_wy0; Short_t Walk_wy1; Short_t Walk_wu0; Short_t Walk_wu1; Int_t xl; Int_t yl; Int_t zl; Float_t lp; UShort_t fg; // Set branch addresses. T->Branch("nx0",&rhits_nx0,"nx0/I"); T->Branch("nx1",&rhits_nx1,"nx1/I"); T->Branch("ny0",&rhits_ny0,"ny0/I"); T->Branch("ny1",&rhits_ny1,"ny1/I"); T->Branch("nu0",&rhits_nu0,"nu0/I"); T->Branch("nu1",&rhits_nu1,"nu1/I"); T->Branch("x0",x0,"x0[nx0]/S"); T->Branch("x1",x1,"x1[nx1]/S"); T->Branch("y0",y0,"y0[ny0]/S"); T->Branch("y1",y1,"y1[ny1]/S"); T->Branch("u0",u0,"u0[nu0]/S"); T->Branch("u1",u1,"u1[nu1]/S"); T->Branch("vs",&v,"v/F"); T->Branch("pulse",&pulse,"pulse/D"); T->Branch("erate",&erate,"erate/F"); T->Branch("xstage",&xstage,"xstage/s"); T->Branch("ystage",&ystage,"ystage/s"); T->Branch("zstage",&zstage,"zstage/s"); T->Branch("VMcpBias",&Vbias,"Vbias/F"); T->Branch("VMcpFront",&VFront,"VFront/F"); T->Branch("TargetErate",&ErateT,"ErateT/F"); T->Branch("Pres",&P,"P/F"); T->Branch("IMcpBias",&Ibias,"Ibias/F"); T->Branch("tx0",&Thresh_tx0,"tx0/S"); T->Branch("tx1",&Thresh_tx1,"tx1/S"); T->Branch("ty0",&Thresh_ty0,"ty0/S"); T->Branch("ty1",&Thresh_ty1,"ty1/S"); T->Branch("tu0",&Thresh_tu0,"tu0/S"); T->Branch("tu1",&Thresh_tu1,"tu1/S"); T->Branch("tux",&UpperThresh_tux,"tux/S"); T->Branch("tuy",&UpperThresh_tuy,"tuy/S"); T->Branch("tuu",&UpperThresh_tuu,"tuu/S"); T->Branch("wx0",&Walk_wx0,"wx0/s"); T->Branch("wx1",&Walk_wx1,"wx1/s"); T->Branch("wy0",&Walk_wy0,"wy0/s"); T->Branch("wy1",&Walk_wy1,"wy1/s"); T->Branch("wu0",&Walk_wu0,"wu0/s"); T->Branch("wu1",&Walk_wu1,"wu1/s"); T->Branch("laserx",&xl,"x1/I"); T->Branch("lasery",&yl,"y1/I"); T->Branch("laserz",&zl,"z1/I"); T->Branch("laserpower",&lp,"lp/F"); T->Branch("FractureGuard",&fg,"fg/S"); // This is the loop skeleton int j; for (Int_t i=0;i<1000000;i++) { rhits_nx0 = i%6; rhits_nx1 = i%5; rhits_ny0 = i%7; rhits_ny1 = i%6; rhits_nu0 = i%7; rhits_nu1 = i%5; for (j=0;jFill(); } T->Print(); T->Write(); }