CMS 3D CMS Logo

Classes | Typedefs | Functions
dqmoffline::l1t Namespace Reference

Classes

class  HistDefinition
 
class  L1TDiffHarvesting
 
class  L1TEfficiencyHarvesting
 
class  L1TEfficiencyPlotHandler
 

Typedefs

typedef std::vector< HistDefinitionHistDefinitions
 
typedef std::vector< L1TEfficiencyPlotHandlerL1TEfficiencyPlotHandlerCollection
 
typedef dqm::reco::MonitorElement MonitorElement
 
typedef std::vector< double > vdouble
 

Functions

void fill2DWithinLimits (MonitorElement *mon, double valueX, double valueY, double weight=1.)
 
void fillWithinLimits (MonitorElement *mon, double value, double weight=1.)
 
double getFillValueWithinLimits (double value, double min, double max)
 
std::vector< unsigned int > getFiredTriggerIndices (const std::vector< unsigned int > &triggers, const std::vector< bool > &triggerResults)
 
std::vector< edm::InputTaggetHLTFilters (const std::vector< unsigned int > &triggers, const HLTConfigProvider &hltConfig, const std::string triggerProcess)
 
trigger::TriggerObjectCollection getMatchedTriggerObjects (double eta, double phi, double maxDeltaR, const trigger::TriggerObjectCollection triggerObjects)
 
std::vector< unsigned int > getTriggerIndices (const std::vector< std::string > &requestedTriggers, const std::vector< std::string > &triggersInEvent)
 
trigger::TriggerObjectCollection getTriggerObjects (const std::vector< edm::InputTag > &hltFilters, const trigger::TriggerEvent &triggerEvent)
 
std::vector< bool > getTriggerResults (const std::vector< unsigned int > &triggers, const edm::TriggerResults &triggerResults)
 
bool passesAnyTriggerFromList (const std::vector< unsigned int > &triggers, const edm::TriggerResults &triggerResults)
 
HistDefinitions readHistDefinitions (const edm::ParameterSet &ps, const std::map< std::string, unsigned int > &mapping)
 
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker< edm::ParameterSetDescriptionFiller< L1TEfficiencyHarvesting > > s_filler__LINE__ ("L1TEfficiencyHarvesting")
 
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker< edm::ParameterSetDescriptionFiller< L1TDiffHarvesting > > s_filler__LINE__ ("L1TDiffHarvesting")
 
static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< L1TEfficiencyHarvesting > > s_maker__LINE__ ("L1TEfficiencyHarvesting")
 
static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< L1TDiffHarvesting > > s_maker__LINE__ ("L1TDiffHarvesting")
 

Typedef Documentation

◆ HistDefinitions

Definition at line 51 of file HistDefinition.h.

◆ L1TEfficiencyPlotHandlerCollection

Definition at line 63 of file L1TEfficiencyHarvesting.h.

◆ MonitorElement

Definition at line 9 of file L1TFillWithinLimits.h.

◆ vdouble

typedef std::vector<double> dqmoffline::l1t::vdouble

Definition at line 8 of file HistDefinition.cc.

Function Documentation

◆ fill2DWithinLimits()

void dqmoffline::l1t::fill2DWithinLimits ( MonitorElement mon,
double  valueX,
double  valueY,
double  weight = 1. 
)

Fills a given MonitorElement within the boundaries of the underlying histogram. This means that underflow is filled into the first bin and overflow is filled into the last bin.

Parameters
pointerto the DQM MonitorElement
fillvalue for X
fillvalue for Y
optionalweight X
optionalweight Y

Definition at line 19 of file L1TFillWithinLimits.cc.

References getFillValueWithinLimits(), HGVHistoProducerAlgoBlock_cfi::maxX, HGVHistoProducerAlgoBlock_cfi::maxY, HGVHistoProducerAlgoBlock_cfi::minX, HGVHistoProducerAlgoBlock_cfi::minY, and LaserDQM_cfi::mon.

Referenced by L1TEGammaOffline::fillElectrons(), L1TStage2CaloLayer2Offline::fillEnergySums(), L1TStage2CaloLayer2Offline::fillJets(), and L1TEGammaOffline::fillPhotons().

