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

Definition at line 51 of file HistDefinition.h.

Definition at line 67 of file L1TEfficiencyHarvesting.h.

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

Definition at line 8 of file HistDefinition.cc.

Function Documentation

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 22 of file L1TFillWithinLimits.cc.

References MonitorElement::Fill(), getFillValueWithinLimits(), MonitorElement::getTH2F(), and create_public_lumi_plots::hist.

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

23 {
24  TH1 * hist = mon->getTH2F();
25  double minX(hist->GetXaxis()->GetXmin());
26  double minY(hist->GetYaxis()->GetXmin());
27 
28  double maxX(hist->GetXaxis()->GetXmax());
29  double maxY(hist->GetYaxis()->GetXmax());
30 
31  double fillValueX = getFillValueWithinLimits(valueX, minX, maxX);
32  double fillValueY = getFillValueWithinLimits(valueY, minY, maxY);
33  mon->Fill(fillValueX, fillValueY, weight);
34 
35 }
double getFillValueWithinLimits(double value, double min, double max)
Definition: weight.py:1
void Fill(long long x)
TH2F * getTH2F() const
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 MonitorElement::Fill(), getFillValueWithinLimits(), MonitorElement::getTH1F(), create_public_lumi_plots::hist, SiStripPI::max, and min().

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

13 {
14  TH1 * hist = mon->getTH1F();
15  double min(hist->GetXaxis()->GetXmin());
16  double max(hist->GetXaxis()->GetXmax());
17 
18  double fillValue = getFillValueWithinLimits(value, min, max);
19  mon->Fill(fillValue, weight);
20 
21 }
double getFillValueWithinLimits(double value, double min, double max)
TH1F * getTH1F() const
Definition: weight.py:1
void Fill(long long x)
Definition: value.py:1
T min(T a, T b)
Definition: MathUtil.h:58
double dqmoffline::l1t::getFillValueWithinLimits ( double  value,
double  min,
double  max 
)

Definition at line 37 of file L1TFillWithinLimits.cc.

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

Referenced by fill2DWithinLimits(), and fillWithinLimits().

38 {
39  if (value < min)
40  return min;
41 
42  // histograms are [min, max), hence fill with a slightly smaller value
43  if (value > max)
44  return max - 1e-6 * max;
45 
46  return value;
47 }
Definition: value.py:1
T min(T a, T b)
Definition: MathUtil.h:58
std::vector< unsigned int > dqmoffline::l1t::getFiredTriggerIndices ( const std::vector< unsigned int > &  triggers,
const std::vector< bool > &  triggerResults 
)

Definition at line 57 of file L1TCommon.cc.

References mps_fire::i.

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

58  {
59  std::vector<unsigned int> results;
60  // std::copy_if instead?
61  for (unsigned int i = 0; i < triggerResults.size(); ++i) {
62  if (triggerResults[i]) {
63  results.push_back(triggers[i]);
64  }
65  }
66  return results;
67 }
static std::string const triggerResults
Definition: EdmProvDump.cc:45
std::vector< edm::InputTag > dqmoffline::l1t::getHLTFilters ( const std::vector< unsigned int > &  triggers,
const HLTConfigProvider hltConfig,
const std::string  triggerProcess 
)

Definition at line 106 of file L1TCommon.cc.

References HLTConfigProvider::moduleLabels(), electrons_cff::modules, HLTConfigProvider::size(), and AlCaHLTBitMon_QueryRunRegistry::string.

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

108  {
109  std::vector<edm::InputTag> results;
110  for (auto trigger : triggers) {
111  unsigned int hltIndexOffset(2);
112  unsigned int moduleIndex = hltConfig.size(trigger) - hltIndexOffset;
113  const std::vector<std::string> modules(hltConfig.moduleLabels(trigger));
114  std::string module(modules[moduleIndex]);
115  edm::InputTag filterInputTag = edm::InputTag(module, "", triggerProcess);
116  results.push_back(filterInputTag);
117  }
118  return results;
119 }
unsigned int size() const
number of trigger paths in trigger table
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
Definition: vlib.h:208
trigger::TriggerObjectCollection dqmoffline::l1t::getMatchedTriggerObjects ( double  eta,
double  phi,
double  maxDeltaR,
const trigger::TriggerObjectCollection  triggerObjects 
)

Definition at line 121 of file L1TCommon.cc.

References boostedElectronIsolation_cff::deltaR, PVValHelper::eta, electrons_cff::maxDeltaR, and hgcalPlots::obj.

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

123  {
125  typedef trigger::TriggerObject trigObj;
126  std::copy_if(triggerObjects.begin(), triggerObjects.end(),
127  std::back_inserter(results),
128  [eta, phi, maxDeltaR](const trigObj &obj) {
129  return deltaR(obj.eta(), obj.phi(), eta, phi) < maxDeltaR;
130  });
131  return results;
132 }
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:22
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:81
std::vector< unsigned int > dqmoffline::l1t::getTriggerIndices ( const std::vector< std::string > &  requestedTriggers,
const std::vector< std::string > &  triggersInEvent 
)

Definition at line 11 of file L1TCommon.cc.

References dataset::name, and AlCaHLTBitMon_QueryRunRegistry::string.

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

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

Definition at line 80 of file L1TCommon.cc.

