00001 #ifndef CocoaAnalyser_HH 00002 #define CocoaAnalyser_HH 00003 //-*- C++ -*- 00004 // 00005 // Package: Alignment/CocoaApplication 00006 // Class: CocoaAnalyzer 00007 // 00008 /* 00009 00010 Description: test access to the OpticalAlignMeasurements via OpticalAlignMeasurementsGeneratedSource 00011 This also should demonstrate access to a geometry via the XMLIdealGeometryESSource 00012 for use in THE COCOA analyzer. 00013 00014 Implementation: 00015 Iterate over retrieved alignments. 00016 */ 00017 // 00018 00019 #include <stdexcept> 00020 #include <string> 00021 #include <iostream> 00022 #include <map> 00023 #include "FWCore/Framework/interface/EDAnalyzer.h" 00024 #include "DetectorDescription/Core/interface/DDPosData.h" 00025 00026 class Event; 00027 class EventSetup; 00028 class Entry; 00029 //#include "FWCore/Framework/interface/EventSetup.h" 00030 00031 #include "CondFormats/OptAlignObjects/interface/OpticalAlignments.h" 00032 #include "CondFormats/OptAlignObjects/interface/OpticalAlignInfo.h" 00033 #include "CondFormats/OptAlignObjects/interface/OpticalAlignMeasurements.h" 00034 00035 class DDFilteredView; 00036 class DDCompactView; 00037 class DDSpecifics; 00038 class OpticalObject; 00039 00040 00041 class CocoaAnalyzer : public edm::EDAnalyzer 00042 { 00043 public: 00044 00045 explicit CocoaAnalyzer(edm::ParameterSet const& p); 00046 explicit CocoaAnalyzer(int i) { } 00047 virtual ~ CocoaAnalyzer() { } 00048 00049 virtual void beginJob(); 00050 virtual void analyze(const edm::Event& e, const edm::EventSetup& c); 00051 // see note on endJob() at the bottom of the file. 00052 // virtual void endJob() ; 00053 00054 private: 00055 void ReadXMLFile( const edm::EventSetup& evts ); 00056 std::vector<OpticalAlignInfo> ReadCalibrationDB( const edm::EventSetup& evts ); 00057 00058 void CorrectOptAlignments( std::vector<OpticalAlignInfo>& oaListCalib ); 00059 OpticalAlignInfo* FindOpticalAlignInfoXML( OpticalAlignInfo oaInfo ); 00060 bool CorrectOaParam( OpticalAlignParam* oaParamXML, OpticalAlignParam oaParamDB ); 00061 00062 void RunCocoa(); 00063 00064 OpticalAlignInfo GetOptAlignInfoFromOptO( OpticalObject* opto ); 00065 double myFetchDbl(const DDsvalues_type& dvst, 00066 const std::string& spName, 00067 const size_t& vecInd ); 00068 std::string myFetchString(const DDsvalues_type& dvst, 00069 const std::string& spName, 00070 const size_t& vecInd ); 00071 00072 private: 00073 OpticalAlignments oaList_; 00074 OpticalAlignMeasurements measList_; 00075 std::string theCocoaDaqRootFileName; 00076 }; 00077 00078 #endif