Skip to content

Commit 060a653

Browse files
committed
update to use recombination schemes and immutable PseudoJets
1 parent 2108be1 commit 060a653

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

cjetreconstruction/src/cjetreconstruction-finder.cc

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,13 @@ void sorted_by_pt(jetreconstruction_JetsResult &jets) {
5151
jetreconstruction_ClusterSequence
5252
run_clustering(std::vector<jetreconstruction_PseudoJet>& input_particles,
5353
jetreconstruction_RecoStrategy strategy,
54-
jetreconstruction_JetAlgorithm algorithm, double R, double p) {
54+
jetreconstruction_JetAlgorithm algorithm,
55+
jetreconstruction_RecombinationScheme recombine_scheme,
56+
double R, double p) {
5557

5658
auto clust_seq = jetreconstruction_ClusterSequence{};
5759
auto retv = jetreconstruction_jet_reconstruct(
58-
input_particles.data(), input_particles.size(), algorithm, R, strategy,
60+
input_particles.data(), input_particles.size(), algorithm, p, R, strategy, recombine_scheme,
5961
&clust_seq);
6062
assert(retv == jetreconstruction_StatusCode::JETRECONSTRUCTION_STATUSCODE_OK);
6163
return clust_seq;
@@ -73,6 +75,7 @@ int main(int argc, char *argv[]) {
7375
string mystrategy = "Best";
7476
double power = -1.0;
7577
string alg = "";
78+
string recombine = "";
7679
double R = 0.4;
7780
string dump_file = "";
7881

@@ -85,6 +88,7 @@ int main(int argc, char *argv[]) {
8588
auto power_option = opts.add<Value<double>>("p", "power", "Algorithm p value: -1=antikt, 0=cambridge_aachen, 1=inclusive kt; otherwise generalised Kt", power, &power);
8689
auto alg_option = opts.add<Value<string>>("A", "algorithm", "Algorithm: AntiKt CA Kt GenKt EEKt Durham (overrides power)", alg, &alg);
8790
auto radius_option = opts.add<Value<double>>("R", "radius", "Algorithm R parameter", R, &R);
91+
auto recombine_option = opts.add<Value<string>>("", "recombine", "Recombination scheme for jet merging", recombine, &recombine);
8892
auto ptmin_option = opts.add<Value<double>>("", "ptmin", "pt cut for inclusive jets");
8993
auto dijmax_option = opts.add<Value<double>>("", "dijmax", "dijmax value for exclusive jets");
9094
auto njets_option = opts.add<Value<int>>("", "njets", "njets value for exclusive jets");
@@ -178,7 +182,16 @@ int main(int argc, char *argv[]) {
178182
}
179183
}
180184

181-
std::cout << "Strategy: " << mystrategy << "; Power: " << power << "; Algorithm " << algorithm << std::endl;
185+
auto recombine_scheme = JETRECONCSTRUCTION_RECOMBINATIONSCHEME_ESCHEME;
186+
std::cout << recombine << std::endl;
187+
if (recombine == "pt_scheme") {
188+
recombine_scheme = JETRECONCSTRUCTION_RECOMBINATIONSCHEME_PTSCHEME;
189+
} else if (recombine == "pt2_scheme") {
190+
recombine_scheme = JETRECONCSTRUCTION_RECOMBINATIONSCHEME_PT2SCHEME;
191+
}
192+
193+
std::cout << "Strategy: " << mystrategy << "; Power: " << power << "; Algorithm " << algorithm <<
194+
"; Recombine " << recombine_scheme << std::endl;
182195

183196
auto dump_fh = stdout;
184197
if (dump_option->is_set()) {
@@ -201,7 +214,7 @@ int main(int argc, char *argv[]) {
201214
auto start_t = std::chrono::steady_clock::now();
202215
for (size_t ievt = skip_events_option->value(); ievt < events.size(); ++ievt) {
203216
auto cluster_sequence =
204-
run_clustering(events[ievt], strategy, algorithm, R, power);
217+
run_clustering(events[ievt], strategy, algorithm, recombine_scheme, R, power);
205218
auto final_jets = jetreconstruction_JetsResult{nullptr,0};
206219
if (ptmin_option->is_set()) {
207220
auto retv = jetreconstruction_inclusive_jets(

cjetreconstruction/src/cjetreconstruction-utils.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@ std::vector<std::vector<jetreconstruction_PseudoJet>> read_input_events(const ch
4444
++events_parsed;
4545
input_particles.clear();
4646
input_particles.reserve(evt.particles().size());
47+
long history_index = 0 ; // particle history index must correspond to their index+1 in array
4748
for(auto p: evt.particles()){
4849
if(p->status() == 1){
4950
auto jet = jetreconstruction_PseudoJet{};
5051
auto retv = jetreconstruction_PseudoJet_init(
5152
&jet, p->momentum().px(), p->momentum().py(), p->momentum().pz(),
52-
p->momentum().e());
53+
p->momentum().e(), ++history_index);
5354
assert(retv ==
5455
jetreconstruction_StatusCode::JETRECONSTRUCTION_STATUSCODE_OK);
5556
input_particles.push_back(std::move(jet));

0 commit comments

Comments
 (0)