CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/Alignment/SurveyAnalysis/plugins/SurveyAlignmentAlgorithm.cc

Go to the documentation of this file.
00001 #include "Alignment/CommonAlignment/interface/AlignableObjectId.h"
00002 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentParameterStore.h"
00003 #include "Alignment/SurveyAnalysis/interface/SurveyAlignmentSensor.h"
00004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00005 
00006 #include "Alignment/SurveyAnalysis/plugins/SurveyAlignmentAlgorithm.h"
00007 
00008 SurveyAlignmentAlgorithm::SurveyAlignmentAlgorithm(const edm::ParameterSet& cfg):
00009   AlignmentAlgorithmBase(cfg),
00010   theOutfile(cfg.getParameter<std::string>("outfile")),
00011   theIterations(cfg.getParameter<unsigned int>("nIteration")),
00012   theLevels(cfg.getParameter< std::vector<std::string> >("levels"))
00013 {
00014 }
00015 
00016 void SurveyAlignmentAlgorithm::initialize(const edm::EventSetup&,
00017                                           AlignableTracker*,
00018                                           AlignableMuon*,
00019                                           AlignableExtras*,
00020                                           AlignmentParameterStore* store)
00021 {
00022   static AlignableObjectId dummy;
00023 
00024   std::vector<align::StructureType> levels;
00025 
00026   for (unsigned int l = 0; l < theLevels.size(); ++l)
00027   {
00028     levels.push_back(dummy.nameToType(theLevels[l]));
00029   }
00030 
00031   SurveyAlignmentSensor align(store->alignables(), levels);
00032 
00033   align.iterate(theIterations, theOutfile, true);
00034 }
00035 
00036 // Plug in to framework
00037 
00038 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentAlgorithmPluginFactory.h"
00039 
00040 DEFINE_EDM_PLUGIN(AlignmentAlgorithmPluginFactory, SurveyAlignmentAlgorithm, "SurveyAlignmentAlgorithm");