Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payload Inspector target DB set to prod #13261

Merged
merged 1 commit into from
Feb 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions CondCore/CondDB/interface/PayloadReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ namespace cond {
class PayloadReader {
public:

//static constexpr const char* const PRODUCTION_DB = "oracle://cms_orcon_adg/CMS_CONDITIONS";
static constexpr const char* const PRODUCTION_DB = "oracle://cms_orcoff_prep/CMS_CONDITIONS_002";
static constexpr const char* const PRODUCTION_DB = "oracle://cms_orcon_adg/CMS_CONDITIONS";

public:

Expand Down
7 changes: 7 additions & 0 deletions CondCore/SiStripPlugins/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@
<use name="CondFormats/Common"/>
<use name="boost_python"/>
</library>

<library file="SiStrip*_PayloadInspector.cc" name="SiStrip_PayloadInspector">
<use name="CondCore/Utilities"/>
<use name="CondCore/CondDB"/>
<use name="CondFormats/Common"/>
<use name="boost_python"/>
</library>
87 changes: 87 additions & 0 deletions CondCore/SiStripPlugins/plugins/SiStripDetVOff_PayloadInspector.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#include "CondCore/Utilities/interface/PayloadInspectorModule.h"
#include "CondCore/Utilities/interface/JsonPrinter.h"
#include "CondCore/CondDB/interface/Time.h"
#include "CondCore/CondDB/interface/PayloadReader.h"

#include "CondFormats/SiStripObjects/interface/SiStripDetVOff.h"

#include <sstream>

namespace {

class SiStripDetVOff_LV {
public:
SiStripDetVOff_LV(){
}

// return the type-name of the objects we handle, so the PayloadInspector can find corresponding tags
std::string objectType() {
return "SiStripDetVOff";
}

// return a title string to be used in the PayloadInspector
std::string title() {
return "Nr of mod with LV OFF vs time";
}

std::string info() {
return title();
}

std::string data( const boost::python::list& iovs ){
cond::persistency::PayloadReader reader;
// TO DO: add try /catch block
reader.open();
cond::utilities::JsonPrinter jprint("Time","nLVOff");
for( int i=0; i< len( iovs ); i++ ) {
cond::Iov_t iov = boost::python::extract<cond::Iov_t>( iovs[i] );
boost::shared_ptr<SiStripDetVOff> obj = reader.fetch<SiStripDetVOff>( iov.payloadId );
jprint.append(boost::lexical_cast<std::string>( iov.since ),
boost::lexical_cast<std::string>( obj->getLVoffCounts() ),
boost::lexical_cast<std::string>( 0. ) );
}
return jprint.print();
}
};

class SiStripDetVOff_HV {
public:
SiStripDetVOff_HV(){
}

// return the type-name of the objects we handle, so the PayloadInspector can find corresponding tags
std::string objectType() {
return "SiStripDetVOff";
}

// return a title string to be used in the PayloadInspector
std::string title() {
return "Nr of mod with HV OFF vs time";
}

std::string info() {
return title();
}

std::string data( const boost::python::list& iovs ){
cond::persistency::PayloadReader reader;
// TO DO: add try /catch block
reader.open();
cond::utilities::JsonPrinter jprint("Time","nHVOff");
for( int i=0; i< len( iovs ); i++ ) {
cond::Iov_t iov = boost::python::extract<cond::Iov_t>( iovs[i] );
boost::shared_ptr<SiStripDetVOff> obj = reader.fetch<SiStripDetVOff>( iov.payloadId );
jprint.append(boost::lexical_cast<std::string>( iov.since ),
boost::lexical_cast<std::string>( obj->getHVoffCounts() ),
boost::lexical_cast<std::string>( 0. ) );
}
return jprint.print();
}
};

}

PAYLOAD_INSPECTOR_MODULE( SiStrip ){
PAYLOAD_INSPECTOR_CLASS( SiStripDetVOff_LV );
PAYLOAD_INSPECTOR_CLASS( SiStripDetVOff_HV );
}
121 changes: 0 additions & 121 deletions CondCore/Utilities/python/generateWrappers.py

This file was deleted.