DAS  3.0
Das Analysis System
Filters

Description

#include <Filters.h>

+ Collaboration diagram for Filters:

Public Member Functions

 Filters (const std::filesystem::path &file)
 
void operator() (const MET &met, RecEvent &event)
 

Public Attributes

std::vector< std::string > names
 
std::vector< size_t > bitsToTest
 

Constructor & Destructor Documentation

◆ Filters()

Filters ( const std::filesystem::path &  file)
inline
Parameters
fileexpecting a 2-column file (see $DARWIN_TABLES/MET)
27  {
28  using namespace std;
29  namespace pt = boost::property_tree;
30  namespace fs = filesystem;
31 
32  if (!fs::exists(file))
33  BOOST_THROW_EXCEPTION(fs::filesystem_error("Bad MET filter list", file,
34  make_error_code(errc::no_such_file_or_directory)));
35 
36  pt::ptree tree;
37  pt::read_info(file, tree);
38 
39  cout << "MET / noise filters:";
40  size_t ibit = 0;
41  for (auto& [name, child]: tree) {
42  auto bit = child.get_value<bool>();
43 
44  // printout
45  cout << (bit ? green : red) << ' ' << name;
46 
47  // save
48  names.push_back(name);
49  if (bit) bitsToTest.push_back(ibit);
50  ++ibit;
51  }
52  cout << def << endl;
53  }

Member Function Documentation

◆ operator()()

void operator() ( const MET met,
RecEvent event 
)
inline
56  {
57  if (met.Bit.size() != names.size())
58  BOOST_THROW_EXCEPTION( std::runtime_error("Inconsistent lengths of MET bits between file and event") );
59 
60  for (size_t ibit: bitsToTest) {
61  if (met.Bit.at(ibit)) continue;
62  event.weights *= 0;
63  return;
64  }
65  }

Member Data Documentation

◆ bitsToTest

std::vector<size_t> bitsToTest

indices of the bits to test in DAS::MET::Bit

◆ names

std::vector<std::string> names

full name of MET filter


The documentation for this struct was generated from the following file:
DYToLL_M-50_13TeV_pythia8_cff_GEN_SIM_RECOBEFMIX_DIGI_L1_DIGI2RAW_L1Reco_RECO.name
name
Definition: DYToLL_M-50_13TeV_pythia8_cff_GEN_SIM_RECOBEFMIX_DIGI_L1_DIGI2RAW_L1Reco_RECO.py:48
jmarExample.pt
pt
Definition: jmarExample.py:19
Step::def
static const char * def
Definition: Step.h:36
Step::red
static const char * red
Definition: Step.h:34
DAS::MET::Bit
std::vector< bool > Bit
flags for application of MET filters (see n-tupliser config file)
Definition: Event.h:89
Step::green
static const char * green
Definition: Step.h:33
met
DAS::MET met
Definition: classes.h:28
DAS::MissingET::Filters::bitsToTest
std::vector< size_t > bitsToTest
indices of the bits to test in DAS::MET::Bit
Definition: Filters.h:23
DAS::MissingET::Filters::names
std::vector< std::string > names
full name of MET filter
Definition: Filters.h:22