51 TFile f1(
"mathcoreVectorIO_F.root",
"RECREATE");
54 TTree t1(
"t1",
"Tree with new Float LorentzVector");
57 t1.Branch(
"LV branch",
"ROOT::Math::XYZTVectorF",&
v1);
60 for (
int i = 0; i <
n; ++i) {
61 double Px =
R.Gaus(0,10);
62 double Py =
R.Gaus(0,10);
63 double Pz =
R.Gaus(0,10);
64 double E =
R.Gaus(100,10);
65 v1->SetCoordinates(Px,Py,Pz,E);
71 std::cout <<
" Time for new Float Vector " << timer.
RealTime() <<
" " << timer.
CpuTime() << std::endl;
80 TFile f1(
"mathcoreVectorIO_F.root");
86 t1->SetBranchAddress(
"LV branch",&
v1);
89 int n = (
int)
t1->GetEntries();
90 std::cout <<
" Tree Entries " <<
n << std::endl;
92 for (
int i = 0; i <
n; ++i) {
98 std::cout <<
" Time for new Float Vector " << timer.
RealTime() <<
" " << timer.
CpuTime() << std::endl;
99 std::cout <<
" E average" <<
n<<
" " << etot <<
" " << etot/
double(
n) << endl;
104#if defined(__CINT__) && !defined(__MAKECINT__)
109 cout <<
"This tutorial can run only using ACliC, you must run it by doing: " << endl;
110 cout <<
"\t .L tutorials/math/mathcoreVectorFloatIO.C+" << endl;
111 cout <<
"\t runIt()" << endl;
113 int nEvents = 100000;
118void mathcoreVectorFloatIO() {
119#if defined(__CINT__) && !defined(__MAKECINT__)
124 cout <<
"This tutorial can run only using ACliC, you must run it by doing: " << endl;
125 cout <<
"\t .L tutorials/math/mathcoreVectorFloatIO.C+" << endl;
126 cout <<
"\t runIt()" << endl;
#define R(a, b, c, d, e, f, g, h, i)
R__EXTERN TSystem * gSystem
Class describing a generic LorentzVector in the 4D space-time, using the specified coordinate system ...
A ROOT file is composed of a header, followed by consecutive data records (TKey instances) with a wel...
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
This is the base class for the ROOT Random number generators.
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
Double_t CpuTime()
Stop the stopwatch (if it is running) and return the cputime (in seconds) passed between the start an...
void Stop()
Stop the stopwatch.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
A TTree represents a columnar dataset.
constexpr Double_t E()
Base of natural log: .