18 std::regex
token(
"\\w+");
19 std::sregex_iterator tbegin(
expr.begin(),
expr.end(),
token), tend;
22 std::stringstream
out;
23 std::sregex_iterator
last;
24 for (std::sregex_iterator
i = tbegin;
i != tend;
last =
i, ++
i) {
28 out <<
"getAnyValue(\"" <<
match.str() <<
"\")";
65 cfg.getParameter<uint32_t>(
"nbins"),
66 cfg.getParameter<double>(
"min"),
67 cfg.getParameter<double>(
"max"))) {}
70 plot_->
Fill(std::accumulate(rowsel.begin(), rowsel.end(), 0u));
79 cfg.getParameter<uint32_t>(
"nbins"),
80 cfg.getParameter<double>(
"min"),
81 cfg.getParameter<double>(
"max"))),
88 switch (
table.columnType(icol)) {
90 vfill<float>(
table, icol, rowsel);
93 vfill<int>(
table, icol, rowsel);
96 vfill<int8_t>(
table, icol, rowsel);
99 vfill<uint8_t>(
table, icol, rowsel);
102 vfill<bool>(
table, icol, rowsel);
111 template <
typename T>
114 for (
unsigned int i = 0,
n =
data.size();
i <
n; ++
i) {
125 cfg.getParameter<uint32_t>(
"nbins"),
126 cfg.getParameter<double>(
"min"),
127 cfg.getParameter<double>(
"max"),
141 for (
unsigned int irow = 0,
n =
table.size(); irow <
n; ++irow) {
155 if (
kind ==
"count1d")
156 return std::make_unique<Count1D>(booker,
cfg);
157 if (
kind ==
"hist1d")
158 return std::make_unique<Plot1D>(booker,
cfg);
159 if (
kind ==
"prof1d")
160 return std::make_unique<Profile1D>(booker,
cfg);
168 std::unique_ptr<StringCutObjectSelector<FlatTable::RowView>>
cutptr;
169 std::vector<std::unique_ptr<Plot>>
plots;
181 for (
unsigned int i = 0,
n =
table.size();
i <
n; ++
i) {
199 group.plotPSets =
pset.getParameter<std::vector<edm::ParameterSet>>(
"plots");
200 group.selGroups.emplace_back();
206 consumesMany<FlatTable>();
214 for (
auto &
sels : pair.second.selGroups) {
221 plots.reserve(pair.second.plotPSets.size());
222 for (
const auto &
cfg : pair.second.plotPSets) {
232 std::vector<edm::Handle<FlatTable>> alltables;
233 iEvent.getManyByType(alltables);
234 std::map<std::string, std::pair<const FlatTable *, std::vector<const FlatTable *>>> maintables;
236 for (
const auto &htab : alltables) {
237 if (htab->extension())
239 maintables[htab->name()] = std::make_pair(htab.product(), std::vector<const FlatTable *>());
241 for (
const auto &htab : alltables) {
242 if (htab->extension()) {
243 if (maintables.find(htab->name()) == maintables.end())
244 throw cms::Exception(
"LogicError",
"Missing main table for " + htab->name());
245 maintables[htab->name()].second.push_back(htab.product());
252 if (maintables.find(
name) == maintables.end())
256 if (!
tables.second.empty()) {
263 std::vector<bool> selbits;
264 for (
auto &
sel : pair.second.selGroups) {
void addExtension(const FlatTable &extension)
T getParameter(std::string const &) const
std::vector< edm::ParameterSet > plotPSets
const std::string & name() const
virtual void fill(const FlatTable &table, const std::vector< bool > &rowsel)=0
virtual void setCurrentFolder(std::string const &fullpath)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
#define DEFINE_FWK_MODULE(type)
std::vector< SelGroupConfig > selGroups
std::unique_ptr< StringCutObjectSelector< FlatTable::RowView > > cutptr
void analyze(const edm::Event &, const edm::EventSetup &) override
nanoaod::FlatTable FlatTable
static std::unique_ptr< Plot > makePlot(DQMStore::IBooker &booker, const edm::ParameterSet &cfg)
Plot1D(DQMStore::IBooker &booker, const edm::ParameterSet &cfg)
NanoAODDQM(const edm::ParameterSet &)
Profile1D(DQMStore::IBooker &booker, const edm::ParameterSet &cfg)
TkSoA const *__restrict__ CAHitNtupletGeneratorKernelsGPU::QualityCuts cuts
std::map< std::string, GroupConfig > groups_
void vfill(const FlatTable &table, int icol, const std::vector< bool > &rowsel)
void fill(const FlatTable &table, const std::vector< bool > &rowsel) override
Count1D(DQMStore::IBooker &booker, const edm::ParameterSet &cfg)
void fill(const FlatTable &table, const std::vector< bool > &rowsel) override
std::vector< std::unique_ptr< Plot > > plots
const std::string & getName() const
get name of ME
SelGroupConfig(const std::string &nam, const std::string &cut)
char data[epos_bytes_allocation]
StringCutObjectSelector< FlatTable::RowView > Selector
void fillSel(const FlatTable &table, std::vector< bool > &out)
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
void fill(const FlatTable &table, const std::vector< bool > &rowsel) override