Skip to content

Commit

Permalink
Merge pull request #13261 from ggovi/PayloadInspector-v2
Browse files Browse the repository at this point in the history
Payload Inspector target DB set to prod
  • Loading branch information
davidlange6 committed Feb 12, 2016
2 parents 2092757 + fe29e34 commit 599a779
Show file tree
Hide file tree
Showing 12 changed files with 95 additions and 1,088 deletions.
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.

0 comments on commit 599a779

Please sign in to comment.