CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/CondCore/EcalPlugins/plugins/EcalAlignmentPyWrapper.cc

Go to the documentation of this file.
00001 #include "CondFormats/Alignment/interface/Alignments.h"
00002 #include "CondTools/Ecal/interface/EcalAlignmentXMLTranslator.h"
00003 #include "CondTools/Ecal/interface/EcalCondHeader.h"
00004 #include "TH2F.h"
00005 #include "TCanvas.h"
00006 #include "TLine.h"
00007 #include "TStyle.h"
00008 #include "TPave.h"
00009 #include "TPaveStats.h"
00010 
00011 #include "CondCore/Utilities/interface/PayLoadInspector.h"
00012 #include "CondCore/Utilities/interface/InspectorPythonWrapper.h"
00013 
00014 #include <string>
00015 #include <fstream>
00016 
00017 using namespace std;
00018 namespace cond {
00019 
00020   template<>
00021   class ValueExtractor<Alignments>: public  BaseValueExtractor<Alignments> {
00022   public:
00023 
00024     typedef Alignments Class;
00025     typedef ExtractWhat<Class> What;
00026     static What what() { return What();}
00027 
00028     ValueExtractor(){}
00029     ValueExtractor(What const & what)
00030     {
00031       // here one can make stuff really complicated...
00032     }
00033     void compute(Class const & it){
00034     }
00035   private:
00036 
00037   };
00038 
00039   template<>
00040   string PayLoadInspector<Alignments>::dump() const {
00041     
00042     stringstream ss;
00043     EcalCondHeader header;
00044     ss << EcalAlignmentXMLTranslator::dumpXML(header,object());
00045     return ss.str();
00046   }
00047   
00048   template<>
00049   string PayLoadInspector<Alignments>::summary() const {
00050 
00051     stringstream ss;   
00052     ss << "   Id    x   y   z   phi   theta   psi "  << endl;
00053     for ( vector<AlignTransform>::const_iterator it = object().m_align.begin();
00054           it != object().m_align.end(); it++ ) {
00055       ss << hex << (*it).rawId()
00056          << " " << (*it).translation().x()
00057          << " " << (*it).translation().y()
00058          << " " << (*it).translation().z()
00059          << " " << (*it).rotation().getPhi()
00060          << " " << (*it).rotation().getTheta() 
00061          << " " << (*it).rotation().getPsi() 
00062          << endl;
00063     }
00064     return ss.str();
00065   }
00066   
00067 
00068   template<>
00069   string PayLoadInspector<Alignments>::plot(string const & filename,
00070                                             string const &, 
00071                                             vector<int> const&, 
00072                                             vector<float> const& ) const {
00073     return filename;
00074   }
00075 }
00076 
00077 PYTHON_WRAPPER(Alignments,Alignments);