CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
HLTSeedL1LogicScalers Class Reference

#include <HLTSeedL1LogicScalers.h>

Inheritance diagram for HLTSeedL1LogicScalers:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 HLTSeedL1LogicScalers (const edm::ParameterSet &)
 
 ~HLTSeedL1LogicScalers ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
bool analyzeL1GtUtils (const edm::Event &, const edm::EventSetup &, const std::string &)
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (const edm::Run &run, const edm::EventSetup &c)
 

Private Attributes

std::string fDQMFolder
 
HLTConfigProvider fHLTConfig
 
bool fL1BeforeMask
 
edm::InputTag fL1GtDaqReadoutRecordInputTag
 
edm::InputTag fL1GtRecordInputTag
 
std::vector< std::pair
< MonitorElement
*, std::vector< std::string > > > 
fMapMEL1Algos
 
std::vector< std::string > fMonitorPaths
 
std::vector< MonitorElement * > fMonitorPathsME
 
std::string fProcessname
 
L1GtUtils m_l1GtUtils
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

DQM/HLTSeedL1LogicScalers/src/HLTSeedL1LogicScalers.cc

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 46 of file HLTSeedL1LogicScalers.h.

Constructor & Destructor Documentation

HLTSeedL1LogicScalers::HLTSeedL1LogicScalers ( const edm::ParameterSet iConfig)
explicit

Definition at line 17 of file HLTSeedL1LogicScalers.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), LogDebug, and AlCaHLTBitMon_QueryRunRegistry::string.

17  {
18  // now do what ever initialization is needed
19  LogDebug("HLTSeedL1LogicScalers") << "constructor";
20 
21  // get untracked parameters
23  fL1BeforeMask = iConfig.getParameter<bool>("l1BeforeMask");
24  fProcessname = iConfig.getParameter<std::string>("processname");
25 
26  // input tag for GT DAQ product
28  iConfig.getParameter<edm::InputTag>("L1GtDaqReadoutRecordInputTag");
29 
30  // input tag for GT lite product
32  iConfig.getParameter<edm::InputTag>("L1GtRecordInputTag");
33 
34  // get untracked parameters
36  "DQMFolder", string("HLT/HLTSeedL1LogicScalers/HLT_LogicL1"));
38  iConfig.getUntrackedParameter<std::vector<std::string> >("monitorPaths");
39 }
#define LogDebug(id)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag fL1GtDaqReadoutRecordInputTag
std::vector< std::string > fMonitorPaths
HLTSeedL1LogicScalers::~HLTSeedL1LogicScalers ( )

Definition at line 41 of file HLTSeedL1LogicScalers.cc.

41 {}

Member Function Documentation

void HLTSeedL1LogicScalers::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::stream::EDAnalyzerBase.

Definition at line 148 of file HLTSeedL1LogicScalers.cc.

References MonitorElement::Fill(), MonitorElement::getName(), i, j, LogDebug, and LogTrace.

149  {
150  LogDebug("HLTSeedL1LogicScalers") << "HLTSeedL1LogicScalers::analyze event ";
151 
152  // before accessing any result from L1GtUtils, one must retrieve and cache
153  // the L1 trigger event setup
154  // add this call in the analyze / produce / filter method of your
155  // analyzer / producer / filter
156 
158 
159  // loop over maps of ME-L1Algos
160  for (unsigned int i = 0; i < fMapMEL1Algos.size(); i++) {
161  MonitorElement* me = fMapMEL1Algos[i].first;
162  LogTrace("HLTSeedL1LogicScalers") << "ME = " << me->getName() << endl;
163 
164  const vector<string>& l1Algos = fMapMEL1Algos[i].second;
165 
166  // word to bit-pack decisions of l1Algos
167  unsigned int myL1Word = 0;
168 
169  // loop over l1Algos
170  for (unsigned int j = 0; j < l1Algos.size(); j++) {
171  // check if this l1Algo passed
172  bool l1Pass = analyzeL1GtUtils(iEvent, iSetup, l1Algos[j]);
173  LogTrace("HLTSeedL1LogicScalers") << "l1Algo = " << l1Algos[j]
174  << " l1Pass = " << l1Pass << endl;
175  if (l1Pass) {
176  // bit-wise pack
177  myL1Word |= (1 << j);
178  }
179  }
180  me->Fill(myL1Word);
181  } // end for i maps
182 }
#define LogDebug(id)
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
bool analyzeL1GtUtils(const edm::Event &, const edm::EventSetup &, const std::string &)
std::vector< std::pair< MonitorElement *, std::vector< std::string > > > fMapMEL1Algos
void Fill(long long x)
int j
Definition: DBlmapReader.cc:9
void retrieveL1EventSetup(const edm::EventSetup &)
retrieve all the relevant L1 trigger event setup records and cache them to improve the speed ...
Definition: L1GtUtils.cc:112
#define LogTrace(id)
bool HLTSeedL1LogicScalers::analyzeL1GtUtils ( const edm::Event ,
const edm::EventSetup ,
const std::string &   
)
private

