[01f457a] | 1 | /*
|
---|
| 2 | * Delphes: a framework for fast simulation of a generic collider experiment
|
---|
| 3 | * Copyright (C) 2012-2014 Universite catholique de Louvain (UCL), Belgium
|
---|
[1fa50c2] | 4 | *
|
---|
[01f457a] | 5 | * This program is free software: you can redistribute it and/or modify
|
---|
| 6 | * it under the terms of the GNU General Public License as published by
|
---|
| 7 | * the Free Software Foundation, either version 3 of the License, or
|
---|
| 8 | * (at your option) any later version.
|
---|
[1fa50c2] | 9 | *
|
---|
[01f457a] | 10 | * This program is distributed in the hope that it will be useful,
|
---|
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 13 | * GNU General Public License for more details.
|
---|
[1fa50c2] | 14 | *
|
---|
[01f457a] | 15 | * You should have received a copy of the GNU General Public License
|
---|
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
---|
| 17 | */
|
---|
| 18 |
|
---|
[d7d2da3] | 19 | /** \class FastJetFinder
|
---|
| 20 | *
|
---|
| 21 | * Finds jets using FastJet library.
|
---|
| 22 | *
|
---|
| 23 | * \author P. Demin - UCL, Louvain-la-Neuve
|
---|
| 24 | *
|
---|
| 25 | */
|
---|
| 26 |
|
---|
| 27 | #include "modules/FastJetFinder.h"
|
---|
| 28 |
|
---|
| 29 | #include "classes/DelphesClasses.h"
|
---|
| 30 | #include "classes/DelphesFactory.h"
|
---|
| 31 | #include "classes/DelphesFormula.h"
|
---|
| 32 |
|
---|
| 33 | #include "ExRootAnalysis/ExRootClassifier.h"
|
---|
[341014c] | 34 | #include "ExRootAnalysis/ExRootFilter.h"
|
---|
| 35 | #include "ExRootAnalysis/ExRootResult.h"
|
---|
[d7d2da3] | 36 |
|
---|
| 37 | #include "TDatabasePDG.h"
|
---|
[341014c] | 38 | #include "TFormula.h"
|
---|
[d7d2da3] | 39 | #include "TLorentzVector.h"
|
---|
[341014c] | 40 | #include "TMath.h"
|
---|
| 41 | #include "TObjArray.h"
|
---|
| 42 | #include "TRandom3.h"
|
---|
| 43 | #include "TString.h"
|
---|
[d7d2da3] | 44 |
|
---|
[8336b6e] | 45 | #include <algorithm>
|
---|
[d7d2da3] | 46 | #include <iostream>
|
---|
| 47 | #include <sstream>
|
---|
[341014c] | 48 | #include <stdexcept>
|
---|
[d7d2da3] | 49 | #include <vector>
|
---|
| 50 |
|
---|
| 51 | #include "fastjet/ClusterSequence.hh"
|
---|
| 52 | #include "fastjet/ClusterSequenceArea.hh"
|
---|
[341014c] | 53 | #include "fastjet/JetDefinition.hh"
|
---|
| 54 | #include "fastjet/PseudoJet.hh"
|
---|
| 55 | #include "fastjet/Selector.hh"
|
---|
[d7d2da3] | 56 | #include "fastjet/tools/JetMedianBackgroundEstimator.hh"
|
---|
| 57 |
|
---|
| 58 | #include "fastjet/plugins/CDFCones/fastjet/CDFJetCluPlugin.hh"
|
---|
[341014c] | 59 | #include "fastjet/plugins/CDFCones/fastjet/CDFMidPointPlugin.hh"
|
---|
| 60 | #include "fastjet/plugins/SISCone/fastjet/SISConePlugin.hh"
|
---|
[d7d2da3] | 61 |
|
---|
[341014c] | 62 | #include "fastjet/contribs/Nsubjettiness/ExtraRecombiners.hh"
|
---|
[9687203] | 63 | #include "fastjet/contribs/Nsubjettiness/Njettiness.hh"
|
---|
| 64 | #include "fastjet/contribs/Nsubjettiness/NjettinessPlugin.hh"
|
---|
[341014c] | 65 | #include "fastjet/contribs/Nsubjettiness/Nsubjettiness.hh"
|
---|
[9687203] | 66 |
|
---|
[f319c1d] | 67 | #include "fastjet/contribs/ValenciaPlugin/ValenciaPlugin.hh"
|
---|
| 68 |
|
---|
[341014c] | 69 | #include "fastjet/contribs/RecursiveTools/SoftDrop.hh"
|
---|
[de6d698] | 70 | #include "fastjet/tools/Filter.hh"
|
---|
| 71 | #include "fastjet/tools/Pruner.hh"
|
---|
| 72 |
|
---|
[d7d2da3] | 73 | using namespace std;
|
---|
| 74 | using namespace fastjet;
|
---|
[9687203] | 75 | using namespace fastjet::contrib;
|
---|
| 76 |
|
---|
[d7d2da3] | 77 | //------------------------------------------------------------------------------
|
---|
| 78 |
|
---|
| 79 | FastJetFinder::FastJetFinder() :
|
---|
[e9c0d73] | 80 | fPlugin(0), fRecomb(0), fAxesDef(0), fMeasureDef(0), fNjettinessPlugin(0), fValenciaPlugin(0),
|
---|
| 81 | fDefinition(0), fAreaDefinition(0), fItInputArray(0)
|
---|
[d7d2da3] | 82 | {
|
---|
| 83 | }
|
---|
| 84 |
|
---|
| 85 | //------------------------------------------------------------------------------
|
---|
| 86 |
|
---|
| 87 | FastJetFinder::~FastJetFinder()
|
---|
| 88 | {
|
---|
| 89 | }
|
---|
| 90 |
|
---|
| 91 | //------------------------------------------------------------------------------
|
---|
| 92 |
|
---|
| 93 | void FastJetFinder::Init()
|
---|
| 94 | {
|
---|
[c6321ad] | 95 | JetDefinition::Plugin *plugin = 0;
|
---|
| 96 | JetDefinition::Recombiner *recomb = 0;
|
---|
[7278220] | 97 | ExRootConfParam param;
|
---|
[8336b6e] | 98 | Long_t i, size;
|
---|
[7278220] | 99 | Double_t etaMin, etaMax;
|
---|
| 100 | TEstimatorStruct estimatorStruct;
|
---|
[8336b6e] | 101 |
|
---|
[d7d2da3] | 102 | // define algorithm
|
---|
| 103 |
|
---|
| 104 | fJetAlgorithm = GetInt("JetAlgorithm", 6);
|
---|
| 105 | fParameterR = GetDouble("ParameterR", 0.5);
|
---|
| 106 |
|
---|
| 107 | fConeRadius = GetDouble("ConeRadius", 0.5);
|
---|
| 108 | fSeedThreshold = GetDouble("SeedThreshold", 1.0);
|
---|
| 109 | fConeAreaFraction = GetDouble("ConeAreaFraction", 1.0);
|
---|
| 110 | fMaxIterations = GetInt("MaxIterations", 100);
|
---|
| 111 | fMaxPairSize = GetInt("MaxPairSize", 2);
|
---|
| 112 | fIratch = GetInt("Iratch", 1);
|
---|
[3ccc8586] | 113 | fAdjacencyCut = GetInt("AdjacencyCut", 2);
|
---|
[d7d2da3] | 114 | fOverlapThreshold = GetDouble("OverlapThreshold", 0.75);
|
---|
| 115 |
|
---|
| 116 | fJetPTMin = GetDouble("JetPTMin", 10.0);
|
---|
| 117 |
|
---|
[9687203] | 118 | //-- N(sub)jettiness parameters --
|
---|
[e4c3fef] | 119 |
|
---|
[9687203] | 120 | fComputeNsubjettiness = GetBool("ComputeNsubjettiness", false);
|
---|
| 121 | fBeta = GetDouble("Beta", 1.0);
|
---|
| 122 | fAxisMode = GetInt("AxisMode", 1);
|
---|
[e4c3fef] | 123 | fRcutOff = GetDouble("RcutOff", 0.8); // used only if Njettiness is used as jet clustering algo (case 8)
|
---|
[341014c] | 124 | fN = GetInt("N", 2); // used only if Njettiness is used as jet clustering algo (case 8)
|
---|
[f319c1d] | 125 |
|
---|
| 126 | //-- Exclusive clustering for e+e- collisions --
|
---|
[3b3d0ad] | 127 |
|
---|
[341014c] | 128 | fNJets = GetInt("NJets", 2);
|
---|
[f319c1d] | 129 | fExclusiveClustering = GetBool("ExclusiveClustering", false);
|
---|
| 130 |
|
---|
| 131 | //-- Valencia Linear Collider algorithm
|
---|
[3b3d0ad] | 132 |
|
---|
[f319c1d] | 133 | fGamma = GetDouble("Gamma", 1.0);
|
---|
| 134 | //fBeta parameter see above
|
---|
[3b3d0ad] | 135 |
|
---|
[919f6a6] | 136 | fMeasureDef = new NormalizedMeasure(fBeta, fParameterR);
|
---|
[3b3d0ad] | 137 |
|
---|
[8abab33] | 138 | switch(fAxisMode)
|
---|
| 139 | {
|
---|
[341014c] | 140 | default:
|
---|
| 141 | case 1:
|
---|
| 142 | fAxesDef = new WTA_KT_Axes();
|
---|
| 143 | break;
|
---|
| 144 | case 2:
|
---|
| 145 | fAxesDef = new OnePass_WTA_KT_Axes();
|
---|
| 146 | break;
|
---|
| 147 | case 3:
|
---|
| 148 | fAxesDef = new KT_Axes();
|
---|
| 149 | break;
|
---|
| 150 | case 4:
|
---|
| 151 | fAxesDef = new OnePass_KT_Axes();
|
---|
[3b3d0ad] | 152 | }
|
---|
[e4c3fef] | 153 |
|
---|
[de6d698] | 154 | //-- Trimming parameters --
|
---|
[3b3d0ad] | 155 |
|
---|
[de6d698] | 156 | fComputeTrimming = GetBool("ComputeTrimming", false);
|
---|
| 157 | fRTrim = GetDouble("RTrim", 0.2);
|
---|
| 158 | fPtFracTrim = GetDouble("PtFracTrim", 0.05);
|
---|
[3b3d0ad] | 159 |
|
---|
[de6d698] | 160 | //-- Pruning parameters --
|
---|
[3b3d0ad] | 161 |
|
---|
[de6d698] | 162 | fComputePruning = GetBool("ComputePruning", false);
|
---|
| 163 | fZcutPrun = GetDouble("ZcutPrun", 0.1);
|
---|
| 164 | fRcutPrun = GetDouble("RcutPrun", 0.5);
|
---|
| 165 | fRPrun = GetDouble("RPrun", 0.8);
|
---|
[3b3d0ad] | 166 |
|
---|
[de6d698] | 167 | //-- SoftDrop parameters --
|
---|
[3b3d0ad] | 168 |
|
---|
[341014c] | 169 | fComputeSoftDrop = GetBool("ComputeSoftDrop", false);
|
---|
| 170 | fBetaSoftDrop = GetDouble("BetaSoftDrop", 0.0);
|
---|
[de6d698] | 171 | fSymmetryCutSoftDrop = GetDouble("SymmetryCutSoftDrop", 0.1);
|
---|
[341014c] | 172 | fR0SoftDrop = GetDouble("R0SoftDrop=", 0.8);
|
---|
[de6d698] | 173 |
|
---|
[d7d2da3] | 174 | // --- Jet Area Parameters ---
|
---|
[3b3d0ad] | 175 |
|
---|
[d7d2da3] | 176 | fAreaAlgorithm = GetInt("AreaAlgorithm", 0);
|
---|
| 177 | fComputeRho = GetBool("ComputeRho", false);
|
---|
[e4c3fef] | 178 |
|
---|
[d7d2da3] | 179 | // - ghost based areas -
|
---|
| 180 | fGhostEtaMax = GetDouble("GhostEtaMax", 5.0);
|
---|
| 181 | fRepeat = GetInt("Repeat", 1);
|
---|
| 182 | fGhostArea = GetDouble("GhostArea", 0.01);
|
---|
| 183 | fGridScatter = GetDouble("GridScatter", 1.0);
|
---|
| 184 | fPtScatter = GetDouble("PtScatter", 0.1);
|
---|
| 185 | fMeanGhostPt = GetDouble("MeanGhostPt", 1.0E-100);
|
---|
[e4c3fef] | 186 |
|
---|
[d7d2da3] | 187 | // - voronoi based areas -
|
---|
| 188 | fEffectiveRfact = GetDouble("EffectiveRfact", 1.0);
|
---|
| 189 |
|
---|
| 190 | switch(fAreaAlgorithm)
|
---|
| 191 | {
|
---|
[341014c] | 192 | default:
|
---|
| 193 | case 0:
|
---|
| 194 | fAreaDefinition = 0;
|
---|
| 195 | break;
|
---|
| 196 | case 1:
|
---|
| 197 | fAreaDefinition = new AreaDefinition(active_area_explicit_ghosts, GhostedAreaSpec(fGhostEtaMax, fRepeat, fGhostArea, fGridScatter, fPtScatter, fMeanGhostPt));
|
---|
| 198 | break;
|
---|
| 199 | case 2:
|
---|
| 200 | fAreaDefinition = new AreaDefinition(one_ghost_passive_area, GhostedAreaSpec(fGhostEtaMax, fRepeat, fGhostArea, fGridScatter, fPtScatter, fMeanGhostPt));
|
---|
| 201 | break;
|
---|
| 202 | case 3:
|
---|
| 203 | fAreaDefinition = new AreaDefinition(passive_area, GhostedAreaSpec(fGhostEtaMax, fRepeat, fGhostArea, fGridScatter, fPtScatter, fMeanGhostPt));
|
---|
| 204 | break;
|
---|
| 205 | case 4:
|
---|
| 206 | fAreaDefinition = new AreaDefinition(VoronoiAreaSpec(fEffectiveRfact));
|
---|
| 207 | break;
|
---|
| 208 | case 5:
|
---|
| 209 | fAreaDefinition = new AreaDefinition(active_area, GhostedAreaSpec(fGhostEtaMax, fRepeat, fGhostArea, fGridScatter, fPtScatter, fMeanGhostPt));
|
---|
| 210 | break;
|
---|
[d7d2da3] | 211 | }
|
---|
| 212 |
|
---|
| 213 | switch(fJetAlgorithm)
|
---|
| 214 | {
|
---|
[341014c] | 215 | case 1:
|
---|
| 216 | plugin = new CDFJetCluPlugin(fSeedThreshold, fConeRadius, fAdjacencyCut, fMaxIterations, fIratch, fOverlapThreshold);
|
---|
| 217 | fDefinition = new JetDefinition(plugin);
|
---|
| 218 | break;
|
---|
| 219 | case 2:
|
---|
| 220 | plugin = new CDFMidPointPlugin(fSeedThreshold, fConeRadius, fConeAreaFraction, fMaxPairSize, fMaxIterations, fOverlapThreshold);
|
---|
| 221 | fDefinition = new JetDefinition(plugin);
|
---|
| 222 | break;
|
---|
| 223 | case 3:
|
---|
| 224 | plugin = new SISConePlugin(fConeRadius, fOverlapThreshold, fMaxIterations, fJetPTMin);
|
---|
| 225 | fDefinition = new JetDefinition(plugin);
|
---|
| 226 | break;
|
---|
| 227 | case 4:
|
---|
| 228 | fDefinition = new JetDefinition(kt_algorithm, fParameterR);
|
---|
| 229 | break;
|
---|
| 230 | case 5:
|
---|
| 231 | fDefinition = new JetDefinition(cambridge_algorithm, fParameterR);
|
---|
| 232 | break;
|
---|
| 233 | default:
|
---|
| 234 | case 6:
|
---|
| 235 | fDefinition = new JetDefinition(antikt_algorithm, fParameterR);
|
---|
| 236 | break;
|
---|
| 237 | case 7:
|
---|
| 238 | recomb = new WinnerTakeAllRecombiner();
|
---|
| 239 | fDefinition = new JetDefinition(antikt_algorithm, fParameterR, recomb, Best);
|
---|
| 240 | break;
|
---|
| 241 | case 8:
|
---|
| 242 | fNjettinessPlugin = new NjettinessPlugin(fN, Njettiness::wta_kt_axes, Njettiness::unnormalized_cutoff_measure, fBeta, fRcutOff);
|
---|
| 243 | fDefinition = new JetDefinition(fNjettinessPlugin);
|
---|
| 244 | break;
|
---|
| 245 | case 9:
|
---|
| 246 | fValenciaPlugin = new ValenciaPlugin(fParameterR, fBeta, fGamma);
|
---|
| 247 | fDefinition = new JetDefinition(fValenciaPlugin);
|
---|
| 248 | break;
|
---|
[d7d2da3] | 249 | }
|
---|
[8336b6e] | 250 |
|
---|
[d7d2da3] | 251 | fPlugin = plugin;
|
---|
[9687203] | 252 | fRecomb = recomb;
|
---|
[e4c3fef] | 253 |
|
---|
[d7d2da3] | 254 | ClusterSequence::print_banner();
|
---|
[8336b6e] | 255 |
|
---|
[7278220] | 256 | if(fComputeRho && fAreaDefinition)
|
---|
| 257 | {
|
---|
| 258 | // read eta ranges
|
---|
| 259 |
|
---|
| 260 | param = GetParam("RhoEtaRange");
|
---|
| 261 | size = param.GetSize();
|
---|
| 262 |
|
---|
| 263 | fEstimators.clear();
|
---|
[341014c] | 264 | for(i = 0; i < size / 2; ++i)
|
---|
[7278220] | 265 | {
|
---|
[341014c] | 266 | etaMin = param[i * 2].GetDouble();
|
---|
| 267 | etaMax = param[i * 2 + 1].GetDouble();
|
---|
[58dcd2e] | 268 | estimatorStruct.estimator = new JetMedianBackgroundEstimator(SelectorRapRange(etaMin, etaMax), *fDefinition, *fAreaDefinition);
|
---|
[7278220] | 269 | estimatorStruct.etaMin = etaMin;
|
---|
| 270 | estimatorStruct.etaMax = etaMax;
|
---|
| 271 | fEstimators.push_back(estimatorStruct);
|
---|
| 272 | }
|
---|
| 273 | }
|
---|
| 274 |
|
---|
[d7d2da3] | 275 | // import input array
|
---|
| 276 |
|
---|
| 277 | fInputArray = ImportArray(GetString("InputArray", "Calorimeter/towers"));
|
---|
| 278 | fItInputArray = fInputArray->MakeIterator();
|
---|
| 279 |
|
---|
| 280 | // create output arrays
|
---|
| 281 |
|
---|
| 282 | fOutputArray = ExportArray(GetString("OutputArray", "jets"));
|
---|
| 283 | fRhoOutputArray = ExportArray(GetString("RhoOutputArray", "rho"));
|
---|
[70bb4cb] | 284 | fConstituentsOutputArray = ExportArray(GetString("ConstituentsOutputArray", "constituents"));
|
---|
[d7d2da3] | 285 | }
|
---|
| 286 |
|
---|
| 287 | //------------------------------------------------------------------------------
|
---|
| 288 |
|
---|
| 289 | void FastJetFinder::Finish()
|
---|
| 290 | {
|
---|
[341014c] | 291 | vector<TEstimatorStruct>::iterator itEstimators;
|
---|
[7278220] | 292 |
|
---|
| 293 | for(itEstimators = fEstimators.begin(); itEstimators != fEstimators.end(); ++itEstimators)
|
---|
| 294 | {
|
---|
| 295 | if(itEstimators->estimator) delete itEstimators->estimator;
|
---|
| 296 | }
|
---|
| 297 |
|
---|
[d7d2da3] | 298 | if(fItInputArray) delete fItInputArray;
|
---|
| 299 | if(fDefinition) delete fDefinition;
|
---|
| 300 | if(fAreaDefinition) delete fAreaDefinition;
|
---|
[341014c] | 301 | if(fPlugin) delete static_cast<JetDefinition::Plugin *>(fPlugin);
|
---|
| 302 | if(fRecomb) delete static_cast<JetDefinition::Recombiner *>(fRecomb);
|
---|
| 303 | if(fNjettinessPlugin) delete static_cast<JetDefinition::Plugin *>(fNjettinessPlugin);
|
---|
[8abab33] | 304 | if(fAxesDef) delete fAxesDef;
|
---|
| 305 | if(fMeasureDef) delete fMeasureDef;
|
---|
[341014c] | 306 | if(fValenciaPlugin) delete static_cast<JetDefinition::Plugin *>(fValenciaPlugin);
|
---|
[d7d2da3] | 307 | }
|
---|
| 308 |
|
---|
| 309 | //------------------------------------------------------------------------------
|
---|
| 310 |
|
---|
| 311 | void FastJetFinder::Process()
|
---|
| 312 | {
|
---|
| 313 | Candidate *candidate, *constituent;
|
---|
| 314 | TLorentzVector momentum;
|
---|
[df04eb1] | 315 |
|
---|
[d7d2da3] | 316 | Double_t deta, dphi, detaMax, dphiMax;
|
---|
[df04eb1] | 317 | Double_t time, timeWeight;
|
---|
[ce4feac] | 318 | Int_t number, ncharged, nneutrals;
|
---|
[3b3d0ad] | 319 | Int_t charge;
|
---|
[df04eb1] | 320 | Double_t rho = 0.0;
|
---|
[d7d2da3] | 321 | PseudoJet jet, area;
|
---|
| 322 | ClusterSequence *sequence;
|
---|
[341014c] | 323 | vector<PseudoJet> inputList, outputList, subjets;
|
---|
| 324 | vector<PseudoJet>::iterator itInputList, itOutputList;
|
---|
| 325 | vector<TEstimatorStruct>::iterator itEstimators;
|
---|
[e9c0d73] | 326 | Double_t excl_ymerge23 = 0.0;
|
---|
| 327 | Double_t excl_ymerge34 = 0.0;
|
---|
| 328 | Double_t excl_ymerge45 = 0.0;
|
---|
| 329 | Double_t excl_ymerge56 = 0.0;
|
---|
[3b3d0ad] | 330 |
|
---|
[d7d2da3] | 331 | DelphesFactory *factory = GetFactory();
|
---|
| 332 |
|
---|
| 333 | inputList.clear();
|
---|
| 334 |
|
---|
| 335 | // loop over input objects
|
---|
| 336 | fItInputArray->Reset();
|
---|
| 337 | number = 0;
|
---|
[341014c] | 338 | while((candidate = static_cast<Candidate *>(fItInputArray->Next())))
|
---|
[8336b6e] | 339 | {
|
---|
[d7d2da3] | 340 | momentum = candidate->Momentum;
|
---|
| 341 | jet = PseudoJet(momentum.Px(), momentum.Py(), momentum.Pz(), momentum.E());
|
---|
| 342 | jet.set_user_index(number);
|
---|
| 343 | inputList.push_back(jet);
|
---|
| 344 | ++number;
|
---|
| 345 | }
|
---|
[8336b6e] | 346 |
|
---|
| 347 | // construct jets
|
---|
[d7d2da3] | 348 | if(fAreaDefinition)
|
---|
| 349 | {
|
---|
| 350 | sequence = new ClusterSequenceArea(inputList, *fDefinition, *fAreaDefinition);
|
---|
| 351 | }
|
---|
| 352 | else
|
---|
| 353 | {
|
---|
| 354 | sequence = new ClusterSequence(inputList, *fDefinition);
|
---|
[8336b6e] | 355 | }
|
---|
[d7d2da3] | 356 |
|
---|
| 357 | // compute rho and store it
|
---|
| 358 | if(fComputeRho && fAreaDefinition)
|
---|
| 359 | {
|
---|
[7278220] | 360 | for(itEstimators = fEstimators.begin(); itEstimators != fEstimators.end(); ++itEstimators)
|
---|
[8336b6e] | 361 | {
|
---|
[7278220] | 362 | itEstimators->estimator->set_particles(inputList);
|
---|
| 363 | rho = itEstimators->estimator->rho();
|
---|
[8336b6e] | 364 |
|
---|
| 365 | candidate = factory->NewCandidate();
|
---|
| 366 | candidate->Momentum.SetPtEtaPhiE(rho, 0.0, 0.0, rho);
|
---|
[7278220] | 367 | candidate->Edges[0] = itEstimators->etaMin;
|
---|
| 368 | candidate->Edges[1] = itEstimators->etaMax;
|
---|
[8336b6e] | 369 | fRhoOutputArray->Add(candidate);
|
---|
| 370 | }
|
---|
[d7d2da3] | 371 | }
|
---|
[8336b6e] | 372 |
|
---|
[d7d2da3] | 373 | outputList.clear();
|
---|
| 374 |
|
---|
[f319c1d] | 375 | if(fExclusiveClustering)
|
---|
[341014c] | 376 | {
|
---|
| 377 | try
|
---|
[f319c1d] | 378 | {
|
---|
[341014c] | 379 | outputList = sorted_by_pt(sequence->exclusive_jets(fNJets));
|
---|
[f319c1d] | 380 | }
|
---|
[341014c] | 381 | catch(fastjet::Error)
|
---|
[f319c1d] | 382 | {
|
---|
[341014c] | 383 | outputList.clear();
|
---|
[f319c1d] | 384 | }
|
---|
[9687203] | 385 |
|
---|
[341014c] | 386 | excl_ymerge23 = sequence->exclusive_ymerge(2);
|
---|
| 387 | excl_ymerge34 = sequence->exclusive_ymerge(3);
|
---|
| 388 | excl_ymerge45 = sequence->exclusive_ymerge(4);
|
---|
| 389 | excl_ymerge56 = sequence->exclusive_ymerge(5);
|
---|
| 390 | }
|
---|
| 391 | else
|
---|
| 392 | {
|
---|
| 393 | outputList = sorted_by_pt(sequence->inclusive_jets(fJetPTMin));
|
---|
| 394 | }
|
---|
| 395 |
|
---|
[d7d2da3] | 396 | // loop over all jets and export them
|
---|
| 397 | detaMax = 0.0;
|
---|
| 398 | dphiMax = 0.0;
|
---|
[3b3d0ad] | 399 |
|
---|
[d7d2da3] | 400 | for(itOutputList = outputList.begin(); itOutputList != outputList.end(); ++itOutputList)
|
---|
| 401 | {
|
---|
[d244bc9] | 402 | jet = *itOutputList;
|
---|
| 403 | if(fJetAlgorithm == 7) jet = join(jet.constituents());
|
---|
[df04eb1] | 404 |
|
---|
[d244bc9] | 405 | momentum.SetPxPyPzE(jet.px(), jet.py(), jet.pz(), jet.E());
|
---|
[df04eb1] | 406 |
|
---|
[d7d2da3] | 407 | area.reset(0.0, 0.0, 0.0, 0.0);
|
---|
| 408 | if(fAreaDefinition) area = itOutputList->area_4vector();
|
---|
| 409 |
|
---|
| 410 | candidate = factory->NewCandidate();
|
---|
| 411 |
|
---|
[df04eb1] | 412 | time = 0.0;
|
---|
| 413 | timeWeight = 0.0;
|
---|
[22dc7fd] | 414 |
|
---|
[5a44a72] | 415 | charge = 0;
|
---|
| 416 |
|
---|
[ce4feac] | 417 | ncharged = 0;
|
---|
| 418 | nneutrals = 0;
|
---|
| 419 |
|
---|
[d7d2da3] | 420 | inputList.clear();
|
---|
| 421 | inputList = sequence->constituents(*itOutputList);
|
---|
[e4c3fef] | 422 |
|
---|
[d7d2da3] | 423 | for(itInputList = inputList.begin(); itInputList != inputList.end(); ++itInputList)
|
---|
| 424 | {
|
---|
[29f8a06] | 425 | if(itInputList->user_index() < 0) continue;
|
---|
[341014c] | 426 | constituent = static_cast<Candidate *>(fInputArray->At(itInputList->user_index()));
|
---|
[d7d2da3] | 427 |
|
---|
| 428 | deta = TMath::Abs(momentum.Eta() - constituent->Momentum.Eta());
|
---|
| 429 | dphi = TMath::Abs(momentum.DeltaPhi(constituent->Momentum));
|
---|
| 430 | if(deta > detaMax) detaMax = deta;
|
---|
| 431 | if(dphi > dphiMax) dphiMax = dphi;
|
---|
[e4c3fef] | 432 |
|
---|
[341014c] | 433 | if(constituent->Charge == 0)
|
---|
| 434 | nneutrals++;
|
---|
| 435 | else
|
---|
| 436 | ncharged++;
|
---|
[ce4feac] | 437 |
|
---|
[341014c] | 438 | time += TMath::Sqrt(constituent->Momentum.E()) * (constituent->Position.T());
|
---|
[df04eb1] | 439 | timeWeight += TMath::Sqrt(constituent->Momentum.E());
|
---|
[e4c3fef] | 440 |
|
---|
[5a44a72] | 441 | charge += constituent->Charge;
|
---|
| 442 |
|
---|
[70bb4cb] | 443 | fConstituentsOutputArray->Add(constituent);
|
---|
[d7d2da3] | 444 | candidate->AddCandidate(constituent);
|
---|
| 445 | }
|
---|
[e4c3fef] | 446 |
|
---|
[d7d2da3] | 447 | candidate->Momentum = momentum;
|
---|
[341014c] | 448 | candidate->Position.SetT(time / timeWeight);
|
---|
[d7d2da3] | 449 | candidate->Area.SetPxPyPzE(area.px(), area.py(), area.pz(), area.E());
|
---|
| 450 |
|
---|
| 451 | candidate->DeltaEta = detaMax;
|
---|
| 452 | candidate->DeltaPhi = dphiMax;
|
---|
[3b3d0ad] | 453 | candidate->Charge = charge;
|
---|
[ce4feac] | 454 | candidate->NNeutrals = nneutrals;
|
---|
| 455 | candidate->NCharged = ncharged;
|
---|
[e9c0d73] | 456 |
|
---|
| 457 | //for exclusive clustering, access y_n,n+1 as exclusive_ymerge (fNJets);
|
---|
| 458 | candidate->ExclYmerge23 = excl_ymerge23;
|
---|
| 459 | candidate->ExclYmerge34 = excl_ymerge34;
|
---|
| 460 | candidate->ExclYmerge45 = excl_ymerge45;
|
---|
| 461 | candidate->ExclYmerge56 = excl_ymerge56;
|
---|
[3b3d0ad] | 462 |
|
---|
[de6d698] | 463 | //------------------------------------
|
---|
| 464 | // Trimming
|
---|
| 465 | //------------------------------------
|
---|
[d7d2da3] | 466 |
|
---|
[8abab33] | 467 | if(fComputeTrimming)
|
---|
[de6d698] | 468 | {
|
---|
| 469 |
|
---|
[341014c] | 470 | fastjet::Filter trimmer(fastjet::JetDefinition(fastjet::kt_algorithm, fRTrim), fastjet::SelectorPtFractionMin(fPtFracTrim));
|
---|
[de6d698] | 471 | fastjet::PseudoJet trimmed_jet = trimmer(*itOutputList);
|
---|
[3b3d0ad] | 472 |
|
---|
[de6d698] | 473 | trimmed_jet = join(trimmed_jet.constituents());
|
---|
[3b3d0ad] | 474 |
|
---|
[de6d698] | 475 | candidate->TrimmedP4[0].SetPtEtaPhiM(trimmed_jet.pt(), trimmed_jet.eta(), trimmed_jet.phi(), trimmed_jet.m());
|
---|
[3b3d0ad] | 476 |
|
---|
| 477 | // four hardest subjets
|
---|
[de6d698] | 478 | subjets.clear();
|
---|
| 479 | subjets = trimmed_jet.pieces();
|
---|
| 480 | subjets = sorted_by_pt(subjets);
|
---|
[3b3d0ad] | 481 |
|
---|
[de6d698] | 482 | candidate->NSubJetsTrimmed = subjets.size();
|
---|
| 483 |
|
---|
[341014c] | 484 | for(size_t i = 0; i < subjets.size() and i < 4; i++)
|
---|
[8abab33] | 485 | {
|
---|
[341014c] | 486 | if(subjets.at(i).pt() < 0) continue;
|
---|
| 487 | candidate->TrimmedP4[i + 1].SetPtEtaPhiM(subjets.at(i).pt(), subjets.at(i).eta(), subjets.at(i).phi(), subjets.at(i).m());
|
---|
[de6d698] | 488 | }
|
---|
| 489 | }
|
---|
[3b3d0ad] | 490 |
|
---|
[de6d698] | 491 | //------------------------------------
|
---|
| 492 | // Pruning
|
---|
| 493 | //------------------------------------
|
---|
[3b3d0ad] | 494 |
|
---|
[de6d698] | 495 | if(fComputePruning)
|
---|
| 496 | {
|
---|
| 497 |
|
---|
[341014c] | 498 | fastjet::Pruner pruner(fastjet::JetDefinition(fastjet::cambridge_algorithm, fRPrun), fZcutPrun, fRcutPrun);
|
---|
[de6d698] | 499 | fastjet::PseudoJet pruned_jet = pruner(*itOutputList);
|
---|
| 500 |
|
---|
| 501 | candidate->PrunedP4[0].SetPtEtaPhiM(pruned_jet.pt(), pruned_jet.eta(), pruned_jet.phi(), pruned_jet.m());
|
---|
[3b3d0ad] | 502 |
|
---|
| 503 | // four hardest subjet
|
---|
[de6d698] | 504 | subjets.clear();
|
---|
| 505 | subjets = pruned_jet.pieces();
|
---|
| 506 | subjets = sorted_by_pt(subjets);
|
---|
[3b3d0ad] | 507 |
|
---|
[de6d698] | 508 | candidate->NSubJetsPruned = subjets.size();
|
---|
| 509 |
|
---|
[341014c] | 510 | for(size_t i = 0; i < subjets.size() and i < 4; i++)
|
---|
[8abab33] | 511 | {
|
---|
[341014c] | 512 | if(subjets.at(i).pt() < 0) continue;
|
---|
| 513 | candidate->PrunedP4[i + 1].SetPtEtaPhiM(subjets.at(i).pt(), subjets.at(i).eta(), subjets.at(i).phi(), subjets.at(i).m());
|
---|
[de6d698] | 514 | }
|
---|
[3b3d0ad] | 515 | }
|
---|
| 516 |
|
---|
[de6d698] | 517 | //------------------------------------
|
---|
| 518 | // SoftDrop
|
---|
| 519 | //------------------------------------
|
---|
[3b3d0ad] | 520 |
|
---|
[de6d698] | 521 | if(fComputeSoftDrop)
|
---|
| 522 | {
|
---|
[3b3d0ad] | 523 |
|
---|
[341014c] | 524 | contrib::SoftDrop softDrop(fBetaSoftDrop, fSymmetryCutSoftDrop, fR0SoftDrop);
|
---|
[de6d698] | 525 | fastjet::PseudoJet softdrop_jet = softDrop(*itOutputList);
|
---|
[3b3d0ad] | 526 |
|
---|
[de6d698] | 527 | candidate->SoftDroppedP4[0].SetPtEtaPhiM(softdrop_jet.pt(), softdrop_jet.eta(), softdrop_jet.phi(), softdrop_jet.m());
|
---|
[3b3d0ad] | 528 |
|
---|
| 529 | // four hardest subjet
|
---|
| 530 |
|
---|
[de6d698] | 531 | subjets.clear();
|
---|
[341014c] | 532 | subjets = softdrop_jet.pieces();
|
---|
| 533 | subjets = sorted_by_pt(subjets);
|
---|
[de6d698] | 534 | candidate->NSubJetsSoftDropped = softdrop_jet.pieces().size();
|
---|
| 535 |
|
---|
[ba75867] | 536 | candidate->SoftDroppedJet = candidate->SoftDroppedP4[0];
|
---|
| 537 |
|
---|
[341014c] | 538 | for(size_t i = 0; i < subjets.size() and i < 4; i++)
|
---|
[8abab33] | 539 | {
|
---|
[341014c] | 540 | if(subjets.at(i).pt() < 0) continue;
|
---|
| 541 | candidate->SoftDroppedP4[i + 1].SetPtEtaPhiM(subjets.at(i).pt(), subjets.at(i).eta(), subjets.at(i).phi(), subjets.at(i).m());
|
---|
| 542 | if(i == 0) candidate->SoftDroppedSubJet1 = candidate->SoftDroppedP4[i + 1];
|
---|
| 543 | if(i == 1) candidate->SoftDroppedSubJet2 = candidate->SoftDroppedP4[i + 1];
|
---|
[de6d698] | 544 | }
|
---|
| 545 | }
|
---|
[3b3d0ad] | 546 |
|
---|
[9687203] | 547 | // --- compute N-subjettiness with N = 1,2,3,4,5 ----
|
---|
[e4c3fef] | 548 |
|
---|
[9687203] | 549 | if(fComputeNsubjettiness)
|
---|
| 550 | {
|
---|
[3b3d0ad] | 551 |
|
---|
[8abab33] | 552 | Nsubjettiness nSub1(1, *fAxesDef, *fMeasureDef);
|
---|
| 553 | Nsubjettiness nSub2(2, *fAxesDef, *fMeasureDef);
|
---|
| 554 | Nsubjettiness nSub3(3, *fAxesDef, *fMeasureDef);
|
---|
| 555 | Nsubjettiness nSub4(4, *fAxesDef, *fMeasureDef);
|
---|
| 556 | Nsubjettiness nSub5(5, *fAxesDef, *fMeasureDef);
|
---|
[3b3d0ad] | 557 |
|
---|
[e4c3fef] | 558 | candidate->Tau[0] = nSub1(*itOutputList);
|
---|
| 559 | candidate->Tau[1] = nSub2(*itOutputList);
|
---|
| 560 | candidate->Tau[2] = nSub3(*itOutputList);
|
---|
| 561 | candidate->Tau[3] = nSub4(*itOutputList);
|
---|
| 562 | candidate->Tau[4] = nSub5(*itOutputList);
|
---|
[9687203] | 563 | }
|
---|
| 564 |
|
---|
[d7d2da3] | 565 | fOutputArray->Add(candidate);
|
---|
| 566 | }
|
---|
| 567 | delete sequence;
|
---|
| 568 | }
|
---|