CMS 3D CMS Logo

OpticalObjectMgr Class Reference

#include <Alignment/CocoaModel/interface/OpticalObjectMgr.h>

List of all members.

Public Member Functions

uint32_t buildCmsSwID ()
void dumpOptOs (std::ostream &out=std::cout) const
OpticalObjectfindOptO (const ALIstring &longName, bool exists=0) const
std::vector< OpticalObject * > findOptOs (const ALIstring &name, bool exists=0) const
 OpticalObjectMgr ()
void registerMe (OpticalObject *opto)
 ~OpticalObjectMgr ()

Static Public Member Functions

static OpticalObjectMgrgetInstance ()
 Get the only instance.

Private Attributes

uint32_t theLastCmsSwID
msopto theOptODict

Static Private Attributes

static OpticalObjectMgrtheInstance = 0


Detailed Description

Definition at line 20 of file OpticalObjectMgr.h.


Constructor & Destructor Documentation

OpticalObjectMgr::OpticalObjectMgr (  )  [inline]

Definition at line 24 of file OpticalObjectMgr.h.

00024 { };

OpticalObjectMgr::~OpticalObjectMgr (  )  [inline]

Definition at line 25 of file OpticalObjectMgr.h.

00025 { };


Member Function Documentation

uint32_t OpticalObjectMgr::buildCmsSwID (  ) 

Definition at line 84 of file OpticalObjectMgr.cc.

References theLastCmsSwID.

00085 {
00086   return theLastCmsSwID++;
00087 }

void OpticalObjectMgr::dumpOptOs ( std::ostream &  out = std::cout  )  const

Definition at line 70 of file OpticalObjectMgr.cc.

References begin, GenMuonPlsPt100GeV_cfg::cout, ALIUtils::dump3v(), lat::endl(), name, Model::OptOList(), and theOptODict.

Referenced by Fit::dumpEntryCorrelations().

00071 {
00072   std::cout << "OPTICALOBJECT list size " << theOptODict.size() << std::endl;
00073   std::vector< OpticalObject* >::const_iterator vocite;
00074   for( vocite = Model::OptOList().begin(); vocite != Model::OptOList().end(); vocite++ ) {
00075     ALIstring name = (*vocite)->name();
00076     ALIUtils::dump3v( (*vocite)->centreGlobal(), (name + " CENTRE GLOBAL: ").c_str() );
00077     if( (*vocite)->parent() != 0 ) ALIUtils::dump3v( (*vocite)->centreLocal(),  (name + "  CENTRE LOCAL: ").c_str() ); //not for the 'system'
00078   }
00079 
00080 }

OpticalObject * OpticalObjectMgr::findOptO ( const ALIstring longName,
bool  exists = 0 
) const

Definition at line 20 of file OpticalObjectMgr.cc.

References TestMuL1L2Filter_cff::cerr, lat::endl(), cmsRelvalreport::exit, and theOptODict.

00021 {
00022   OpticalObject* opto = 0;
00023   msopto::const_iterator cite = theOptODict.find( longName );
00024   if( cite == theOptODict.end() ) {
00025     if( exists ) {
00026       std::cerr << "!!!! EXITING: OptO not found: " << longName << std::endl;
00027       exit(1);
00028     } else {
00029       std::cerr << "!! WARNING: OptO not found: " << longName << std::endl;
00030     }
00031   } else {
00032     opto = (*cite).second;
00033   }
00034 
00035   return opto;
00036 
00037 }  

std::vector< OpticalObject * > OpticalObjectMgr::findOptOs ( const ALIstring name,
bool  exists = 0 
) const

Definition at line 41 of file OpticalObjectMgr.cc.

References TestMuL1L2Filter_cff::cerr, lat::endl(), cmsRelvalreport::exit, and theOptODict.

00042 {
00043   std::vector<OpticalObject*> vopto;
00044   msopto::const_iterator cite;
00045   //----- Look for OptO's that contains 'name' in its longName as the last word (after the last '/')
00046   for( cite = theOptODict.begin(); cite != theOptODict.end(); cite++ ) {
00047     ALIstring oname = (*cite).first;
00048     int nf = oname.rfind( name );
00049     int sf = oname.rfind( '/' );
00050     if( nf != -1 && sf <= nf ) {
00051       vopto.push_back( (*cite).second );
00052     }
00053   }
00054 
00055   if( vopto.size() == 0 ) {
00056     if( exists ) {
00057       std::cerr << "!!!! EXITING: OptO not found: " << name << std::endl;
00058       exit(1);
00059     } else {
00060       std::cerr << "!! WARNING: OptO not found: " << name << std::endl;
00061     }
00062   }
00063 
00064   return vopto;
00065 
00066 }

OpticalObjectMgr * OpticalObjectMgr::getInstance (  )  [static]

Get the only instance.

Definition at line 8 of file OpticalObjectMgr.cc.

References theInstance, and theLastCmsSwID.

Referenced by OpticalObject::createComponentOptOs(), Fit::dumpEntryCorrelations(), and OpticalObject::OpticalObject().

00009 {
00010   if( !theInstance ) {
00011     theInstance = new OpticalObjectMgr;
00012     theInstance->theLastCmsSwID = 0;
00013     //    theInstance->verbose = ALIUtils::verbosity();
00014   }
00015   return theInstance;
00016 }

void OpticalObjectMgr::registerMe ( OpticalObject opto  )  [inline]

Definition at line 31 of file OpticalObjectMgr.h.

References OpticalObject::longName(), and theOptODict.

Referenced by OpticalObject::OpticalObject().

00031                                         {
00032     theOptODict[opto->longName()] = opto;
00033   }


Member Data Documentation

OpticalObjectMgr * OpticalObjectMgr::theInstance = 0 [static, private]

Definition at line 44 of file OpticalObjectMgr.h.

Referenced by getInstance().

uint32_t OpticalObjectMgr::theLastCmsSwID [private]

Definition at line 46 of file OpticalObjectMgr.h.

Referenced by buildCmsSwID(), and getInstance().

msopto OpticalObjectMgr::theOptODict [private]

Definition at line 45 of file OpticalObjectMgr.h.

Referenced by dumpOptOs(), findOptO(), findOptOs(), and registerMe().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:29:17 2009 for CMSSW by  doxygen 1.5.4