37 m_l1GtObjectMapTag(pset.getParameter<edm::InputTag>(
"L1GtObjectMapTag")) {
39 produces<L1GlobalTriggerObjectMaps>();
52 if (!gtObjectMapRecord.
isValid()) {
60 std::vector<int> algoBitNumbers;
61 std::vector<L1GlobalTriggerObjectMap>
const& vectorInRecord = gtObjectMapRecord->gtObjectMap();
62 algoBitNumbers.reserve(vectorInRecord.size());
63 for (std::vector<L1GlobalTriggerObjectMap>::const_iterator
i = vectorInRecord.begin(),
64 iEnd = vectorInRecord.end();
66 algoBitNumbers.push_back(
i->algoBitNumber());
70 gtObjectMaps->reserveForAlgorithms(algoBitNumbers.size());
72 if (!algoBitNumbers.empty() && algoBitNumbers[0] < 0) {
74 ex <<
"Negative algorithm bit number";
75 ex.
addContext(
"Calling ConvertObjectMapRecord::produce");
79 unsigned sizeOfNamesVector = 0;
80 if (!algoBitNumbers.empty()) {
81 sizeOfNamesVector =
static_cast<unsigned>(algoBitNumbers.back()) + 1;
83 std::vector<std::string> savedNames(sizeOfNamesVector);
88 unsigned startIndexOfConditions = 0;
89 unsigned nIndexes = 0;
91 for (std::vector<int>::const_iterator iBit = algoBitNumbers.begin(), endBits = algoBitNumbers.end();
92 iBit != endBits; ++iBit) {
95 gtObjectMaps->pushBackAlgorithm(startIndexOfConditions,
99 savedNames.at(static_cast<unsigned>(*iBit)) = objMap->
algoName();
101 std::vector<L1GtLogicParser::OperandToken>
const& operandTokens =
104 startIndexOfConditions += operandTokens.size();
106 int tokenCounter = 0;
107 for (std::vector<L1GtLogicParser::OperandToken>::const_iterator iToken = operandTokens.begin(),
108 endTokens = operandTokens.end();
110 ++iToken, ++tokenCounter) {
112 if (tokenCounter != iToken->tokenNumber) {
114 ex <<
"Token numbers not sequential";
115 ex.
addContext(
"Calling ConvertObjectMapRecord::produce");
120 for (CombinationsInCond::const_iterator iCombo = combos->begin(),
121 endCombos = combos->end();
122 iCombo != endCombos; ++iCombo) {
123 for (std::vector<int>::const_iterator iIndex = iCombo->begin(),
124 endIndexes = iCombo->end();
125 iIndex != endIndexes; ++iIndex) {
131 gtObjectMaps->reserveForConditions(startIndexOfConditions);
132 gtObjectMaps->reserveForObjectIndexes(nIndexes);
135 namesPset.
addParameter<std::vector<std::string> >(std::string(
"@algorithmNames"), savedNames);
139 unsigned startIndexOfCombinations = 0;
140 for (std::vector<int>::const_iterator iBit = algoBitNumbers.begin(), endBits = algoBitNumbers.end();
141 iBit != endBits; ++iBit) {
144 std::vector<L1GtLogicParser::OperandToken>
const& operandTokens =
148 if (savedNames.capacity() < operandTokens.size()) {
149 savedNames.reserve(operandTokens.size());
152 for (std::vector<L1GtLogicParser::OperandToken>::const_iterator iToken = operandTokens.begin(),
153 endTokens = operandTokens.end();
154 iToken != endTokens; ++iToken) {
156 savedNames.push_back(iToken->tokenName);
158 unsigned short nObjectsPerCombination = 0;
160 unsigned nIndexesInCombination = 0;
163 for (CombinationsInCond::const_iterator iCombo = combos->begin(),
164 endCombos = combos->end();
165 iCombo != endCombos; ++iCombo) {
169 ex <<
"Number of objects per combination out of range";
170 ex.
addContext(
"Calling ConvertObjectMapRecord::produce");
173 nObjectsPerCombination = iCombo->size();
176 if (nObjectsPerCombination != iCombo->size()) {
178 ex <<
"inconsistent number of objects per condition";
179 ex.
addContext(
"Calling ConvertObjectMapRecord::produce");
184 for (std::vector<int>::const_iterator iIndex = iCombo->begin(),
185 endIndexes = iCombo->end();
186 iIndex != endIndexes; ++iIndex) {
190 ex <<
"object index too large, out of range";
191 ex.
addContext(
"Calling ConvertObjectMapRecord::produce");
194 gtObjectMaps->pushBackObjectIndex(*iIndex);
195 ++nIndexesInCombination;
198 gtObjectMaps->pushBackCondition(startIndexOfCombinations,
199 nObjectsPerCombination,
200 iToken->tokenResult);
201 startIndexOfCombinations += nIndexesInCombination;
206 gtObjectMaps->setNamesParameterSetID(namesPset.
id());
208 gtObjectMaps->consistencyCheck();
209 event.put(gtObjectMaps);
ParameterSetID id() const
const std::vector< L1GtLogicParser::OperandToken > & operandTokenVector() const
bool algoGtlResult() const
ConvertObjectMapRecord(const edm::ParameterSet &pset)
const std::string & algoName() const
get / set name for algorithm in the object map
const T & max(const T &a, const T &b)
const CombinationsInCond * getCombinationsInCond(const std::string &condNameVal) const
return all the combinations passing the requirements imposed in condition condNameVal ...
void addParameter(std::string const &name, T const &value)
~ConvertObjectMapRecord()
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
virtual void produce(edm::Event &event, const edm::EventSetup &es)
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
void addContext(std::string const &context)
int algoBitNumber() const
get / set bit number for algorithm in the object map
std::vector< SingleCombInCond > CombinationsInCond
all the object combinations evaluated to true in the condition
ParameterSet const & registerIt()
edm::InputTag m_l1GtObjectMapTag