Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:57:23

0001 #include "Alignment/CommonAlignment/interface/AlignableObjectId.h"
0002 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentParameterStore.h"
0003 #include "Alignment/SurveyAnalysis/interface/SurveyAlignmentSensor.h"
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 
0006 #include "Alignment/SurveyAnalysis/plugins/SurveyAlignmentAlgorithm.h"
0007 
0008 SurveyAlignmentAlgorithm::SurveyAlignmentAlgorithm(const edm::ParameterSet& cfg, const edm::ConsumesCollector& iC)
0009     : AlignmentAlgorithmBase(cfg, iC),
0010       theOutfile(cfg.getParameter<std::string>("outfile")),
0011       theIterations(cfg.getParameter<unsigned int>("nIteration")),
0012       theLevels(cfg.getParameter<std::vector<std::string> >("levels")) {}
0013 
0014 void SurveyAlignmentAlgorithm::initialize(
0015     const edm::EventSetup&, AlignableTracker*, AlignableMuon*, AlignableExtras*, AlignmentParameterStore* store) {
0016   std::vector<align::StructureType> levels;
0017 
0018   // FIXME: - currently defaulting to RunI as this was the previous behaviour
0019   //        - check this, when resurrecting this code in the future
0020   AlignableObjectId alignableObjectId{AlignableObjectId::Geometry::General};
0021 
0022   for (unsigned int l = 0; l < theLevels.size(); ++l) {
0023     levels.push_back(alignableObjectId.stringToId(theLevels[l].c_str()));
0024   }
0025 
0026   SurveyAlignmentSensor align(store->alignables(), levels);
0027 
0028   align.iterate(theIterations, theOutfile, true);
0029 }
0030 
0031 // Plug in to framework
0032 
0033 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentAlgorithmPluginFactory.h"
0034 
0035 DEFINE_EDM_PLUGIN(AlignmentAlgorithmPluginFactory, SurveyAlignmentAlgorithm, "SurveyAlignmentAlgorithm");