Fork me on GitHub

Changeset de6d698 in git


Ignore:
Timestamp:
Mar 16, 2015, 4:39:51 PM (10 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
986d9d5
Parents:
666d795
Message:

added Trimming, Pruning and SoftDrop in FastJetFinder

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • classes/DelphesClasses.cc

    r666d795 rde6d698  
    129129  NCharged(0),
    130130  NNeutrals(0),
     131  NSubJetsTrimmed(0),
     132  NSubJetsPruned(0),
     133  NSubJetsSoftDropped(0),
    131134  Beta(0),
    132135  BetaStar(0),
     
    157160  Tau[3] = 0.0;
    158161  Tau[4] = 0.0;
     162  TrimmedP4[0] = 0.0;
     163  TrimmedP4[1] = 0.0;
     164  TrimmedP4[2] = 0.0;
     165  TrimmedP4[3] = 0.0;
     166  TrimmedP4[4] = 0.0;
     167  PrunedP4[0] = 0.0;
     168  PrunedP4[1] = 0.0;
     169  PrunedP4[2] = 0.0;
     170  PrunedP4[3] = 0.0;
     171  PrunedP4[4] = 0.0;
     172  SoftDroppedP4[0] = 0.0;
     173  SoftDroppedP4[1] = 0.0;
     174  SoftDroppedP4[2] = 0.0;
     175  SoftDroppedP4[3] = 0.0;
     176  SoftDroppedP4[4] = 0.0;
    159177}
    160178
     
    274292  object.Tau[3] = Tau[3];
    275293  object.Tau[4] = Tau[4];
     294 
     295  object.TrimmedP4[0] = TrimmedP4[0];
     296  object.TrimmedP4[1] = TrimmedP4[1];
     297  object.TrimmedP4[2] = TrimmedP4[2];
     298  object.TrimmedP4[3] = TrimmedP4[3];
     299  object.TrimmedP4[4] = TrimmedP4[4];
     300  object.PrunedP4[0] = PrunedP4[0];
     301  object.PrunedP4[1] = PrunedP4[1];
     302  object.PrunedP4[2] = PrunedP4[2];
     303  object.PrunedP4[3] = PrunedP4[3];
     304  object.PrunedP4[4] = PrunedP4[4];
     305  object.SoftDroppedP4[0] = SoftDroppedP4[0];
     306  object.SoftDroppedP4[1] = SoftDroppedP4[1];
     307  object.SoftDroppedP4[2] = SoftDroppedP4[2];
     308  object.SoftDroppedP4[3] = SoftDroppedP4[3];
     309  object.SoftDroppedP4[4] = SoftDroppedP4[4];
     310
     311  object.NSubJetsTrimmed     = NSubJetsTrimmed;
     312  object.NSubJetsPruned      = NSubJetsPruned;
     313  object.NSubJetsSoftDropped = NSubJetsSoftDropped;
    276314
    277315  object.fFactory = fFactory;
    278316  object.fArray = 0;
    279 
    280317
    281318  // Copy cluster timing info
     
    351388  Tau[3] = 0.0;
    352389  Tau[4] = 0.0;
    353 
     390 
     391  TrimmedP4[0]= 0.0;
     392  TrimmedP4[1]= 0.0;
     393  TrimmedP4[2]= 0.0;
     394  TrimmedP4[3]= 0.0;
     395  TrimmedP4[4]= 0.0;
     396  PrunedP4[0]= 0.0;
     397  PrunedP4[1]= 0.0;
     398  PrunedP4[2]= 0.0;
     399  PrunedP4[3]= 0.0;
     400  PrunedP4[4]= 0.0;
     401  SoftDroppedP4[0]= 0.0;
     402  SoftDroppedP4[1]= 0.0;
     403  SoftDroppedP4[2]= 0.0;
     404  SoftDroppedP4[3]= 0.0;
     405  SoftDroppedP4[4]= 0.0;
     406  NSubJetsTrimmed     = 0;
     407  NSubJetsPruned      = 0;
     408  NSubJetsSoftDropped = 0;
     409 
    354410  fArray = 0;
    355411}
  • classes/DelphesClasses.h

    r666d795 rde6d698  
    349349
    350350  Float_t Tau[5]; // N-subjettiness
    351  
     351 
     352  TLorentzVector TrimmedP4[5]; //first entry (i = 0) is the total Trimmed Jet 4-momenta and from i = 1 to 4 are the trimmed subjets 4-momenta
     353  TLorentzVector PrunedP4[5]; //first entry (i = 0) is the total Pruned Jet 4-momenta and from i = 1 to 4 are the pruned subjets 4-momenta
     354  TLorentzVector SoftDroppedP4[5]; //first entry (i = 0) is the total SoftDropped Jet 4-momenta and from i = 1 to 4 are the pruned subjets 4-momenta
     355 
     356  Int_t    NSubJetsTrimmed; // number of subjets trimmed
     357  Int_t    NSubJetsPruned; // number of subjets pruned
     358  Int_t    NSubJetsSoftDropped; // number of subjets soft-dropped
     359   
    352360  TRefArray Constituents; // references to constituents
    353361  TRefArray Particles; // references to generated particles
     
    527535  Float_t Tau[5];
    528536 
    529  
    530  
     537  // Other Substructure variables
     538 
     539  TLorentzVector TrimmedP4[5]; //first entry (i = 0) is the total Trimmed Jet 4-momenta and from i = 1 to 4 are the trimmed subjets 4-momenta
     540  TLorentzVector PrunedP4[5]; //first entry (i = 0) is the total Pruned Jet 4-momenta and from i = 1 to 4 are the pruned subjets 4-momenta
     541  TLorentzVector SoftDroppedP4[5]; //first entry (i = 0) is the total SoftDropped Jet 4-momenta and from i = 1 to 4 are the pruned subjets 4-momenta
     542 
     543  Int_t    NSubJetsTrimmed; // number of subjets trimmed
     544  Int_t    NSubJetsPruned; // number of subjets pruned
     545  Int_t    NSubJetsSoftDropped; // number of subjets soft-dropped
     546
    531547
    532548  static CompBase *fgCompare; //!
     
    548564  void SetFactory(DelphesFactory *factory) { fFactory = factory; }
    549565
    550   ClassDef(Candidate, 2)
     566  ClassDef(Candidate, 3)
    551567};
    552568
  • modules/FastJetFinder.cc

    r666d795 rde6d698  
    6666#include "fastjet/contribs/Nsubjettiness/WinnerTakeAllRecombiner.hh"
    6767
     68#include "fastjet/tools/Filter.hh"
     69#include "fastjet/tools/Pruner.hh"
     70#include "fastjet/contribs/RecursiveTools/SoftDrop.hh"
     71
    6872using namespace std;
    6973using namespace fastjet;
     
    121125  fN = GetInt("N", 2);                  // used only if Njettiness is used as jet clustering algo (case 8)
    122126
     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
    123149  // ---  Jet Area Parameters ---
    124150  fAreaAlgorithm = GetInt("AreaAlgorithm", 0);
     
    260286  PseudoJet jet, area;
    261287  ClusterSequence *sequence;
    262   vector< PseudoJet > inputList, outputList;
     288  vector< PseudoJet > inputList, outputList, subjets;
    263289  vector< PseudoJet >::iterator itInputList, itOutputList;
    264290  vector< TEstimatorStruct >::iterator itEstimators;
     
    352378    candidate->DeltaEta = detaMax;
    353379    candidate->DeltaPhi = dphiMax;
    354 
     380       
     381    //------------------------------------
     382    // Trimming
     383    //------------------------------------
     384
     385     if(fComputeTrimming)
     386    {
     387
     388      fastjet::Filter    trimmer(fastjet::JetDefinition(fastjet::kt_algorithm,fRTrim),fastjet::SelectorPtFractionMin(fPtFracTrim));
     389      fastjet::PseudoJet trimmed_jet = trimmer(*itOutputList);
     390     
     391      trimmed_jet = join(trimmed_jet.constituents());
     392     
     393      candidate->TrimmedP4[0].SetPtEtaPhiM(trimmed_jet.pt(), trimmed_jet.eta(), trimmed_jet.phi(), trimmed_jet.m());
     394       
     395      // four hardest subjets
     396      subjets.clear();
     397      subjets = trimmed_jet.pieces();
     398      subjets = sorted_by_pt(subjets);
     399     
     400      candidate->NSubJetsTrimmed = subjets.size();
     401
     402      for (size_t i = 0; i < subjets.size() and i < 4; i++){
     403        if(subjets.at(i).pt() < 0) continue ;
     404        candidate->TrimmedP4[i+1].SetPtEtaPhiM(subjets.at(i).pt(), subjets.at(i).eta(), subjets.at(i).phi(), subjets.at(i).m());
     405      }
     406    }
     407   
     408   
     409    //------------------------------------
     410    // Pruning
     411    //------------------------------------
     412   
     413   
     414    if(fComputePruning)
     415    {
     416
     417      fastjet::Pruner    pruner(fastjet::JetDefinition(fastjet::cambridge_algorithm,fRPrun),fZcutPrun,fRcutPrun);
     418      fastjet::PseudoJet pruned_jet = pruner(*itOutputList);
     419
     420      candidate->PrunedP4[0].SetPtEtaPhiM(pruned_jet.pt(), pruned_jet.eta(), pruned_jet.phi(), pruned_jet.m());
     421         
     422      // four hardest subjet
     423      subjets.clear();
     424      subjets = pruned_jet.pieces();
     425      subjets = sorted_by_pt(subjets);
     426     
     427      candidate->NSubJetsPruned = subjets.size();
     428
     429      for (size_t i = 0; i < subjets.size() and i < 4; i++){
     430        if(subjets.at(i).pt() < 0) continue ;
     431        candidate->PrunedP4[i+1].SetPtEtaPhiM(subjets.at(i).pt(), subjets.at(i).eta(), subjets.at(i).phi(), subjets.at(i).m());
     432      }
     433
     434    }
     435     
     436    //------------------------------------
     437    // SoftDrop
     438    //------------------------------------
     439   
     440    if(fComputeSoftDrop)
     441    {
     442   
     443      contrib::SoftDrop  softDrop(fBetaSoftDrop,fSymmetryCutSoftDrop,fR0SoftDrop);
     444      fastjet::PseudoJet softdrop_jet = softDrop(*itOutputList);
     445     
     446      candidate->SoftDroppedP4[0].SetPtEtaPhiM(softdrop_jet.pt(), softdrop_jet.eta(), softdrop_jet.phi(), softdrop_jet.m());
     447       
     448      // four hardest subjet
     449     
     450      subjets.clear();
     451      subjets    = softdrop_jet.pieces();
     452      subjets    = sorted_by_pt(subjets);
     453      candidate->NSubJetsSoftDropped = softdrop_jet.pieces().size();
     454
     455      for (size_t i = 0; i < subjets.size()  and i < 4; i++){
     456        if(subjets.at(i).pt() < 0) continue ;
     457        candidate->SoftDroppedP4[i+1].SetPtEtaPhiM(subjets.at(i).pt(), subjets.at(i).eta(), subjets.at(i).phi(), subjets.at(i).m());
     458      }
     459    }
     460 
    355461    // --- compute N-subjettiness with N = 1,2,3,4,5 ----
    356462
  • modules/FastJetFinder.h

    r666d795 rde6d698  
    8383  Int_t fN ;
    8484
     85  //-- Trimming parameters --
     86 
     87  Bool_t fComputeTrimming;
     88  Double_t fRTrim;
     89  Double_t fPtFracTrim;
     90 
     91  //-- Pruning parameters --
     92
     93  Bool_t fComputePruning;
     94  Double_t fZcutPrun;
     95  Double_t fRcutPrun;
     96  Double_t fRPrun;
     97
     98  //-- SoftDrop parameters --
     99
     100  Bool_t fComputeSoftDrop;
     101  Double_t fBetaSoftDrop;
     102  Double_t fSymmetryCutSoftDrop;
     103  Double_t fR0SoftDrop;
     104
    85105  // --- FastJet Area method --------
    86106
  • modules/TreeWriter.cc

    r666d795 rde6d698  
    533533  Double_t ecalEnergy, hcalEnergy;
    534534  const Double_t c_light = 2.99792458E8;
     535  Int_t i;
    535536
    536537  array->Sort();
     
    592593    entry->MeanSqDeltaR = candidate->MeanSqDeltaR;
    593594    entry->PTD = candidate->PTD;
    594     entry->FracPt[0] = candidate->FracPt[0];
    595     entry->FracPt[1] = candidate->FracPt[1];
    596     entry->FracPt[2] = candidate->FracPt[2];
    597     entry->FracPt[3] = candidate->FracPt[3];
    598     entry->FracPt[4] = candidate->FracPt[4];
    599    
    600     //--- N-subjettiness variables ----
    601595   
    602     entry->Tau[0] = candidate->Tau[0];
    603     entry->Tau[1] = candidate->Tau[1];
    604     entry->Tau[2] = candidate->Tau[2];
    605     entry->Tau[3] = candidate->Tau[3];
    606     entry->Tau[4] = candidate->Tau[4];
     596    //--- Sub-structure variables ----
     597   
     598    entry->NSubJetsTrimmed     = candidate->NSubJetsTrimmed;
     599    entry->NSubJetsPruned      = candidate->NSubJetsPruned;
     600    entry->NSubJetsSoftDropped = candidate->NSubJetsSoftDropped;
     601   
     602    for(i = 0; i < 5; i++)
     603    {
     604      entry->FracPt[i]        = candidate -> FracPt[i];
     605      entry->Tau[i]           = candidate -> Tau[i];
     606      entry->TrimmedP4[i]     = candidate -> TrimmedP4[i];
     607      entry->PrunedP4[i]      = candidate -> PrunedP4[i];
     608      entry->SoftDroppedP4[i] = candidate -> SoftDroppedP4[i];
     609    }
    607610   
    608611    FillParticles(candidate, &entry->Particles);
Note: See TracChangeset for help on using the changeset viewer.