CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/Alignment/CommonAlignmentMonitor/plugins/AlignmentMonitorSurvey.cc

Go to the documentation of this file.
00001 #include "Alignment/CommonAlignment/interface/AlignableObjectId.h"  
00002 #include "Alignment/CommonAlignment/interface/SurveyResidual.h"
00003 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00004 
00005 #include "Alignment/CommonAlignmentMonitor/plugins/AlignmentMonitorSurvey.h"
00006 
00007 AlignmentMonitorSurvey::AlignmentMonitorSurvey(const edm::ParameterSet& cfg)
00008   :AlignmentMonitorBase(cfg, "AlignmentMonitorSurvey")
00009 {
00010   static AlignableObjectId dummy;
00011 
00012   const std::vector<std::string>& levels = cfg.getUntrackedParameter< std::vector<std::string> >("surveyResiduals");
00013 
00014   for (unsigned int l = 0; l < levels.size(); ++l)
00015   {
00016     theLevels.push_back( dummy.nameToType(levels[l]) );
00017   }
00018 }
00019 
00020 void AlignmentMonitorSurvey::book()
00021 {
00022   align::ID id;
00023   align::StructureType level;
00024 
00025   double par[6]; // survey residual
00026 
00027   TTree* tree = directory("/iterN/")->make<TTree>("survey", "");
00028 
00029   tree->Branch("id"   , &id   , "id/i");
00030   tree->Branch("level", &level, "level/I");
00031   tree->Branch("par"  , &par  , "par[6]/D");
00032 
00033   const align::Alignables& all = pStore()->alignables();
00034 
00035   const unsigned int nAlignable = all.size();
00036 
00037   for (unsigned int i = 0; i < nAlignable; ++i)
00038   {
00039     const Alignable* ali = all[i];
00040 
00041     id = ali->id();
00042 
00043     for (unsigned int l = 0; l < theLevels.size(); ++l)
00044     {
00045       level = theLevels[l];
00046 
00047       SurveyResidual resid(*ali, level, true);
00048       AlgebraicVector resParams = resid.sensorResidual();
00049                         
00050       par[0] = resParams[0];
00051       par[1] = resParams[1];
00052       par[2] = resParams[2];
00053       par[3] = resParams[3];
00054       par[4] = resParams[4];
00055       par[5] = resParams[5];
00056                 
00057       tree->Fill();
00058     }
00059   }
00060 }
00061 
00062 #include "Alignment/CommonAlignmentMonitor/interface/AlignmentMonitorPluginFactory.h"
00063 DEFINE_EDM_PLUGIN(AlignmentMonitorPluginFactory, AlignmentMonitorSurvey, "AlignmentMonitorSurvey");