References ALCARECOTkAlBeamHalo_cff::filter, trigger::TriggerEvent::filterIds(), trigger::TriggerEvent::filterIndex(), trigger::TriggerEvent::filterKeys(), trigger::TriggerEvent::getObjects(), mps_fire::i, trigger::TriggerEvent::sizeFilters(), and TriggerAnalyzer::triggerObjects.

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

81  {
84 
85  for (auto filter : hltFilters) {
86  const unsigned filterIndex = triggerEvent.filterIndex(filter);
87 
88  if (filterIndex < triggerEvent.sizeFilters()) {
89  const trigger::Keys triggerKeys(triggerEvent.filterKeys(filterIndex));
90  const size_t nTriggers = triggerEvent.filterIds(filterIndex).size();
91  for (size_t i = 0; i < nTriggers; ++i) {
92  results.push_back(triggerObjects[triggerKeys[i]]);
93  }
94  }
95  }
96  // sort by ET
97  typedef trigger::TriggerObject trigObj;
98  std::sort(results.begin(), results.end(),
99  [](const trigObj &obj1, const trigObj &obj2) {
100  return obj1.et() > obj2.et();
101  });
102  return results;
103 }
trigger::size_type sizeFilters() const
Definition: TriggerEvent.h:135
const Keys & filterKeys(trigger::size_type index) const
Definition: TriggerEvent.h:111
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
Definition: TriggerEvent.h:123
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:22
const Vids & filterIds(trigger::size_type index) const
Definition: TriggerEvent.h:110
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:98
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:81
std::vector< size_type > Keys
std::vector< bool > dqmoffline::l1t::getTriggerResults ( const std::vector< unsigned int > &  triggers,
const edm::TriggerResults triggerResults 
)

Definition at line 35 of file L1TCommon.cc.

References edm::HLTGlobalStatus::accept(), and edm::HLTGlobalStatus::size().

Referenced by L1TStage2CaloLayer2Offline::doesNotOverlapWithHLTObjects(), evf::EvFOutputModule::endRun(), L1TEGammaOffline::matchesAnHLTObject(), passesAnyTriggerFromList(), and edm::OutputModule::wantAllEvents().

36  {
37  std::vector<bool> results;
38  results.resize(triggers.size());
39 
40  for (unsigned int index = 0; index < triggers.size(); ++index) {
41 
42  if (triggers[index] >= triggerResults.size()) {
43  results[index] = false;
44  continue;
45  }
46 
47  if (triggerResults.accept(triggers[index])) {
48  results[index] = true;
49  } else {
50  results[index] = false;
51  }
52  }
53  return results;
54 }
bool accept() const
Has at least one path accepted the event?
unsigned int size() const
Get number of paths stored.
bool dqmoffline::l1t::passesAnyTriggerFromList ( const std::vector< unsigned int > &  triggers,
const edm::TriggerResults triggerResults 
)

Definition at line 69 of file L1TCommon.cc.

References KineDebug3::count(), and getTriggerResults().

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

70  {
71  std::vector<bool> results =
72  dqmoffline::l1t::getTriggerResults(triggers, triggerResults);
73  if (std::count(results.begin(), results.end(), true) == 0) {
74  return false;
75  }
76  return true;
77 }
std::vector< bool > getTriggerResults(const std::vector< unsigned int > &triggers, const edm::TriggerResults &triggerResults)
Definition: L1TCommon.cc:35
HistDefinitions dqmoffline::l1t::readHistDefinitions ( const edm::ParameterSet ps,
const std::map< std::string, unsigned int > &  mapping 
)

Definition at line 45 of file HistDefinition.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNames(), dqmoffline::l1t::HistDefinition::HistDefinition(), SiStripPI::max, dqmoffline::l1t::HistDefinition::name, and names.

46  {
48  std::vector<std::string> names = ps.getParameterNames();
49  std::vector<unsigned int> map_values;
50 
51  for (auto const &imap : mapping) {
52  map_values.push_back(imap.second);
53  }
54  unsigned int max_size = *std::max_element(map_values.begin(), map_values.end());
55  max_size = std::max(max_size, (unsigned int) mapping.size());
56  definitions.resize(max_size);
57 
58  for (auto name : names) {
59  if (mapping.find(name) != mapping.end()) {
61  definitions[mapping.at(name)] = HistDefinition(hd);
62  } else {
63  edm::LogError("HistDefinition::readHistDefinitions")
64  << "Could not find histogram definition for '" << name << "'"
65  << std::endl;
66  }
67  }
68  return definitions;
69 }
T getParameter(std::string const &) const
std::vector< HistDefinition > HistDefinitions
const std::string names[nVars_]
std::vector< std::string > getParameterNames() const
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker<edm::ParameterSetDescriptionFiller< L1TEfficiencyHarvesting > > dqmoffline::l1t::s_filler__LINE__ ( "L1TEfficiencyHarvesting"  )
static
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker<edm::ParameterSetDescriptionFiller< L1TDiffHarvesting > > dqmoffline::l1t::s_filler__LINE__ ( "L1TDiffHarvesting"  )
static
static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< L1TEfficiencyHarvesting > > dqmoffline::l1t::s_maker__LINE__ ( "L1TEfficiencyHarvesting"  )
static
static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< L1TDiffHarvesting > > dqmoffline::l1t::s_maker__LINE__ ( "L1TDiffHarvesting"  )
static