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

Added dictionary classes in EcalCondDB to be used in pyroot for the laser monitoring analysis #29240

Merged
merged 10 commits into from
Apr 16, 2020
22 changes: 22 additions & 0 deletions OnlineDB/EcalCondDB/bin/test_db_connect.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import ROOT
import sys
db_sid = 'CMS_OMDS_LB'
db_usr = 'CMS_ECAL_LASER_COND'
db_pwd = sys.argv[1]

runMin = 309000
runMax = 999999

econn = ROOT.EcalCondDBInterface( db_sid, db_usr, db_pwd )
my_locdef = ROOT.LocationDef()
my_locdef.setLocation("P5_Co")
my_rundef = ROOT.RunTypeDef()
my_rundef.setRunType("PHYSICS")

runtag = ROOT.RunTag()
runtag.setLocationDef(my_locdef)
runtag.setRunTypeDef(my_rundef)
runtag.setGeneralTag("GLOBAL")
runlist = econn.fetchNonEmptyGlobalRunList( runtag, runMin, runMax ).getRuns()
runs = [ runlist[i].getRunNumber() for i in range( runlist.size() ) ]
print(runs)
2 changes: 0 additions & 2 deletions OnlineDB/EcalCondDB/interface/IODConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,9 @@ class IODConfig : public IDBObject {
inFile.close();
std::cout << "we are here4" << std::endl;
delete[] buffer;

} catch (SQLException &e) {
throw(std::runtime_error(std::string("populateClob(): ") + e.getMessage()));
}

std::cout << "Populating the Clob - Success" << std::endl;
}

Expand Down
11 changes: 11 additions & 0 deletions OnlineDB/EcalCondDB/src/classes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would seem that these classes need to move to CondFormats?

#include "OnlineDB/EcalCondDB/interface/RunTag.h"
#include "OnlineDB/EcalCondDB/interface/RunIOV.h"

namespace OnlineDB_EcalCondDB {
struct dictionnary {
RunTag r1;
RunIOV r2;
EcalCondDBInterface e1;
};
} // namespace OnlineDB_EcalCondDB
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
namespace OnlineDB_EcalCondDB {
struct dictionnary {
RunTag r1;
RunIOV r2;
EcalCondDBInterface e1;
};
} // namespace OnlineDB_EcalCondDB

These are not needed anymore.

5 changes: 5 additions & 0 deletions OnlineDB/EcalCondDB/src/classes_def.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<lcgdict>
<class name="RunIOV"/>
<class name="RunTag"/>
<class name="EcalCondDBInterface"/>
</lcgdict>