-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLundGenerator.hh
137 lines (104 loc) · 4.38 KB
/
LundGenerator.hh
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// $Id$
//
// Copyright (c) 2018-, Frederic A. Dreyer, Gavin P. Salam, Gregory Soyez
//
//----------------------------------------------------------------------
// This file is part of FastJet contrib.
//
// It is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2 of the License, or (at
// your option) any later version.
//
// It is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
// License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this code. If not, see <http://www.gnu.org/licenses/>.
//----------------------------------------------------------------------
#ifndef __FASTJET_CONTRIB_LUNDGENERATOR_HH__
#define __FASTJET_CONTRIB_LUNDGENERATOR_HH__
#include <fastjet/internal/base.hh>
#include "fastjet/tools/Recluster.hh"
#include "fastjet/JetDefinition.hh"
#include "fastjet/PseudoJet.hh"
#include <string>
#include <vector>
#include <utility>
// TODO:
// - add interface to write declusterings to json files
// [gps, possibly as a separate header, in order to factorise the json.hh dependence]
// - something for pileup subtraction?
// - do we want to update json.hh to latest? And handle
// the precision issue more elegantly than the current
// hack of editing json.hh
// - what do we do about the fact that json.hh is c++11?
FASTJET_BEGIN_NAMESPACE
namespace contrib{
class LundGenerator;
//----------------------------------------------------------------------
/// \class LundDeclustering
/// Contains the declustering variables associated with a single qnode
/// on the Lund plane
class LundDeclustering {
public:
/// return the pair PseudoJet, i.e. sum of the two subjets
const PseudoJet & pair() const {return pair_;}
/// returns the subjet with larger transverse momentum
const PseudoJet & harder() const {return harder_;}
/// returns the subjet with smaller transverse momentum
const PseudoJet & softer() const {return softer_;}
/// returns pair().m() [cached]
double m() const {return m_;}
/// returns the rapidity-azimuth separation of the pair of subjets [cached]
double Delta() const {return Delta_;}
/// returns softer().pt() / (softer().pt() + harder().pt()) [cached]
double z() const {return z_;}
/// returns softer().pt() * Delta() [cached]
double kt() const {return kt_;}
/// returns z() * Delta() [cached]
double kappa() const {return kappa_;}
/// returns an azimuthal type angle of softer() around harder()
double psi() const {return psi_;}
/// returns the x,y coordinates that are used in the Lund-plane plots
/// of arXiv:1807.04758: ln(1/Delta()), and ln(kt()) respectively
std::pair<double,double> const lund_coordinates() const {
return std::pair<double,double>(std::log(1.0/Delta()),std::log(kt()));
}
virtual ~LundDeclustering() {}
private:
double m_, Delta_, z_, kt_, kappa_, psi_;
PseudoJet pair_, harder_, softer_;
protected:
/// the constructor is private, because users will not generally be
/// constructing a LundDeclustering element themselves.
LundDeclustering(const PseudoJet& pair,
const PseudoJet& j1, const PseudoJet& j2);
friend class LundGenerator;
};
//----------------------------------------------------------------------
/// \class LundGenerator
/// Generates vector of LundDeclustering for a given jet
/// corresponding to its Lund plane.
class LundGenerator : public FunctionOfPseudoJet< std::vector<LundDeclustering> > {
public:
/// LundGenerator constructor
LundGenerator(JetAlgorithm jet_alg = cambridge_algorithm)
: recluster_(JetDefinition(jet_alg, JetDefinition::max_allowable_R)){}
/// LundGenerator constructor with jet definition
LundGenerator(const JetDefinition & jet_def) : recluster_(jet_def){}
/// destructor
virtual ~LundGenerator() {}
/// obtain the declusterings of the primary plane of the jet
virtual std::vector<LundDeclustering> result(const PseudoJet& jet) const;
/// description of the class
virtual std::string description() const;
private:
/// recluster definition
Recluster recluster_;
};
} // namespace contrib
FASTJET_END_NAMESPACE
#endif // __FASTJET_CONTRIB_LUNDGENERATOR_HH__