Fork me on GitHub

Ignore:
Timestamp:
Jun 17, 2015, 4:36:20 PM (9 years ago)
Author:
Pavel Demin <pavel.demin@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
a446115
Parents:
edf10ba
Message:

add BTaggingCMS and rename JetFlavourAssociation to JetFlavorAssociation

File:
1 moved

Legend:

Unmodified
Added
Removed
  • modules/JetFlavorAssociation.cc

    redf10ba r9040259  
    1818
    1919
    20 /** \class JetFlavourAssociation
     20/** \class JetFlavorAssociation
    2121 *
    2222 *  Find origin of jet && evaluate jet flavor
     
    2626 */
    2727
    28 #include "modules/JetFlavourAssociation.h"
     28#include "modules/JetFlavorAssociation.h"
    2929
    3030#include "classes/DelphesClasses.h"
     
    117117//------------------------------------------------------------------------------
    118118
    119 JetFlavourAssociation::JetFlavourAssociation() :
     119JetFlavorAssociation::JetFlavorAssociation() :
    120120  fClassifier(0), fFilter(0),
    121121  fItPartonInputArray(0), fItPartonInputArrayLHEF(0),
    122122  fItJetInputArray(0), fItParticleInputArray(0)
    123123{
    124   fClassifier    = new PartonClassifier;
     124  fClassifier = new PartonClassifier;
    125125  fClassifierLHEF = new PartonClassifierLHEF;
    126126}
     
    128128//------------------------------------------------------------------------------
    129129
    130 JetFlavourAssociation::~JetFlavourAssociation()
     130JetFlavorAssociation::~JetFlavorAssociation()
    131131{
    132132  if(fClassifier) delete fClassifier;
     
    136136//------------------------------------------------------------------------------
    137137
    138 void JetFlavourAssociation::Init()
     138void JetFlavorAssociation::Init()
    139139{
    140140  ExRootConfParam param;
     
    168168//------------------------------------------------------------------------------
    169169
    170 void JetFlavourAssociation::Finish()
     170void JetFlavorAssociation::Finish()
    171171{
    172172  if(fFilter) delete fFilter;
     
    181181//------------------------------------------------------------------------------
    182182
    183 void JetFlavourAssociation::Process(){
     183void JetFlavorAssociation::Process(){
    184184
    185185  Candidate *jet;
     
    205205  {
    206206    // get standard flavor
    207     GetAlgoFlavour(jet, itPartonArray, itPartonLHEFArray);
    208     GetPhysicsFlavour(jet, itPartonArray, itPartonLHEFArray);
     207    GetAlgoFlavor(jet, itPartonArray, itPartonLHEFArray);
     208    GetPhysicsFlavor(jet, itPartonArray, itPartonLHEFArray);
    209209  }
    210210}
     
    214214// https://cmssdt.cern.ch/SDT/lxr/source/PhysicsTools/JetMCAlgos/plugins/JetPartonMatcher.cc?v=CMSSW_7_3_0_pre1
    215215
    216 void JetFlavourAssociation::GetAlgoFlavour(Candidate *jet, TIter &itPartonArray, TIter &itPartonLHEFArray)
     216void JetFlavorAssociation::GetAlgoFlavor(Candidate *jet, TIter &itPartonArray, TIter &itPartonLHEFArray)
    217217{
    218218  float maxPt = 0;
     
    254254      {
    255255        // partons are only quarks || gluons
    256         int daughterFlavour1 = -1;
    257         int daughterFlavour2 = -1;
    258         if(parton->D1 != -1) daughterFlavour1 = TMath::Abs(static_cast<Candidate *>(fParticleInputArray->At(parton->D1))->PID);
    259         if(parton->D2 != -1) daughterFlavour2 = TMath::Abs(static_cast<Candidate *>(fParticleInputArray->At(parton->D2))->PID);
    260         if((daughterFlavour1 == 1 || daughterFlavour1 == 2 || daughterFlavour1 == 3 || daughterFlavour1 == 4 || daughterFlavour1 == 5 || daughterFlavour1 == 21)) daughterCounter++;
    261         if((daughterFlavour2 == 1 || daughterFlavour2 == 2 || daughterFlavour2 == 3 || daughterFlavour2 == 4 || daughterFlavour1 == 5 || daughterFlavour2 == 21)) daughterCounter++;
     256        int daughterFlavor1 = -1;
     257        int daughterFlavor2 = -1;
     258        if(parton->D1 != -1) daughterFlavor1 = TMath::Abs(static_cast<Candidate *>(fParticleInputArray->At(parton->D1))->PID);
     259        if(parton->D2 != -1) daughterFlavor2 = TMath::Abs(static_cast<Candidate *>(fParticleInputArray->At(parton->D2))->PID);
     260        if((daughterFlavor1 == 1 || daughterFlavor1 == 2 || daughterFlavor1 == 3 || daughterFlavor1 == 4 || daughterFlavor1 == 5 || daughterFlavor1 == 21)) daughterCounter++;
     261        if((daughterFlavor2 == 1 || daughterFlavor2 == 2 || daughterFlavor2 == 3 || daughterFlavor2 == 4 || daughterFlavor1 == 5 || daughterFlavor2 == 21)) daughterCounter++;
    262262      }
    263263      if(daughterCounter > 0) continue;
     
    296296//------------------------------------------------------------------------------
    297297
    298 void JetFlavourAssociation::GetPhysicsFlavour(Candidate *jet, TIter &itPartonArray, TIter &itPartonLHEFArray)
     298void JetFlavorAssociation::GetPhysicsFlavor(Candidate *jet, TIter &itPartonArray, TIter &itPartonLHEFArray)
    299299{
    300300  float minDr = 1000;
     
    303303  float dist;
    304304  bool isGoodCandidate;
    305   int contaminatingFlavour = 0;
     305  int contaminatingFlavor = 0;
    306306  int motherCounter = 0;
    307307  Candidate *parton, *partonLHEF, *mother1, *mother2;
     
    372372    {
    373373      parton = *itContaminations;
    374       contaminatingFlavour = TMath::Abs(parton->PID);
     374      contaminatingFlavor = TMath::Abs(parton->PID);
    375375      motherCounter = 0;
    376376      if(parton->M1 != -1) motherCounter++;
     
    391391      {
    392392        // keep association --> the initialParton is a c --> the contaminated parton is a c
    393         if(contaminatingFlavour == 4) continue;
     393        if(contaminatingFlavor == 4) continue;
    394394        jet->FlavorPhysics = 0; // all the other cases reject!
    395395        break;
Note: See TracChangeset for help on using the changeset viewer.