Fork me on GitHub

Ignore:
Timestamp:
Jun 26, 2015, 12:08:48 PM (9 years ago)
Author:
Pavel Demin <pavel.demin@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
28027d5
Parents:
d38348d
Message:

merge BTagging and BTaggingCMS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/JetFlavorAssociation.cc

    rd38348d rfe0273c  
    216216{
    217217  float maxPt = 0;
    218   float minDr = 1000;
    219218  bool isGoodParton = true;
    220219  int daughterCounter = 0;
    221220  Candidate *parton, *partonLHEF;
    222   Candidate *tempParton = 0, *tempPartonNearest = 0, *tempPartonHighestPt = 0;
     221  Candidate *tempParton = 0, *tempPartonHighestPt = 0;
    223222  int pdgCode, pdgCodeMax = -1;
    224223
     
    263262      if(jet->Momentum.DeltaR(parton->Momentum) <= fDeltaR)
    264263      {
    265         if(jet->Momentum.DeltaR(parton->Momentum) < minDr)
    266         {
    267           minDr = jet->Momentum.DeltaR(parton->Momentum);
    268           tempPartonNearest = parton;
    269         }
    270 
    271264        // if not yet found && pdgId is a c, take as c
    272265        if(TMath::Abs(parton->PID) == 4) tempParton = parton;
     
    281274  }
    282275
    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;
    286276  if(!tempParton) tempParton = tempPartonHighestPt;
    287277  jet->FlavorAlgo = tempParton ? TMath::Abs(tempParton->PID) : 0;
     
    290280  if(pdgCodeMax == -1) pdgCodeMax = 0;
    291281
    292   jet->FlavorDefault = pdgCodeMax;
     282  jet->Flavor = pdgCodeMax;
    293283}
    294284
     
    297287void JetFlavorAssociation::GetPhysicsFlavor(Candidate *jet, TIter &itPartonArray, TIter &itPartonLHEFArray)
    298288{
    299   float minDr = 1000;
    300289  int partonCounter = 0;
    301290  float biggerConeSize = 0.7;
     
    305294  int motherCounter = 0;
    306295  Candidate *parton, *partonLHEF, *mother1, *mother2;
    307   Candidate *tempParton = 0, *tempPartonNearest = 0;
     296  Candidate *tempParton = 0;
    308297  vector<Candidate *> contaminations;
    309298  vector<Candidate *>::iterator itContaminations;
     
    315304  {
    316305    dist = jet->Momentum.DeltaR(partonLHEF->Momentum); // take the DR
    317     if(partonLHEF->Status == 1 && dist < minDr)
    318     {
    319       tempPartonNearest = partonLHEF;
    320       minDr = dist;
    321     }
    322306
    323307    if(partonLHEF->Status == 1 && dist <= fDeltaR)
     
    354338  }
    355339
    356   jet->FlavorNearest3 = tempPartonNearest ? TMath::Abs(tempPartonNearest->PID) : 0;
    357 
    358340  if(partonCounter != 1)
    359341  {
    360     jet->FlavorPhysics = 0;
     342    jet->FlavorPhys = 0;
    361343  }
    362344  else if(contaminations.size() == 0)
    363345  {
    364     jet->FlavorPhysics = TMath::Abs(tempParton->PID);
     346    jet->FlavorPhys = TMath::Abs(tempParton->PID);
    365347  }
    366348  else if(contaminations.size() > 0)
    367349  {
    368     jet->FlavorPhysics = TMath::Abs(tempParton->PID);
     350    jet->FlavorPhys = TMath::Abs(tempParton->PID);
    369351
    370352    for(itContaminations = contaminations.begin(); itContaminations != contaminations.end(); ++itContaminations)
     
    391373        // keep association --> the initialParton is a c --> the contaminated parton is a c
    392374        if(contaminatingFlavor == 4) continue;
    393         jet->FlavorPhysics = 0; // all the other cases reject!
     375        jet->FlavorPhys = 0; // all the other cases reject!
    394376        break;
    395377      }
Note: See TracChangeset for help on using the changeset viewer.