CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/Alignment/CommonAlignment/interface/AlignableBuilder.h

Go to the documentation of this file.
00001 #ifndef Alignment_CommonAlignment_AlignableBuilder_H
00002 #define Alignment_CommonAlignment_AlignableBuilder_H
00003 
00013 #include "Alignment/CommonAlignment/interface/StructureType.h"
00014 #include "CondFormats/Alignment/interface/Definitions.h"
00015 #include "Alignment/CommonAlignment/interface/Utilities.h"
00016 #include "Alignment/CommonAlignment/interface/Counters.h"
00017 #include "Alignment/CommonAlignment/interface/AlignSetup.h"
00018 
00019 class AlignableBuilder
00020 {
00021   public:
00022 
00024   AlignableBuilder( align::StructureType moduleType, Counters& counter );
00025 
00027   void addLevelInfo( align::StructureType,
00028                      bool flat,
00029                      unsigned int maxComponent );
00030 
00032   void buildAll( AlignSetup<align::Alignables>& setup ) const;
00033 
00034   private:
00035 
00036   struct LevelInfo
00037   {
00038     align::StructureType type_; // level type
00039     bool flat_;                 // true if type is a flat surface (rod, string, ladder,...)
00040     unsigned int maxComponent_; // max no. of components in this level
00041     
00042     LevelInfo( align::StructureType,
00043                bool flat,
00044                unsigned int maxComponent );
00045   };
00046 
00048   unsigned int maxComponent( unsigned int level ) const;
00049 
00053   unsigned int index( unsigned int level,
00054                       align::ID ) const;
00055 
00057   void build( unsigned int level, align::StructureType dauType, 
00058               AlignSetup<align::Alignables>& setup ) const;
00059 
00060   align::StructureType theModuleType; // starting level to build composites
00061 
00062   std::vector<LevelInfo> theLevelInfos;
00063 
00064   Counters theCounters;
00065 
00066 };
00067 
00068 #endif