CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Friends
AlCaRecoTriggerBits Class Reference

#include <AlCaRecoTriggerBits.h>

Public Member Functions

 AlCaRecoTriggerBits ()
 
std::string compose (const std::vector< std::string > &paths) const
 Compose several paths into one string : More...
 
std::vector< std::string > decompose (const std::string &concatPaths) const
 Decompose one value of map from concatenated string. More...
 
 ~AlCaRecoTriggerBits ()
 

Public Attributes

std::map< std::string, std::string > m_alcarecoToTrig
 

Static Public Attributes

static const std::string::value_type delimeter_ = ';'
 Delimeter for composing paths to one string in DB: More...
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Definition at line 9 of file AlCaRecoTriggerBits.h.

Constructor & Destructor Documentation

◆ AlCaRecoTriggerBits()

AlCaRecoTriggerBits::AlCaRecoTriggerBits ( )

Definition at line 3 of file AlCaRecoTriggerBits.cc.

3 {}

◆ ~AlCaRecoTriggerBits()

AlCaRecoTriggerBits::~AlCaRecoTriggerBits ( )

Definition at line 4 of file AlCaRecoTriggerBits.cc.

4 {}

Member Function Documentation

◆ compose()

std::string AlCaRecoTriggerBits::compose ( const std::vector< std::string > &  paths) const

Compose several paths into one string :

Definition at line 9 of file AlCaRecoTriggerBits.cc.

References delimeter_, Skims_PA_cff::paths, and AlCaHLTBitMon_QueryRunRegistry::string.

9  {
10  std::string mergedPaths;
11  for (std::vector<std::string>::const_iterator iPath = paths.begin(); iPath != paths.end(); ++iPath) {
12  if (iPath != paths.begin())
13  mergedPaths += delimeter_;
14  if (iPath->find(delimeter_) != std::string::npos) {
15  // What to do in CondFormats?
16  // cms::Exception? std::cerr? edm::LogError?
17  }
18  mergedPaths += *iPath;
19  }
20 
21  // Special case: DB cannot store empty strings, see e.g.
22  // https://hypernews.cern.ch/HyperNews/CMS/get/database/674.html ,
23  // so choose delimeter_ for that - it cannot appear in a path anyway.
24  if (mergedPaths.empty())
25  mergedPaths = delimeter_;
26 
27  return mergedPaths;
28 }
static const std::string::value_type delimeter_
Delimeter for composing paths to one string in DB:

◆ decompose()

std::vector< std::string > AlCaRecoTriggerBits::decompose ( const std::string &  concatPaths) const

Decompose one value of map from concatenated string.

Definition at line 31 of file AlCaRecoTriggerBits.cc.

References delimeter_, mps_fire::result, and alignCSCRings::s.

Referenced by TriggerHelper::expressionsFromDB(), and AlCaRecoTriggerBitsRcdRead::printMap().

31  {
32  // decompose 's' into its parts that are separated by 'delimeter_'
33  // (similar as in
34  // Alignment/CommonAlignmentAlgorithm/src/AlignmentParameterSelector.cc)
35 
36  std::vector<std::string> result;
37  if (!(s.size() == 1 && s[0] == delimeter_)) {
38  // delimeter_ only indicates an empty list as DB cannot store empty strings
39  std::string::size_type previousPos = 0;
40  while (true) {
41  const std::string::size_type delimiterPos = s.find(delimeter_, previousPos);
42  if (delimiterPos == std::string::npos) {
43  result.push_back(s.substr(previousPos)); // until end
44  break;
45  }
46  result.push_back(s.substr(previousPos, delimiterPos - previousPos));
47  previousPos = delimiterPos + 1; // +1: skip delim
48  }
49  }
50 
51  return result;
52 }
uint16_t size_type
static const std::string::value_type delimeter_
Delimeter for composing paths to one string in DB:

◆ serialize()

template<class Archive >
void AlCaRecoTriggerBits::serialize ( Archive &  ar,
const unsigned int  version 
)
private

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 23 of file AlCaRecoTriggerBits.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 23 of file AlCaRecoTriggerBits.h.

Member Data Documentation

◆ delimeter_

const std::string::value_type AlCaRecoTriggerBits::delimeter_ = ';'
static

Delimeter for composing paths to one string in DB:

Definition at line 19 of file AlCaRecoTriggerBits.h.

Referenced by compose(), and decompose().

◆ m_alcarecoToTrig

std::map<std::string, std::string> AlCaRecoTriggerBits::m_alcarecoToTrig