CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
OOTPileupCorrectionColl.cc
Go to the documentation of this file.
2 
4 
6  const std::string& category) const
7 {
8  DataMap::const_iterator dit = data_.find(category);
9  if (dit == data_.end())
10  return false;
11  else
12  return !(dit->second.find(name) == dit->second.end());
13 }
14 
15 boost::shared_ptr<AbsOOTPileupCorrection> OOTPileupCorrectionColl::get(
16  const std::string& name, const std::string& category) const
17 {
18  DataMap::const_iterator dit = data_.find(category);
19  if (dit == data_.end()) throw cms::Exception(
20  "In OOTPileupCorrectionColl::get: unknown category");
21  PtrMap::const_iterator pit = dit->second.find(name);
22  if (pit == dit->second.end()) throw cms::Exception(
23  "In OOTPileupCorrectionColl::get: unknown name");
24  return pit->second;
25 }
26 
28 {
29  if (data_.size() != r.data_.size())
30  return false;
31  DataMap::const_iterator dit = data_.begin();
32  const DataMap::const_iterator end = data_.end();
33  DataMap::const_iterator rit = r.data_.begin();
34  for (; dit != end; ++dit, ++rit)
35  {
36  if (dit->first != rit->first)
37  return false;
38  if (dit->second.size() != rit->second.size())
39  return false;
40  PtrMap::const_iterator pit = dit->second.begin();
41  const PtrMap::const_iterator pend = dit->second.end();
42  PtrMap::const_iterator rpit = rit->second.begin();
43  for (; pit != pend; ++pit, ++rpit)
44  {
45  if (pit->first != rpit->first)
46  return false;
47  if (*(pit->second) != *(rpit->second))
48  return false;
49  }
50  }
51  return true;
52 }
boost::shared_ptr< AbsOOTPileupCorrection > get(const std::string &name, const std::string &category) const
bool operator==(const OOTPileupCorrectionColl &r) const
#define end
Definition: vmac.h:37
bool exists(const std::string &name, const std::string &category) const