Changeset fe0273c in git for modules/JetFlavorAssociation.cc
- Timestamp:
- Jun 26, 2015, 12:08:48 PM (9 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 28027d5
- Parents:
- d38348d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note:
See TracChangeset
for help on using the changeset viewer.