CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Protected Member Functions | Static Private Member Functions | Private Attributes
NanoAODDQM Class Reference
Inheritance diagram for NanoAODDQM:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Classes

class  Count1D
 
struct  GroupConfig
 
class  Plot
 
class  Plot1D
 
class  Profile1D
 
struct  SelGroupConfig
 

Public Types

typedef nanoaod::FlatTable FlatTable
 
- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 NanoAODDQM (const edm::ParameterSet &)
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Protected Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Static Private Member Functions

static std::unique_ptr< PlotmakePlot (DQMStore::IBooker &booker, const edm::ParameterSet &cfg)
 

Private Attributes

std::map< std::string,
GroupConfig
groups_
 

Additional Inherited Members

- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr
< DQMEDAnalyzerGlobalCache
initializeGlobalCache (edm::ParameterSet const &)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 38 of file NanoAODDQM.cc.

Member Typedef Documentation

Definition at line 40 of file NanoAODDQM.cc.

Constructor & Destructor Documentation

NanoAODDQM::NanoAODDQM ( const edm::ParameterSet iConfig)

Definition at line 194 of file NanoAODDQM.cc.

References cuts, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNamesForType(), watchdog::group, groups_, mergeVDriftHistosByStation::name, TrackValidation_cff::pset, AlCaHLTBitMon_QueryRunRegistry::string, and nanoDQM_cff::vplots.

194  {
195  const edm::ParameterSet &vplots = iConfig.getParameter<edm::ParameterSet>("vplots");
197  auto &group = groups_[name];
198  const auto &pset = vplots.getParameter<edm::ParameterSet>(name);
199  group.plotPSets = pset.getParameter<std::vector<edm::ParameterSet>>("plots");
200  group.selGroups.emplace_back(); // no selection (all entries)
201  const auto &cuts = pset.getParameter<edm::ParameterSet>("sels");
202  for (const std::string &cname : cuts.getParameterNamesForType<std::string>()) {
203  group.selGroups.emplace_back(cname, cuts.getParameter<std::string>(cname));
204  }
205  }
206  consumesMany<FlatTable>();
207 }
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:179
TkSoA const *__restrict__ CAHitNtupletGeneratorKernelsGPU::QualityCuts cuts
std::map< std::string, GroupConfig > groups_
Definition: NanoAODDQM.cc:191
tuple group
Definition: watchdog.py:82
T getParameter(std::string const &) const
Definition: ParameterSet.h:303

Member Function Documentation

void NanoAODDQM::analyze ( const edm::Event iEvent,
const edm::EventSetup  
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 231 of file NanoAODDQM.cc.

References nanoaod::FlatTable::addExtension(), edm::Event::getManyByType(), groups_, isotrackNtupler::merged, mergeVDriftHistosByStation::name, bigModule::plot(), EgammaValidation_Wenu_cff::sel, AlCaHLTBitMon_QueryRunRegistry::string, and postprocess-scan-build::tables.

231  {
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;
235 
236  for (const auto &htab : alltables) {
237  if (htab->extension())
238  continue;
239  maintables[htab->name()] = std::make_pair(htab.product(), std::vector<const FlatTable *>());
240  }
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());
246  }
247  }
248 
250  for (auto &pair : groups_) {
251  const std::string &name = pair.first;
252  if (maintables.find(name) == maintables.end())
253  continue; // may happen for missing collections
254  auto &tables = maintables[name];
255  const FlatTable *table = tables.first;
256  if (!tables.second.empty()) {
257  merged = *tables.first;
258  for (auto *other : tables.second) {
259  merged.addExtension(*other);
260  }
261  table = &merged;
262  }
263  std::vector<bool> selbits;
264  for (auto &sel : pair.second.selGroups) {
265  sel.fillSel(*table, selbits);
266 
267  for (auto &plot : sel.plots) {
268  plot->fill(*table, selbits);
269  }
270  }
271  }
272 }
nanoaod::FlatTable FlatTable
Definition: NanoAODDQM.cc:40
void getManyByType(std::vector< Handle< PROD >> &results) const
Definition: Event.h:530
def plot
Definition: bigModule.py:18
std::map< std::string, GroupConfig > groups_
Definition: NanoAODDQM.cc:191
void NanoAODDQM::bookHistograms ( DQMStore::IBooker booker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 209 of file NanoAODDQM.cc.

References looper::cfg, DeadROC_duringRun::dir, groups_, makePlot(), eostools::move(), bigModule::plot(), L1TEGammaDiff_cfi::plots, dqm::implementation::NavigatorBase::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

209  {
210  booker.setCurrentFolder("Physics/NanoAODDQM");
211 
212  for (auto &pair : groups_) {
213  booker.setCurrentFolder("Physics/NanoAODDQM/" + pair.first);
214  for (auto &sels : pair.second.selGroups) {
215  std::string dir("Physics/NanoAODDQM/" + pair.first);
216  if (!sels.nullCut())
217  dir += "/" + sels.name;
218  booker.setCurrentFolder(dir);
219  auto &plots = sels.plots;
220  plots.clear();
221  plots.reserve(pair.second.plotPSets.size());
222  for (const auto &cfg : pair.second.plotPSets) {
223  auto plot = makePlot(booker, cfg);
224  if (plot)
225  plots.push_back(std::move(plot));
226  }
227  }
228  }
229 }
tuple cfg
Definition: looper.py:296
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
static std::unique_ptr< Plot > makePlot(DQMStore::IBooker &booker, const edm::ParameterSet &cfg)
Definition: NanoAODDQM.cc:151
def plot
Definition: bigModule.py:18
std::map< std::string, GroupConfig > groups_
Definition: NanoAODDQM.cc:191
def move
Definition: eostools.py:511
static std::unique_ptr<Plot> NanoAODDQM::makePlot ( DQMStore::IBooker booker,
const edm::ParameterSet cfg 
)
inlinestaticprivate

Definition at line 151 of file NanoAODDQM.cc.

References looper::cfg, Exception, edm::ParameterSet::getParameter(), class-composition::kind, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by bookHistograms().

151  {
152  const std::string &kind = cfg.getParameter<std::string>("kind");
153  if (kind == "none")
154  return nullptr;
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);
161  throw cms::Exception("Configuration", "Unsupported plot kind '" + kind + "'");
162  }
tuple cfg
Definition: looper.py:296
T getParameter(std::string const &) const
Definition: ParameterSet.h:303

Member Data Documentation

std::map<std::string, GroupConfig> NanoAODDQM::groups_
private

Definition at line 191 of file NanoAODDQM.cc.

Referenced by analyze(), bookHistograms(), and NanoAODDQM().