19  {
20  double minX(mon->getAxisMin(1));
21  double minY(mon->getAxisMin(2));
22 
23  double maxX(mon->getAxisMax(1));
24  double maxY(mon->getAxisMax(2));
25 
26  double fillValueX = getFillValueWithinLimits(valueX, minX, maxX);
27  double fillValueY = getFillValueWithinLimits(valueY, minY, maxY);
28  mon->Fill(fillValueX, fillValueY, weight);
29  }
double getFillValueWithinLimits(double value, double min, double max)
Definition: weight.py:1

◆ fillWithinLimits()

void dqmoffline::l1t::fillWithinLimits ( MonitorElement mon,
double  value,
double  weight = 1. 
)

Fills a given MonitorElement within the boundaries of the underlying histogram. This means that underflow is filled into the first bin and overflow is filled into the last bin.

Parameters
pointerto the DQM MonitorElement
fillvalue
optionalweight

Fills a given

Parameters

Definition at line 12 of file L1TFillWithinLimits.cc.

References getFillValueWithinLimits(), SiStripPI::max, SiStripPI::min, and LaserDQM_cfi::mon.

Referenced by L1TEGammaOffline::analyze(), L1TStage2CaloLayer2Offline::analyze(), L1TEGammaOffline::fillElectrons(), L1TStage2CaloLayer2Offline::fillEnergySums(), L1TStage2CaloLayer2Offline::fillJetEfficiencies(), L1TStage2CaloLayer2Offline::fillJets(), L1TEGammaOffline::fillPhotons(), and L1TEGammaOffline::findTagAndProbePair().

12  {
13  double min(mon->getAxisMin(1));
14  double max(mon->getAxisMax(1));
15 
16  double fillValue = getFillValueWithinLimits(value, min, max);
17  mon->Fill(fillValue, weight);
18  }
double getFillValueWithinLimits(double value, double min, double max)
Definition: weight.py:1
Definition: value.py:1

◆ getFillValueWithinLimits()

double dqmoffline::l1t::getFillValueWithinLimits ( double  value,
double  min,
double  max 
)

Definition at line 31 of file L1TFillWithinLimits.cc.

References MillePedeFileConverter_cfg::e, SiStripPI::max, SiStripPI::min, and relativeConstraints::value.

Referenced by fill2DWithinLimits(), and fillWithinLimits().

31  {
32  if (value < min)
33  return min;
34 
35  // histograms are [min, max), hence fill with a slightly smaller value
36  if (value > max)
37  return max - 1e-6 * max;
38 
39  return value;
40  }
Definition: value.py:1

◆ getFiredTriggerIndices()

std::vector< unsigned int > dqmoffline::l1t::getFiredTriggerIndices ( const std::vector< unsigned int > &  triggers,
const std::vector< bool > &  triggerResults 
)

Definition at line 54 of file L1TCommon.cc.

References mps_fire::i, bookConverter::results, and triggerResults.

Referenced by L1TStage2CaloLayer2Offline::doesNotOverlapWithHLTObjects(), and L1TEGammaOffline::matchesAnHLTObject().

55  {
56  std::vector<unsigned int> results;
57  // std::copy_if instead?
58  for (unsigned int i = 0; i < triggerResults.size(); ++i) {
59  if (triggerResults[i]) {
60  results.push_back(triggers[i]);
61  }
62  }
63  return results;
64  }
static std::string const triggerResults
Definition: EdmProvDump.cc:44

◆ getHLTFilters()

std::vector< edm::InputTag > dqmoffline::l1t::getHLTFilters ( const std::vector< unsigned int > &  triggers,
const HLTConfigProvider hltConfig,
const std::string  triggerProcess 
)

Definition at line 99 of file L1TCommon.cc.

References HltComparatorCreateWorkflow::hltConfig, HLT_2022v11_cff::InputTag, callgraph::module, LogMessageMonitor_cff::modules, bookConverter::results, AlCaHLTBitMon_QueryRunRegistry::string, and L1TEGammaOffline_cfi::triggerProcess.

Referenced by L1TStage2CaloLayer2Offline::doesNotOverlapWithHLTObjects(), and L1TEGammaOffline::matchesAnHLTObject().

