CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/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   const std::vector<std::string>& levels = cfg.getUntrackedParameter< std::vector<std::string> >("surveyResiduals");
00011 
00012   for (unsigned int l = 0; l < levels.size(); ++l)
00013   {
00014     theLevels.push_back(AlignableObjectId::stringToId(levels[l]) );
00015   }
00016 }
00017 
00018 void AlignmentMonitorSurvey::book()
00019 {
00020   align::ID id;
00021   align::StructureType level;
00022 
00023   double par[6]; // survey residual
00024 
00025   TTree* tree = directory("/iterN/")->make<TTree>("survey", "");
00026 
00027   tree->Branch("id"   , &id   , "id/i");
00028   tree->Branch("level", &level, "level/I");
00029   tree->Branch("par"  , &par  , "par[6]/D");
00030 
00031   const align::Alignables& all = pStore()->alignables();
00032 
00033   const unsigned int nAlignable = all.size();
00034 
00035   for (unsigned int i = 0; i < nAlignable; ++i)
00036   {
00037     const Alignable* ali = all[i];
00038 
00039     id = ali->id();
00040 
00041     for (unsigned int l = 0; l < theLevels.size(); ++l)
00042     {
00043       level = theLevels[l];
00044 
00045       SurveyResidual resid(*ali, level, true);
00046       AlgebraicVector resParams = resid.sensorResidual();
00047                         
00048       par[0] = resParams[0];
00049       par[1] = resParams[1];
00050       par[2] = resParams[2];
00051       par[3] = resParams[3];
00052       par[4] = resParams[4];
00053       par[5] = resParams[5];
00054                 
00055       tree->Fill();
00056     }
00057   }
00058 }
00059 
00060 #include "Alignment/CommonAlignmentMonitor/interface/AlignmentMonitorPluginFactory.h"
00061 DEFINE_EDM_PLUGIN(AlignmentMonitorPluginFactory, AlignmentMonitorSurvey, "AlignmentMonitorSurvey");