22 #include <type_traits> 26 std::regex
token(
"\\w+");
27 std::sregex_iterator tbegin(expr.begin(), expr.end(),
token), tend;
30 std::stringstream
out;
31 std::sregex_iterator
last;
32 for (std::sregex_iterator
i = tbegin;
i != tend;
last =
i, ++
i) {
33 const std::smatch &
match = *
i;
36 out <<
"getAnyValue(\"" <<
match.str() <<
"\")";
75 cfg.getParameter<uint32_t>(
"nbins"),
76 cfg.getParameter<double>(
"min"),
77 cfg.getParameter<double>(
"max"))) {}
80 plot_->
Fill(std::accumulate(rowsel.begin(), rowsel.end(), 0u));
89 cfg.getParameter<uint32_t>(
"nbins"),
90 cfg.getParameter<double>(
"min"),
91 cfg.getParameter<double>(
"max"))),
99 switch (
table.columnType(icol)) {
101 vfill<uint8_t>(
table, icol, rowsel);
104 vfill<int16_t>(
table, icol, rowsel);
107 vfill<uint16_t>(
table, icol, rowsel);
110 vfill<int32_t>(
table, icol, rowsel);
113 vfill<uint32_t>(
table, icol, rowsel);
116 vfill<bool>(
table, icol, rowsel);
119 vfill<float>(
table, icol, rowsel);
122 vfill<double>(
table, icol, rowsel);
132 template <
typename T>
135 for (
unsigned int i = 0,
n =
data.size();
i <
n; ++
i) {
140 for (
unsigned int b = 0; b < std::numeric_limits<T>::digits;
b++) {
160 cfg.getParameter<uint32_t>(
"nbins"),
161 cfg.getParameter<double>(
"min"),
162 cfg.getParameter<double>(
"max"),
176 for (
unsigned int irow = 0,
n =
table.size(); irow <
n; ++irow) {
190 if (
kind ==
"count1d")
191 return std::make_unique<Count1D>(booker,
cfg);
192 if (
kind ==
"hist1d")
193 return std::make_unique<Plot1D>(booker,
cfg);
194 if (
kind ==
"prof1d")
195 return std::make_unique<Profile1D>(booker,
cfg);
203 std::unique_ptr<StringCutObjectSelector<FlatTable::RowView>>
cutptr;
204 std::vector<std::unique_ptr<Plot>>
plots;
216 for (
unsigned int i = 0,
n =
table.size();
i <
n; ++
i) {
235 group.plotPSets =
pset.getParameter<std::vector<edm::ParameterSet>>(
"plots");
236 group.selGroups.emplace_back();
249 sels.setComment(
"a paramerter set to define the selections to be made from the table row");
259 "column",
true,
edm::Comment(
"name of the raw to fill the content of the plot"));
261 "xcolumn",
true,
edm::Comment(
"name of the raw to fill the x content of the plot"));
263 "ycolumn",
true,
edm::Comment(
"name of the raw to fill the y content of the plot"));
266 plot.setComment(
"a parameter set that defines a DQM histogram");
276 "a parameter set to define all the plots to be made from a table row selected from the name of the PSet");
281 vplots.setComment(
"a parameter set to define all the set of plots to be made from the tables");
293 for (
auto &
sels : pair.second.selGroups) {
300 plots.reserve(pair.second.plotPSets.size());
301 for (
const auto &
cfg : pair.second.plotPSets) {
311 std::vector<edm::Handle<FlatTable>> alltables;
313 std::map<std::string, std::pair<const FlatTable *, std::vector<const FlatTable *>>> maintables;
315 for (
const auto &htab : alltables) {
316 if (htab->extension())
318 maintables[htab->name()] = std::make_pair(htab.product(), std::vector<const FlatTable *>());
320 for (
const auto &htab : alltables) {
321 if (htab->extension()) {
322 if (maintables.find(htab->name()) == maintables.end())
323 throw cms::Exception(
"LogicError",
"Missing main table for " + htab->name());
324 maintables[htab->name()].second.push_back(htab.product());
331 if (maintables.find(
name) == maintables.end())
333 auto &tables = maintables[
name];
335 if (!tables.second.empty()) {
336 merged = *tables.first;
337 for (
auto *
other : tables.second) {
342 std::vector<bool> selbits;
343 for (
auto &
sel : pair.second.selGroups) {
void addExtension(const FlatTable &extension)
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
T getParameter(std::string const &) const
std::vector< edm::ParameterSet > plotPSets
const std::string & name() const
ParameterDescriptionBase * addVPSet(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
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
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)
void setComment(std::string const &value)
std::map< std::string, GroupConfig > groups_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
void vfill(const FlatTable &table, int icol, const std::vector< bool > &rowsel)
#define DEFINE_FWK_MODULE(type)
void fill(const FlatTable &table, const std::vector< bool > &rowsel) override
ParameterDescriptionBase * add(U const &iLabel, T const &value)
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
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::GetterOfProducts< FlatTable > getterOfProducts_
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
static constexpr float b1