35 #pragma link C++ class ROOT::Math::PxPyPzE4D<float>+; 36 #pragma link C++ class ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<float> >+; 37 #pragma link C++ typedef ROOT::Math::XYZTVectorF; 47 TFile f1(
"mathcoreVectorIO_F.root",
"RECREATE");
50 TTree t1(
"t1",
"Tree with new Float LorentzVector");
53 t1.Branch(
"LV branch",
"ROOT::Math::XYZTVectorF",&v1);
56 for (
int i = 0; i <
n; ++i) {
57 double Px = R.
Gaus(0,10);
58 double Py = R.
Gaus(0,10);
59 double Pz = R.
Gaus(0,10);
60 double E = R.
Gaus(100,10);
67 std::cout <<
" Time for new Float Vector " << timer.
RealTime() <<
" " << timer.
CpuTime() << std::endl;
76 TFile f1(
"mathcoreVectorIO_F.root");
86 std::cout <<
" Tree Entries " << n << std::endl;
88 for (
int i = 0; i <
n; ++i) {
94 std::cout <<
" Time for new Float Vector " << timer.
RealTime() <<
" " << timer.
CpuTime() << std::endl;
95 std::cout <<
" E average" << n<<
" " << etot <<
" " << etot/double(n) << endl;
100 #if defined(__CINT__) && !defined(__MAKECINT__) 105 cout <<
"This tutorial can run only using ACliC, you must run it by doing: " << endl;
106 cout <<
"\t .L tutorials/math/mathcoreVectorFloatIO.C+" << endl;
107 cout <<
"\t runIt()" << endl;
114 void mathcoreVectorFloatIO() {
115 #if defined(__CINT__) && !defined(__MAKECINT__) 120 cout <<
"This tutorial can run only using ACliC, you must run it by doing: " << endl;
121 cout <<
"\t .L tutorials/math/mathcoreVectorFloatIO.C+" << endl;
122 cout <<
"\t runIt()" << endl;
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
Scalar E() const
return 4-th component (time, or energy for a 4-momentum vector)
double read(const std::string &file_name)
reading
Class describing a generic LorentzVector in the 4D space-time, using the specified coordinate system ...
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 write(int n, const std::string &file_name, const std::string &vector_type, int compress=0)
writing
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
LorentzVector< CoordSystem > & SetCoordinates(const Scalar src[])
Set internal data based on an array of 4 Scalar numbers.
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 void Print(Option_t *option="") const
Dump this text with its attributes.
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr=0)
Change branch address, dealing with clone trees properly.
This is the base class for the ROOT Random number generators.
R__EXTERN TSystem * gSystem
LorentzVector< PxPyPzE4D< float > > XYZTVectorF
LorentzVector based on x,y,x,t (or px,py,pz,E) coordinates in float precision with metric (-...
virtual Long64_t GetEntries() const
A TTree object has a header with a name and a title.