Changes in / [4564cba:7dbc149] in git
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
cards/delphes_card_CMS.tcl
r4564cba r7dbc149 585 585 module PdgCodeFilter NeutrinoFilter { 586 586 587 #set InputArray Delphes/stableParticles 588 set InputArray Delphes/allParticles 587 set InputArray Delphes/stableParticles 589 588 set OutputArray filteredParticles 590 589 591 590 set PTMin 0.0 592 set RequireStatus true593 set RequireKeepGhostBHadron true594 591 595 592 add PdgCode {12} -
modules/PdgCodeFilter.cc
r4564cba r7dbc149 85 85 fCharge = GetInt("Charge", 1); 86 86 87 // keep bhadron88 fRequireKeepGhostBHadron = GetBool("RequireKeepGhostBHadron", false);89 90 87 // import input array 91 88 fInputArray = ImportArray(GetString("InputArray", "Delphes/allParticles")); … … 127 124 { 128 125 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 140 126 const TLorentzVector &candidateMomentum = candidate->Momentum; 141 127 pt = candidateMomentum.Pt(); … … 153 139 } 154 140 } 155 156 Bool_t PdgCodeFilter::isBHadron(const unsigned int absPdgId) {157 if (absPdgId <= 100)158 return false; // Fundamental particles and MC internals159 if (absPdgId >= 1000000000)160 return false; // Nuclei, +-10LZZZAAAI161 162 // General form of PDG ID is 7 digit form163 // +- n nr nL nq1 nq2 nq3 nJ164 //const int nJ = absPdgId % 10; // Spin165 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; // Diquarks171 if (nq1 == 0 and nq2 == 5)172 return true; // B mesons173 if (nq1 == 5)174 return true; // B baryons175 176 return false;177 }178 -
modules/PdgCodeFilter.h
r4564cba r7dbc149 55 55 Bool_t fRequireNotPileup; //! 56 56 57 Bool_t fRequireKeepGhostBHadron; //!58 59 57 std::vector<Int_t> fPdgCodes; 60 61 Bool_t isBHadron(const unsigned int absPdgId); //!62 58 63 59 TIterator *fItInputArray; //!
Note:
See TracChangeset
for help on using the changeset viewer.