Fork me on GitHub

Changeset 9040259 in git for modules


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

Location:
modules
Files:
2 added
2 edited
2 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;
  • modules/JetFlavorAssociation.h

    redf10ba r9040259  
    1717 */
    1818
    19 #ifndef JetFlavourAssociation_h
    20 #define JetFlavourAssociation_h
     19#ifndef JetFlavorAssociation_h
     20#define JetFlavorAssociation_h
    2121
    22 /** \class JetFlavourAssociation
     22/** \class JetFlavorAssociation
    2323 *
    24  *  Find origin of jet and evaluate jet flavour
     24 *  Find origin of jet and evaluate jet flavor
    2525 *
    2626 *  \author P. Demin - UCL, Louvain-la-Neuve
     
    3939class PartonClassifierLHEF;
    4040
    41 class JetFlavourAssociation: public DelphesModule
     41class JetFlavorAssociation: public DelphesModule
    4242{
    4343public:
    4444
    45   JetFlavourAssociation();
    46   ~JetFlavourAssociation();
     45  JetFlavorAssociation();
     46  ~JetFlavorAssociation();
    4747
    4848  void Init();
     
    5050  void Finish();
    5151
    52   void GetAlgoFlavour(Candidate *jet, TIter &itPartonArray, TIter &itPartonArrayLHEF);
    53   void GetPhysicsFlavour(Candidate *jet, TIter &itPartonArray, TIter &itPartonArrayLHEF);
     52  void GetAlgoFlavor(Candidate *jet, TIter &itPartonArray, TIter &itPartonArrayLHEF);
     53  void GetPhysicsFlavor(Candidate *jet, TIter &itPartonArray, TIter &itPartonArrayLHEF);
    5454
    5555private:
     
    7373  const TObjArray *fParticleInputArray; //!
    7474
    75   ClassDef(JetFlavourAssociation, 1)
     75  ClassDef(JetFlavorAssociation, 1)
    7676};
    7777
  • modules/ModulesLinkDef.h

    redf10ba r9040259  
    4242#include "modules/UniqueObjectFinder.h"
    4343#include "modules/TrackCountingBTagging.h"
     44#include "modules/BTaggingCMS.h"
    4445#include "modules/BTagging.h"
    4546#include "modules/TauTagging.h"
     
    5960#include "modules/Hector.h"
    6061#include "modules/RunPUPPI.h"
    61 #include "modules/JetFlavourAssociation.h"
     62#include "modules/JetFlavorAssociation.h"
    6263#include "modules/ExampleModule.h"
    6364
     
    8485#pragma link C++ class UniqueObjectFinder+;
    8586#pragma link C++ class TrackCountingBTagging+;
     87#pragma link C++ class BTaggingCMS+;
    8688#pragma link C++ class BTagging+;
    8789#pragma link C++ class TauTagging+;
     
    101103#pragma link C++ class Hector+;
    102104#pragma link C++ class RunPUPPI+;
    103 #pragma link C++ class JetFlavourAssociation+;
     105#pragma link C++ class JetFlavorAssociation+;
    104106#pragma link C++ class ExampleModule+;
    105107
  • modules/TreeWriter.cc

    redf10ba r9040259  
    291291    entry->ZOuter = position.Z();
    292292    entry->TOuter = position.T()*1.0E-3/c_light;
    293    
     293
    294294    entry->Dxy = candidate->Dxy;
    295295    entry->SDxy = candidate->SDxy ;
     
    297297    entry->Yd = candidate->Yd;
    298298    entry->Zd = candidate->Zd;
    299    
     299
    300300    const TLorentzVector &momentum = candidate->Momentum;
    301301
     
    362362
    363363    entry->T = position.T()*1.0E-3/c_light;
    364     entry->Ntimes = candidate->Ntimes;   
     364    entry->Ntimes = candidate->Ntimes;
    365365
    366366    FillParticles(candidate, &entry->Particles);
     
    405405
    406406    // Isolation variables
    407        
     407
    408408    entry->IsolationVar = candidate->IsolationVar;
    409409    entry->IsolationVarRhoCorr = candidate->IsolationVarRhoCorr ;
     
    453453
    454454    // Isolation variables
    455        
     455
    456456    entry->IsolationVar = candidate->IsolationVar;
    457457    entry->IsolationVarRhoCorr = candidate->IsolationVarRhoCorr ;
     
    507507
    508508    entry->T = position.T()*1.0E-3/c_light;
    509    
     509
    510510    // Isolation variables
    511        
     511
    512512    entry->IsolationVar = candidate->IsolationVar;
    513513    entry->IsolationVarRhoCorr = candidate->IsolationVarRhoCorr ;
     
    568568
    569569    entry->BTag = candidate->BTag;
     570
     571    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;
     586
    570587    entry->TauTag = candidate->TauTag;
    571588
     
    593610    entry->MeanSqDeltaR = candidate->MeanSqDeltaR;
    594611    entry->PTD = candidate->PTD;
    595    
     612
    596613    //--- Sub-structure variables ----
    597    
    598     entry->NSubJetsTrimmed     = candidate->NSubJetsTrimmed;
    599     entry->NSubJetsPruned      = candidate->NSubJetsPruned;
     614
     615    entry->NSubJetsTrimmed = candidate->NSubJetsTrimmed;
     616    entry->NSubJetsPruned = candidate->NSubJetsPruned;
    600617    entry->NSubJetsSoftDropped = candidate->NSubJetsSoftDropped;
    601    
     618
    602619    for(i = 0; i < 5; i++)
    603620    {
    604       entry->FracPt[i]        = candidate -> FracPt[i];
    605       entry->Tau[i]           = candidate -> Tau[i];
    606       entry->TrimmedP4[i]     = candidate -> TrimmedP4[i];
    607       entry->PrunedP4[i]      = candidate -> PrunedP4[i];
     621      entry->FracPt[i] = candidate -> FracPt[i];
     622      entry->Tau[i] = candidate -> Tau[i];
     623      entry->TrimmedP4[i] = candidate -> TrimmedP4[i];
     624      entry->PrunedP4[i] = candidate -> PrunedP4[i];
    608625      entry->SoftDroppedP4[i] = candidate -> SoftDroppedP4[i];
    609626    }
    610    
     627
    611628    FillParticles(candidate, &entry->Particles);
    612629  }
Note: See TracChangeset for help on using the changeset viewer.