Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F8309408
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
14 KB
Subscribers
None
View Options
Index: trunk/ExternalTools/ExternalToolsLinkDef.hpp
===================================================================
--- trunk/ExternalTools/ExternalToolsLinkDef.hpp (revision 528)
+++ trunk/ExternalTools/ExternalToolsLinkDef.hpp (revision 529)
@@ -1,55 +1,56 @@
// Copyright (c) 2010-11, Pierre-Antoine Delsart, Kurtis Geerlings, Joey Huston,
// Brian Martin, and Christopher Vermilion
//
//----------------------------------------------------------------------
// This file is part of SpartyJet.
//
// SpartyJet is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// SpartyJet is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with SpartyJet; if not, write to the Free Software
// Foundation, Inc.:
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//----------------------------------------------------------------------
#ifdef __CINT__
#pragma link off all global;
#pragma link off all classes;
#pragma link off all function;
#pragma link off all namespaces;
#pragma link C++ nestedclass;
#pragma link C++ nestedtypedef;
#pragma link C++ class fastjet::MinMassFunction;
#pragma link C++ class fastjet::zCellFunction;
#pragma link C++ class fastjet::zCutFunction;
//#pragma link C++ class SpartyJet::DipolarityFunc;
#pragma link C++ class SpartyJet::FastJet::AngularCorrelationTool;
#pragma link C++ class SpartyJet::FastJet::TransformerTool;
#pragma link C++ class fastjet::CMSTopTagger;
#pragma link C++ class fastjet::HEPTopTagger;
+#pragma link C++ class SpartyJet::FastJet::TopTaggerDipolarityTool;
#pragma link C++ class SpartyJet::FastJet::WTaggerTool;
#pragma link C++ class SpartyJet::RadialSmearingTool;
// njettiness
#pragma link C++ class fastjet::NjettinessPlugin;
#pragma link C++ class fastjet::Nsubjettiness;
#pragma link C++ class Njettiness;
#pragma link C++ enum Njettiness::AxesMode;
#endif
Index: trunk/ExternalTools/TopTaggerDipolarityTool.hh
===================================================================
--- trunk/ExternalTools/TopTaggerDipolarityTool.hh (revision 0)
+++ trunk/ExternalTools/TopTaggerDipolarityTool.hh (revision 529)
@@ -0,0 +1,77 @@
+// Copyright (c) 2010-11, Pierre-Antoine Delsart, Kurtis Geerlings, Joey Huston,
+// Brian Martin, and Christopher Vermilion
+//
+//----------------------------------------------------------------------
+// This file is part of SpartyJet.
+//
+// SpartyJet is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// SpartyJet is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with SpartyJet; if not, write to the Free Software
+// Foundation, Inc.:
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//----------------------------------------------------------------------
+
+
+/*
+ * Implements the W-tagging tool from Cui, Han, and Schwartz.
+ * See External/wtag-1.00/README. The various cuts can be fiddled with by
+ * editing the parameter files in wtag-1.00/data. The ability to generate new
+ * parameters is not available from within SpartyJet (yet).
+ */
+
+#ifndef _TOPTAGGERDIPOLARITYTOOL_HH_
+#define _TOPTAGGERDIPOLARITYTOOL_HH_
+
+#include "TransformerTool.hh"
+#include "Dipolarity.hh"
+#include "fastjet/tools/TopTaggerBase.hh"
+
+
+namespace SpartyJet {
+namespace FastJet {
+
+class TopTaggerDipolarityTool : public TransformerTool {
+public:
+ TopTaggerDipolarityTool(fastjet::TopTaggerBase* tagger, std::string name="TopTaggerDipolarity")
+ : TransformerTool(name, tagger) {
+ }
+
+ virtual void init(JetMomentMap* mmap=0) {
+ TransformerTool::init(mmap);
+ if (mmap) mmap->schedule_jet_moment<Double32_t>("dipolarity");
+ }
+
+ virtual void execute(JetCollection& inputJets) {
+ TransformerTool::execute(inputJets);
+ JetCollection::iterator it, itE = inputJets.end();
+ for (it = inputJets.begin(); it != itE; ++it) {
+ Double32_t dipolarity = 0.;
+ if ((fastjet::PseudoJet)(**it) != 0.0) {
+ fastjet::PseudoJet W = (*it)->structure_of<fastjet::TopTaggerBase>().W();
+ std::vector<fastjet::PseudoJet> subjets = W.pieces();
+ if (subjets.size() == 2) {
+ dipolarity = Dipolarity(subjets[0], subjets[1], W.constituents());
+ } else {
+ m_log << DEBUG << "Dipolarity assumes two W subjets found; found " << subjets.size() << std::endl;
+ }
+ }
+ inputJets.get_JetMomentMap()->set_jet_moment<Double32_t>("dipolarity", *it, dipolarity);
+ }
+ }
+};
+
+
+
+}
+} // namespace SpartyJet
+
+#endif
Index: trunk/ExternalTools/README
===================================================================
--- trunk/ExternalTools/README (revision 528)
+++ trunk/ExternalTools/README (revision 529)
@@ -1,47 +1,50 @@
This directory consists of a number of external jet tools, together with a few
simple SpartyJet wrappers. The following files are internal to SpartyJet and
were written by the SpartyJet authors:
ExternalToolsLinkDef.hpp
WTaggerTool.hh (wraps the W tagging package in external/)
+TransformerTool.hh,cc (wraps FastJet Transformers)
+TransformerMonentHandler.hh,cc (provide helper functions to store jet moments)
+TopTaggerDipolarityTool.hh
AngularCorrelationTool.hh
Makefile
README (see README for further details)
The following taggers and variables are independent of SpartyJet and were
written by Christopher K. Vermilion. CMSTopTagger.hh and HEPTopTaggerWraperr.hh
are based on the JHTopTagger code, written by the FastJet authors.
CMSTopTagger.hh
HEPTopTaggerWrapper.hh,cc
BoostVariables.hh
HEPTopTagger.hh is courtesy Tilman Plehn, available at http://fastjet.fr/tools.
We have made a very small modification, suggested by Gavin Salam, so that the
ClusterSequence used in filtering stays alive and can be used to access the
top jet's substructure.
The following files constitute Peter Loch's calorimeter simulation, available
from his website (http://atlas.physics.arizona.edu/~loch/index.html). Some
minor, transparent changes have been made for speed.
DetectorModel.h
DetectorModel.cxx
The following code is courtesy Martin Jankowiak:
Dipolarity.hh
AngularCorrelation.{hh,cc}
The following code was written by Jesse Thaler, Ken Van Tilburg, and Christopher
K. Vermilion:
Njettiness.hh
Nsubjettiness.hh
NjettinessPlugin.hh
Index: trunk/examples_py/Boost2011.py
===================================================================
--- trunk/examples_py/Boost2011.py (revision 528)
+++ trunk/examples_py/Boost2011.py (revision 529)
@@ -1,70 +1,163 @@
#!/usr/bin/env python
# $Id$
#----------------------------------------------------------------------
# Copyright (c) 2010-11, Pierre-Antoine Delsart, Kurtis Geerlings, Joey Huston,
# Brian Martin, and Christopher Vermilion
#
#----------------------------------------------------------------------
# This file is part of SpartyJet.
#
# SpartyJet is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# SpartyJet is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SpartyJet; if not, write to the Free Software
# Foundation, Inc.:
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#----------------------------------------------------------------------
from spartyjet import *
#===============================================
# Create a jet builder---------------------------
builder = SJ.JetBuilder(SJ.DEBUG)
# Configure input -------------------------------
-input = getInputMaker('../data/HepMC_sample.hepmc')
+input = getInputMaker('../data/Zprime_ttbar.hepmc')
builder.configure_input(input)
-# Jet definition and basic analysis
-anti10 = SJ.FastJet.FastJetFinder('AntiKt10', fj.antikt_algorithm, 1.0, False)
-builder.add_default_analysis(anti10)
-
# input tool: calorimeter sim
#builder.add_jetTool_input(SJ.RadialSmearingTool())
#builder.add_jetTool_input(SJ.JetPtSelectorTool(1.*input.getGeV()))
-# add Nsubjettiness tools
+
+# ------------------------- Analyses ---------------------------------
+analyses = []
+
+# They all start with Anti-kt 1.0 jets, so set this up and fork off
+antiktFinder = SJ.FastJet.FastJetFinder('AntiKt', fj.antikt_algorithm, 1.0)
+AntiKt = SJ.JetAnalysis(antiktFinder)
+# cut on pT *before* forking to save time
+AntiKt.add_tool(SJ.JetPtSelectorTool(200.0, 2)) # two highest-pt jets over 200
+AKTparent = SJ.ForkToolParent('AntiKtParent')
+AntiKt.add_tool(AKTparent)
+analyses.append(AntiKt)
+
+# recluster with CA, then fork again for different taggers
+CA = SJ.JetAnalysis(SJ.ForkToolChild(AKTparent, 'CA'))
+CA.add_tool(SJ.FastJet.FastJetRecluster('CAcluster', fj.cambridge_algorithm, 100.0))
+CAparent = SJ.ForkToolParent('CAParent')
+CA.add_tool(CAparent)
+analyses.append(CA)
+
+# recluster with kT
+Kt = SJ.JetAnalysis(SJ.ForkToolChild(AKTparent, 'KT'))
+Kt.add_tool(SJ.FastJet.FastJetRecluster('KTcluster', fj.kt_algorithm, 100.0))
+KTparent = SJ.ForkToolParent('KTParent')
+Kt.add_tool(KTparent)
+analyses.append(Kt)
+
+# do some forks before measurement, just for clarity of output
+ATLAS = SJ.JetAnalysis(SJ.ForkToolChild(KTparent, 'ATLAS'))
+analyses.append(ATLAS)
+TW = SJ.JetAnalysis(SJ.ForkToolChild(KTparent, 'TW'))
+analyses.append(TW)
+NSub = SJ.JetAnalysis(SJ.ForkToolChild(AKTparent, 'NSub'))
+analyses.append(NSub)
+
+# pruning
+big_CA_def = fj.JetDefinition(fj.cambridge_algorithm, 100.0)
+Pruned50 = SJ.JetAnalysis(SJ.ForkToolChild(AKTparent, "Pruned"))
+pruner50 = fj.Pruner(fj.cambridge_algorithm, 0.05, 0.1)
+Pruned50.add_tool(SJ.FastJet.TransformerTool("Pruner", pruner50))
+analyses.append(Pruned50)
+
+# trimming
+Trimmed = SJ.JetAnalysis(SJ.ForkToolChild(CAparent, "Trimmed"))
+trimmer = fj.Filter(0.35, fj.SelectorPtFractionMin(0.03))
+Trimmed.add_tool(SJ.FastJet.TransformerTool("TrimmerTool", trimmer))
+analyses.append(Trimmed)
+
+# filtering
+Filtered = SJ.JetAnalysis(SJ.ForkToolChild(CAparent, "Filtered"))
+filter = fj.Filter(0.35, fj.SelectorNHardest(3))
+Filtered.add_tool(SJ.FastJet.TransformerTool("FilterTool", filter))
+analyses.append(Filtered)
+
+# JH top tagger
+JH50 = SJ.JetAnalysis(SJ.ForkToolChild(CAparent, "JH"))
+JH50transformer = fj.JHTopTagger(0.04, 0.19, 1.0, 81.0)
+JH50.add_tool(SJ.FastJet.TransformerTool("JHTagger", JH50transformer))
+analyses.append(JH50)
+
+# CMS top tagger
+CMS = SJ.JetAnalysis(SJ.ForkToolChild(CAparent, "CMS"))
+# measure mass *before* "pruning" step
+massFunction = SJ.FastJet.MassFunction()
+CMS.add_tool(SJ.FastJet.PseudoJetMomentTool(double)(massFunction, "AKTmass"))
+CMStransformer = fj.CMSTopTagger(0.05, 0.4, 0.0004)
+CMS.add_tool(SJ.FastJet.TransformerTool("CMSTagger", CMStransformer))
+analyses.append(CMS)
+
+# HEP top tagger, including dipolarity
+HEP = SJ.JetAnalysis(SJ.ForkToolChild(CAparent, "HEP"))
+HEPtransformer = fj.HEPTopTagger()
+HEP.add_tool(SJ.FastJet.TopTaggerDipolarityTool(HEPtransformer, "HEPTagger"))
+#HEP.add_tool(SJ.FastJet.TransformerTool("HEPTagger", HEPtransformer))
+analyses.append(HEP)
+
+
+[builder.add_analysis(a, False) for a in analyses]
+
+
+# ------------------ Measurements ------------------------------------
+
+# ATLAS z_cut variables
+indices = [1, 2, 3, 4]
+zCutFunctions = [fj.zCutFunction(i) for i in indices]
+[ATLAS.add_tool(SJ.FastJet.PseudoJetMomentTool(double)(zCut, "zcut"+str(i))) for (zCut,i) in zip(zCutFunctions, indices)]
+
+# Thaler-Wang z_cell
+zCellFunction = fj.zCellFunction()
+TW.add_tool(SJ.FastJet.PseudoJetMomentTool(double)(zCellFunction, "zcell"))
+
+# N-Subjettiness
nsub_tools = []
for i in [1,2,3]:
nsub_tools += [fj.Nsubjettiness(i, Njettiness.kt_axes, 1.0, 1.0)]
- builder.add_jetTool(SJ.FastJet.PseudoJetMomentTool(double)(nsub_tools[-1], "tau"+str(i)+"_kt"))
+ NSub.add_tool(SJ.FastJet.PseudoJetMomentTool(double)(nsub_tools[-1], "tau"+str(i)+"_kt"))
+ # these ones are the ones actually used in the report
nsub_tools += [fj.Nsubjettiness(i, Njettiness.onepass_kt_axes, 1.0, 1.0)]
- builder.add_jetTool(SJ.FastJet.PseudoJetMomentTool(double)(nsub_tools[-1], "tau"+str(i)+"_1pass"))
+ NSub.add_tool(SJ.FastJet.PseudoJetMomentTool(double)(nsub_tools[-1], "tau"+str(i)))
+
+# Add a min-mass tool to analyses that don't have a different W identifier
+minMass = fj.MinMassFunction()
+for a in [Pruned50, Filtered, Trimmed, ATLAS, TW, NSub]:
+ a.add_tool(SJ.FastJet.PseudoJetMomentTool(double)(minMass, "mW"))
+
# add angular correlation ("Jet Substructure Without Trees") tool
-builder.add_jetTool(SJ.FastJet.AngularCorrelationTool(4.0, False, 0.06))
+AntiKt.add_tool(SJ.FastJet.AngularCorrelationTool(4.0, False, 0.06))
# Require three peaks
-builder.add_jetTool(SJ.JetMomentSelectorTool(int)("nPeaks", 3, 3))
+AntiKt.add_tool(SJ.JetMomentSelectorTool(int)("nPeaks", 3, 3))
-# TODO: Dipolarity
# Configure output--------------------------------
builder.add_text_output("../data/output/boost2011.dat") # optional
outfile = "../data/output/boost2011.root"
builder.configure_output("SpartyJet_Tree", outfile)
# Run SpartyJet
-builder.process_events()
+builder.process_events(10)
# Save this script in the ROOT file (needs to go after process_events or it
# gets over-written!)
writeCurrentFile(outfile)
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Dec 21, 3:16 PM (1 d, 6 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4023254
Default Alt Text
(14 KB)
Attached To
rSPARTYJETSVN spartyjetsvn
Event Timeline
Log In to Comment