101  {
102  std::vector<edm::InputTag> results;
103  for (auto trigger : triggers) {
104  unsigned int hltIndexOffset(2);
105  unsigned int moduleIndex = hltConfig.size(trigger) - hltIndexOffset;
106  const std::vector<std::string> &modules(hltConfig.moduleLabels(trigger));
107  std::string module(modules[moduleIndex]);
108  edm::InputTag filterInputTag = edm::InputTag(module, "", triggerProcess);
109  results.push_back(filterInputTag);
110  }
111  return results;
112  }

◆ getMatchedTriggerObjects()

trigger::TriggerObjectCollection dqmoffline::l1t::getMatchedTriggerObjects ( double  eta,
double  phi,
double  maxDeltaR,
const trigger::TriggerObjectCollection  triggerObjects 
)

Definition at line 114 of file L1TCommon.cc.

References PbPb_ZMuSkimMuonDPG_cff::deltaR, PVValHelper::eta, ewkMuLumiMonitorDQM_cfi::maxDeltaR, getGTfromDQMFile::obj, bookConverter::results, and triggerMatchMonitor_cfi::triggerObjects.

Referenced by L1TStage2CaloLayer2Offline::doesNotOverlapWithHLTObjects(), and L1TEGammaOffline::matchesAnHLTObject().

117  {
119  typedef trigger::TriggerObject trigObj;
120  std::copy_if(
121  triggerObjects.begin(),
122  triggerObjects.end(),
123  std::back_inserter(results),
124  [eta, phi, maxDeltaR](const trigObj &obj) { return deltaR(obj.eta(), obj.phi(), eta, phi) < maxDeltaR; });
125  return results;
126  }
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:21
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:75

◆ getTriggerIndices()

std::vector< unsigned int > dqmoffline::l1t::getTriggerIndices ( const std::vector< std::string > &  requestedTriggers,
const std::vector< std::string > &  triggersInEvent 
)

Definition at line 10 of file L1TCommon.cc.

References Skims_PA_cff::name, AlCaHLTBitMon_QueryRunRegistry::string, and PDWG_DiPhoton_SD_cff::triggerName.

Referenced by L1TEGammaOffline::dqmBeginRun(), and L1TStage2CaloLayer2Offline::dqmBeginRun().

11  {
12  std::vector<unsigned int> triggerIndices;
13 
14  for (const auto &requestedTriggerName : requestedTriggers) {
15  std::string name(requestedTriggerName);
16  std::size_t wildcarPosition = name.find('*');
17  if (wildcarPosition != std::string::npos) {
18  // take everything up to the wildcard
19  name = name.substr(0, wildcarPosition - 1);
20  }
21 
22  unsigned int triggerIndex = 0;
23  for (const auto &triggerName : triggersInEvent) {
24  if (triggerName.find(name) != std::string::npos) {
25  triggerIndices.push_back(triggerIndex);
26  break;
27  }
28  ++triggerIndex;
29  }
30  }
31  return triggerIndices;
32  }

◆ getTriggerObjects()

trigger::TriggerObjectCollection dqmoffline::l1t::getTriggerObjects ( const std::vector< edm::InputTag > &  hltFilters,
const trigger::TriggerEvent triggerEvent 
)

Definition at line 75 of file L1TCommon.cc.

References ALCARECOTkAlBeamHalo_cff::filter, mps_fire::i, bookConverter::results, jetUpdater_cfi::sort, PDWG_DiPhoton_SD_cff::triggerEvent, and triggerMatchMonitor_cfi::triggerObjects.

Referenced by L1TStage2CaloLayer2Offline::doesNotOverlapWithHLTObjects(), and L1TEGammaOffline::matchesAnHLTObject().

76  {
79 
80  for (const auto &filter : hltFilters) {
81  const unsigned filterIndex = triggerEvent.filterIndex(filter);
82 
83  if (filterIndex < triggerEvent.sizeFilters()) {
84  const trigger::Keys &triggerKeys(triggerEvent.filterKeys(filterIndex));
85  const size_t nTriggers = triggerEvent.filterIds(filterIndex).size();
86  for (size_t i = 0; i < nTriggers; ++i) {
87  results.push_back(triggerObjects[triggerKeys[i]]);
88  }
89  }
90  }
91  // sort by ET
92  typedef trigger::TriggerObject trigObj;
93  std::sort(results.begin(), results.end(), [](const trigObj &obj1, const trigObj &obj2) {
94  return obj1.et() > obj2.et();
95  });
96  return results;
97  }
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:21
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:75
std::vector< size_type > Keys

