Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-07 04:34:26

0001 #ifndef OpticalObjectMgr_h
0002 #define OpticalObjectMgr_h
0003 /*---------------------------------------------------------------------------

0004 ClassName:   OpticalObjectMgr

0005 Author:      P. Arce

0006 Changes:     02/05/01: creation  

0007 ---------------------------------------------------------------------------*/
0008 // Description:

0009 // Manages the set of optical objects

0010 
0011 #include "Alignment/CocoaUtilities/interface/CocoaGlobals.h"
0012 #include <map>
0013 #include "Alignment/CocoaModel/interface/OpticalObject.h"
0014 
0015 typedef std::map<ALIstring, OpticalObject*, std::less<ALIstring> > msopto;
0016 
0017 class OpticalObject;
0018 
0019 class OpticalObjectMgr {
0020 public:
0021   OpticalObjectMgr() {}
0022   ~OpticalObjectMgr() {}
0023 
0024   /// Get the only instance

0025   static OpticalObjectMgr* getInstance();
0026 
0027   // register an OpticalObject

0028   void registerMe(OpticalObject* opto) { theOptODict[opto->longName()] = opto; }
0029   // find an OpticalObject by long name (its name + name of its ancestors)

0030   OpticalObject* findOptO(const ALIstring& longName, bool exists = false) const;
0031   // find a list of OpticalObject's by name

0032   std::vector<OpticalObject*> findOptOs(const ALIstring& name, bool exists = false) const;
0033 
0034   void dumpOptOs(std::ostream& out = std::cout) const;
0035 
0036   ALIuint buildCmsSwID();
0037 
0038 private:
0039   static OpticalObjectMgr* theInstance;
0040   msopto theOptODict;
0041   ALIuint theLastCmsSwID;
0042 };
0043 
0044 #endif