Fork me on GitHub

Changeset 2c8865f in git for modules


Ignore:
Timestamp:
Feb 24, 2022, 6:01:00 AM (2 years ago)
Author:
youngkwon jo <cccpy98@…>
Children:
46b3e01
Parents:
dd263e4
Message:

add code for keeping the BHadrons

Location:
modules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • modules/PdgCodeFilter.cc

    rdd263e4 r2c8865f  
    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    //std::cout << "--" << pdgCode << std::endl;
     130
     131    if (fRequireKeepGhostBHadron) {
     132      if (isBHadron(abs(pdgCode)) ){
     133        candidate->PT = candidate->PT * 1e-18;
     134        if (candidate->PT ==0) candidate->PT = 1e-18;
     135        candidate->Momentum.SetPtEtaPhiM(candidate->PT, candidate->Momentum.Eta(), candidate->Phi, candidate->Momentum.M());
     136        fOutputArray->Add(candidate);
     137        continue;
     138      }
     139    }
     140
    126141    const TLorentzVector &candidateMomentum = candidate->Momentum;
    127142    pt = candidateMomentum.Pt();
     
    139154  }
    140155}
     156
     157Bool_t PdgCodeFilter::isBHadron(const unsigned int absPdgId) {
     158  if (absPdgId <= 100)
     159    return false;  // Fundamental particles and MC internals
     160  if (absPdgId >= 1000000000)
     161    return false;  // Nuclei, +-10LZZZAAAI
     162
     163  // General form of PDG ID is 7 digit form
     164  // +- n nr nL nq1 nq2 nq3 nJ
     165  //const int nJ = absPdgId % 10; // Spin
     166  const int nq3 = (absPdgId / 10) % 10;
     167  const int nq2 = (absPdgId / 100) % 10;
     168  const int nq1 = (absPdgId / 1000) % 10;
     169
     170  if (nq3 == 0)
     171    return false;  // Diquarks
     172  if (nq1 == 0 and nq2 == 5)
     173    return true;  // B mesons
     174  if (nq1 == 5)
     175    return true;  // B baryons
     176
     177  return false;
     178}
     179
  • modules/PdgCodeFilter.h

    rdd263e4 r2c8865f  
    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.