CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/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   std::vector<align::StructureType> levels;
00023 
00024   for (unsigned int l = 0; l < theLevels.size(); ++l)
00025   {
00026     levels.push_back(AlignableObjectId::stringToId(theLevels[l].c_str()));
00027   }
00028 
00029   SurveyAlignmentSensor align(store->alignables(), levels);
00030 
00031   align.iterate(theIterations, theOutfile, true);
00032 }
00033 
00034 // Plug in to framework
00035 
00036 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentAlgorithmPluginFactory.h"
00037 
00038 DEFINE_EDM_PLUGIN(AlignmentAlgorithmPluginFactory, SurveyAlignmentAlgorithm, "SurveyAlignmentAlgorithm");