Skip to content

Commit

Permalink
Merge pull request cms-sw#3691 from ktf/initial-merge-of-boost-io
Browse files Browse the repository at this point in the history
Initial merge of boost io
davidlange6 committed May 10, 2014
2 parents e4f286c + c6e0f02 commit 067ffe8
Showing 611 changed files with 7,712 additions and 557 deletions.
1 change: 1 addition & 0 deletions Alignment/CocoaDaq/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<use name="rootcore"/>
<use name="CondFormats/OptAlignObjects"/>
<export>
<lib name="1"/>
</export>
7 changes: 7 additions & 0 deletions Alignment/CocoaFit/interface/MatrixMeschach.h
Original file line number Diff line number Diff line change
@@ -20,6 +20,13 @@ extern "C" {
#include <matrix2.h>
}

// Meschach external (matrix.h) defines C++-incompatible macros
// which break other code (e.g. standard <limits>).
// Since these are not used here, undef them.
#undef max
#undef min
#undef catch
#undef Real

class MatrixMeschach
{
2 changes: 2 additions & 0 deletions Alignment/CocoaFit/src/CocoaDBMgr.cc
Original file line number Diff line number Diff line change
@@ -32,6 +32,8 @@
#include "CondFormats/OptAlignObjects/interface/OpticalAlignInfo.h"
#include "CondFormats/OptAlignObjects/interface/OpticalAlignMeasurements.h"

#include "CondCore/CondDB/interface/Serialization.h"

CocoaDBMgr* CocoaDBMgr::instance = 0;

//----------------------------------------------------------------------
1 change: 1 addition & 0 deletions Alignment/CommonAlignment/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -13,3 +13,4 @@
<use name="Geometry/CommonDetUnit"/>
<use name="Geometry/CommonTopologies" />
<use name="clhep"/>
<use name="boost_serialization"/>
1 change: 1 addition & 0 deletions Alignment/TrackerAlignment/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<use name="Alignment/CommonAlignment"/>
<use name="CondCore/DBOutputService"/>
<use name="CondFormats/Alignment"/>
<use name="DataFormats/GeometrySurface"/>
<use name="DataFormats/SiPixelDetId"/>
<use name="DataFormats/SiStripDetId"/>
10 changes: 6 additions & 4 deletions CondCore/CondDB/interface/Serialization.h
Original file line number Diff line number Diff line change
@@ -22,6 +22,8 @@
// temporarely
#include <boost/shared_ptr.hpp>

#include "CondFormats/Serialization/interface/Archive.h"

class RootStreamBuffer;

namespace cond {
@@ -82,8 +84,8 @@ namespace cond {
return *this;
}

typedef RootInputArchive CondInputArchive;
typedef RootOutputArchive CondOutputArchive;
typedef cond::serialization::InputArchive CondInputArchive;
typedef cond::serialization::OutputArchive CondOutputArchive;

// call for the serialization. Setting packingOnly = TRUE the data will stay in the original memory layout
// ( no serialization in this case ). This option is used by the ORA backend - will be dropped after the changeover
@@ -93,7 +95,7 @@ namespace cond {
// save data to buffers
std::ostringstream dataBuffer;
std::ostringstream streamerInfoBuffer;
CondOutputArchive oa( dataBuffer, streamerInfoBuffer );
CondOutputArchive oa( dataBuffer );
oa << payload;
//TODO: avoid (2!!) copies
ret.first.copy( dataBuffer.str() );
@@ -121,7 +123,7 @@ namespace cond {

std::istream dataBuffer( &sdataBuf );
std::istream streamerInfoBuffer( &sstreamerInfoBuf );
CondInputArchive ia( dataBuffer, streamerInfoBuffer );
CondInputArchive ia( dataBuffer );
payload.reset( createPayload<T>(payloadType) );
ia >> (*payload);
} else {
2 changes: 2 additions & 0 deletions CondCore/CondDB/src/ConnectionPool.cc
Original file line number Diff line number Diff line change
@@ -124,6 +124,8 @@ namespace cond {
coral::Context::instance().loadComponent( authServiceName, m_pluginManager );
}

std::cout << "==> using " << servName << " for auth, sys " << authSys << std::endl;

coralConfig.setAuthenticationService( authServiceName );
}

5 changes: 3 additions & 2 deletions CondCore/CondDB/src/GTSchema.cc
Original file line number Diff line number Diff line change
@@ -90,8 +90,9 @@ namespace cond {
q.addOrderClause<RECORD>();
q.addOrderClause<LABEL>();
for ( auto row : q ) {
std::string& label = std::get<1>( row );
if( label == "-" ) label = "";
if ( std::get<1>(row) == "-" ) {
std::get<1>(row) = "";
}
tags.push_back( row );
}
return q.retrievedRows();
19 changes: 17 additions & 2 deletions CondCore/CondDB/test/MyTestData.h
Original file line number Diff line number Diff line change
@@ -4,6 +4,8 @@
#include <iostream>
#include <string>

#include "CondFormats/Serialization/interface/Serializable.h"

class MyTestData {
public:

@@ -65,7 +67,20 @@ class MyTestData {
int a;
float b;
std::string s;
double d[2][2];
int f[2][2];
int d[2][2];
float f[2][2];

COND_SERIALIZABLE;
};

#include <boost/serialization/nvp.hpp>

template <class Archive>
void MyTestData::serialize(Archive & ar, const unsigned int)
{
ar & BOOST_SERIALIZATION_NVP(a);
ar & BOOST_SERIALIZATION_NVP(b);
ar & BOOST_SERIALIZATION_NVP(s);
}

#endif
1 change: 1 addition & 0 deletions CondCore/DBOutputService/test/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<use name="CondCore/DBOutputService"/>
<use name="CondFormats/Calibration"/>
<use name="CondFormats/External"/>
<library file="stubs/IOVPayloadAnalyzer.cc" name="IOVPayloadAnalyze">
<flags EDM_PLUGIN="1"/>
</library>
1 change: 0 additions & 1 deletion CondCore/DBOutputService/test/stubs/IOVPayloadAnalyzer.cc
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
#include "CondFormats/Calibration/interface/Pedestals.h"


#include "IOVPayloadAnalyzer.h"
#include <iostream>

1 change: 1 addition & 0 deletions CondCore/DBOutputService/test/stubs/writeBlob.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
#include "CondFormats/Calibration/interface/mySiStripNoises.h"

#include <boost/random/linear_congruential.hpp>
#include <boost/random/uniform_real.hpp>
#include <boost/random/variate_generator.hpp>
1 change: 1 addition & 0 deletions CondCore/DBOutputService/test/stubs/writeBlobComplex.cc
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
#include "FWCore/Framework/interface/Event.h"
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
#include "CondFormats/Calibration/interface/BlobComplex.h"

#include "writeBlobComplex.h"

#include <iostream>
2 changes: 2 additions & 0 deletions CondCore/DBOutputService/test/stubs/writeInt.cc
Original file line number Diff line number Diff line change
@@ -7,6 +7,8 @@
#include<vector>
#include<sstream>

#include <boost/serialization/vector.hpp>

typedef std::vector<int> Payload;


1 change: 1 addition & 0 deletions CondCore/DBOutputService/test/stubs/writeKeyed.cc
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
#include <iostream>
#include <string>
#include "FWCore/ServiceRegistry/interface/Service.h"

#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
#include "CondCore/DBOutputService/interface/KeyedElement.h"
#include "CondFormats/Calibration/interface/Conf.h"
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
#include "CondFormats/Calibration/interface/Pedestals.h"
#include "CondFormats/Calibration/interface/mySiStripNoises.h"

#include <boost/random/linear_congruential.hpp>
#include <boost/random/uniform_real.hpp>
#include <boost/random/variate_generator.hpp>
1 change: 1 addition & 0 deletions CondCore/DTPlugins/src/plugin.cc
Original file line number Diff line number Diff line change
@@ -43,6 +43,7 @@

//
#include "CondCore/CondDB/interface/Serialization.h"
#include "CondFormats/External/interface/DetID.h"

namespace cond {

26 changes: 8 additions & 18 deletions CondCore/PhysicsToolsPlugins/src/plugin.cc
Original file line number Diff line number Diff line change
@@ -11,33 +11,23 @@
#include "CondFormats/PhysicsToolsObjects/interface/Histogram2D.h"
#include "CondFormats/PhysicsToolsObjects/interface/Histogram3D.h"
#include "CondFormats/DataRecord/interface/SiStripDeDxMipRcd.h"
REGISTER_PLUGIN(SiStripDeDxMipRcd, PhysicsTools::Calibration::HistogramD2D);
#include "CondFormats/DataRecord/interface/SiStripDeDxMip_3D_Rcd.h"
REGISTER_PLUGIN(SiStripDeDxMip_3D_Rcd, PhysicsTools::Calibration::HistogramD3D);
#include "CondFormats/DataRecord/interface/SiStripDeDxProton_3D_Rcd.h"
REGISTER_PLUGIN(SiStripDeDxProton_3D_Rcd, PhysicsTools::Calibration::HistogramD3D);
#include "CondFormats/DataRecord/interface/SiStripDeDxPion_3D_Rcd.h"
REGISTER_PLUGIN(SiStripDeDxPion_3D_Rcd, PhysicsTools::Calibration::HistogramD3D);
#include "CondFormats/DataRecord/interface/SiStripDeDxKaon_3D_Rcd.h"
REGISTER_PLUGIN(SiStripDeDxKaon_3D_Rcd, PhysicsTools::Calibration::HistogramD3D);
#include "CondFormats/DataRecord/interface/SiStripDeDxElectron_3D_Rcd.h"
REGISTER_PLUGIN(SiStripDeDxElectron_3D_Rcd, PhysicsTools::Calibration::HistogramD3D);

#include "CondFormats/DataRecord/interface/PhysicsTFormulaPayloadRcd.h"
#include "CondFormats/PhysicsToolsObjects/interface/PhysicsTFormulaPayload.h"
REGISTER_PLUGIN(PhysicsTFormulaPayloadRcd, PhysicsTFormulaPayload);

#include "CondFormats/DataRecord/interface/PhysicsTGraphPayloadRcd.h"
#include "CondFormats/PhysicsToolsObjects/interface/PhysicsTGraphPayload.h"
REGISTER_PLUGIN(PhysicsTGraphPayloadRcd, PhysicsTGraphPayload);

#include "CondFormats/DataRecord/interface/DropBoxMetadataRcd.h"
#include "CondFormats/Common/interface/DropBoxMetadata.h"
REGISTER_PLUGIN(DropBoxMetadataRcd, DropBoxMetadata);




#include "CondCore/CondDB/interface/Serialization.h"

REGISTER_PLUGIN(DropBoxMetadataRcd,DropBoxMetadata);

REGISTER_PLUGIN(SiStripDeDxMipRcd, PhysicsTools::Calibration::HistogramD2D);
REGISTER_PLUGIN(SiStripDeDxMip_3D_Rcd, PhysicsTools::Calibration::HistogramD3D);
REGISTER_PLUGIN(SiStripDeDxProton_3D_Rcd, PhysicsTools::Calibration::HistogramD3D);
REGISTER_PLUGIN(SiStripDeDxPion_3D_Rcd, PhysicsTools::Calibration::HistogramD3D);
REGISTER_PLUGIN(SiStripDeDxKaon_3D_Rcd, PhysicsTools::Calibration::HistogramD3D);
REGISTER_PLUGIN(SiStripDeDxElectron_3D_Rcd, PhysicsTools::Calibration::HistogramD3D);

2 changes: 1 addition & 1 deletion CondCore/PopCon/test/stubs/EffSourceHandler.cc
Original file line number Diff line number Diff line change
@@ -4,14 +4,14 @@
#include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"


//#include<iostream>
#include<sstream>
#include<vector>
#include<string>
#include <sstream>
#include <typeinfo>

#include "CondCore/CondDB/interface/Serialization.h"

popcon::ExEffSource::ExEffSource(const edm::ParameterSet& pset) :
m_name(pset.getUntrackedParameter<std::string>("name","ExEffSource")),
2 changes: 0 additions & 2 deletions CondCore/PopCon/test/stubs/EffSourceHandler.h
Original file line number Diff line number Diff line change
@@ -8,8 +8,6 @@

#include "CondCore/PopCon/interface/PopConSourceHandler.h"



#include "CondFormats/Calibration/interface/Efficiency.h"

#include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
2 changes: 2 additions & 0 deletions CondCore/PopCon/test/stubs/ExSourceHandler.cc
Original file line number Diff line number Diff line change
@@ -10,6 +10,8 @@
#include<string>
#include <sstream>

#include "CondCore/CondDB/interface/Serialization.h"


namespace {

2 changes: 0 additions & 2 deletions CondCore/PopCon/test/stubs/ExSourceHandler.h
Original file line number Diff line number Diff line change
@@ -8,8 +8,6 @@

#include "CondCore/PopCon/interface/PopConSourceHandler.h"



#include "CondFormats/Calibration/interface/Pedestals.h"

#include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
1 change: 1 addition & 0 deletions CondCore/RPCPlugins/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -6,3 +6,4 @@
<use name="root"/>
<use name="rootgraphics"/>
<flags EDM_PLUGIN="1"/>
<flags CXXFLAGS="-ftemplate-depth=600"/>
1 change: 1 addition & 0 deletions CondCore/Utilities/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -28,6 +28,7 @@
<use name="CondFormats/L1TObjects"/>
<use name="CondFormats/PhysicsToolsObjects"/>
<use name="CondFormats/GeometryObjects"/>
<use name="CondFormats/RecoMuonObjects"/>
<use name="CondFormats/RPCObjects"/>
<use name="CondFormats/RunInfo"/>
<use name="CondFormats/SiPixelObjects"/>
3 changes: 3 additions & 0 deletions CondCore/Utilities/bin/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -50,6 +50,9 @@
<bin file="conddb_test_gt_load.cpp" name="conddb_test_gt_load">
<use name="CondCore/CondDB"/>
</bin>
<bin file="conddb_test_gt_perf.cpp" name="conddb_test_gt_perf">
<use name="CondCore/CondDB"/>
</bin>
<bin file="conddb_migrate_gt.cpp" name="conddb_migrate_gt">
<use name="CondCore/CondDB"/>
</bin>
61 changes: 54 additions & 7 deletions CondCore/Utilities/bin/conddb_migrate_gt.cpp
Original file line number Diff line number Diff line change
@@ -27,6 +27,11 @@
#include "CoralBase/Attribute.h"
#include "CoralBase/AttributeList.h"

#include <boost/regex.hpp>

// for the xml dump
#include "TFile.h"
#include "Cintex/Cintex.h"
#include <sstream>
#include <vector>
#include <tuple>
@@ -47,6 +52,54 @@

namespace cond {


std::string convert(const std::string & input)
{
static const boost::regex trivial("oracle://(cms_orcon_adg|cms_orcoff_prep)/([_[:alnum:]]+?)");
static const boost::regex short_frontier("frontier://([[:alnum:]]+?)/([_[:alnum:]]+?)");
static const boost::regex long_frontier("frontier://((\\([-[:alnum:]]+?=[^\\)]+?\\))+)/([_[:alnum:]]+?)");
static const boost::regex long_frontier_serverurl("\\(serverurl=[^\\)]+?/([[:alnum:]]+?)\\)");

static const std::map<std::string, std::string> frontier_map = {
{"PromptProd", "cms_orcon_adg"},
{"FrontierProd", "cms_orcon_adg"},
{"FrontierOnProd", "cms_orcon_adg"},
{"FrontierPrep", "cms_orcoff_prep"},
{"FrontierArc", "cms_orcon_adg"},
};

boost::smatch matches;

if (boost::regex_match(input, matches, trivial))
return std::string("oracle://") + matches[1] + "/" + matches[2];

if (boost::regex_match(input, matches, short_frontier)) {
std::string acct = matches[2];
if( matches[1] == "FrontierArc" ) {
size_t len = acct.size()-5;
acct = acct.substr(0,len);
}
return std::string("oracle://") + frontier_map.at(matches[1]) + "/" + acct;
}

if (boost::regex_match(input, matches, long_frontier)) {
std::string frontier_config(matches[1]);
boost::smatch matches2;
if (not boost::regex_search(frontier_config, matches2, long_frontier_serverurl))
throw std::runtime_error("No serverurl in matched long frontier");

std::string acct = matches[3];
if( matches2[1] == "FrontierArc" ) {
size_t len = acct.size()-5;
acct = acct.substr(0,len);
}
return std::string("oracle://") + frontier_map.at(matches2[1]) + "/" + acct;
}

throw std::runtime_error("Could not match input string to any known connection string.");
}


d_table( GT ){
d_column( tagid, int );
}
@@ -149,13 +202,7 @@ int cond::MigrateGTUtilities::execute(){
std::string connectionString = std::get<4>( gtitem );

std::cout <<"--> Processing tag "<<tag<<" (objectType: "<<payloadTypeName<<") on account "<<connectionString<<std::endl;

std::string sourceConn = connectionString;
std::string protocol = getConnectionProtocol( connectionString );
if( protocol == "frontier" ){
sourceConn = convertoToOracleConnection( connectionString);
}

std::string sourceConn = convert( connectionString ); // "oracle://cms_orcon_adg/"+account;
std::string destTag("");
cond::MigrationStatus status;
bool exists = session.checkMigrationLog( sourceConn, tag, destTag, status );
Loading

0 comments on commit 067ffe8

Please sign in to comment.