CMS 3D CMS Logo

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

#include <AlignableMap.h>

Public Member Functions

 AlignableMap ()
 
void dump (void) const
 Print the name of all stored data. More...
 
align::Alignablesfind (const std::string &name="")
 
align::Alignablesget (const std::string &name="")
 
virtual ~AlignableMap ()
 

Private Types

using Container = std::map< std::string, align::Alignables >
 

Private Attributes

Container theStore
 

Detailed Description

A helper class to hold Alignables used by modules in alignment.

Alignables are stored in a map<string, Alignables>. Users get Alignables by passing the corresponding name through the method get(), if the name doesn't exist a new entry will be created. The find()-method also delivers Alignables per name, but it does not created new entries and will throw an error in case of an unknown name.

Date
2008/02/12 18:06:49
Revision
1.3
Author
Chung Khim Lae

Last Update: Max Stark Date: Mon, 22 Feb 2016 19:58:45 CET

Definition at line 27 of file AlignableMap.h.

Member Typedef Documentation

◆ Container

using AlignableMap::Container = std::map<std::string, align::Alignables>
private

Definition at line 28 of file AlignableMap.h.

Constructor & Destructor Documentation

◆ AlignableMap()

AlignableMap::AlignableMap ( )
inline

Definition at line 31 of file AlignableMap.h.

31 {};

◆ ~AlignableMap()

virtual AlignableMap::~AlignableMap ( )
inlinevirtual

Definition at line 32 of file AlignableMap.h.

32 {};

Member Function Documentation

◆ dump()

void AlignableMap::dump ( void  ) const

Print the name of all stored data.

Definition at line 27 of file AlignableMap.cc.

27  {
28  edm::LogInfo("AlignableMap") << "Printing out AlignSetup: ";
29  for (typename Container::const_iterator it = theStore.begin(); it != theStore.end(); ++it) {
30  edm::LogVerbatim("AlignableMap") << it->first << std::endl;
31  }
32 }

References theStore.

◆ find()

align::Alignables & AlignableMap::find ( const std::string &  name = "")

Find and return an object from map using its name. Throw an exception if the name does not exist.

Definition at line 10 of file AlignableMap.cc.

10  {
11  typename Container::iterator o = theStore.find(name);
12 
13  if (theStore.end() == o) {
14  std::ostringstream knownKeys;
15  for (auto it = theStore.begin(); it != theStore.end(); ++it) {
16  knownKeys << (it != theStore.begin() ? ", " : "") << it->first;
17  }
18 
19  throw cms::Exception("AlignableMapError") << "Cannot find an object of name " << name << " in AlignableMap, "
20  << "know only " << knownKeys.str() << ".";
21  }
22 
23  return o->second;
24 }

References Exception, Skims_PA_cff::name, EcalTangentSkim_cfg::o, and theStore.

Referenced by BeautifulSoup.Tag::__getattr__(), AlignableCompositeBuilder::buildLevel(), AlignableTrackerBuilder::buildPixelDetector(), AlignableTrackerBuilder::buildStripDetector(), BeautifulSoup.Tag::firstText(), AlignableExtras::subStructures(), and AlignableTracker::subStructures().

◆ get()

align::Alignables & AlignableMap::get ( const std::string &  name = "")

Member Data Documentation

◆ theStore

Container AlignableMap::theStore
private

Definition at line 46 of file AlignableMap.h.

Referenced by dump(), find(), and get().

AlignableMap::theStore
Container theStore
Definition: AlignableMap.h:46
edm::LogInfo
Definition: MessageLogger.h:254
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
edm::LogVerbatim
Definition: MessageLogger.h:297
Exception
Definition: hltDiff.cc:246
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17