ATLAS Offline Software
Loading...
Searching...
No Matches
SiHitCollectionCnv_p4.cxx File Reference
#include "InDetSimEvent/SiHit.h"
#include "InDetSimEvent/SiHitCollection.h"
#include "InDetSimEventTPCnv/InDetHits/SiHitCollection_p4.h"
#include "InDetSimEventTPCnv/InDetHits/SiHitCollectionCnv_p4.h"
#include "GeneratorObjects/HepMcParticleLink.h"
#include <cmath>
#include "CLHEP/Geometry/Point3D.h"
#include "GaudiKernel/MsgStream.h"
#include "GaudiKernel/ThreadLocalContext.h"
#include "AthenaKernel/ExtendedEventContext.h"
#include "StoreGate/StoreGateSvc.h"

Go to the source code of this file.

Functions

double phicorr (double a)
double cycle (double a, double b)

Function Documentation

◆ cycle()

double cycle ( double a,
double b )
inline

Definition at line 41 of file SiHitCollectionCnv_p4.cxx.

42{
43 double del = b-a;
44 if (del > M_PI)
45 {
46 return a+2.0*M_PI;
47 }
48 else if (del < -M_PI)
49 {
50 return a-2.0*M_PI;
51 }
52 else
53 {
54 return a;
55 }
56}
#define M_PI
static Double_t a

◆ phicorr()

double phicorr ( double a)
inline

Definition at line 24 of file SiHitCollectionCnv_p4.cxx.

25{
26 if (a <= -M_PI)
27 {
28 return a+(2*M_PI*floor(-(a-M_PI)/(2*M_PI)));
29 }
30 else if (a > M_PI)
31 {
32 return a-(2*M_PI*floor((a+M_PI)/(2*M_PI)));
33 }
34 else
35 {
36 return a;
37 }
38}