Giter Club home page Giter Club logo

puppisoftdropmasscorr's Introduction

PUPPI Softdrop Mass Corrections

Scripts and weights for correcting PUPPI softdrop mass. Weights for CMSSW 80X are stored in the "weights/" folder of the master branch, while weights for CMSSW 76X can be found in the same folder of the branch "76X". For futher details, see presentation at https://indico.cern.ch/event/559594/contributions/2258188/attachments/1316911/1973452/puppiSoftdropJMScorr_2707.pdf.

Get uncorrected PUPPI soft drop mass from MINIAOD:

When running on MINIAOD, the uncorrected PUPPI softdrop mass can be obtained in the following way:

TLorentzVector puppi_softdrop, puppi_softdrop_subjet;
        auto const & sdSubjetsPuppi = jet.subjets("SoftDropPuppi");
        for ( auto const & it : sdSubjetsPuppi ) {
          puppi_softdrop_subjet.SetPtEtaPhiM(it->correctedP4(0).pt(),it->correctedP4(0).eta(),it->correctedP4(0).phi(),it->correctedP4(0).mass());
          puppi_softdrop+=puppi_softdrop_subjet;
        }

Get PUPPI soft drop mass correction:

To compute the weights, the AK8 jet pt and eta must be passed, where the jet pT should be corrected with the newest JEC corrections available for MC(data). For the AK8 jet pt and eta, either CHS AK8 jets or PUPPI AK8 jets with full JEC applied can be used (but not the PUPPI softdrop AK8 jet pt and eta, unless they are shown to have the same JES as the ungroomed jets). In the example below, these are called "AK8jetPt" and "AK8jetEta" respectively. The returned weight is then applied to the uncorrected PUPPI softdrop mass, which can be obtained following the example above ("Get uncorrected PUPPI soft drop mass from MINIAOD").

float puppiCorr = getPUPPIweight( AK8jetPt , AK8jetEta );
float jetmass = AK8PUPPISoftdropUncorrectedMass*puppiCorr;

float ExoDiBosonAnalysis::getPUPPIweight(float puppipt, float puppieta ){

 TFile* file = TFile::Open( "weights/puppiCorr.root","READ");
  puppisd_corrGEN      = (TF1*)file->Get("puppiJECcorr_gen");
  puppisd_corrRECO_cen = (TF1*)file->Get("puppiJECcorr_reco_0eta1v3");
  puppisd_corrRECO_for = (TF1*)file->Get("puppiJECcorr_reco_1v3eta2v5");


  float genCorr  = 1.;
  float recoCorr = 1.;
  float totalWeight = 1.;
        
  genCorr =  puppisd_corrGEN->Eval( puppipt );
  if( fabs(puppieta)  <= 1.3 ){
    recoCorr = puppisd_corrRECO_cen->Eval( puppipt );
  }
  else{
    recoCorr = puppisd_corrRECO_for->Eval( puppipt );
  }
  
  totalWeight = genCorr * recoCorr;

  return totalWeight;
}

puppisoftdropmasscorr's People

Contributors

thaarres avatar ahinzmann avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.