- Timestamp:
- Feb 24, 2022, 6:01:00 AM (3 years ago)
- Children:
- 46b3e01
- Parents:
- dd263e4
- Location:
- modules
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/PdgCodeFilter.cc
rdd263e4 r2c8865f 85 85 fCharge = GetInt("Charge", 1); 86 86 87 // keep bhadron 88 fRequireKeepGhostBHadron = GetBool("RequireKeepGhostBHadron", false); 89 87 90 // import input array 88 91 fInputArray = ImportArray(GetString("InputArray", "Delphes/allParticles")); … … 124 127 { 125 128 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 126 141 const TLorentzVector &candidateMomentum = candidate->Momentum; 127 142 pt = candidateMomentum.Pt(); … … 139 154 } 140 155 } 156 157 Bool_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 55 55 Bool_t fRequireNotPileup; //! 56 56 57 Bool_t fRequireKeepGhostBHadron; //! 58 57 59 std::vector<Int_t> fPdgCodes; 60 61 Bool_t isBHadron(const unsigned int absPdgId); //! 58 62 59 63 TIterator *fItInputArray; //!
Note:
See TracChangeset
for help on using the changeset viewer.