Fork me on GitHub

Changeset 4564cba in git for modules


Ignore:
Timestamp:
Mar 7, 2022, 8:57:55 PM (3 years ago)
Author:
GitHub <noreply@…>
Parents:
7dbc149 (diff), 54ec182 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Young-Kwon Jo <cccpy98@…> (03/07/22 20:57:55)
git-committer:
GitHub <noreply@…> (03/07/22 20:57:55)
Message:

Merge 54ec182fe38fb844b7fade1332f5742a7081e2f5 into 7dbc149c352934669e33e09cd38531519b916d62

Location:
modules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • modules/PdgCodeFilter.cc

    r7dbc149 r4564cba  
    8585  fCharge = GetInt("Charge", 1);
    8686
     87  // keep bhadron
     88  fRequireKeepGhostBHadron = GetBool("RequireKeepGhostBHadron", false);
     89
    8790  // import input array
    8891  fInputArray = ImportArray(GetString("InputArray", "Delphes/allParticles"));
     
    124127  {
    125128    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
    126140    const TLorentzVector &candidateMomentum = candidate->Momentum;
    127141    pt = candidateMomentum.Pt();
     
    139153  }
    140154}
     155
     156Bool_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

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