- Timestamp:
- Jun 26, 2015, 12:08:48 PM (9 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 28027d5
- Parents:
- d38348d
- Location:
- modules
- Files:
-
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/BTagging.cc
rd38348d rfe0273c 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 //------------------------------------------------------------------------------ -
modules/JetFlavorAssociation.cc
rd38348d rfe0273c 216 216 { 217 217 float maxPt = 0; 218 float minDr = 1000;219 218 bool isGoodParton = true; 220 219 int daughterCounter = 0; 221 220 Candidate *parton, *partonLHEF; 222 Candidate *tempParton = 0, *tempParton Nearest = 0, *tempPartonHighestPt = 0;221 Candidate *tempParton = 0, *tempPartonHighestPt = 0; 223 222 int pdgCode, pdgCodeMax = -1; 224 223 … … 263 262 if(jet->Momentum.DeltaR(parton->Momentum) <= fDeltaR) 264 263 { 265 if(jet->Momentum.DeltaR(parton->Momentum) < minDr)266 {267 minDr = jet->Momentum.DeltaR(parton->Momentum);268 tempPartonNearest = parton;269 }270 271 264 // if not yet found && pdgId is a c, take as c 272 265 if(TMath::Abs(parton->PID) == 4) tempParton = parton; … … 281 274 } 282 275 283 jet->FlavorHeaviest = tempParton ? TMath::Abs(tempParton->PID) : 0;284 jet->FlavorHighestPt = tempPartonHighestPt ? TMath::Abs(tempPartonHighestPt->PID) : 0;285 jet->FlavorNearest2 = tempPartonNearest ? TMath::Abs(tempPartonNearest->PID) : 0;286 276 if(!tempParton) tempParton = tempPartonHighestPt; 287 277 jet->FlavorAlgo = tempParton ? TMath::Abs(tempParton->PID) : 0; … … 290 280 if(pdgCodeMax == -1) pdgCodeMax = 0; 291 281 292 jet->Flavor Default= pdgCodeMax;282 jet->Flavor = pdgCodeMax; 293 283 } 294 284 … … 297 287 void JetFlavorAssociation::GetPhysicsFlavor(Candidate *jet, TIter &itPartonArray, TIter &itPartonLHEFArray) 298 288 { 299 float minDr = 1000;300 289 int partonCounter = 0; 301 290 float biggerConeSize = 0.7; … … 305 294 int motherCounter = 0; 306 295 Candidate *parton, *partonLHEF, *mother1, *mother2; 307 Candidate *tempParton = 0 , *tempPartonNearest = 0;296 Candidate *tempParton = 0; 308 297 vector<Candidate *> contaminations; 309 298 vector<Candidate *>::iterator itContaminations; … … 315 304 { 316 305 dist = jet->Momentum.DeltaR(partonLHEF->Momentum); // take the DR 317 if(partonLHEF->Status == 1 && dist < minDr)318 {319 tempPartonNearest = partonLHEF;320 minDr = dist;321 }322 306 323 307 if(partonLHEF->Status == 1 && dist <= fDeltaR) … … 354 338 } 355 339 356 jet->FlavorNearest3 = tempPartonNearest ? TMath::Abs(tempPartonNearest->PID) : 0;357 358 340 if(partonCounter != 1) 359 341 { 360 jet->FlavorPhys ics= 0;342 jet->FlavorPhys = 0; 361 343 } 362 344 else if(contaminations.size() == 0) 363 345 { 364 jet->FlavorPhys ics= TMath::Abs(tempParton->PID);346 jet->FlavorPhys = TMath::Abs(tempParton->PID); 365 347 } 366 348 else if(contaminations.size() > 0) 367 349 { 368 jet->FlavorPhys ics= TMath::Abs(tempParton->PID);350 jet->FlavorPhys = TMath::Abs(tempParton->PID); 369 351 370 352 for(itContaminations = contaminations.begin(); itContaminations != contaminations.end(); ++itContaminations) … … 391 373 // keep association --> the initialParton is a c --> the contaminated parton is a c 392 374 if(contaminatingFlavor == 4) continue; 393 jet->FlavorPhys ics= 0; // all the other cases reject!375 jet->FlavorPhys = 0; // all the other cases reject! 394 376 break; 395 377 } -
modules/ModulesLinkDef.h
rd38348d rfe0273c 42 42 #include "modules/UniqueObjectFinder.h" 43 43 #include "modules/TrackCountingBTagging.h" 44 #include "modules/BTaggingCMS.h"45 44 #include "modules/BTagging.h" 46 45 #include "modules/TauTagging.h" … … 85 84 #pragma link C++ class UniqueObjectFinder+; 86 85 #pragma link C++ class TrackCountingBTagging+; 87 #pragma link C++ class BTaggingCMS+;88 86 #pragma link C++ class BTagging+; 89 87 #pragma link C++ class TauTagging+; -
modules/TreeWriter.cc
rd38348d rfe0273c 490 490 const TLorentzVector &position = candidate->Position; 491 491 492 493 492 pt = momentum.Pt(); 494 493 cosTheta = TMath::Abs(momentum.CosTheta()); … … 567 566 entry->DeltaPhi = candidate->DeltaPhi; 568 567 568 entry->Flavor = candidate->Flavor; 569 entry->FlavorAlgo = candidate->FlavorAlgo; 570 entry->FlavorPhys = candidate->FlavorPhys; 571 569 572 entry->BTag = candidate->BTag; 570 573 571 574 entry->BTagAlgo = candidate->BTagAlgo; 572 entry->BTagDefault = candidate->BTagDefault; 573 entry->BTagPhysics = candidate->BTagPhysics; 574 entry->BTagNearest2 = candidate->BTagNearest2; 575 entry->BTagNearest3 = candidate->BTagNearest3; 576 entry->BTagHeaviest = candidate->BTagHeaviest; 577 entry->BTagHighestPt = candidate->BTagHighestPt; 578 579 entry->FlavorAlgo = candidate->FlavorAlgo; 580 entry->FlavorDefault = candidate->FlavorDefault; 581 entry->FlavorPhysics = candidate->FlavorPhysics; 582 entry->FlavorNearest2 = candidate->FlavorNearest2; 583 entry->FlavorNearest3 = candidate->FlavorNearest3; 584 entry->FlavorHeaviest = candidate->FlavorHeaviest; 585 entry->FlavorHighestPt = candidate->FlavorHighestPt; 575 entry->BTagPhys = candidate->BTagPhys; 586 576 587 577 entry->TauTag = candidate->TauTag;
Note:
See TracChangeset
for help on using the changeset viewer.