Fork me on GitHub

Changes in / [4564cba:7dbc149] in git


Ignore:
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cards/delphes_card_CMS.tcl

    r4564cba r7dbc149  
    585585module PdgCodeFilter NeutrinoFilter {
    586586
    587   #set InputArray Delphes/stableParticles
    588   set InputArray Delphes/allParticles
     587  set InputArray Delphes/stableParticles
    589588  set OutputArray filteredParticles
    590589
    591590  set PTMin 0.0
    592   set RequireStatus true
    593   set RequireKeepGhostBHadron true
    594591
    595592  add PdgCode {12}
  • modules/PdgCodeFilter.cc

    r4564cba r7dbc149  
    8585  fCharge = GetInt("Charge", 1);
    8686
    87   // keep bhadron
    88   fRequireKeepGhostBHadron = GetBool("RequireKeepGhostBHadron", false);
    89 
    9087  // import input array
    9188  fInputArray = ImportArray(GetString("InputArray", "Delphes/allParticles"));
     
    127124  {
    128125    pdgCode = candidate->PID;
    129 
    130     if (fRequireKeepGhostBHadron) {
    131       if (isBHadron(abs(pdgCode)) ){
    132         candidate->PT = candidate->PT * 1e-18;
    133         if (candidate->PT ==0) candidate->PT = 1e-18;
    134         candidate->Momentum.SetPtEtaPhiM(candidate->PT, candidate->Momentum.Eta(), candidate->Momentum.Phi(), candidate->Momentum.M());
    135         fOutputArray->Add(candidate);
    136         continue;
    137       }
    138     }
    139 
    140126    const TLorentzVector &candidateMomentum = candidate->Momentum;
    141127    pt = candidateMomentum.Pt();
     
    153139  }
    154140}
    155 
    156 Bool_t PdgCodeFilter::isBHadron(const unsigned int absPdgId) {
    157   if (absPdgId <= 100)
    158     return false;  // Fundamental particles and MC internals
    159   if (absPdgId >= 1000000000)
    160     return false;  // Nuclei, +-10LZZZAAAI
    161 
    162   // General form of PDG ID is 7 digit form
    163   // +- n nr nL nq1 nq2 nq3 nJ
    164   //const int nJ = absPdgId % 10; // Spin
    165   const int nq3 = (absPdgId / 10) % 10;
    166   const int nq2 = (absPdgId / 100) % 10;
    167   const int nq1 = (absPdgId / 1000) % 10;
    168 
    169   if (nq3 == 0)
    170     return false;  // Diquarks
    171   if (nq1 == 0 and nq2 == 5)
    172     return true;  // B mesons
    173   if (nq1 == 5)
    174     return true;  // B baryons
    175 
    176   return false;
    177 }
    178 
  • modules/PdgCodeFilter.h

    r4564cba r7dbc149  
    5555  Bool_t fRequireNotPileup; //!
    5656
    57   Bool_t fRequireKeepGhostBHadron; //!
    58 
    5957  std::vector<Int_t> fPdgCodes;
    60 
    61   Bool_t isBHadron(const unsigned int absPdgId); //!
    6258
    6359  TIterator *fItInputArray; //!
Note: See TracChangeset for help on using the changeset viewer.