-
Notifications
You must be signed in to change notification settings - Fork 5
BoostedXbbTag
Table of Contents generated with DocToc
For use on xAOD jets (+muons)!
- This uses the muon selector tool to select the correct muon quality
cmt/Makefile.RootCore include:
PACKAGE_DEP = ... JetSubStructureUtils ...
Header include:
#include "JetSubStructureUtils/BoostedXbbTag.h"Inside execute() call:
// load up the Xbb tagger
static std::string wk_pt("medium");
static std::string recs_file("$ROOTCOREBIN/data/JetSubStructureUtils/config_13TeV_20150710_Htagging.dat");
static std::string boson_type("Higgs");
static std::string alg_name("AK10LCTRIMF5R20");
static int num_bTags(2);
static std::string decor_prefix("");
static bool debug(false);
static bool verbose(false);
static JetSubStructureUtils::BoostedXbbTag higgsTagger(wk_pt, recs_file, boson_type, alg_name, num_bTags, decor_prefix, debug, verbose);
const xAOD::MuonContainer* muons = ...;
const xAOD::JetContainer* jets = ...;
for(auto jet: *jets)
int isHiggsTagged = higgsTagger.result(*jet, muons);If your jet doesn't have any of the appropriate decorations for whatever reason, you can override the automatic lookup and retrieval by using the overloaded result() function:
const xAOD::MuonContainer* muons = ...;
const xAOD::JetContainer* jets = ...;
for(auto jet: *jets)
int isHiggsTagged = m_higgsTagger.result(*jet, "AK10LCTRIMF5R20", muons);The string for the second argument must match one of the columns in the provided configuration file.
The tool provides an ElementLink from the jet to the closest matched muon. In order for ElementLinks to work properly (to find the muon in the context of the StoreGate), the muon container being passed in must exist in the TEvent or TStore. A simple line like
m_store->record(muons, "MuonsShallow");
m_store->record(muons_aux, "MuonsShallowAux.");will not only make sure that this exists in the context of StoreGate, but it will also manage your memory for you and make sure that the xAOD objects are cleaned up appropriately.
The constructor takes 6 different arguments. The defaults are bolded where appropriate.
| variable | description | values |
|---|---|---|
| working point | see a recommendations file for the working points available | veryloose, loose, medium, tight |
| recommendations file | path to the recommendations file | ... |
| boson type | which kind of boson to tag | Higgs |
| algorithm name | which algorithm to use for the jet | AK10LCTRIMF5R20 |
| bTag multiplicity | min num of required bTags | 2 |
| decoration prefix | string to prefix to decoration names | "" |
| debug | enable debug output in case there are errors when trying to track down why you have more false tags | true, false |
| verbose | significant verbosity to understand what the hell the tagger is doing | true, false |
The tagging tool returns many different values. Negative values (less than zero) correspond to a problem with the jet or the muons. If you run into a problem, you might want to flip on m_debug or m_verbose to see the specific issue
| value | meaning |
|---|---|
| -2 | A problem with the track jets |
| -5 | Jet does not pass basic kinematic selections |
| -9 | A generic problem (tool configuration, missing values or variables) |
If tagging was successful, there are 8 possible non-negative values:
| binary | value | meaning |
|---|---|---|
000 |
0 | passed no cuts |
001 |
1 | passed bTag cut only |
010 |
2 | passed D2 cut only |
011 |
3 | passed: bTag, D2 |
100 |
4 | passed mass only |
101 |
5 | passed: mass, bTag |
110 |
6 | passed: mass, D2 |
111 |
7 | pass all cuts |
The code to return the value is given by
return static_cast<int>((pass_mass << 2)|(pass_d2 << 1)|(pass_btag << 0));The main algorithm is quite involved and will be described more fully in depth here later. Read the code to see what goes on. In particular, the steps taken are
- Get all AntiKt2TrackJets asssociated with the jet's ungroomed parent
- Clean the track jets using the kinematic selections
- B-tag the two leading track-jets
- decorate the track-jets with the b-tagging decision
- If any track-jets are b-tagged, match the muon (if any) to these b-tagged track-jets
- only use muons that have passed kinematic selections
- if more than 1 muon matches a track jet (within the radius of the track jet), only use the muon closest in DR
- create an element link on the fat-jet to the matched muon
- Correct the fat-jet mass by putting the matched muon back
- also correct for double-counting using the energy loss calculation
- decorate the fat jet with the corrected jet TLV
- Set a cut on the corrected fat jet mass
- Cut on the D2 of the fat-jet (D2 from calorimeter constituents only)
One recommendation file is provided for HiggsTagging. Look in JetSubStructueUtils/data to see it.
The tool decorates the jet with a bunch of extra information that can be useful for analyzers in various contexts. The table below lists the decorations available on the jet after the tool has computed a tagging result for it.
All names are prefixed by m_decor_prefix which is part of the tool configuration.
| type | name | meaning |
|---|---|---|
ElementLink<xAOD::IParticleContainer> |
MatchedMuonLink | an ElementLink to the matched muon |
TLorentzVector |
CorrectedJetP4 | a 4-vector representing the corrected jet kinematics |
std::pair<float, float> |
MassWindow | the lower and upper bounds of the mass window |
std::pair<float, std::string> |
D2Pivot | the D2 Cut applied and the direction |
In addition to the above, the associated track jets are decorated on whether or not they have been b-tagged by the tool
| type | name | meaning |
|---|---|---|
int |
isB | b-tagging result of the given object |
We provide some user functions for lazy coders to make it easier to grab the relevant information the tool uses for tagging. All of this information will only exist after the jet has been processed by the tool itself. Rather than elaborating, we just show a code example for all of these
for(auto jet: *jets){
int isHiggsTagged = hT.result(*jet, muons);
std::vector<const xAOD::Jet*> btagged_track_jets = hT.get_bTagged_trackJets(*jet);
const xAOD::Muon* matched_muon = hT.get_matched_muon(*jet);
TLorentzVector correctedJet = hT.get_correctedJet_TLV(*jet);
std::pair<float, float> massWindow = hT.get_mass_window(*jet);
std::pair<float, std::string> D2Cut = hT.get_D2_pivot(*jet);
}for(const auto& jet: *jets){
switch(hT.result(*jet, muons)){
// the case where D2 and bTag pass, but the mass cut doesn't
case 3:
std::pair<float, float> massWindow = hT.get_mass_window(*jet);
if(jet->m() < massWindow.first) // lower than window
// ...
if(jet->m() > massWindow.second) // higher than window
// ...
break;
// the case where mass and D2 pass, but bTag doesn't
case 6:
std::vector<xAOD::Jet*> btaggedTrackJets = hT.get_bTagged_trackJets(*jet);
bTaggedTrackJets.size(); // number of btagged track jets
break;
}
}See the source code to see how these functions work (they are very, very, very simple).