Changes in modules/FastJetFinder.cc [5a44a72:df04eb1] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/FastJetFinder.cc
r5a44a72 rdf04eb1 66 66 #include "fastjet/contribs/Nsubjettiness/WinnerTakeAllRecombiner.hh" 67 67 68 #include "fastjet/tools/Filter.hh"69 #include "fastjet/tools/Pruner.hh"70 #include "fastjet/contribs/RecursiveTools/SoftDrop.hh"71 72 68 using namespace std; 73 69 using namespace fastjet; … … 96 92 JetDefinition::Plugin *plugin = 0; 97 93 JetDefinition::Recombiner *recomb = 0; 98 ExRootConfParam param; 94 NjettinessPlugin *njetPlugin = 0; 95 96 // read eta ranges 97 98 ExRootConfParam param = GetParam("RhoEtaRange"); 99 99 Long_t i, size; 100 Double_t etaMin, etaMax; 101 TEstimatorStruct estimatorStruct; 100 101 fEtaRangeMap.clear(); 102 size = param.GetSize(); 103 for(i = 0; i < size/2; ++i) 104 { 105 fEtaRangeMap[param[i*2].GetDouble()] = param[i*2 + 1].GetDouble(); 106 } 102 107 103 108 // define algorithm … … 125 130 fN = GetInt("N", 2); // used only if Njettiness is used as jet clustering algo (case 8) 126 131 127 //-- Trimming parameters --128 129 fComputeTrimming = GetBool("ComputeTrimming", false);130 fRTrim = GetDouble("RTrim", 0.2);131 fPtFracTrim = GetDouble("PtFracTrim", 0.05);132 133 134 //-- Pruning parameters --135 136 fComputePruning = GetBool("ComputePruning", false);137 fZcutPrun = GetDouble("ZcutPrun", 0.1);138 fRcutPrun = GetDouble("RcutPrun", 0.5);139 fRPrun = GetDouble("RPrun", 0.8);140 141 //-- SoftDrop parameters --142 143 fComputeSoftDrop = GetBool("ComputeSoftDrop", false);144 fBetaSoftDrop = GetDouble("BetaSoftDrop", 0.0);145 fSymmetryCutSoftDrop = GetDouble("SymmetryCutSoftDrop", 0.1);146 fR0SoftDrop= GetDouble("R0SoftDrop=", 0.8);147 148 149 132 // --- Jet Area Parameters --- 150 133 fAreaAlgorithm = GetInt("AreaAlgorithm", 0); … … 214 197 break; 215 198 case 8: 216 fNjettinessPlugin = new NjettinessPlugin(fN, Njettiness::wta_kt_axes, Njettiness::unnormalized_cutoff_measure, fBeta, fRcutOff);217 fDefinition = new JetDefinition( fNjettinessPlugin);199 njetPlugin = new NjettinessPlugin(fN, Njettiness::wta_kt_axes, Njettiness::unnormalized_cutoff_measure, fBeta, fRcutOff); 200 fDefinition = new JetDefinition(njetPlugin); 218 201 break; 219 202 } … … 221 204 fPlugin = plugin; 222 205 fRecomb = recomb; 206 fNjettinessPlugin = njetPlugin; 223 207 224 208 ClusterSequence::print_banner(); 225 226 if(fComputeRho && fAreaDefinition)227 {228 // read eta ranges229 230 param = GetParam("RhoEtaRange");231 size = param.GetSize();232 233 fEstimators.clear();234 for(i = 0; i < size/2; ++i)235 {236 etaMin = param[i*2].GetDouble();237 etaMax = param[i*2 + 1].GetDouble();238 estimatorStruct.estimator = new JetMedianBackgroundEstimator(SelectorEtaRange(etaMin, etaMax), *fDefinition, *fAreaDefinition);239 estimatorStruct.etaMin = etaMin;240 estimatorStruct.etaMax = etaMax;241 fEstimators.push_back(estimatorStruct);242 }243 }244 209 245 210 // import input array … … 258 223 void FastJetFinder::Finish() 259 224 { 260 vector< TEstimatorStruct >::iterator itEstimators;261 262 for(itEstimators = fEstimators.begin(); itEstimators != fEstimators.end(); ++itEstimators)263 {264 if(itEstimators->estimator) delete itEstimators->estimator;265 }266 267 225 if(fItInputArray) delete fItInputArray; 268 226 if(fDefinition) delete fDefinition; … … 283 241 Double_t time, timeWeight; 284 242 Int_t number; 285 Int_t charge;286 243 Double_t rho = 0.0; 287 244 PseudoJet jet, area; 245 vector<PseudoJet> inputList, outputList; 288 246 ClusterSequence *sequence; 289 vector< PseudoJet > inputList, outputList, subjets; 290 vector< PseudoJet >::iterator itInputList, itOutputList; 291 vector< TEstimatorStruct >::iterator itEstimators; 247 map< Double_t, Double_t >::iterator itEtaRangeMap; 292 248 293 249 DelphesFactory *factory = GetFactory(); … … 320 276 if(fComputeRho && fAreaDefinition) 321 277 { 322 for(itE stimators = fEstimators.begin(); itEstimators != fEstimators.end(); ++itEstimators)278 for(itEtaRangeMap = fEtaRangeMap.begin(); itEtaRangeMap != fEtaRangeMap.end(); ++itEtaRangeMap) 323 279 { 324 itEstimators->estimator->set_particles(inputList); 325 rho = itEstimators->estimator->rho(); 280 Selector select_rapidity = SelectorAbsRapRange(itEtaRangeMap->first, itEtaRangeMap->second); 281 JetMedianBackgroundEstimator estimator(select_rapidity, *fDefinition, *fAreaDefinition); 282 estimator.set_particles(inputList); 283 rho = estimator.rho(); 326 284 327 285 candidate = factory->NewCandidate(); 328 286 candidate->Momentum.SetPtEtaPhiE(rho, 0.0, 0.0, rho); 329 candidate->Edges[0] = itE stimators->etaMin;330 candidate->Edges[1] = itE stimators->etaMax;287 candidate->Edges[0] = itEtaRangeMap->first; 288 candidate->Edges[1] = itEtaRangeMap->second; 331 289 fRhoOutputArray->Add(candidate); 332 290 } … … 340 298 detaMax = 0.0; 341 299 dphiMax = 0.0; 300 vector<PseudoJet>::iterator itInputList, itOutputList; 342 301 for(itOutputList = outputList.begin(); itOutputList != outputList.end(); ++itOutputList) 343 302 { … … 355 314 timeWeight = 0.0; 356 315 357 charge = 0;358 359 316 inputList.clear(); 360 317 inputList = sequence->constituents(*itOutputList); … … 362 319 for(itInputList = inputList.begin(); itInputList != inputList.end(); ++itInputList) 363 320 { 364 if(itInputList->user_index() < 0) continue;365 321 constituent = static_cast<Candidate*>(fInputArray->At(itInputList->user_index())); 366 322 … … 373 329 timeWeight += TMath::Sqrt(constituent->Momentum.E()); 374 330 375 charge += constituent->Charge;376 377 331 candidate->AddCandidate(constituent); 378 332 } … … 384 338 candidate->DeltaEta = detaMax; 385 339 candidate->DeltaPhi = dphiMax; 386 candidate->Charge = charge; 387 //------------------------------------ 388 // Trimming 389 //------------------------------------ 390 391 if(fComputeTrimming) 392 { 393 394 fastjet::Filter trimmer(fastjet::JetDefinition(fastjet::kt_algorithm,fRTrim),fastjet::SelectorPtFractionMin(fPtFracTrim)); 395 fastjet::PseudoJet trimmed_jet = trimmer(*itOutputList); 396 397 trimmed_jet = join(trimmed_jet.constituents()); 398 399 candidate->TrimmedP4[0].SetPtEtaPhiM(trimmed_jet.pt(), trimmed_jet.eta(), trimmed_jet.phi(), trimmed_jet.m()); 400 401 // four hardest subjets 402 subjets.clear(); 403 subjets = trimmed_jet.pieces(); 404 subjets = sorted_by_pt(subjets); 405 406 candidate->NSubJetsTrimmed = subjets.size(); 407 408 for (size_t i = 0; i < subjets.size() and i < 4; i++){ 409 if(subjets.at(i).pt() < 0) continue ; 410 candidate->TrimmedP4[i+1].SetPtEtaPhiM(subjets.at(i).pt(), subjets.at(i).eta(), subjets.at(i).phi(), subjets.at(i).m()); 411 } 412 } 413 414 415 //------------------------------------ 416 // Pruning 417 //------------------------------------ 418 419 420 if(fComputePruning) 421 { 422 423 fastjet::Pruner pruner(fastjet::JetDefinition(fastjet::cambridge_algorithm,fRPrun),fZcutPrun,fRcutPrun); 424 fastjet::PseudoJet pruned_jet = pruner(*itOutputList); 425 426 candidate->PrunedP4[0].SetPtEtaPhiM(pruned_jet.pt(), pruned_jet.eta(), pruned_jet.phi(), pruned_jet.m()); 427 428 // four hardest subjet 429 subjets.clear(); 430 subjets = pruned_jet.pieces(); 431 subjets = sorted_by_pt(subjets); 432 433 candidate->NSubJetsPruned = subjets.size(); 434 435 for (size_t i = 0; i < subjets.size() and i < 4; i++){ 436 if(subjets.at(i).pt() < 0) continue ; 437 candidate->PrunedP4[i+1].SetPtEtaPhiM(subjets.at(i).pt(), subjets.at(i).eta(), subjets.at(i).phi(), subjets.at(i).m()); 438 } 439 440 } 441 442 //------------------------------------ 443 // SoftDrop 444 //------------------------------------ 445 446 if(fComputeSoftDrop) 447 { 448 449 contrib::SoftDrop softDrop(fBetaSoftDrop,fSymmetryCutSoftDrop,fR0SoftDrop); 450 fastjet::PseudoJet softdrop_jet = softDrop(*itOutputList); 451 452 candidate->SoftDroppedP4[0].SetPtEtaPhiM(softdrop_jet.pt(), softdrop_jet.eta(), softdrop_jet.phi(), softdrop_jet.m()); 453 454 // four hardest subjet 455 456 subjets.clear(); 457 subjets = softdrop_jet.pieces(); 458 subjets = sorted_by_pt(subjets); 459 candidate->NSubJetsSoftDropped = softdrop_jet.pieces().size(); 460 461 for (size_t i = 0; i < subjets.size() and i < 4; i++){ 462 if(subjets.at(i).pt() < 0) continue ; 463 candidate->SoftDroppedP4[i+1].SetPtEtaPhiM(subjets.at(i).pt(), subjets.at(i).eta(), subjets.at(i).phi(), subjets.at(i).m()); 464 } 465 } 466 340 467 341 // --- compute N-subjettiness with N = 1,2,3,4,5 ---- 468 342 … … 503 377 } 504 378 379 505 380 fOutputArray->Add(candidate); 506 381 }
Note:
See TracChangeset
for help on using the changeset viewer.