-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcalc.h
64 lines (57 loc) · 2.74 KB
/
calc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// .
// ..: P. Chang, [email protected]
#ifndef calc_h
#define calc_h
// C/C++
// ROOT
#include "TLorentzVector.h"
#include "TVector3.h"
#include "TVector2.h"
#include "TMath.h"
#include "Math/LorentzVector.h"
#include "Math/PtEtaPhiM4D.h"
#include "Math/VectorUtil.h"
///////////////////////////////////////////////////////////////////////////////////////////////
// LorentzVector typedef that we use very often
///////////////////////////////////////////////////////////////////////////////////////////////
#ifdef LorentzVectorPtEtaPhiM4D
typedef ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<float> > LV;
#else
typedef ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<float> > LV;
#endif
#include "hungarian.h"
namespace RooUtil
{
namespace Calc {
TLorentzVector getTLV(const LV& a);
LV getLV(const TLorentzVector& a);
LV getLV(float pt, float eta, float phi, float m);
TVector3 boostVector(const LV& a);
LV getBoosted(const LV& a, const TVector3& b);
void boost(LV& a, const TVector3& b);
float DeltaR(const LV& a, const LV& b);
float alpha(const LV& a, const LV& b);
float pPRel(const LV& a, const LV& b);
float DeltaEta(const LV& a, const LV& b);
float DeltaPhi(const LV& a, const LV& b);
float DeltaPtFrac(const LV& a, const LV& b);
float mT(const LV& lep, const LV& met);
LV getNeutrinoP4(const LV& lep, const float& met_pt, const float& met_phi, float mw=80.385, bool getsol2=false, bool invertpz=false, bool debug=false);
float getNeutrinoPz(const LV& lep, const float& met_pt, const float& met_phi, float mw=80.385, bool getsol2=false, bool debug=false);
float getNeutrinoPzDet(const LV& lep, const float& met_pt, const float& met_phi, float mw=80.385, bool debug=false);
TVector2 getEtaPhiVecRotated(const LV& target, const LV& ref, const LV& axis_ref);
float getRho(const LV& ref, const LV& target);
void printTLV(const TLorentzVector& a);
void printLV(const LV& a);
int calcBin2D(const std::vector<float>& xbounds, const std::vector<float>& ybounds, float xval, float yval);
std::tuple<bool, int, int, float> pickZcandidateIdxs(
const std::vector<int>& lepton_pdgids,
const std::vector<LV>& lepton_p4s,
std::vector<int> to_skip=std::vector<int>());
std::vector<LV> sortByPt(std::vector<LV> vecs);
std::vector<int> hungarianDeltaRMatching(std::vector<LV> src_obj_to_match, std::vector<LV> target_obj_to_match_to);
std::vector<int> hungarianDeltaEtaMatching(std::vector<LV> src_obj_to_match, std::vector<LV> target_obj_to_match_to);
std::pair<int, int> selectVBFJetsMaxEScheme(std::vector<LV> jets);
}
}
#endif