Macro illustrating automatic dictionary generation and I/O with Lorentz Vectors of floats The dictionary for LorentzVector of float is not in the libMathCore, therefore is generated when parsed the file with CINT.
More...
Macro illustrating automatic dictionary generation and I/O with Lorentz Vectors of floats The dictionary for LorentzVector of float is not in the libMathCore, therefore is generated when parsed the file with CINT.
To run this macro you must do
root[0] .L mathcoreVectorFloatIO.C+
root[1] runIt();
#include <iostream>
#ifdef __MAKECINT__
#pragma link C++ class ROOT::Math::PxPyPzE4D<float>+;
#pragma link C++ class ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<float> >+;
#pragma link C++ typedef ROOT::Math::XYZTVectorF;
#endif
using namespace ROOT::Math;
TFile
f1(
"mathcoreVectorIO_F.root",
"RECREATE");
TTree t1(
"t1",
"Tree with new Float LorentzVector");
t1.
Branch(
"LV branch",
"ROOT::Math::XYZTVectorF",&v1);
for (
int i = 0; i <
n; ++i) {
double Px = R.
Gaus(0,10);
double Py = R.
Gaus(0,10);
double Pz = R.
Gaus(0,10);
double E = R.
Gaus(100,10);
}
std::cout <<
" Time for new Float Vector " << timer.
RealTime() <<
" " << timer.
CpuTime() << std::endl;
}
TFile
f1(
"mathcoreVectorIO_F.root");
std::cout << " Tree Entries " << n << std::endl;
double etot=0;
for (
int i = 0; i <
n; ++i) {
}
std::cout <<
" Time for new Float Vector " << timer.
RealTime() <<
" " << timer.
CpuTime() << std::endl;
std::cout <<
" E average" << n<<
" " << etot <<
" " << etot/
double(n) << endl;
}
void runIt() {
#if defined(__CINT__) && !defined(__MAKECINT__)
using namespace ROOT::Math;
cout << "This tutorial can run only using ACliC, you must run it by doing: " << endl;
cout << "\t .L tutorials/math/mathcoreVectorFloatIO.C+" << endl;
cout << "\t runIt()" << endl;
#endif
}
void mathcoreVectorFloatIO() {
#if defined(__CINT__) && !defined(__MAKECINT__)
using namespace ROOT::Math;
cout << "This tutorial can run only using ACliC, you must run it by doing: " << endl;
cout << "\t .L tutorials/math/mathcoreVectorFloatIO.C+" << endl;
cout << "\t runIt()" << endl;
#endif
}
- Author
- Lorenzo Moneta
Definition in file mathcoreVectorFloatIO.C.