Definition at line 184 of file HLTSeedL1LogicScalers.cc.

References LogTrace.

186  {
187  LogTrace("HLTSeedL1LogicScalers") << "analyzeL1GtUtils..." << endl;
188 
189  // access L1 trigger results using public methods from L1GtUtils
190  // always check on error code returned by that method
191 
192  int iErrorCode = -1;
193 
194  LogTrace("HLTSeedL1LogicScalers") << "l1AlgoName = " << l1AlgoName << endl;
195 
196  bool decisionAlgTechTrig = false;
197 
198  // check flag L1BeforeMask
199  if (fL1BeforeMask) {
200  decisionAlgTechTrig = m_l1GtUtils.decisionBeforeMask(
202  iErrorCode);
203  } else {
204  decisionAlgTechTrig = m_l1GtUtils.decisionAfterMask(
206  iErrorCode);
207  }
208 
209  LogTrace("HLTSeedL1LogicScalers")
210  << "bool L1BeforeMask = " << fL1BeforeMask
211  << " decisionAlgTechTrig = " << decisionAlgTechTrig << endl;
212 
213  if (iErrorCode == 0) {
214  return decisionAlgTechTrig;
215  } else if (iErrorCode == 1) {
216  // algorithm / technical trigger does not exist in the L1 menu
217  LogWarning("HLTSeedL1LogicScalers")
218  << "L1 algorithm " << l1AlgoName
219  << " not in L1 menu, but HLTConfigProvider found it in "
220  "L1SeedsLogicalExpression of at least one HLT path of the HLT menu."
221  << endl;
222  return false;
223  } else {
224  // error - see error code
225  // do whatever needed
226  return false;
227  }
228  return false;
229 }
const bool decisionAfterMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision after trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1534
const bool decisionBeforeMask(const edm::Event &iEvent, const edm::InputTag &l1GtRecordInputTag, const edm::InputTag &l1GtReadoutRecordInputTag, const std::string &nameAlgoTechTrig, int &errorCode) const
return decision before trigger mask for a given algorithm or technical trigger
Definition: L1GtUtils.cc:1497
int iEvent
Definition: GenABIO.cc:230
#define LogTrace(id)
edm::InputTag fL1GtDaqReadoutRecordInputTag
void HLTSeedL1LogicScalers::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 60 of file HLTSeedL1LogicScalers.cc.

References DQMStore::IBooker::book1D(), edm::first(), relval_steps::k, LogTrace, mergeVDriftHistosByStation::name, edm::second(), MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), and indexGen::title.

