CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Typedefs | Functions
dqmoffline::l1t Namespace Reference

Classes

class  HistDefinition
 
class  L1TDiffHarvesting
 
class  L1TEfficiencyHarvesting
 
class  L1TEfficiencyPlotHandler
 

Typedefs

typedef std::vector
< HistDefinition
HistDefinitions
 
typedef std::vector
< L1TEfficiencyPlotHandler
L1TEfficiencyPlotHandlerCollection
 
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

Definition at line 51 of file HistDefinition.h.

Definition at line 63 of file L1TEfficiencyHarvesting.h.

Definition at line 9 of file L1TFillWithinLimits.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 19 of file L1TFillWithinLimits.cc.

References dqm::impl::MonitorElement::Fill(), dqm::impl::MonitorElement::getAxisMax(), dqm::impl::MonitorElement::getAxisMin(), and getFillValueWithinLimits().

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)
virtual double getAxisMin(int axis=1) const
void Fill(long long x)
int weight
Definition: histoStyle.py:51
virtual double getAxisMax(int axis=1) 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 dqm::impl::MonitorElement::Fill(), dqm::impl::MonitorElement::getAxisMax(), dqm::impl::MonitorElement::getAxisMin(), getFillValueWithinLimits(), SiStripPI::max, and min().

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)
virtual double getAxisMin(int axis=1) const
void Fill(long long x)
T min(T a, T b)
Definition: MathUtil.h:58
int weight
Definition: histoStyle.py:51
virtual double getAxisMax(int axis=1) const
double dqmoffline::l1t::getFillValueWithinLimits ( double  value,
double  min,
double  max 
)

Definition at line 31 of file L1TFillWithinLimits.cc.

References alignCSCRings::e, SiStripPI::max, 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  }
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 54 of file L1TCommon.cc.

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

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  }
dictionary results
static std::string const triggerResults
Definition: EdmProvDump.cc:44
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 HLT_FULL_cff::InputTag, callgraph::module, HLTConfigProvider::moduleLabels(), TrackingSourceConfig_Tier0_Cosmic_cff::modules, bookConverter::results, HLTConfigProvider::size(), and AlCaHLTBitMon_QueryRunRegistry::string.

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  }
unsigned int size() const
number of trigger paths in trigger table
dictionary results
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
tuple module
Definition: callgraph.py:69
trigger::TriggerObjectCollection dqmoffline::l1t::getMatchedTriggerObjects ( double  eta,
double  phi,
double  maxDeltaR,
const trigger::TriggerObjectCollection  triggerObjects 
)

Definition at line 114 of file L1TCommon.cc.

References HLT_FULL_cff::deltaR, PVValHelper::eta, HLT_FULL_cff::maxDeltaR, getGTfromDQMFile::obj, and bookConverter::results.

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  }
dictionary results
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< 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 mergeVDriftHistosByStation::name, and AlCaHLTBitMon_QueryRunRegistry::string.

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  }
trigger::TriggerObjectCollection dqmoffline::l1t::getTriggerObjects ( const std::vector< edm::InputTag > &  hltFilters,
const trigger::TriggerEvent triggerEvent 
)

Definition at line 75 of file L1TCommon.cc.

References alcazmumu_cfi::filter, trigger::TriggerEvent::filterIds(), trigger::TriggerEvent::filterIndex(), trigger::TriggerEvent::filterKeys(), trigger::TriggerEvent::getObjects(), mps_fire::i, bookConverter::results, and trigger::TriggerEvent::sizeFilters().

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

76  {
77  trigger::TriggerObjectCollection triggerObjects = triggerEvent.getObjects();
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  }
trigger::size_type sizeFilters() const
Definition: TriggerEvent.h:146
dictionary results
const Keys & filterKeys(trigger::size_type index) const
Definition: TriggerEvent.h:118
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
Definition: TriggerEvent.h:132
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:21
const Vids & filterIds(trigger::size_type index) const
Definition: TriggerEvent.h:117
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:101
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:75
std::vector< size_type > Keys
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 edm::HLTGlobalStatus::accept(), bookConverter::results, and edm::HLTGlobalStatus::size().

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  }
dictionary results
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 66 of file L1TCommon.cc.

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

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  }
dictionary results
std::vector< bool > getTriggerResults(const std::vector< unsigned int > &triggers, const edm::TriggerResults &triggerResults)
Definition: L1TCommon.cc:34
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(), SiStripPI::max, mergeVDriftHistosByStation::name, and names.

Referenced by L1TPhase2CorrelatorOffline::L1TPhase2CorrelatorOffline().

30  {
31  HistDefinitions definitions;
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()) {
46  definitions[mapping.at(name)] = HistDefinition(hd);
47  } else {
48  edm::LogError("HistDefinition::readHistDefinitions")
49  << "Could not find histogram definition for '" << name << "'" << std::endl;
50  }
51  }
52  return definitions;
53  }
std::vector< HistDefinition > HistDefinitions
Log< level::Error, false > LogError
const std::string names[nVars_]
std::vector< std::string > getParameterNames() const
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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