14 #include "boost/algorithm/string/trim.hpp"
33 boost::mutex::scoped_lock sl(listLock_);
37 std::string trimmedOMLabel = boost::algorithm::trim_copy(inputOMLabel);
38 if (trimmedOMLabel.empty()) {
40 <<
"Invalid INIT message: the HLT output module label is empty!"
45 bool addToList =
true;
48 if (initMsgList_.empty()) {
49 this->
add(initMsgView);
56 for (InitMsgList::iterator msgIter = initMsgList_.begin(),
57 msgIterEnd = initMsgList_.end();
58 msgIter != msgIterEnd;
62 InitMsgView existingInitMsg(&(*serializedProds)[0]);
66 if (inputOMLabel == existingOMLabel) {
76 this->
add(initMsgView);
88 boost::mutex::scoped_lock sl(listLock_);
95 if (requestedOMLabel.empty()) {
96 if (initMsgList_.size() == 1) {
97 serializedProds = initMsgList_.back().first;
99 else if (initMsgList_.size() > 1) {
100 std::string
msg =
"Invalid INIT message lookup: the requested ";
101 msg.append(
"HLT output module label is empty but there are multiple ");
102 msg.append(
"HLT output modules to choose from.");
103 throw cms::Exception(
"InitMsgCollection",
"getElementForOutputModule:")
110 for (InitMsgList::const_iterator msgIter = initMsgList_.begin(),
111 msgIterEnd = initMsgList_.end();
112 msgIter != msgIterEnd;
116 InitMsgView existingInitMsg(&(*workingMessage)[0]);
120 if (requestedOMLabel == existingOMLabel) {
121 serializedProds = workingMessage;
127 return serializedProds;
133 boost::mutex::scoped_lock sl(listLock_);
136 if (!initMsgList_.empty()) {
137 ptrToLast = initMsgList_.back().first;
145 boost::mutex::scoped_lock sl(listLock_);
150 ptrToElement = initMsgList_.at(index).first;
152 catch (std::out_of_range&
e)
161 boost::mutex::scoped_lock sl(listLock_);
162 initMsgList_.clear();
163 outModNameTable_.clear();
169 boost::mutex::scoped_lock sl(listLock_);
170 return initMsgList_.size();
176 boost::mutex::scoped_lock sl(listLock_);
178 for (InitMsgList::const_iterator msgIter = initMsgList_.begin(),
179 msgIterEnd = initMsgList_.end();
180 msgIter != msgIterEnd;
184 InitMsgView existingInitMsg(&(*workingMessage)[0]);
188 if (outputModuleLabel == existingOMLabel) {
189 return msgIter->second;
198 boost::mutex::scoped_lock sl(listLock_);
202 for (InitMsgList::const_iterator msgIter = initMsgList_.begin(),
203 msgIterEnd = initMsgList_.end();
204 msgIter != msgIterEnd;
207 if (msgIter->second > maxCount)
208 maxCount = msgIter->second;
216 boost::mutex::scoped_lock sl(listLock_);
219 if (initMsgList_.empty()) {
220 return "No information is available about the available triggers.";
224 std::string helpString;
225 helpString.append(
"The full list of trigger paths is the following:");
230 InitMsgView existingInitMsg(&(*serializedProds)[0]);
233 for (
unsigned int idx = 0; idx < existingTriggerList.size(); idx++) {
234 helpString.append(
"\n " + existingTriggerList[idx]);
238 helpString.append(
"\nThe registered HLT output modules and their ");
239 helpString.append(
"trigger selections are the following:");
242 for (InitMsgList::const_iterator msgIter = initMsgList_.begin(),
243 msgIterEnd = initMsgList_.end();
244 msgIter != msgIterEnd;
247 serializedProds = msgIter->first;
248 InitMsgView workingInitMsg(&(*serializedProds)[0]);
249 helpString.append(
"\n *** Output module \"");
251 helpString.append(
"\" ***");
254 for (
unsigned int idx = 0; idx < workingSelectionList.size(); idx++) {
255 helpString.append(
"\n " + workingSelectionList[idx]);
266 boost::mutex::scoped_lock sl(listLock_);
268 OutModTable::const_iterator it = outModNameTable_.find(outputModuleId);
270 if (it == outModNameTable_.end())
281 unsigned int maxCount)
283 std::string resultString =
"";
284 unsigned int elementCount = list.size();
285 if (maxCount > 0 && maxCount < elementCount) {elementCount = maxCount;}
286 for (
unsigned int idx = 0; idx < elementCount; idx++)
288 resultString.append(list[idx]);
289 if (idx < (elementCount-1)) {
290 resultString.append(
", ");
293 if (elementCount < list.size())
295 resultString.append(
", ...");
305 initMsgList_.push_back( std::make_pair(serializedProds,1) );
308 &(*serializedProds)[0]);
std::vector< unsigned char > InitMsgBuffer
InitMsgSharedPtr getElementAt(const unsigned int index) const
void add(InitMsgView const &initMsgView)
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
boost::shared_ptr< InitMsgBuffer > InitMsgSharedPtr
size_t initMsgCount(const std::string &outputModuleLabel) const
void hltTriggerNames(Strings &save_here) const
std::string getOutputModuleName(const uint32_t outputModuleId) const
uint8 * startAddress() const
InitMsgSharedPtr getElementForOutputModule(const std::string &requestedOMLabel) const
size_t maxMsgCount() const
std::string getSelectionHelpString() const
std::string outputModuleLabel() const
bool addIfUnique(InitMsgView const &initMsgView)
InitMsgSharedPtr getLastElement() const
uint32 outputModuleId() const
static std::string stringsToText(Strings const &list, unsigned int maxCount=0)
void hltTriggerSelections(Strings &save_here) const
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 list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run