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< L1TDiffHarvesting > > s_filler__LINE__ ("L1TDiffHarvesting")
 
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker< edm::ParameterSetDescriptionFiller< L1TEfficiencyHarvesting > > s_filler__LINE__ ("L1TEfficiencyHarvesting")
 
static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< L1TDiffHarvesting > > s_maker__LINE__ ("L1TDiffHarvesting")
 
static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< L1TEfficiencyHarvesting > > s_maker__LINE__ ("L1TEfficiencyHarvesting")
 

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.

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  }

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().

◆ 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.

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  }

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

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

◆ getFillValueWithinLimits()

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

Definition at line 31 of file L1TFillWithinLimits.cc.

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  }

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

Referenced by fill2DWithinLimits(), and fillWithinLimits().

◆ 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.

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  }

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

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

◆ 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.

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  }

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

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

◆ getMatchedTriggerObjects()

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

Definition at line 114 of file L1TCommon.cc.

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  }

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().

◆ 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.

11  {
12  std::vector<unsigned int> triggerIndices;
13 
14  for (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 (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  }

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

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

◆ getTriggerObjects()

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

Definition at line 75 of file L1TCommon.cc.

76  {
79 
80  for (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  }

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

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

◆ 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.

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  }

References bookConverter::results, and triggerResults.

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

◆ passesAnyTriggerFromList()

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

Definition at line 66 of file L1TCommon.cc.

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  }

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

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

◆ 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.

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

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

◆ s_filler__LINE__() [1/2]

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

◆ s_filler__LINE__() [2/2]

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

◆ s_maker__LINE__() [1/2]

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

◆ s_maker__LINE__() [2/2]

static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< L1TEfficiencyHarvesting > > dqmoffline::l1t::s_maker__LINE__ ( "L1TEfficiencyHarvesting"  )
static
mps_fire.i
i
Definition: mps_fire.py:355
LogMessageMonitor_cff.modules
modules
Definition: LogMessageMonitor_cff.py:7
triggerMatchMonitor_cfi.triggerObjects
triggerObjects
Definition: triggerMatchMonitor_cfi.py:15
min
T min(T a, T b)
Definition: MathUtil.h:58
modules
Definition: ZHLTMatchFilter.cc:17
triggerResults
static const std::string triggerResults
Definition: EdmProvDump.cc:45
L1TEGammaOffline_cfi.triggerProcess
triggerProcess
Definition: L1TEGammaOffline_cfi.py:38
bookConverter.results
results
Definition: bookConverter.py:144
HGVHistoProducerAlgoBlock_cfi.minX
minX
Definition: HGVHistoProducerAlgoBlock_cfi.py:153
names
const std::string names[nVars_]
Definition: PhotonIDValueMapProducer.cc:122
PVValHelper::eta
Definition: PVValidationHelpers.h:69
dqmoffline::l1t::getTriggerResults
std::vector< bool > getTriggerResults(const std::vector< unsigned int > &triggers, const edm::TriggerResults &triggerResults)
Definition: L1TCommon.cc:34
HistDefinition
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
trigger::TriggerObject
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:21
LaserDQM_cfi.mon
mon
Definition: LaserDQM_cfi.py:3
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
PVValHelper::phi
Definition: PVValidationHelpers.h:68
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
KineDebug3::count
void count()
Definition: KinematicConstrainedVertexUpdatorT.h:21
trigger::TriggerObjectCollection
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:75
HGVHistoProducerAlgoBlock_cfi.minY
minY
Definition: HGVHistoProducerAlgoBlock_cfi.py:158
edm::ParameterSet::getParameterNames
std::vector< std::string > getParameterNames() const
Definition: ParameterSet.cc:656
value
Definition: value.py:1
trigger::Keys
std::vector< size_type > Keys
Definition: TriggerTypeDefs.h:19
definitions
Definition: definitions.py:1
dqmoffline::l1t::getFillValueWithinLimits
double getFillValueWithinLimits(double value, double min, double max)
Definition: L1TFillWithinLimits.cc:31
module
Definition: vlib.h:198
PDWG_DiPhoton_SD_cff.triggerEvent
triggerEvent
Definition: PDWG_DiPhoton_SD_cff.py:39
dqmoffline::l1t::HistDefinitions
std::vector< HistDefinition > HistDefinitions
Definition: HistDefinition.h:51
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
ewkMuLumiMonitorDQM_cfi.maxDeltaR
maxDeltaR
Definition: ewkMuLumiMonitorDQM_cfi.py:44
relativeConstraints.value
value
Definition: relativeConstraints.py:53
HGVHistoProducerAlgoBlock_cfi.maxY
maxY
Definition: HGVHistoProducerAlgoBlock_cfi.py:159
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
HltComparatorCreateWorkflow.hltConfig
hltConfig
Definition: HltComparatorCreateWorkflow.py:161
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
trigger
Definition: HLTPrescaleTableCond.h:8
taus_updatedMVAIds_cff.mapping
mapping
Definition: taus_updatedMVAIds_cff.py:28
edm::InputTag
Definition: InputTag.h:15
weight
Definition: weight.py:1
PDWG_DiPhoton_SD_cff.triggerName
triggerName
Definition: PDWG_DiPhoton_SD_cff.py:37
HGVHistoProducerAlgoBlock_cfi.maxX
maxX
Definition: HGVHistoProducerAlgoBlock_cfi.py:154
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37