-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLundWithSecondary.cc
65 lines (57 loc) · 2.57 KB
/
LundWithSecondary.cc
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
// $Id$
//
// Copyright (c) -, 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/>.
//----------------------------------------------------------------------
#include "LundWithSecondary.hh"
#include <sstream>
FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
namespace contrib{
//----------------------------------------------------------------------
/// return LundDeclustering sequence of primary plane
std::vector<LundDeclustering> LundWithSecondary::primary(const PseudoJet& jet) const {
return lund_gen_(jet);
}
//----------------------------------------------------------------------
/// return LundDeclustering sequence of secondary plane (slow version)
std::vector<LundDeclustering> LundWithSecondary::secondary(const PseudoJet& jet) const {
// this is not optimal as one is computing the primary plane twice.
std::vector<LundDeclustering> declusts = lund_gen_(jet);
return secondary(jet, declusts);
}
//----------------------------------------------------------------------
/// return LundDeclustering sequence of secondary plane with primary sequence as input
std::vector<LundDeclustering> LundWithSecondary::secondary(const PseudoJet& jet,
const std::vector<LundDeclustering> & declusts) const {
assert(secondary_def_);
int secondary_index = (*secondary_def_)(declusts);
// if we found the index of secondary emission, return its declustering sequence
if (secondary_index >= 0)
return lund_gen_(declusts[secondary_index].softer());
return std::vector<LundDeclustering>();
}
//----------------------------------------------------------------------
/// description
std::string LundWithSecondary::description() const {
std::ostringstream oss;
oss << "LundWithSecondary using " << secondary_def_->description()
<< " and " << lund_gen_.description();
return oss.str();
}
} // namespace contrib
FASTJET_END_NAMESPACE