Giter VIP home page Giter VIP logo

voronoiweighttool's Introduction

VoronoiWeightTool

This tool applies Voronoi weights to clusters. It makes a shallow copy container of the clusters with the pT of the clusters modified appropriately.

Dependencies

This package makes use of UChicago's xAODAnaHelpers package and Giordon Stark's xAODJetReclustering package.

Installing

To install,

mkdir myRootCore && cd $_
rcSetup Base,2.3.41
git clone https://github.com/kratsg/xAODJetReclustering
git clone https://github.com/UCATLAS/xAODAnaHelpers
git clone https://github.com/AvivCukierman/VoronoiWeightTool
rc checkout_pkg atlasoff/AsgExternal/Asg_FastJet/tags
rc checkout_pkg atlasoff/AsgExternal/Asg_FastJetContrib/tags
rc find_packages
rc compile

(You might have to do a rcSetup -u && rcSetup before the final rc compile just because.)

Configurations

Property Type Default Description
InputContainer string "CaloCalTopoClusters" name of the input cluster container to be modified
OutputContainer string "VoronoiClusters" name of the output shallow copy cluster container with modified pT
doLCWeights bool false apply LC weights to clusters before Voronoi algorithms
doSpread bool true after Voronoi subtraction, apply spreading to negative pT clusters
nSigma int 0 at the end, suppress all clusters with pT<nSigma * sigmaRho * sqrt(area)

Using

Add this package as a dependency in cmt/Makefile.RootCore.

Add a header

#include <VoronoiWeightTool/VoronoiWeightTool.h>

Set up the tool in the initialize() portion of your algorithm as a pointer

  m_VoronoiTool = new VoronoiWeightTool(m_name);
  m_VoronoiTool->setProperty("InputContainer", m_InputContainer);
  m_VoronoiTool->setProperty("OutputContainer", m_OutputContainer);
  m_VoronoiTool->setProperty("doSpread", m_doSpread);
  m_VoronoiTool->setProperty("doLCWeights", m_doLCWeights);
  m_VoronoiTool->setProperty("nSigma", m_nSigma);
  m_VoronoiTool->initialize();

And then simply call m_VoronoiTool->execute() in the execute() portion of your algorithm to fill the TStore with the appropriate container(s). Don't forget to delete the pointer when you're done.

if(m_VoronoiTool) delete m_VoronoiTool;

You can then do jet clustering as normal on the output cluster container.

N.B. The doLCWeights option indicates whether to apply LC weights (if true) or EM weights (if false) to clusters. The output clusters have their pTs modified in the given state. I.e. with doLCWeights set to true, only the LC pT of the new cluster collection is modified, and with doLCWeights set to false, only the EM pT of the new cluster collection is modified. In order to set the state of the output (or any) cluster collection, the CaloClusterChangeSignalStateList tool should be used in your algorithm, as follows:

#include "xAODCaloEvent/CaloClusterChangeSignalState.h"
 const xAOD::CaloClusterContainer*             new_clusters   (nullptr);
 if(evtStore()->retrieve(new_clusters,m_OutputContainer).isFailure()) Error(APP_NAME,"Could not retrieve the Voronoi cluster container");

 CaloClusterChangeSignalStateList stateHelperList;
 for(auto clust: *new_clusters){
   if(m_doLCWeights) stateHelperList.add(clust,xAOD::CaloCluster::State(1)); //default is calibrated but we can make it explicit anyway
   else stateHelperList.add(clust,xAOD::CaloCluster::State(0));
   //now clust->pt() will give Voronoi modified pT, and jet reconstruction will use Voronoi modified pT
 }

Note that as it behaves like an AsgTool, the functions setProperty() and initialize() have a return type StatusCode.

Authors

Acknowledgements

Giordon Stark, from whom I plagiarized this readme and also whose code I used for inspiration.

voronoiweighttool's People

Contributors

avivcukierman avatar

Watchers

 avatar  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.