Skip to content

Commit

Permalink
Revert "Remove dependency on DD"
Browse files Browse the repository at this point in the history
This reverts commit 8212718.
  • Loading branch information
ghugo83 committed Jun 18, 2020
1 parent 3cff852 commit 0456dd2
Show file tree
Hide file tree
Showing 4 changed files with 789 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Alignment/CocoaApplication/BuildFile.xml
@@ -0,0 +1,16 @@
<use name="clhep"/>
<use name="root"/>
<use name="DetectorDescription/Core"/>
<use name="FWCore/Framework"/>
<use name="FWCore/ParameterSet"/>
<use name="Geometry/Records"/>
<use name="CondFormats/OptAlignObjects"/>
<use name="CondFormats/DataRecord"/>
<use name="CondFormats/Alignment"/>
<use name="CondFormats/AlignmentRecord"/>
<use name="Alignment/CocoaModel"/>
<use name="Alignment/CocoaFit"/>
<use name="meschach"/>
<use name="Alignment/CocoaDaq"/>
<use name="CondCore/DBOutputService"/>
<flags EDM_PLUGIN="1"/>
78 changes: 78 additions & 0 deletions Alignment/CocoaApplication/interface/CocoaAnalyzer.h
@@ -0,0 +1,78 @@
#ifndef CocoaAnalyser_HH
#define CocoaAnalyser_HH
//-*- C++ -*-
//
// Package: Alignment/CocoaApplication
// Class: CocoaAnalyzer
//
/*
Description: test access to the OpticalAlignMeasurements via OpticalAlignMeasurementsGeneratedSource
This also should demonstrate access to a geometry via the XMLIdealGeometryESSource
for use in THE COCOA analyzer.
Implementation:
Iterate over retrieved alignments.
*/
//

#include <stdexcept>
#include <string>
#include <iostream>
#include <map>
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "DetectorDescription/Core/interface/DDPosData.h"

class Event;
class EventSetup;
class Entry;
//#include "FWCore/Framework/interface/EventSetup.h"

#include "CondFormats/OptAlignObjects/interface/OpticalAlignments.h"
#include "CondFormats/OptAlignObjects/interface/OpticalAlignInfo.h"
#include "CondFormats/OptAlignObjects/interface/OpticalAlignMeasurements.h"

class DDFilteredView;
class DDCompactView;
class DDSpecifics;
class OpticalObject;


class CocoaAnalyzer : public edm::one::EDAnalyzer<edm::one::SharedResources>
{
public:

explicit CocoaAnalyzer(edm::ParameterSet const& p);
explicit CocoaAnalyzer(int i) { }
virtual ~ CocoaAnalyzer() { }

virtual void beginJob() override;
virtual void analyze(const edm::Event& e, const edm::EventSetup& c) override;
// see note on endJob() at the bottom of the file.
// virtual void endJob() ;

private:
void ReadXMLFile( const edm::EventSetup& evts );
std::vector<OpticalAlignInfo> ReadCalibrationDB( const edm::EventSetup& evts );

void CorrectOptAlignments( std::vector<OpticalAlignInfo>& oaListCalib );
OpticalAlignInfo* FindOpticalAlignInfoXML( const OpticalAlignInfo& oaInfo );
bool CorrectOaParam( OpticalAlignParam* oaParamXML, const OpticalAlignParam& oaParamDB );

void RunCocoa();

OpticalAlignInfo GetOptAlignInfoFromOptO( OpticalObject* opto );
double myFetchDbl(const DDsvalues_type& dvst,
const std::string& spName,
const size_t& vecInd );
std::string myFetchString(const DDsvalues_type& dvst,
const std::string& spName,
const size_t& vecInd );

private:
OpticalAlignments oaList_;
OpticalAlignMeasurements measList_;
std::string theCocoaDaqRootFileName;
};

#endif

0 comments on commit 0456dd2

Please sign in to comment.