62  {
63  // book histos for L1 logic of specificified HLT paths
64  LogTrace("HLTSeedL1LogicScalers")
65  << "size of vector of paths to monitor = " << fMonitorPaths.size()
66  << endl;
67  for (unsigned int iPath = 0; iPath < fMonitorPaths.size(); iPath++) {
68  string monPath = fMonitorPaths[iPath];
69  LogTrace("HLTSeedL1LogicScalers") << "monPath = " << monPath << endl;
70 
71  string folderName = fDQMFolder + "/" + monPath;
72  iBooker.setCurrentFolder(folderName);
73 
74  // do nothing if monPath is not in the HLT menu
75  if (fHLTConfig.triggerIndex(monPath) == fHLTConfig.size()) continue;
76  // get L1SeedLogicalExpression of this path
77  vector<pair<bool, string> > hltL1GTSeed = fHLTConfig.hltL1GTSeeds(monPath);
78  LogTrace("HLTSeedL1LogicScalers")
79  << endl << "size of vector of GTSeedL1LogicalExpression = "
80  << hltL1GTSeed.size() << endl;
81 
82  // each GT Seed of each path contains l1Algos
83  for (unsigned int iSeed = 0; iSeed < hltL1GTSeed.size(); iSeed++) {
84  LogTrace("HLTSeedL1LogicScalers")
85  << " TechBit_flag = " << hltL1GTSeed[iSeed].first
86  << " GTSeedL1LogicalExpression = " << hltL1GTSeed[iSeed].second
87  << endl;
88 
89  istringstream totalSString(hltL1GTSeed[iSeed].second);
90  string temp_string;
91 
92  vector<string> l1Algos;
93 
94  // only if not TechBit flag
95  while (!hltL1GTSeed[iSeed].first) {
96  totalSString >> temp_string;
97 
98  if (!l1Algos.empty()) {
99  if (temp_string.compare(l1Algos.back()) == 0) break;
100  }
101  if (temp_string != "OR" && temp_string != "AND" &&
102  temp_string != "NOT" && temp_string != "(" && temp_string != ")" &&
103  temp_string != "") {
104  l1Algos.push_back(temp_string);
105  }
106  }
107 
108  int nL1Algo = l1Algos.size();
109 
110  // put an upper limit on the size of l1Algos
111  if (nL1Algo > 32) {
112  LogWarning("HLTSeedL1LogicScalers")
113  << " number of l1 Algos grater than 32. Using only the first 32."
114  << endl;
115  l1Algos.resize(32);
116  }
117  int nBins = 1 << nL1Algo;
118 
119  for (unsigned int k = 0; k < l1Algos.size(); k++) {
120  LogTrace("HLTSeedL1LogicScalers") << " l1 Algo = " << l1Algos[k]
121  << endl;
122  } // end for k
123 
124  std::stringstream title;
125  std::stringstream name;
126 
127  name << monPath << "_Seed_" << iSeed << "_L1BitLogic";
128  title << monPath << " BitPacked L1Algos of GTSeed " << iSeed << ": '"
129  << hltL1GTSeed[iSeed].second << "'";
130 
131  LogTrace("HLTSeedL1LogicScalers") << " MonitorElement name = " << name
132  << endl;
133  LogTrace("HLTSeedL1LogicScalers") << " MonitorElement title = " << title
134  << endl;
135  LogTrace("HLTSeedL1LogicScalers") << " MonitorElement nBins = " << nBins
136  << endl << endl;
137 
138  MonitorElement* me = iBooker.book1D(name.str().c_str(), title.str().c_str(),
139  nBins, 0, nBins);
140  me->setAxisTitle("bit-packed word L1 Algorithms");
141  fMonitorPathsME.push_back(me);
142 
143  fMapMEL1Algos.push_back(make_pair(me, l1Algos));
144  } // end for Seeds
145  } // end for monitoring paths
146 }
unsigned int size() const
number of trigger paths in trigger table
const std::vector< std::vector< std::pair< bool, std::string > > > & hltL1GTSeeds() const
std::vector< std::pair< MonitorElement *, std::vector< std::string > > > fMapMEL1Algos
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
U second(std::pair< T, U > const &p)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
#define LogTrace(id)
HLTConfigProvider fHLTConfig
std::vector< std::string > fMonitorPaths
std::vector< MonitorElement * > fMonitorPathsME
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void HLTSeedL1LogicScalers::dqmBeginRun ( const edm::Run run,
const edm::EventSetup c 
)
privatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 43 of file HLTSeedL1LogicScalers.cc.

References j, LogDebug, LogTrace, and gen::n.

44  {
45  // HLT config does not change within runs!
46  bool changed = false;
47  if (!fHLTConfig.init(run, iSetup, fProcessname, changed)) {
48  LogDebug("HLTSeedL1LogicScalers")
49  << "HLTConfigProvider failed to initialize.";
50  return;
51  }
52 
53  const unsigned int n(fHLTConfig.size());
54  for (unsigned int j = 0; j != n; ++j) {
55  LogTrace("HLTSeedL1LogicScalers") << "HLTConfig path "
56  << fHLTConfig.triggerName(j) << endl;
57  }
58 }
#define LogDebug(id)
unsigned int size() const
number of trigger paths in trigger table
const std::string & triggerName(unsigned int triggerIndex) const
int j
Definition: DBlmapReader.cc:9
#define LogTrace(id)
HLTConfigProvider fHLTConfig
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor

Member Data Documentation

std::string HLTSeedL1LogicScalers::fDQMFolder
private

Definition at line 62 of file HLTSeedL1LogicScalers.h.

HLTConfigProvider HLTSeedL1LogicScalers::fHLTConfig
private

Definition at line 67 of file HLTSeedL1LogicScalers.h.

bool HLTSeedL1LogicScalers::fL1BeforeMask
private

Definition at line 61 of file HLTSeedL1LogicScalers.h.

edm::InputTag HLTSeedL1LogicScalers::fL1GtDaqReadoutRecordInputTag
private

Definition at line 68 of file HLTSeedL1LogicScalers.h.

edm::InputTag HLTSeedL1LogicScalers::fL1GtRecordInputTag
private

Definition at line 69 of file HLTSeedL1LogicScalers.h.

std::vector<std::pair<MonitorElement*, std::vector<std::string> > > HLTSeedL1LogicScalers::fMapMEL1Algos
private

Definition at line 74 of file HLTSeedL1LogicScalers.h.

std::vector<std::string> HLTSeedL1LogicScalers::fMonitorPaths
private

Definition at line 71 of file HLTSeedL1LogicScalers.h.

std::vector<MonitorElement*> HLTSeedL1LogicScalers::fMonitorPathsME
private

Definition at line 72 of file HLTSeedL1LogicScalers.h.

std::string HLTSeedL1LogicScalers::fProcessname
private

Definition at line 63 of file HLTSeedL1LogicScalers.h.

L1GtUtils HLTSeedL1LogicScalers::m_l1GtUtils
private

Definition at line 65 of file HLTSeedL1LogicScalers.h.