CMS 3D CMS Logo

TriggerVariables.h
Go to the documentation of this file.
2 
4 
6 public:
8  : VariableComputer(arg, iC) {
10  edm::Service<InputTagDistributorService>()->retrieve("src", arg.iConfig));
11  for (int i = 0; i != 128; i++) {
12  std::stringstream ss;
13  ss << i;
14  declare(ss.str(), iC);
15  }
16 
17  for (int i = 0; i != 64; i++) {
18  std::stringstream ss;
19  ss << "TechTrig_";
20  ss << i;
21  declare(ss.str(), iC);
22  }
23  }
24  ~L1BitComputer() override{};
25 
26  void compute(const edm::Event& iEvent) const override {
28  iEvent.getByToken(src_, l1Handle);
29  if (l1Handle.failedToGet())
31  const DecisionWord& dWord = l1Handle->decisionWord();
32  for (int i = 0; i != 128; i++) {
33  std::stringstream ss;
34  ss << i;
35  double r = dWord.at(i);
36  assign(ss.str(), r);
37  }
38 
39  const TechnicalTriggerWord& tTWord = l1Handle->technicalTriggerWord();
40  for (int i = 0; i != 64; i++) {
41  std::stringstream ss;
42  ss << "TechTrig_";
43  ss << i;
44  double r = tTWord.at(i);
45  assign(ss.str(), r);
46  }
47  }
48 
49 private:
51 };
52 
56 
58 public:
60  : VariableComputer(arg, iC) {
62  HLTConfigProvider provider;
63  //the function will not work anymore until a major redesign is performed. so long for HLT variables.
64  //provider.init(src_.process());
65  validTriggerNames_ = provider.triggerNames();
66  for (unsigned int iT = 0; iT != validTriggerNames_.size(); ++iT) {
67  TString tname(validTriggerNames_[iT]);
68  tname.ReplaceAll("HLT_", ""); //remove the "HLT_" prefix
69  declare(std::string(static_cast<const char*>(tname)), iC);
70  }
71  }
72  ~HLTBitComputer() override {}
73  void compute(const edm::Event& iEvent) const override {
75  iEvent.getByToken(src_, trh);
76  if (!trh.isValid())
78  const edm::TriggerNames& triggerNames = iEvent.triggerNames(*trh);
79  for (unsigned int iT = 0; iT != validTriggerNames_.size(); ++iT) {
80  TString tname(validTriggerNames_[iT]);
81  tname.ReplaceAll("HLT_", "");
82  double r = trh->accept(triggerNames.triggerIndex(validTriggerNames_[iT]));
83  assign(std::string(static_cast<const char*>(tname)), r);
84  }
85  }
86 
87 private:
89  std::vector<std::string> validTriggerNames_;
90 };
91 
93 public:
95  : CachingVariable("HLTBitVariable", arg.n, arg.iConfig, iC),
96  src_(
97  iC.consumes<edm::TriggerResults>(edm::Service<InputTagDistributorService>()->retrieve("src", arg.iConfig))),
98  bitName_(arg.n) {
99  arg.m[arg.n] = this;
100  }
103  iEvent.getByToken(src_, hltHandle);
104  if (hltHandle.failedToGet())
105  return std::make_pair(false, 0);
106  const edm::TriggerNames& trgNames = iEvent.triggerNames(*hltHandle);
107  unsigned int index = trgNames.triggerIndex(bitName_);
108  if (index == trgNames.size())
109  return std::make_pair(false, 0);
110  else
111  return std::make_pair(true, hltHandle->accept(index));
112  }
113 
114 private:
117 };
mps_fire.i
i
Definition: mps_fire.py:355
InputTagDistributorService
Definition: InputTagDistributor.h:39
HLTBitComputer::validTriggerNames_
std::vector< std::string > validTriggerNames_
Definition: TriggerVariables.h:89
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
L1BitComputer::~L1BitComputer
~L1BitComputer() override
Definition: TriggerVariables.h:24
TriggerResults.h
L1BitComputer::src_
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > src_
Definition: TriggerVariables.h:50
CachingVariable.h
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord >
edm
HLT enums.
Definition: AlignableModifier.h:19
L1BitComputer::L1BitComputer
L1BitComputer(CachingVariable::CachingVariableFactoryArg arg, edm::ConsumesCollector &iC)
Definition: TriggerVariables.h:7
HLTBitVariable::bitName_
std::string bitName_
Definition: TriggerVariables.h:116
L1BitComputer::compute
void compute(const edm::Event &iEvent) const override
Definition: TriggerVariables.h:26
CachingVariable
Definition: CachingVariable.h:40
HLTBitComputer::HLTBitComputer
HLTBitComputer(CachingVariable::CachingVariableFactoryArg arg, edm::ConsumesCollector &iC)
Definition: TriggerVariables.h:59
VariableComputer::doesNotCompute
void doesNotCompute() const
Definition: CachingVariable.cc:79
edm::Handle
Definition: AssociativeIterator.h:50
HLTBitComputer::compute
void compute(const edm::Event &iEvent) const override
Definition: TriggerVariables.h:73
L1GlobalTriggerReadoutRecord
Definition: L1GlobalTriggerReadoutRecord.h:46
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
HLTBitVariable::src_
edm::EDGetTokenT< edm::TriggerResults > src_
Definition: TriggerVariables.h:115
L1TEGammaOffline_cfi.triggerNames
triggerNames
Definition: L1TEGammaOffline_cfi.py:40
HLTBitVariable
Definition: TriggerVariables.h:92
Service
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
VariableComputer
Definition: CachingVariable.h:115
cond::persistency::GLOBAL_TAG::tname
static constexpr char const * tname
Definition: GTSchema.h:13
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
VariableComputer::assign
void assign(std::string var, double &value) const
Definition: CachingVariable.cc:66
edm::HandleBase::failedToGet
bool failedToGet() const
Definition: HandleBase.h:72
HLTBitVariable::HLTBitVariable
HLTBitVariable(CachingVariableFactoryArg arg, edm::ConsumesCollector &iC)
Definition: TriggerVariables.h:94
L1GlobalTriggerReadoutRecord::decisionWord
const DecisionWord & decisionWord(int bxInEventValue) const
Definition: L1GlobalTriggerReadoutRecord.cc:186
HLTBitComputer
Definition: TriggerVariables.h:57
edm::Service
Definition: Service.h:30
TriggerNames.h
iEvent
int iEvent
Definition: GenABIO.cc:224
HLTConfigProvider.h
VariableComputer::declare
void declare(std::string var, edm::ConsumesCollector &iC)
Definition: CachingVariable.cc:55
alignCSCRings.r
r
Definition: alignCSCRings.py:93
DecisionWord
std::vector< bool > DecisionWord
typedefs
Definition: L1GlobalTriggerReadoutSetupFwd.h:34
HLTBitComputer::~HLTBitComputer
~HLTBitComputer() override
Definition: TriggerVariables.h:72
HLTBitVariable::eval
CachingVariable::evalType eval(const edm::Event &iEvent) const override
Definition: TriggerVariables.h:101
HLTConfigProvider
Definition: HLTConfigProvider.h:28
edm::TriggerNames::size
Strings::size_type size() const
Definition: TriggerNames.cc:31
HLTBitComputer::src_
edm::EDGetTokenT< edm::TriggerResults > src_
Definition: TriggerVariables.h:88
edm::TriggerNames
Definition: TriggerNames.h:55
edm::HLTGlobalStatus::accept
bool accept() const
Has at least one path accepted the event?
Definition: HLTGlobalStatus.h:49
CachingVariable::evalType
std::pair< bool, valueType > evalType
Definition: CachingVariable.h:44
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
funct::arg
A arg
Definition: Factorize.h:36
CachingVariable::CachingVariableFactoryArg
Definition: CachingVariable.h:46
L1GlobalTriggerReadoutRecord::technicalTriggerWord
const TechnicalTriggerWord & technicalTriggerWord(int bxInEventValue) const
Definition: L1GlobalTriggerReadoutRecord.cc:212
TechnicalTriggerWord
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
Definition: L1GlobalTriggerReadoutSetupFwd.h:41
L1BitComputer
Definition: TriggerVariables.h:5
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
HLTObjectsMonitor_cfi.TriggerResults
TriggerResults
Definition: HLTObjectsMonitor_cfi.py:9
edm::Event
Definition: Event.h:73
edm::TriggerNames::triggerIndex
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:24
L1GlobalTriggerReadoutRecord.h
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
edm::TriggerResults
Definition: TriggerResults.h:35