Hello ROOTers,
How would i go about creating an EtaPhiVector with randomly generated eta and phi values? I am currently trying a simple random number generation for a specific range for each of my two coordinates, and then setting the values in the vector:

TLorentzVector conePosition;
    //Random Cones
    for (int j = 0; j < 100; j++) {
        double randomPhi = m_ranNumGen->Uniform(2 * pi);
        double randomEta = m_ranNumGen->Uniform(4);

The problems I am having are:
Currently, it is defined as just a TLorentzVector, not specifically EtaPhi. How would I change this?
There does not appear to be a SetEta() to use in this case.

End goal is an object that I can use in DeltaR()



ROOT Reference Documentation → Functional Parts → Math → Physics Vectors

Using this I can create the vector as

double randomPhi = m_ranNumGen->Uniform(2 * pi);
double randomEta = m_ranNumGen->Uniform(4);
ROOT::Math::PtEtaPhiMVector conePosition(0.0, randomEta, randomPhi, 0.0);

However, I cannot use DeltaR() with this, as I could with TLorentzVector

Dear @abunka ,
Please see also ROOT: ROOT::Math::VectorUtil Namespace Reference for a list of helper functions for physics vectors. For example

>>> import ROOT
>>> randomPhi_1 = ROOT.gRandom.Uniform(2*ROOT.TMath.Pi())
>>> randomPhi_2 = ROOT.gRandom.Uniform(2*ROOT.TMath.Pi())
>>> randomEta_1 = ROOT.gRandom.Uniform(4)
>>> randomEta_2 = ROOT.gRandom.Uniform(4)
>>> conePosition_1 = ROOT.Math.PtEtaPhiMVector(0, randomEta_1, randomPhi_1, 0)
>>> conePosition_2 = ROOT.Math.PtEtaPhiMVector(0, randomEta_2, randomPhi_2, 0)
>>> ROOT.Math.VectorUtil.DeltaR(conePosition_1, conePosition_2)