Hi Rooters, I’m using Root to calculate some particles physics observable by looping over events in a ttree some of the output values are wrong and always given this value: -2.78275e-08
this is what im trying to calculate :
aco_init= ( 1. - acos(cos(Photon_phi->at(0)-Photon_phi->at(1)))/TMath::Pi());
when looking to this the numbers are correct
cout<<"Photon_phi->at(0) = "<<Photon_phi->at(0)<<endl;
cout<<"Photon_phi->at(1) = "<<Photon_phi->at(1)<<endl;
but the result is not
cout<<"aco = "<< aco_init<<endl;
If you have any hint in how to overcome this I will be grateful.
Thanks for the answer
the Photon_phi is between -pi and pi
here is an example of a good result
Photon_phi->at(0) = 0.475022
Photon_phi->at(1) = -2.76514
aco = 0.0313744
and a wrong one :
Photon_phi->at(0) = 1.16033
Photon_phi->at(1) = -1.98119
aco = -2.78275e-08