Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:56:05

0001 #ifndef Alignment_CommonAlignment_AlignSetup_h
0002 #define Alignment_CommonAlignment_AlignSetup_h
0003 
0004 /** \class AlignableMap
0005  *
0006  *  A helper class to hold Alignables used by modules in alignment.
0007  *
0008  *  Alignables are stored in a map<string, Alignables>. Users get Alignables
0009  *  by passing the corresponding name through the method get(), if the name
0010  *  doesn't exist a new entry will be created. The find()-method also delivers
0011  *  Alignables per name, but it does not created new entries and will throw an
0012  *  error in case of an unknown name.
0013  *
0014  *  $Date: 2008/02/12 18:06:49 $
0015  *  $Revision: 1.3 $
0016  *  \author Chung Khim Lae
0017  *
0018  *  Last Update: Max Stark
0019  *         Date: Mon, 22 Feb 2016 19:58:45 CET
0020  */
0021 
0022 #include <map>
0023 #include <sstream>
0024 
0025 #include "Alignment/CommonAlignment/interface/Utilities.h"
0026 
0027 class AlignableMap {
0028   using Container = std::map<std::string, align::Alignables>;
0029 
0030 public:
0031   AlignableMap(){};
0032   virtual ~AlignableMap(){};
0033 
0034   /// Get an object from map using its name.
0035   /// A new object is default-constructed if the name does not exist.
0036   align::Alignables& get(const std::string& name = "");
0037 
0038   /// Find and return an object from map using its name.
0039   /// Throw an exception if the name does not exist.
0040   align::Alignables& find(const std::string& name = "");
0041 
0042   /// Print the name of all stored data
0043   void dump(void) const;
0044 
0045 private:
0046   Container theStore;
0047 };
0048 
0049 #endif