Changeset 28027d5 in git for modules/BTagging.cc
- Timestamp:
- Jun 26, 2015, 3:13:55 PM (9 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- f3c4047
- Parents:
- f53a4d2 (diff), fe0273c (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/BTagging.cc
rf53a4d2 r28027d5 22 22 * Determines origin of jet, 23 23 * applies b-tagging efficiency (miss identification rate) formulas 24 * and sets b-tagging flags 24 * and sets b-tagging flags 25 25 * 26 26 * \author P. Demin - UCL, Louvain-la-Neuve … … 46 46 #include "TLorentzVector.h" 47 47 48 #include <algorithm> 48 #include <algorithm> 49 49 #include <stdexcept> 50 50 #include <iostream> … … 62 62 63 63 Int_t GetCategory(TObject *object); 64 64 65 65 Double_t fEtaMax, fPTMin; 66 66 }; … … 75 75 76 76 if(momentum.Pt() <= fPTMin || TMath::Abs(momentum.Eta()) > fEtaMax) return -1; 77 77 78 78 pdgCode = TMath::Abs(parton->PID); 79 79 if(pdgCode != 21 && pdgCode > 5) return -1; … … 117 117 param = GetParam("EfficiencyFormula"); 118 118 size = param.GetSize(); 119 119 120 120 fEfficiencyMap.clear(); 121 121 for(i = 0; i < size/2; ++i) … … 143 143 144 144 fFilter = new ExRootFilter(fPartonInputArray); 145 145 146 146 fJetInputArray = ImportArray(GetString("JetInputArray", "FastJetFinder/jets")); 147 147 fItJetInputArray = fJetInputArray->MakeIterator(); … … 170 170 void BTagging::Process() 171 171 { 172 Candidate *jet , *parton;172 Candidate *jet; 173 173 Double_t pt, eta, phi, e; 174 174 TObjArray *partonArray; 175 175 map< Int_t, DelphesFormula * >::iterator itEfficiencyMap; 176 176 DelphesFormula *formula; 177 Int_t pdgCode, pdgCodeMax;178 177 179 178 // select quark and gluons 180 179 fFilter->Reset(); 181 180 partonArray = fFilter->GetSubArray(fClassifier, 0); 182 181 183 182 if(partonArray == 0) return; 184 183 185 184 TIter itPartonArray(partonArray); 186 185 187 186 // loop over all input jets 188 187 fItJetInputArray->Reset(); … … 190 189 { 191 190 const TLorentzVector &jetMomentum = jet->Momentum; 192 pdgCodeMax = -1;193 191 eta = jetMomentum.Eta(); 194 192 phi = jetMomentum.Phi(); 195 193 pt = jetMomentum.Pt(); 196 194 e = jetMomentum.E(); 197 198 // loop over all input partons199 itPartonArray.Reset();200 while((parton = static_cast<Candidate*>(itPartonArray.Next())))201 {202 pdgCode = TMath::Abs(parton->PID);203 if(pdgCode == 21) pdgCode = 0;204 if(jetMomentum.DeltaR(parton->Momentum) <= fDeltaR)205 {206 if(pdgCodeMax < pdgCode) pdgCodeMax = pdgCode;207 }208 }209 if(pdgCodeMax == 0) pdgCodeMax = 21;210 if(pdgCodeMax == -1) pdgCodeMax = 0;211 195 212 196 // find an efficency formula 213 itEfficiencyMap = fEfficiencyMap.find( pdgCodeMax);197 itEfficiencyMap = fEfficiencyMap.find(jet->Flavor); 214 198 if(itEfficiencyMap == fEfficiencyMap.end()) 215 199 { … … 220 204 // apply an efficency formula 221 205 jet->BTag |= (gRandom->Uniform() <= formula->Eval(pt, eta, phi, e)) << fBitNumber; 222 } 223 } 224 225 //------------------------------------------------------------------------------ 206 207 // find an efficency formula for algo flavor definition 208 itEfficiencyMap = fEfficiencyMap.find(jet->FlavorAlgo); 209 if(itEfficiencyMap == fEfficiencyMap.end()) 210 { 211 itEfficiencyMap = fEfficiencyMap.find(0); 212 } 213 formula = itEfficiencyMap->second; 214 215 // apply an efficency formula 216 jet->BTagAlgo |= (gRandom->Uniform() <= formula->Eval(pt, eta, phi, e)) << fBitNumber; 217 218 // find an efficency formula for phys flavor definition 219 itEfficiencyMap = fEfficiencyMap.find(jet->FlavorPhys); 220 if(itEfficiencyMap == fEfficiencyMap.end()) 221 { 222 itEfficiencyMap = fEfficiencyMap.find(0); 223 } 224 formula = itEfficiencyMap->second; 225 226 // apply an efficency formula 227 jet->BTagPhys |= (gRandom->Uniform() <= formula->Eval(pt, eta, phi, e)) << fBitNumber; 228 } 229 } 230 231 //------------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.