◆ getTriggerResults()

std::vector< bool > dqmoffline::l1t::getTriggerResults ( const std::vector< unsigned int > &  triggers,
const edm::TriggerResults triggerResults 
)

Definition at line 34 of file L1TCommon.cc.

References bookConverter::results, and triggerResults.

Referenced by L1TStage2CaloLayer2Offline::doesNotOverlapWithHLTObjects(), L1TEGammaOffline::matchesAnHLTObject(), and passesAnyTriggerFromList().

35  {
36  std::vector<bool> results;
37  results.resize(triggers.size());
38 
39  for (unsigned int index = 0; index < triggers.size(); ++index) {
40  if (triggers[index] >= triggerResults.size()) {
41  results[index] = false;
42  continue;
43  }
44 
45  if (triggerResults.accept(triggers[index])) {
46  results[index] = true;
47  } else {
48  results[index] = false;
49  }
50  }
51  return results;
52  }
static std::string const triggerResults
Definition: EdmProvDump.cc:44

◆ passesAnyTriggerFromList()

bool dqmoffline::l1t::passesAnyTriggerFromList ( const std::vector< unsigned int > &  triggers,
const edm::TriggerResults triggerResults 
)

Definition at line 66 of file L1TCommon.cc.

References submitPVResolutionJobs::count, getTriggerResults(), bookConverter::results, and triggerResults.

Referenced by L1TEGammaOffline::analyze(), and L1TStage2CaloLayer2Offline::analyze().

67  {
68  std::vector<bool> results = dqmoffline::l1t::getTriggerResults(triggers, triggerResults);
69  if (std::count(results.begin(), results.end(), true) == 0) {
70  return false;
71  }
72  return true;
73  }
static std::string const triggerResults
Definition: EdmProvDump.cc:44
std::vector< bool > getTriggerResults(const std::vector< unsigned int > &triggers, const edm::TriggerResults &triggerResults)
Definition: L1TCommon.cc:34

◆ readHistDefinitions()

HistDefinitions dqmoffline::l1t::readHistDefinitions ( const edm::ParameterSet ps,
const std::map< std::string, unsigned int > &  mapping 
)

Definition at line 29 of file HistDefinition.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNames(), taus_updatedMVAIds_cff::mapping, SiStripPI::max, Skims_PA_cff::name, and names.

30  {
32  std::vector<std::string> names = ps.getParameterNames();
33  std::vector<unsigned int> map_values;
34 
35  map_values.reserve(mapping.size());
36  for (auto const &imap : mapping) {
37  map_values.push_back(imap.second);
38  }
39  unsigned int max_size = *std::max_element(map_values.begin(), map_values.end());
40  max_size = std::max(max_size, (unsigned int)mapping.size());
41  definitions.resize(max_size);
42 
43  for (const auto &name : names) {
44  if (mapping.find(name) != mapping.end()) {
47  } else {
48  edm::LogError("HistDefinition::readHistDefinitions")
49  << "Could not find histogram definition for '" << name << "'" << std::endl;
50  }
51  }
52  return definitions;
53  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::vector< HistDefinition > HistDefinitions
Log< level::Error, false > LogError
const std::string names[nVars_]
std::vector< std::string > getParameterNames() const

◆ s_filler__LINE__() [1/2]

static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker<edm::ParameterSetDescriptionFiller< L1TEfficiencyHarvesting > > dqmoffline::l1t::s_filler__LINE__ ( "L1TEfficiencyHarvesting"  )
static

◆ s_filler__LINE__() [2/2]

static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker<edm::ParameterSetDescriptionFiller< L1TDiffHarvesting > > dqmoffline::l1t::s_filler__LINE__ ( "L1TDiffHarvesting"  )
static

◆ s_maker__LINE__() [1/2]

static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< L1TEfficiencyHarvesting > > dqmoffline::l1t::s_maker__LINE__ ( "L1TEfficiencyHarvesting"  )
static

◆ s_maker__LINE__() [2/2]

static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< L1TDiffHarvesting > > dqmoffline::l1t::s_maker__LINE__ ( "L1TDiffHarvesting"  )
static