CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends
OOTPileupCorrectionColl Class Reference

#include <OOTPileupCorrectionColl.h>

Public Member Functions

void add (const std::string &name, const std::string &category, std::shared_ptr< AbsOOTPileupCorrection > ptr)
 
void clear ()
 
bool empty () const
 
bool exists (const std::string &name, const std::string &category) const
 
std::shared_ptr< AbsOOTPileupCorrectionget (const std::string &name, const std::string &category) const
 
bool operator!= (const OOTPileupCorrectionColl &r) const
 
bool operator== (const OOTPileupCorrectionColl &r) const
 

Private Types

typedef std::map< std::string, PtrMapDataMap
 
typedef std::map< std::string, std::shared_ptr< AbsOOTPileupCorrection > > PtrMap
 

Private Member Functions

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

Private Attributes

DataMap data_
 

Friends

class boost::serialization::access
 

Detailed Description

Definition at line 11 of file OOTPileupCorrectionColl.h.

Member Typedef Documentation

◆ DataMap

typedef std::map<std::string, PtrMap> OOTPileupCorrectionColl::DataMap
private

Definition at line 31 of file OOTPileupCorrectionColl.h.

◆ PtrMap

typedef std::map<std::string, std::shared_ptr<AbsOOTPileupCorrection> > OOTPileupCorrectionColl::PtrMap
private

Definition at line 30 of file OOTPileupCorrectionColl.h.

Member Function Documentation

◆ add()

void OOTPileupCorrectionColl::add ( const std::string &  name,
const std::string &  category,
std::shared_ptr< AbsOOTPileupCorrection ptr 
)
inline

◆ clear()

void OOTPileupCorrectionColl::clear ( void  )
inline

Definition at line 17 of file OOTPileupCorrectionColl.h.

References data_.

17 { data_.clear(); }

◆ empty()

bool OOTPileupCorrectionColl::empty ( ) const
inline

Definition at line 19 of file OOTPileupCorrectionColl.h.

References data_.

19 { return data_.empty(); }

◆ exists()

bool OOTPileupCorrectionColl::exists ( const std::string &  name,
const std::string &  category 
) const

Definition at line 5 of file OOTPileupCorrectionColl.cc.

References taus_updatedMVAIds_cff::category, data_, and Skims_PA_cff::name.

5  {
6  DataMap::const_iterator dit = data_.find(category);
7  if (dit == data_.end())
8  return false;
9  else
10  return !(dit->second.find(name) == dit->second.end());
11 }

◆ get()

std::shared_ptr< AbsOOTPileupCorrection > OOTPileupCorrectionColl::get ( const std::string &  name,
const std::string &  category 
) const

Definition at line 13 of file OOTPileupCorrectionColl.cc.

References taus_updatedMVAIds_cff::category, data_, and Skims_PA_cff::name.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), submitPVValidationJobs.BetterConfigParser::__updateDict(), util.rrapi.RRApi::columns(), rrapi.RRApi::columns(), rrapi.RRApi::count(), util.rrapi.RRApi::count(), rrapi.RRApi::data(), util.rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), submitPVValidationJobs.BetterConfigParser::getResultingSection(), util.rrapi.RRApi::report(), rrapi.RRApi::report(), rrapi.RRApi::reports(), util.rrapi.RRApi::reports(), rrapi.RRApi::tables(), util.rrapi.RRApi::tables(), util.rrapi.RRApi::tags(), rrapi.RRApi::tags(), rrapi.RRApi::templates(), util.rrapi.RRApi::templates(), util.rrapi.RRApi::workspaces(), and rrapi.RRApi::workspaces().

14  {
15  DataMap::const_iterator dit = data_.find(category);
16  if (dit == data_.end())
17  throw cms::Exception("In OOTPileupCorrectionColl::get: unknown category");
18  PtrMap::const_iterator pit = dit->second.find(name);
19  if (pit == dit->second.end())
20  throw cms::Exception("In OOTPileupCorrectionColl::get: unknown name");
21  return pit->second;
22 }

◆ operator!=()

bool OOTPileupCorrectionColl::operator!= ( const OOTPileupCorrectionColl r) const
inline

Definition at line 27 of file OOTPileupCorrectionColl.h.

References alignCSCRings::r.

27 { return !(*this == r); }

◆ operator==()

bool OOTPileupCorrectionColl::operator== ( const OOTPileupCorrectionColl r) const

Definition at line 24 of file OOTPileupCorrectionColl.cc.

References data_, mps_fire::end, and alignCSCRings::r.

24  {
25  if (data_.size() != r.data_.size())
26  return false;
27  DataMap::const_iterator dit = data_.begin();
28  const DataMap::const_iterator end = data_.end();
29  DataMap::const_iterator rit = r.data_.begin();
30  for (; dit != end; ++dit, ++rit) {
31  if (dit->first != rit->first)
32  return false;
33  if (dit->second.size() != rit->second.size())
34  return false;
35  PtrMap::const_iterator pit = dit->second.begin();
36  const PtrMap::const_iterator pend = dit->second.end();
37  PtrMap::const_iterator rpit = rit->second.begin();
38  for (; pit != pend; ++pit, ++rpit) {
39  if (pit->first != rpit->first)
40  return false;
41  if (*(pit->second) != *(rpit->second))
42  return false;
43  }
44  }
45  return true;
46 }

◆ serialize()

template<class Archive >
void OOTPileupCorrectionColl::serialize ( Archive &  ar,
unsigned   
)
inlineprivate

Definition at line 37 of file OOTPileupCorrectionColl.h.

References data_.

37  {
38  ar& data_;
39  }

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 34 of file OOTPileupCorrectionColl.h.

Member Data Documentation

◆ data_

DataMap OOTPileupCorrectionColl::data_
private

Definition at line 32 of file OOTPileupCorrectionColl.h.

Referenced by add(), clear(), empty(), exists(), get(), operator==(), and serialize().