38 m_l1GtObjectMapTag(pset.getParameter<edm::InputTag>(
"L1GtObjectMapTag")),
39 m_l1GtObjectMapsTag(pset.getParameter<edm::InputTag>(
"L1GtObjectMapsTag")),
40 verbose_(pset.getUntrackedParameter<bool>(
"verbose",
false))
64 ex <<
"Could not find L1 trigger names ParameterSet in the registry";
65 ex.
addContext(
"Calling CompareToObjectMapRecord::analyze");
70 std::vector<int> algoBitNumbers1;
71 std::vector<L1GlobalTriggerObjectMap>
const& vectorInRecord = gtObjectMapRecord->gtObjectMap();
72 algoBitNumbers1.reserve(vectorInRecord.size());
73 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator
i = vectorInRecord.begin(),
74 iEnd = vectorInRecord.end();
76 algoBitNumbers1.push_back(
i->algoBitNumber());
84 std::vector<int> algoBitNumbers2;
85 gtObjectMaps->getAlgorithmBitNumbers(algoBitNumbers2);
86 if (algoBitNumbers1 != algoBitNumbers2) {
88 ex <<
"Algorithm bit numbers do not match";
89 ex.
addContext(
"Calling CompareToObjectMapRecord::analyze");
94 std::vector<std::string> algoNames2 = pset->
getParameter<std::vector<std::string> >(
"@algorithmNames");
99 for (
int i = 0; i < static_cast<int>(algoNames2.size()); ++
i) {
100 if (!std::binary_search(algoBitNumbers1.begin(), algoBitNumbers1.end(),
i)) {
101 if (algoNames2[
i] != std::string(
"")) {
103 ex <<
"Undefined algorithm should have empty name";
104 ex.
addContext(
"Calling CompareToObjectMapRecord::analyze");
111 for (std::vector<int>::const_iterator iBit = algoBitNumbers1.begin(), endBits = algoBitNumbers1.end();
112 iBit != endBits; ++iBit) {
115 std::string algoName1 = objMap->
algoName();
117 if (algoName1 != algoNames2.at(*iBit)) {
119 ex <<
"Algorithm names do not match";
120 ex.
addContext(
"Calling CompareToObjectMapRecord::analyze");
125 if (objMap->
algoGtlResult() != gtObjectMaps->algorithmResult(*iBit)) {
127 ex <<
"Algorithm results do not match";
128 ex.
addContext(
"Calling CompareToObjectMapRecord::analyze");
132 std::vector<L1GtLogicParser::OperandToken>
const& operandTokens1 =
136 if (conditions2.
nConditions() != operandTokens1.size()) {
138 ex <<
"Number of conditions does not match";
139 ex.
addContext(
"Calling CompareToObjectMapRecord::analyze");
143 std::vector<std::string> conditionNames2;
144 conditionNames2 = pset->
getParameter<std::vector<std::string> >(algoNames2.at(*iBit));
149 <<
" " << algoNames2[*iBit]
150 <<
" " << gtObjectMaps->algorithmResult(*iBit) <<
"\n";
152 for (
unsigned j = 0;
j < gtObjectMaps->getNumberOfConditions(*iBit); ++
j) {
155 <<
" " << conditionNames2[
j]
169 unsigned iCondition = 0;
170 for (std::vector<L1GtLogicParser::OperandToken>::const_iterator iToken1 = operandTokens1.begin(),
171 endTokens1 = operandTokens1.end();
172 iToken1 != endTokens1;
173 ++iToken1, ++iCondition) {
176 if (iToken1->tokenNumber != static_cast<int>(iCondition)) {
178 ex <<
"Token numbers not sequential";
179 ex.
addContext(
"Calling CompareToObjectMapRecord::analyze");
186 ex <<
"Condition results do not match";
187 ex.
addContext(
"Calling CompareToObjectMapRecord::analyze");
192 if (iToken1->tokenName != conditionNames2.at(iCondition)) {
194 ex <<
"Condition names do not match";
195 ex.
addContext(
"Calling CompareToObjectMapRecord::analyze");
201 gtObjectMaps->getCombinationsInCondition(*iBit, iCondition);
204 if (combinations1->size() != combinations2.
nCombinations()) {
206 ex <<
"The number of combinations in a condition does not match";
207 ex.
addContext(
"Calling CompareToObjectMapRecord::analyze");
211 for (CombinationsInCond::const_iterator iCombo = combinations1->begin(),
212 endCombos = combinations1->end();
213 iCombo != endCombos; ++iCombo) {
216 ex <<
"The number of indexes in a combination does not match";
217 ex.
addContext(
"Calling CompareToObjectMapRecord::analyze");
221 for (std::vector<int>::const_iterator iIndex = iCombo->begin(),
222 endIndexes = iCombo->end();
223 iIndex != endIndexes; ++iIndex) {
225 if (*iIndex != combinations2.
getObjectIndex(iCombo - combinations1->begin(), iIndex - iCombo->begin())) {
227 ex <<
"Object index does not match";
228 ex.
addContext(
"Calling CompareToObjectMapRecord::analyze");
T getParameter(std::string const &) const
unsigned char getObjectIndex(unsigned combination, unsigned object) const
const std::vector< L1GtLogicParser::OperandToken > & operandTokenVector() const
unsigned short nObjectsPerCombination() const
edm::InputTag m_l1GtObjectMapTag
static ThreadSafeRegistry * instance()
bool algoGtlResult() const
const std::string & algoName() const
get / set name for algorithm in the object map
bool getMapped(key_type const &k, value_type &result) const
const CombinationsInCond * getCombinationsInCond(const std::string &condNameVal) const
return all the combinations passing the requirements imposed in condition condNameVal ...
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
unsigned nConditions() const
CompareToObjectMapRecord(const edm::ParameterSet &pset)
unsigned nCombinations() const
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
virtual void analyze(edm::Event const &event, edm::EventSetup const &es)
void addContext(std::string const &context)
edm::InputTag m_l1GtObjectMapsTag
bool getConditionResult(unsigned condition) const
std::vector< SingleCombInCond > CombinationsInCond
all the object combinations evaluated to true in the condition
~CompareToObjectMapRecord()