ATLAS Offline Software
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"
14 #include "FourMom/P4IPtCotThPhiM.h"
15 #include "FourMomUtils/P4Helpers.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
P4IPtCotThPhiM.h
P4DummyTest::P4DummyTest
P4DummyTest()
Definition: P4DummyTest.cxx:19
P4Helpers::invMass
double invMass(const I4Momentum &pA, const I4Momentum &pB)
invariant mass from two I4momentum references
Definition: P4Helpers.h:252
P4EEtaPhiM
Definition: P4EEtaPhiM.h:25
P4IPtCotThPhiMBase::px
virtual double px() const
x component of momentum
Definition: P4IPtCotThPhiMBase.cxx:91
P4IPtCotThPhiM
Definition: P4IPtCotThPhiM.h:27
P4Helpers::deltaPhi
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
Definition: P4Helpers.h:34
P4EEtaPhiMBase::hlv
virtual CLHEP::HepLorentzVector hlv() const
HepLorentzVector Special implementation from Frank Paige : if negative energy, points in opposite dir...
Definition: P4EEtaPhiMBase.cxx:134
P4Helpers::deltaR
double deltaR(const I4Momentum &p4, double eta, double phi)
from 1 I4Momentum
Definition: P4Helpers.h:209
P4Helpers.h
P4EEtaPhiM.h
P4PxPyPzE
Definition: P4PxPyPzE.h:29
P4PtEtaPhiM.h
P4PxPyPzE::px
virtual double px() const
get px data member
Definition: P4PxPyPzE.h:122
P4DummyTest.h
P4PtEtaPhiM
Definition: P4PtEtaPhiM.h:25
P4PxPyPzE.h
P4EEtaPhiMBase::px
virtual double px() const
x component of momentum
Definition: P4EEtaPhiMBase.cxx:122