ATLAS Offline Software
Loading...
Searching...
No Matches
P4DummyTest.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5// AthAnalysisBase/ManaCore doesn't currently include the Trigger Service
6#ifndef XAOD_ANALYSIS
7
8// this file is only useful to check
9// all virtual methods have been implemented
11#include "FourMom/P4EEtaPhiM.h"
12#include "FourMom/P4PtEtaPhiM.h"
13#include "FourMom/P4PxPyPzE.h"
16#include "CLHEP/Vector/LorentzVector.h"
17
18
20{
21 P4EEtaPhiM theP4EEtaPhiM(10.,1.,2.,0.);
22 P4EEtaPhiM twoP4EEtaPhiM(10.,1.3,2.4,0.);
23 P4PxPyPzE theP4PxPyPzE(0.,3.,4.,5.);
24 P4IPtCotThPhiM theP4IPtCotThPhiM(0.5,1.,2.,0.);
25 P4EEtaPhiM threeP4EEtaPhiM(theP4IPtCotThPhiM);
26 P4PtEtaPhiM fourP4PtEtaPhiM(theP4IPtCotThPhiM);
27
28
29 double aux [[maybe_unused]] = theP4EEtaPhiM.px();
30 aux+=theP4PxPyPzE.px();
31 aux+=theP4IPtCotThPhiM.px();
32 double theDeltaR1= P4Helpers::deltaR(theP4EEtaPhiM,theP4IPtCotThPhiM);
33 std::cout << "P4DummyTest: theDeltaR1= " << theDeltaR1 << std::endl ;
34 double theDeltaR2= P4Helpers::deltaR(theP4EEtaPhiM,threeP4EEtaPhiM);
35 std::cout << "P4DummyTesters: theDeltaR2= " << theDeltaR2 << std::endl ;
36 double theDeltaR3= P4Helpers::deltaR(theP4EEtaPhiM,twoP4EEtaPhiM);
37 std::cout << "P4DummyTest: theDeltaR3= " << theDeltaR3 << std::endl ;
38 CLHEP::HepLorentzVector theHlv=twoP4EEtaPhiM.hlv() ;
39 double theDeltaR4= P4Helpers::deltaR(P4PxPyPzE(theHlv),theP4EEtaPhiM);
40 std::cout << "P4DummyTest: theDeltaR4= " << theDeltaR4 << std::endl ;
41
42
43 double theDeltaR5= P4Helpers::deltaR(theP4EEtaPhiM,fourP4PtEtaPhiM);
44 std::cout << "P4DummyTest: theDeltaR5= " << theDeltaR5 << " [=R2]"<< std::endl ;
45
46
47 //> Test of deltaPhi
48 double dPhi1 = P4Helpers::deltaPhi( theP4EEtaPhiM, theP4IPtCotThPhiM );
49 std::cout << "P4DummyTest: dPhi1= " << dPhi1 << std::endl;
50
51 double dPhi2 = P4Helpers::deltaPhi( theP4EEtaPhiM, threeP4EEtaPhiM );
52 std::cout << "P4DummyTest: dPhi2= " << dPhi2 << std::endl;
53
54 double dPhi3 = P4Helpers::deltaPhi( theP4EEtaPhiM, twoP4EEtaPhiM );
55 std::cout << "P4DummyTest: dPhi3= " << dPhi3 << std::endl;
56
57 double dPhi4 = P4Helpers::deltaPhi( P4PxPyPzE(theHlv), theP4EEtaPhiM );
58 std::cout << "P4DummyTest: dPhi4= " << dPhi4 << std::endl;
59
60 double dPhi5 = P4Helpers::deltaPhi( theP4EEtaPhiM, fourP4PtEtaPhiM );
61 std::cout << "P4DummyTest: dPhi5= " << dPhi5 << " [=dPhi2]"<< std::endl;
62
63
64
65 //> Test of invMass -- 2Body
66 std::cout << "P4DummyTest: --- Test 2-body invariant mass ---" << std::endl;
67 double inv2Mass1 = P4Helpers::invMass( theP4EEtaPhiM, theP4IPtCotThPhiM );
68 std::cout << "P4DummyTest: inv2Mass1= " << inv2Mass1 << std::endl;
69
70 double inv2Mass2 = P4Helpers::invMass( theP4EEtaPhiM, threeP4EEtaPhiM );
71 std::cout << "P4DummyTest: inv2Mass2= " << inv2Mass2 << std::endl;
72
73 double inv2Mass3 = P4Helpers::invMass( theP4EEtaPhiM, twoP4EEtaPhiM );
74 std::cout << "P4DummyTest: inv2Mass3= " << inv2Mass3 << std::endl;
75
76 double inv2Mass4 = P4Helpers::invMass( P4PxPyPzE(theHlv), theP4EEtaPhiM );
77 std::cout << "P4DummyTest: inv2Mass4= " << inv2Mass4 << std::endl;
78
79 double inv2Mass5 = P4Helpers::invMass( theP4EEtaPhiM, fourP4PtEtaPhiM );
80 std::cout << "P4DummyTest: inv2Mass5= " << inv2Mass5 << " [=mass2]"<< std::endl;
81
82 //> Test of invMass -- 4-Body
83 std::cout << "P4DummyTest: --- Test 4-body invariant mass ---" << std::endl;
84 double inv4Mass1 = P4Helpers::invMass( theP4EEtaPhiM, theP4IPtCotThPhiM,
85 theP4EEtaPhiM, theP4IPtCotThPhiM );
86 std::cout << "P4DummyTest: inv4Mass1= " << inv4Mass1 << std::endl;
87
88 double inv4Mass2 = P4Helpers::invMass( theP4EEtaPhiM, threeP4EEtaPhiM,
89 theP4EEtaPhiM, threeP4EEtaPhiM );
90 std::cout << "P4DummyTest: inv4Mass2= " << inv4Mass2 << std::endl;
91
92 double inv4Mass3 = P4Helpers::invMass( theP4EEtaPhiM, twoP4EEtaPhiM,
93 theP4EEtaPhiM, twoP4EEtaPhiM );
94 std::cout << "P4DummyTesters: inv4Mass3= " << inv4Mass3 << std::endl;
95
96 double inv4Mass4 = P4Helpers::invMass( P4PxPyPzE(theHlv), theP4EEtaPhiM,
97 P4PxPyPzE(theHlv), theP4EEtaPhiM );
98 std::cout << "P4DummyTest: inv4Mass4= " << inv4Mass4 << std::endl;
99
100 double inv4Mass5 = P4Helpers::invMass( theP4EEtaPhiM, fourP4PtEtaPhiM,
101 theP4EEtaPhiM, fourP4PtEtaPhiM );
102 std::cout << "P4DummyTest: inv4Mass5= " << inv4Mass5 << " [=Mass2]"<< std::endl;
103
104
105
106}
107
108#endif
virtual CLHEP::HepLorentzVector hlv() const
HepLorentzVector Special implementation from Frank Paige : if negative energy, points in opposite dir...
virtual double px() const
x component of momentum
virtual double px() const
x component of momentum
P4IPtCotThPhiM is a concrete class with 4-momentum behavior for which 1/Pt, cottan(tehta),...
P4PtEtaPhiM is a class with 4-momentum behavior, for which Pt, Eta, Phi and M are data members.
Definition P4PtEtaPhiM.h:25
P4PxPyPzE is a class with 4-momentum behavior, for which Px, Py, Pz and M are data members.
Definition P4PxPyPzE.h:29
virtual double px() const
get px data member
Definition P4PxPyPzE.h:122
double invMass(const I4Momentum &pA, const I4Momentum &pB)
invariant mass from two I4momentum references
Definition P4Helpers.h:252
double deltaR(const I4Momentum &p4, double eta, double phi)
from 1 I4Momentum
Definition P4Helpers.h:209
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
Definition P4Helpers.h:34