CP3-llbb Framework
Tools.h
1 #pragma once
2 
3 #include <algorithm>
4 
5 namespace pat {
6  class Jet;
7 }
8 
9 namespace Tools {
10  namespace Jets {
11 
12  // Jet id: https://twiki.cern.ch/twiki/bin/view/CMS/JetID#Recommendations_for_13_TeV_data
13 #define DECLARE_QUANTITIES(jet) \
14  float eta = jet.eta(); \
15  float NHF = jet.neutralHadronEnergyFraction(); \
16  float NEMF = jet.neutralEmEnergyFraction(); \
17  float CHF = jet.chargedHadronEnergyFraction(); \
18  float MUF = jet.muonEnergyFraction(); \
19  float CEMF = jet.chargedEmEnergyFraction(); \
20  size_t NumConst = jet.chargedMultiplicity() + jet.neutralMultiplicity(); \
21  size_t NumNeutralParticles = jet.neutralMultiplicity(); \
22  size_t CHM = jet.chargedMultiplicity();
23 
24  bool passLooseId(const pat::Jet& jet);
25  bool passTightId(const pat::Jet& jet);
26  bool passTightLeptonVetoId(const pat::Jet& jet);
27  };
28 
29  inline bool caseInsensitiveEquals(const std::string& a, const std::string& b) {
30  return std::equal(a.begin(), a.end(), b.begin(), [](char a, char b) { return std::tolower(a) == std::tolower(b); });
31  }
32 
33  double process_mem_usage();
34 };