diff --git a/CondTools/Ecal/plugins/SealModule.cc b/CondTools/Ecal/plugins/SealModule.cc index 50fc64b002856..407af4f9cdc52 100644 --- a/CondTools/Ecal/plugins/SealModule.cc +++ b/CondTools/Ecal/plugins/SealModule.cc @@ -1,6 +1,7 @@ #include "FWCore/PluginManager/interface/ModuleDef.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "CondTools/Ecal/plugins/StoreEcalCondition.h" +#include "CondTools/Ecal/plugins/StoreESCondition.h" #include "CondTools/Ecal/interface/EcalDBCopy.h" #include "CondTools/Ecal/interface/ESDBCopy.h" #include "CondTools/Ecal/interface/EcalTestDevDB.h" @@ -10,6 +11,7 @@ DEFINE_FWK_MODULE(StoreEcalCondition); +DEFINE_FWK_MODULE(StoreESCondition); DEFINE_FWK_MODULE(EcalDBCopy); DEFINE_FWK_MODULE(ESDBCopy); DEFINE_FWK_MODULE(EcalTestDevDB); diff --git a/CondTools/Ecal/plugins/StoreESCondition.cc b/CondTools/Ecal/plugins/StoreESCondition.cc new file mode 100644 index 0000000000000..9cf37a6e86625 --- /dev/null +++ b/CondTools/Ecal/plugins/StoreESCondition.cc @@ -0,0 +1,451 @@ +#include "CondTools/Ecal/plugins/StoreESCondition.h" + +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Framework/interface/Event.h" +#include "CondCore/DBOutputService/interface/PoolDBOutputService.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" + +#include +#include +#include +#include +#include +#include + +using std::string; + +StoreESCondition::StoreESCondition(const edm::ParameterSet& iConfig) { + + prog_name_ = "StoreESCondition"; + + logfile_ = iConfig.getParameter< std::string >("logfile"); + + esgain_ = iConfig.getParameter< unsigned int >("gain"); + + typedef std::vector< edm::ParameterSet > Parameters; + Parameters toPut=iConfig.getParameter("toPut"); + for (Parameters::iterator itToPut = toPut.begin(); itToPut != toPut.end(); ++itToPut) { + inpFileName_.push_back(itToPut->getUntrackedParameter("inputFile")); + objectName_.push_back(itToPut->getUntrackedParameter("conditionType")); + since_.push_back(itToPut->getUntrackedParameter("since")); + } + +} + +void StoreESCondition::endJob() { + + edm::Service mydbservice; + if ( !mydbservice.isAvailable() ) { + edm::LogError("StoreESCondition")<<"PoolDBOutputService is unavailable"<< "\n"; + return; + } + + bool toAppend = false; + // copy a string to the char * + std::string message = "finished OK\n"; + size_t messageSize = message.size() + 1; + char * messChar = new char [messageSize]; + strncpy(messChar, message.c_str(), messageSize); + + for (unsigned int i=0;iisNewTagRequest( objectName_[i]+std::string("Rcd") ) ) { + // This is the first object for this tag. + // Append mode should be off. + // newTime is the end of this new objects IOV. + newTime = mydbservice->beginOfTime(); + } else { + // There should already be an object in the DB for this tag. + // Append IOV mode should be on. + // newTime is the beginning of this new objects IOV. + toAppend=true; + newTime = (cond::Time_t)since_[i]; + } + edm::LogInfo("StoreESCondition") << "Reading " << objectName_[i] + << " from file and writing to DB with newTime " << newTime << "\n"; + if (objectName_[i] == "ESChannelStatus") { + edm::LogInfo("StoreESCondition") << " ESChannelStatus file " << inpFileName_[i] << "\n"; + ESChannelStatus* mycali = readESChannelStatusFromFile(inpFileName_[i].c_str()); + edm::LogInfo("StoreESCondition") << " ESChannelStatus file read " << "\n"; + if(!toAppend){ + edm::LogInfo("StoreESCondition") << " before create " << "\n"; + mydbservice->createNewIOV(mycali,newTime,mydbservice->endOfTime(),"ESChannelStatusRcd"); + edm::LogInfo("StoreESCondition") << " after create " << "\n"; + }else{ + edm::LogInfo("StoreESCondition") << " before append " << "\n"; + mydbservice->appendSinceTime(mycali,newTime,"ESChannelStatusRcd"); + edm::LogInfo("StoreESCondition") << " after append " << "\n"; + } + } else if (objectName_[i] == "ESIntercalibConstants") { + ESIntercalibConstants* myintercalib = readESIntercalibConstantsFromFile(inpFileName_[i].c_str()); + if(!toAppend){ + mydbservice->createNewIOV(myintercalib, newTime, mydbservice->endOfTime(), "ESIntercalibConstantsRcd"); + }else{ + mydbservice->appendSinceTime(myintercalib, newTime, "ESIntercalibConstantsRcd"); + } + } else if (objectName_[i] == "ESTimeSampleWeights") { + ESTimeSampleWeights* myintercalib = readESTimeSampleWeightsFromFile(inpFileName_[i].c_str()); + if(!toAppend){ + mydbservice->createNewIOV(myintercalib, newTime, mydbservice->endOfTime(), "ESTimeSampleWeightsRcd"); + }else{ + mydbservice->appendSinceTime(myintercalib, newTime, "ESTimeSampleWeightsRcd"); + } + } else if (objectName_[i] == "ESGain") { + ESGain* myintercalib = readESGainFromFile(inpFileName_[i].c_str()); + if(!toAppend){ + mydbservice->createNewIOV(myintercalib, newTime, mydbservice->endOfTime(), "ESGainRcd"); + }else{ + mydbservice->appendSinceTime(myintercalib, newTime, "ESGainRcd"); + } + } else if (objectName_[i] == "ESMissingEnergyCalibration") { + ESMissingEnergyCalibration* myintercalib = readESMissingEnergyFromFile(inpFileName_[i].c_str()); + if(!toAppend){ + mydbservice->createNewIOV(myintercalib, newTime, mydbservice->endOfTime(), "ESMissingEnergyCalibrationRcd"); + }else{ + mydbservice->appendSinceTime(myintercalib, newTime, "ESMissingEnergyCalibrationRcd"); + } + } else if (objectName_[i] == "ESRecHitRatioCuts") { + ESRecHitRatioCuts* myintercalib = readESRecHitRatioCutsFromFile(inpFileName_[i].c_str()); + if(!toAppend){ + mydbservice->createNewIOV(myintercalib, newTime, mydbservice->endOfTime(), "ESRecHitRatioCutsRcd"); + }else{ + mydbservice->appendSinceTime(myintercalib, newTime, "ESRecHitRatioCutsRcd"); + } + } else if (objectName_[i] == "ESThresholds") { + ESThresholds* myintercalib = readESThresholdsFromFile(inpFileName_[i].c_str()); + if(!toAppend){ + mydbservice->createNewIOV(myintercalib, newTime, mydbservice->endOfTime(), "ESThresholdsRcd"); + }else{ + mydbservice->appendSinceTime(myintercalib, newTime, "ESThresholdsRcd"); + } + } else if (objectName_[i] == "ESPedestals") { + ESPedestals* myintercalib = readESPedestalsFromFile(inpFileName_[i].c_str()); + if(!toAppend){ + mydbservice->createNewIOV(myintercalib, newTime, mydbservice->endOfTime(), "ESPedestalsRcd"); + }else{ + mydbservice->appendSinceTime(myintercalib, newTime, "ESPedestalsRcd"); + } + } else if (objectName_[i] == "ESEEIntercalibConstants") { + ESEEIntercalibConstants *myintercalib = readESEEIntercalibConstantsFromFile(inpFileName_[i].c_str()); + if(!toAppend){ + mydbservice->createNewIOV(myintercalib, newTime, mydbservice->endOfTime(), "ESEEIntercalibConstantsRcd"); + }else{ + mydbservice->appendSinceTime(myintercalib, newTime, "ESEEIntercalibConstantsRcd"); + } + } else { + edm::LogError("StoreESCondition")<< "Object " << objectName_[i] << " is not supported by this program." << "\n"; + } + // if more records write here else if .... + + writeToLogFileResults(messChar); + + edm::LogInfo("StoreESCondition") << "Finished endJob" << "\n"; + } + + delete [] messChar; +} + +StoreESCondition::~StoreESCondition() { + +} + +void StoreESCondition::analyze( const edm::Event& evt, const edm::EventSetup& evtSetup) { +} + +void StoreESCondition::writeToLogFile(string a, string b, unsigned long long since) { + + FILE *outFile; // output log file for appending + outFile = fopen(logfile_.c_str(),"a"); + if (!outFile) { + edm::LogError("StoreESCondition") <<"*** Can not open file: " << logfile_; + return; + } + char header[256]; + fillHeader(header); + char appendMode[10]; + if (since != 0) + strcpy(appendMode,"append"); + else + strcpy(appendMode,"create"); + + //fprintf(outFile, "%s %s condition from file %s written into DB for SM %d (mapped to SM %d) in %s mode (since run %u)\n", + //header, a.c_str(), b.c_str(), appendMode, (unsigned int)since); + + fclose(outFile); // close out file + +} + +void StoreESCondition::writeToLogFileResults(char* arg) { + + FILE *outFile; // output log file for appending + outFile = fopen(logfile_.c_str(),"a"); + if (!outFile) { + edm::LogError("StoreESCondition")<<"*** Can not open file: " << logfile_; + return; + } + char header[256]; + fillHeader(header); + fprintf(outFile, "%s %s\n", header,arg); + fclose(outFile); // close out file +} + +void StoreESCondition::fillHeader(char* header) { + time_t rawtime; + struct tm * timeinfo; + time ( &rawtime ); + timeinfo = localtime ( &rawtime ); + char user[50]; + strcpy(user,getlogin()); + strcpy(header,asctime(timeinfo)); + strcpy(header,user); +} + +ESThresholds* StoreESCondition::readESThresholdsFromFile(const char* inputFile) { + + std::ifstream ESThresholdsFile(edm::FileInPath(inputFile).fullPath().c_str()); + float ts2, zs; //2nd time sample, ZS threshold + ESThresholdsFile >> ts2; + ESThresholdsFile >> zs; + ESThresholds* esThresholds = new ESThresholds(ts2, zs); + + return esThresholds; +} + +ESEEIntercalibConstants* StoreESCondition::readESEEIntercalibConstantsFromFile(const char* inputFile) { + + std::ifstream ESEEIntercalibFile(edm::FileInPath(inputFile).fullPath().c_str()); + float gammaLow0, alphaLow0, gammaHigh0, alphaHigh0, gammaLow1, alphaLow1, gammaHigh1, alphaHigh1, + gammaLow2, alphaLow2, gammaHigh2, alphaHigh2, gammaLow3, alphaLow3, gammaHigh3, alphaHigh3; + // const float ESEEIntercalibValue[16]; + // for (int i = 0; i < 16; ++i) { + // ESEEIntercalibFile >> ESEEIntercalibValue[i]; + // } + // ESEEIntercalibConstants* eseeIntercalibConstants = new ESEEIntercalibConstants(ESEEIntercalibValue); + ESEEIntercalibFile >> gammaLow0; + ESEEIntercalibFile >> alphaLow0; + ESEEIntercalibFile >> gammaHigh0; + ESEEIntercalibFile >> alphaHigh0; + ESEEIntercalibFile >> gammaLow1; + ESEEIntercalibFile >> alphaLow1; + ESEEIntercalibFile >> gammaHigh1; + ESEEIntercalibFile >> alphaHigh1; + ESEEIntercalibFile >> gammaLow2; + ESEEIntercalibFile >> alphaLow2; + ESEEIntercalibFile >> gammaHigh2; + ESEEIntercalibFile >> alphaHigh2; + ESEEIntercalibFile >> gammaLow3; + ESEEIntercalibFile >> alphaLow3; + ESEEIntercalibFile >> gammaHigh3; + ESEEIntercalibFile >> alphaHigh3; + ESEEIntercalibConstants* eseeIntercalibConstants = new ESEEIntercalibConstants(gammaLow0, alphaLow0, gammaHigh0, alphaHigh0, + gammaLow1, alphaLow1, gammaHigh1, alphaHigh1, + gammaLow2, alphaLow2, gammaHigh2, alphaHigh2, + gammaLow3, alphaLow3, gammaHigh3, alphaHigh3); + + return eseeIntercalibConstants; + +} + +ESMissingEnergyCalibration* StoreESCondition::readESMissingEnergyFromFile(const char* inputFile) { + + std::ifstream ESMissingEnergyFile(edm::FileInPath(inputFile).fullPath().c_str()); + float ConstAEta0, ConstBEta0, ConstAEta1, ConstBEta1, ConstAEta2, ConstBEta2, ConstAEta3, ConstBEta3; + ESMissingEnergyFile >> ConstAEta0; + ESMissingEnergyFile >> ConstBEta0; + ESMissingEnergyFile >> ConstAEta1; + ESMissingEnergyFile >> ConstBEta1; + ESMissingEnergyFile >> ConstAEta2; + ESMissingEnergyFile >> ConstBEta2; + ESMissingEnergyFile >> ConstAEta3; + ESMissingEnergyFile >> ConstBEta3; + ESMissingEnergyCalibration* esMissingEnergy = new ESMissingEnergyCalibration(ConstAEta0, ConstBEta0, ConstAEta1, ConstBEta1, + ConstAEta2, ConstBEta2, ConstAEta3, ConstBEta3); + + return esMissingEnergy; +} + +ESPedestals* StoreESCondition::readESPedestalsFromFile(const char* inputFile) { + + ESPedestals* esPedestals = new ESPedestals(); + + // int ped[2][2][40][40][32]; + // for (int i=0; i<2; ++i) + // for (int j=0; j<2; ++j) + // for (int k=0; k<40; ++k) + // for (int m=0; m<40; ++m) + // for (int n=0; n<32; ++n) + // ped[i][j][k][m][n] = 0; + + int ped[ESDetId::IZ_NUM][ESDetId::PLANE_MAX][ESDetId::IX_MAX][ESDetId::IY_MAX][ESDetId::ISTRIP_MAX]={}; + + int iz, ip, ix, iy, is, ped_, zside; + std::ifstream pedestalFile(edm::FileInPath(inputFile).fullPath().c_str()); + + for (int i=0; i<137216; ++i) { + pedestalFile >> iz >> ip >> ix >> iy >> is >> ped_; + + zside = (iz==-1) ? 1 : 0; + ped[zside][ip-1][ix-1][iy-1][is-1] = ped_; + } + + for (int iz=-1; iz<=1; ++iz) { + + if (iz==0) continue; + zside = (iz==-1) ? 1 : 0; + + for (int iplane=ESDetId::PLANE_MIN; iplane<=ESDetId::PLANE_MAX; ++iplane) + for (int ix=ESDetId::IX_MIN; ix<=ESDetId::IX_MAX; ++ix) + for (int iy=ESDetId::IY_MIN; iy<=ESDetId::IY_MAX; ++iy) + for (int istrip=ESDetId::ISTRIP_MIN; istrip<=ESDetId::ISTRIP_MAX; ++istrip) { + + ESPedestals::Item ESitem; + ESitem.mean = ped[zside][iplane-1][ix-1][iy-1][istrip-1]; + ESitem.rms = 3; // LG : 3, HG : 6 + + if(ESDetId::validDetId(istrip, ix, iy, iplane, iz)) { + ESDetId esId(istrip, ix, iy, iplane, iz); + esPedestals->insert(std::make_pair(esId.rawId(), ESitem)); + } + } + } + + return esPedestals; +} + +ESRecHitRatioCuts* StoreESCondition::readESRecHitRatioCutsFromFile(const char* inputFile) { + + std::ifstream ESRecHitRatioCutsFile(edm::FileInPath(inputFile).fullPath().c_str()); + + float r12Low, r23Low, r12High, r23High; + ESRecHitRatioCutsFile >> r12Low; + ESRecHitRatioCutsFile >> r23Low; + ESRecHitRatioCutsFile >> r12High; + ESRecHitRatioCutsFile >> r23High; + ESRecHitRatioCuts* esRecHitRatioCuts= new ESRecHitRatioCuts(r12Low, r23Low, r12High, r23High); + // cout<<"We are in RH ratio cut : gain : " << esgain_<> gain; + edm::LogInfo("StoreESCondition") << "gain : "<< gain << "\n"; + + ESGain* esGain = new ESGain(gain); // 1: LG, 2: HG + return esGain; +} + +ESTimeSampleWeights* StoreESCondition::readESTimeSampleWeightsFromFile(const char* inputFile) { + + std::ifstream amplFile(edm::FileInPath(inputFile).fullPath().c_str()); + + float w[3]; + for (int k = 0; k < 3; ++k) { + float ww; + amplFile >> ww; + w[k] = ww; + edm::LogInfo("StoreESCondition") <<"weight : "<> iz >> ip >> ix >> iy >> is >> mip; + //if (mip <20 || mip> 70) cout< 70) edm::LogInfo("StoreESCondition") <setValue(esId.rawId(), mip); + } + } + + return ical; +} + +ESChannelStatus* StoreESCondition::readESChannelStatusFromFile(const char* inputFile) { + + + int z[1000], p[1000], x[1000], y[1000], nsensors; + std::ifstream statusFile(edm::FileInPath(inputFile).fullPath().c_str()); + statusFile >> nsensors; + edm::LogInfo("StoreESCondition") << " nsensors " << nsensors << "\n"; + if(nsensors >= 1000) { + edm::LogInfo("StoreESCondition") << " *** value too high, modify the method!***" << "\n"; + exit(-1); + } + for (int i = 0; i < nsensors; ++i) { + statusFile >> z[i] >> p[i] >> x[i] >> y[i]; + } + ESChannelStatus* ecalStatus = new ESChannelStatus(); + int Nbstatus = 0, Nbstrip = 0; + for (int istrip=ESDetId::ISTRIP_MIN;istrip<=ESDetId::ISTRIP_MAX;istrip++) { + for (int ix=ESDetId::IX_MIN;ix<=ESDetId::IX_MAX;ix++) { + for (int iy=ESDetId::IY_MIN;iy<=ESDetId::IY_MAX;iy++) { + for (int iplane = 1; iplane <= 2; iplane++) { + for (int izeta = -1; izeta <= 1; izeta = izeta + 2) { + // if (izeta==0) continue; + // try { + + //ESDetId Plane iplane Zside izeta + // if(!ESDetId::validDetId(istrip,ix,iy,iplane,izeta)) cout << " Unvalid DetId" << endl; + // else { + if(ESDetId::validDetId(istrip,ix,iy,iplane,izeta)) { + ESDetId anESId(istrip,ix,iy,iplane,izeta); + int status = 0; + // std::ifstream statusFile(edm::FileInPath(inputFile).fullPath().c_str()); + Nbstrip++; + for (int i=0; isetValue(anESId, status); + // statusFile.close(); + } // valid DetId + // catch ( cms::Exception &e ) { } + } // loop over z + } // loop over plane + } // loop over y + } // loop over x + } // loop over strips + edm::LogInfo("StoreESCondition") << " Nb of strips " << Nbstrip << " Number of bad channels " << Nbstatus << "\n"; + statusFile.close(); + + // overwrite the statuses which are in the file + return ecalStatus; + +} + diff --git a/CondTools/Ecal/plugins/StoreESCondition.h b/CondTools/Ecal/plugins/StoreESCondition.h new file mode 100644 index 0000000000000..d8fcb69e2cdf1 --- /dev/null +++ b/CondTools/Ecal/plugins/StoreESCondition.h @@ -0,0 +1,74 @@ +#ifndef StoreESCondition_h +#define StoreESCondition_h + +#include "FWCore/Framework/interface/EDAnalyzer.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "CondFormats/ESObjects/interface/ESTimeSampleWeights.h" +#include "CondFormats/ESObjects/interface/ESChannelStatus.h" +#include "CondFormats/ESObjects/interface/ESGain.h" +#include "CondFormats/ESObjects/interface/ESThresholds.h" +#include "CondFormats/ESObjects/interface/ESPedestals.h" +#include "CondFormats/ESObjects/interface/ESRecHitRatioCuts.h" +#include "CondFormats/ESObjects/interface/ESIntercalibConstants.h" +#include "CondFormats/ESObjects/interface/ESMissingEnergyCalibration.h" +#include "CondFormats/ESObjects/interface/ESEEIntercalibConstants.h" +#include "DataFormats/EcalDetId/interface/ESDetId.h" + +namespace edm { + class ParameterSet; + class Event; + class EventSetup; +} + +class StoreESCondition : public edm::EDAnalyzer { + + public: + + ESThresholds* readESThresholdsFromFile(const char*); + ESPedestals* readESPedestalsFromFile(const char*); + ESRecHitRatioCuts* readESRecHitRatioCutsFromFile(const char*); + ESGain* readESGainFromFile(const char*); + ESTimeSampleWeights* readESTimeSampleWeightsFromFile(const char*); + ESChannelStatus* readESChannelStatusFromFile(const char *); + ESIntercalibConstants* readESIntercalibConstantsFromFile(const char*); + ESMissingEnergyCalibration* readESMissingEnergyFromFile(const char*); + ESEEIntercalibConstants* readESEEIntercalibConstantsFromFile(const char*); + void writeToLogFile(std::string , std::string, unsigned long long) ; + void writeToLogFileResults(char* ) ; + + explicit StoreESCondition(const edm::ParameterSet& iConfig ); + ~StoreESCondition(); + + virtual void analyze( const edm::Event& evt, const edm::EventSetup& evtSetup); + virtual void endJob(); + + private: + + void fillHeader(char*); + + std::vector< std::string > objectName_ ; + std::vector< std::string > inpFileName_ ; + std::vector< std::string > inpFileNameEE_ ; + std::string prog_name_ ; + std::vector< unsigned long long > since_; // beginning IOV for objects + std::string logfile_; + + unsigned int esgain_; + + std::string to_string( char value[]) { + std::ostringstream streamOut; + streamOut << value; + return streamOut.str(); + } + +}; + +#endif diff --git a/CondTools/Ecal/python/EcalTPGFineGrainStripfromFile_cfg.py b/CondTools/Ecal/python/EcalTPGFineGrainStripfromFile_cfg.py index 44715511305f0..6d49fc7a89aab 100644 --- a/CondTools/Ecal/python/EcalTPGFineGrainStripfromFile_cfg.py +++ b/CondTools/Ecal/python/EcalTPGFineGrainStripfromFile_cfg.py @@ -1,12 +1,13 @@ import FWCore.ParameterSet.Config as cms process = cms.Process("ProcessOne") -process.load("CondCore.DBCommon.CondDBCommon_cfi") -process.CondDBCommon.DBParameters.authenticationPath = '/afs/cern.ch/cms/DB/conddb/' +process.load("CondCore.CondDB.CondDB_cfi") +#process.load("CondCore.DBCommon.CondDBCommon_cfi") +process.CondDB.DBParameters.authenticationPath = '/afs/cern.ch/cms/DB/conddb/' # # Choose the output database # -process.CondDBCommon.connect = 'sqlite_file:EcalTPGFineGrainStrip.db' +process.CondDB.connect = 'sqlite_file:EcalTPGFineGrainStrip.db' process.MessageLogger = cms.Service("MessageLogger", debugModules = cms.untracked.vstring('*'), @@ -21,7 +22,7 @@ ) process.PoolDBESSource = cms.ESSource("PoolDBESSource", - process.CondDBCommon, + process.CondDB, timetype = cms.untracked.string('runnumber'), toGet = cms.VPSet( cms.PSet( @@ -32,7 +33,7 @@ ) process.PoolDBOutputService = cms.Service("PoolDBOutputService", - process.CondDBCommon, + process.CondDB, logconnect = cms.untracked.string('sqlite_file:DBLog.db'), timetype = cms.untracked.string('runnumber'), toPut = cms.VPSet( diff --git a/CondTools/Ecal/python/EcalTPGSpikeThresholdfromFile_cfg.py b/CondTools/Ecal/python/EcalTPGSpikeThresholdfromFile_cfg.py index 86d3b693f7fa9..d19487306ffb3 100644 --- a/CondTools/Ecal/python/EcalTPGSpikeThresholdfromFile_cfg.py +++ b/CondTools/Ecal/python/EcalTPGSpikeThresholdfromFile_cfg.py @@ -1,12 +1,13 @@ import FWCore.ParameterSet.Config as cms process = cms.Process("ProcessOne") -process.load("CondCore.DBCommon.CondDBCommon_cfi") -process.CondDBCommon.DBParameters.authenticationPath = '/afs/cern.ch/cms/DB/conddb/' +process.load("CondCore.CondDB.CondDB_cfi") +#process.load("CondCore.DBCommon.CondDBCommon_cfi") +process.CondDB.DBParameters.authenticationPath = '/afs/cern.ch/cms/DB/conddb/' # # Choose the output database # -process.CondDBCommon.connect = 'sqlite_file:EcalTPGSpike.db' +process.CondDB.connect = 'sqlite_file:EcalTPGSpike.db' process.MessageLogger = cms.Service("MessageLogger", debugModules = cms.untracked.vstring('*'), @@ -21,7 +22,7 @@ ) process.PoolDBESSource = cms.ESSource("PoolDBESSource", - process.CondDBCommon, + process.CondDB, timetype = cms.untracked.string('runnumber'), toGet = cms.VPSet( cms.PSet( @@ -32,7 +33,7 @@ ) process.PoolDBOutputService = cms.Service("PoolDBOutputService", - process.CondDBCommon, + process.CondDB, logconnect = cms.untracked.string('sqlite_file:DBLog.db'), timetype = cms.untracked.string('runnumber'), toPut = cms.VPSet( diff --git a/CondTools/Ecal/python/Ecal_Laser_weekly_Linearization_Check_cfg.py b/CondTools/Ecal/python/Ecal_Laser_weekly_Linearization_Check_cfg.py index a16d22432dc4d..9ad2d26b81563 100644 --- a/CondTools/Ecal/python/Ecal_Laser_weekly_Linearization_Check_cfg.py +++ b/CondTools/Ecal/python/Ecal_Laser_weekly_Linearization_Check_cfg.py @@ -1,13 +1,14 @@ import FWCore.ParameterSet.Config as cms process = cms.Process("ProcessOne") -process.load("CondCore.DBCommon.CondDBCommon_cfi") -process.CondDBCommon.DBParameters.authenticationPath = '/afs/cern.ch/cms/DB/conddb/' +#process.load("CondCore.DBCommon.CondDBCommon_cfi") +process.load("CondCore.CondDB.CondDB_cfi") +process.CondDB.DBParameters.authenticationPath = '/afs/cern.ch/cms/DB/conddb/' # # Choose the output database # #process.CondDBCommon.connect = 'oracle://cms_orcon_prod/CMS_COND_311X_ECAL_LAS' -process.CondDBCommon.connect = 'sqlite_file:EcalLin.db' +process.CondDB.connect = 'sqlite_file:EcalLin.db' process.MessageLogger = cms.Service("MessageLogger", debugModules = cms.untracked.vstring('*'), @@ -22,7 +23,7 @@ ) process.PoolDBESSource = cms.ESSource("PoolDBESSource", - process.CondDBCommon, + process.CondDB, timetype = cms.untracked.string('runnumber'), toGet = cms.VPSet( cms.PSet( @@ -33,7 +34,7 @@ ) process.PoolDBOutputService = cms.Service("PoolDBOutputService", - process.CondDBCommon, + process.CondDB, logconnect = cms.untracked.string('sqlite_file:DBLog.db'), timetype = cms.untracked.string('runnumber'), toPut = cms.VPSet( diff --git a/CondTools/Ecal/test/preshower/writeESChannelStatus.py b/CondTools/Ecal/test/preshower/writeESChannelStatus.py new file mode 100644 index 0000000000000..c8e7d01714f9a --- /dev/null +++ b/CondTools/Ecal/test/preshower/writeESChannelStatus.py @@ -0,0 +1,47 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("TEST") +#process.load("CondCore.DBCommon.CondDBCommon_cfi") +process.load("CondCore.CondDB.CondDB_cfi") +#process.CondDBCommon.connect = 'oracle://cms_orcon_prod/CMS_COND_39X_PRESHOWER' +#process.CondDBCommon.DBParameters.authenticationPath = '/nfshome0/popcondev/conddb' +process.CondDB.connect = 'sqlite_file:ESChannelStatus.db' + +process.MessageLogger = cms.Service("MessageLogger", + debugModules = cms.untracked.vstring('*'), + destinations = cms.untracked.vstring('cout') + ) + +process.source = cms.Source("EmptyIOVSource", + firstValue = cms.uint64(1), + lastValue = cms.uint64(1), + timetype = cms.string('runnumber'), + interval = cms.uint64(1) + ) + +process.PoolDBOutputService = cms.Service("PoolDBOutputService", + process.CondDB, + timetype = cms.untracked.string('runnumber'), + toPut = cms.VPSet(cms.PSet( + + record = cms.string('ESChannelStatusRcd'), + tag = cms.string('ESChannelStatus') + + ))) + +process.ecalModule = cms.EDAnalyzer("StoreESCondition", + gain = cms.uint32(1), + logfile = cms.string('./logfile.log'), + toPut = cms.VPSet(cms.PSet( + + # channel status + conditionType = cms.untracked.string('ESChannelStatus'), + #inputFile = cms.untracked.string('CondTools/Ecal/test/preshower/channelStatus_20110809.txt') + since = cms.untracked.uint32(250000), + inputFile = cms.untracked.string('CondTools/Ecal/test/preshower/ESChannelStatus.txt') + ))) + +process.p = cms.Path(process.ecalModule) + + + diff --git a/CondTools/Ecal/test/preshower/writeESEEIntercalibConstants_HG.py b/CondTools/Ecal/test/preshower/writeESEEIntercalibConstants_HG.py new file mode 100644 index 0000000000000..b6e82108b8cf1 --- /dev/null +++ b/CondTools/Ecal/test/preshower/writeESEEIntercalibConstants_HG.py @@ -0,0 +1,47 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("TEST") +#process.load("CondCore.DBCommon.CondDBCommon_cfi") +process.load("CondCore.CondDB.CondDB_cfi") +#process.CondDBCommon.connect = 'oracle://cms_orcon_prod/CMS_COND_39X_PRESHOWER' +#process.CondDBCommon.DBParameters.authenticationPath = '/nfshome0/popcondev/conddb' +process.CondDB.connect = 'sqlite_file:ESEEIntercalibConstants_HG.db' + +process.MessageLogger = cms.Service("MessageLogger", + debugModules = cms.untracked.vstring('*'), + destinations = cms.untracked.vstring('cout') + ) + +process.source = cms.Source("EmptyIOVSource", + firstValue = cms.uint64(1), + lastValue = cms.uint64(1), + timetype = cms.string('runnumber'), + interval = cms.uint64(1) + ) + +process.PoolDBOutputService = cms.Service("PoolDBOutputService", + process.CondDB, + timetype = cms.untracked.string('runnumber'), + toPut = cms.VPSet(cms.PSet( + # weights + record = cms.string('ESEEIntercalibConstantsRcd'), + tag = cms.string('ESEEIntercalibConstants_HG') + + ))) + +process.ecalModule = cms.EDAnalyzer("StoreESCondition", + logfile = cms.string('./logfile.log'), + gain = cms.uint32(2), + toPut = cms.VPSet(cms.PSet( + + # weights + conditionType = cms.untracked.string('ESEEIntercalibConstants'), + since = cms.untracked.uint32(1), + inputFile = cms.untracked.string('CondTools/Ecal/test/preshower/ESEEIntercalibConstants_HG.txt') + + ))) + +process.p = cms.Path(process.ecalModule) + + + diff --git a/CondTools/Ecal/test/preshower/writeESEEIntercalibConstants_LG.py b/CondTools/Ecal/test/preshower/writeESEEIntercalibConstants_LG.py new file mode 100644 index 0000000000000..4528ad0eed58f --- /dev/null +++ b/CondTools/Ecal/test/preshower/writeESEEIntercalibConstants_LG.py @@ -0,0 +1,47 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("TEST") +#process.load("CondCore.DBCommon.CondDBCommon_cfi") +process.load("CondCore.CondDB.CondDB_cfi") +#process.CondDBCommon.connect = 'oracle://cms_orcon_prod/CMS_COND_39X_PRESHOWER' +#process.CondDBCommon.DBParameters.authenticationPath = '/nfshome0/popcondev/conddb' +process.CondDB.connect = 'sqlite_file:ESEEIntercalibConstants_LG.db' + +process.MessageLogger = cms.Service("MessageLogger", + debugModules = cms.untracked.vstring('*'), + destinations = cms.untracked.vstring('cout') + ) + +process.source = cms.Source("EmptyIOVSource", + firstValue = cms.uint64(1), + lastValue = cms.uint64(1), + timetype = cms.string('runnumber'), + interval = cms.uint64(1) + ) + +process.PoolDBOutputService = cms.Service("PoolDBOutputService", + process.CondDB, + timetype = cms.untracked.string('runnumber'), + toPut = cms.VPSet(cms.PSet( + # weights + record = cms.string('ESEEIntercalibConstantsRcd'), + tag = cms.string('ESEEIntercalibConstants_LG') + + ))) + +process.ecalModule = cms.EDAnalyzer("StoreESCondition", + logfile = cms.string('./logfile.log'), + gain = cms.uint32(1), + toPut = cms.VPSet(cms.PSet( + + # weights + conditionType = cms.untracked.string('ESEEIntercalibConstants'), + since = cms.untracked.uint32(1), + inputFile = cms.untracked.string('CondTools/Ecal/test/preshower/ESEEIntercalibConstants_LG.txt') + + ))) + +process.p = cms.Path(process.ecalModule) + + + diff --git a/CondTools/Ecal/test/preshower/writeESGain_HG.py b/CondTools/Ecal/test/preshower/writeESGain_HG.py new file mode 100644 index 0000000000000..5ea5cb6e435bb --- /dev/null +++ b/CondTools/Ecal/test/preshower/writeESGain_HG.py @@ -0,0 +1,45 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("TEST") +#process.load("CondCore.DBCommon.CondDBCommon_cfi") +process.load("CondCore.CondDB.CondDB_cfi") +process.CondDB.connect = 'sqlite_file:ESGain_HG.db' + +process.MessageLogger = cms.Service("MessageLogger", + debugModules = cms.untracked.vstring('*'), + destinations = cms.untracked.vstring('cout') + ) + +process.source = cms.Source("EmptyIOVSource", + firstValue = cms.uint64(1), + lastValue = cms.uint64(1), + timetype = cms.string('runnumber'), + interval = cms.uint64(1) + ) + +process.PoolDBOutputService = cms.Service("PoolDBOutputService", + process.CondDB, + timetype = cms.untracked.string('runnumber'), + toPut = cms.VPSet(cms.PSet( + # gain + record = cms.string('ESGainRcd'), + tag = cms.string('ESGain_HG') + + ))) + +process.ecalModule = cms.EDAnalyzer("StoreESCondition", + logfile = cms.string('./logfile.log'), + gain = cms.uint32(2), + toPut = cms.VPSet(cms.PSet( + + # gain + conditionType = cms.untracked.string('ESGain'), + since = cms.untracked.uint32(1), + inputFile = cms.untracked.string('CondTools/Ecal/test/preshower/ESGain_HG.txt') + + ))) + +process.p = cms.Path(process.ecalModule) + + + diff --git a/CondTools/Ecal/test/preshower/writeESGain_LG.py b/CondTools/Ecal/test/preshower/writeESGain_LG.py new file mode 100644 index 0000000000000..6b4ccf96cd11e --- /dev/null +++ b/CondTools/Ecal/test/preshower/writeESGain_LG.py @@ -0,0 +1,45 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("TEST") +#process.load("CondCore.DBCommon.CondDBCommon_cfi") +process.load("CondCore.CondDB.CondDB_cfi") +process.CondDB.connect = 'sqlite_file:ESGain_LG.db' + +process.MessageLogger = cms.Service("MessageLogger", + debugModules = cms.untracked.vstring('*'), + destinations = cms.untracked.vstring('cout') + ) + +process.source = cms.Source("EmptyIOVSource", + firstValue = cms.uint64(1), + lastValue = cms.uint64(1), + timetype = cms.string('runnumber'), + interval = cms.uint64(1) + ) + +process.PoolDBOutputService = cms.Service("PoolDBOutputService", + process.CondDB, + timetype = cms.untracked.string('runnumber'), + toPut = cms.VPSet(cms.PSet( + # gain + record = cms.string('ESGainRcd'), + tag = cms.string('ESGain_LG') + + ))) + +process.ecalModule = cms.EDAnalyzer("StoreESCondition", + logfile = cms.string('./logfile.log'), + gain = cms.uint32(1), + toPut = cms.VPSet(cms.PSet( + + # gain + conditionType = cms.untracked.string('ESGain'), + since = cms.untracked.uint32(1), + inputFile = cms.untracked.string('CondTools/Ecal/test/preshower/ESGain_LG.txt') + + ))) + +process.p = cms.Path(process.ecalModule) + + + diff --git a/CondTools/Ecal/test/preshower/writeESIntercalibConstants_HG.py b/CondTools/Ecal/test/preshower/writeESIntercalibConstants_HG.py new file mode 100644 index 0000000000000..ade0fbf5af7c2 --- /dev/null +++ b/CondTools/Ecal/test/preshower/writeESIntercalibConstants_HG.py @@ -0,0 +1,50 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("TEST") +#process.load("CondCore.DBCommon.CondDBCommon_cfi") +process.load("CondCore.CondDB.CondDB_cfi") +#process.CondDBCommon.connect = 'oracle://cms_orcon_prod/CMS_COND_39X_PRESHOWER' +#process.CondDBCommon.DBParameters.authenticationPath = '/nfshome0/popcondev/conddb' +process.CondDB.connect = 'sqlite_file:ESIntercalibConstants_HG.db' + +process.MessageLogger = cms.Service("MessageLogger", + debugModules = cms.untracked.vstring('*'), + destinations = cms.untracked.vstring('cout') + ) + +process.source = cms.Source("EmptyIOVSource", + firstValue = cms.uint64(1), + lastValue = cms.uint64(1), + timetype = cms.string('runnumber'), + interval = cms.uint64(1) + ) + +process.PoolDBOutputService = cms.Service("PoolDBOutputService", + process.CondDB, + timetype = cms.untracked.string('runnumber'), + toPut = cms.VPSet(cms.PSet( + # MIP constants + record = cms.string('ESIntercalibConstantsRcd'), + # ESIntercalibConstants_V01_offline is used up to May 2012 + tag = cms.string('ESIntercalibConstants_HG') + + ))) + +process.ecalModule = cms.EDAnalyzer("StoreESCondition", + gain = cms.uint32(2), # HG + #gain = cms.uint32(1), # LG + logfile = cms.string('./logfile.log'), + toPut = cms.VPSet(cms.PSet( + + # MIP constants + conditionType = cms.untracked.string('ESIntercalibConstants'), + #inputFile = cms.untracked.string('CondTools/Ecal/test/preshower/calibration_constant_LG_Run2012A.txt') + # 2012/11/28 LG 2012 D for test + since = cms.untracked.uint32(1), + inputFile = cms.untracked.string('CondTools/Ecal/test/preshower/ESIntercalibConstants_HG.txt') + ))) + +process.p = cms.Path(process.ecalModule) + + + diff --git a/CondTools/Ecal/test/preshower/writeESIntercalibConstants_LG.py b/CondTools/Ecal/test/preshower/writeESIntercalibConstants_LG.py new file mode 100644 index 0000000000000..cbfb2dc495308 --- /dev/null +++ b/CondTools/Ecal/test/preshower/writeESIntercalibConstants_LG.py @@ -0,0 +1,50 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("TEST") +#process.load("CondCore.DBCommon.CondDBCommon_cfi") +process.load("CondCore.CondDB.CondDB_cfi") +#process.CondDBCommon.connect = 'oracle://cms_orcon_prod/CMS_COND_39X_PRESHOWER' +#process.CondDBCommon.DBParameters.authenticationPath = '/nfshome0/popcondev/conddb' +process.CondDB.connect = 'sqlite_file:ESIntercalibConstants_LG.db' + +process.MessageLogger = cms.Service("MessageLogger", + debugModules = cms.untracked.vstring('*'), + destinations = cms.untracked.vstring('cout') + ) + +process.source = cms.Source("EmptyIOVSource", + firstValue = cms.uint64(1), + lastValue = cms.uint64(1), + timetype = cms.string('runnumber'), + interval = cms.uint64(1) + ) + +process.PoolDBOutputService = cms.Service("PoolDBOutputService", + process.CondDB, + timetype = cms.untracked.string('runnumber'), + toPut = cms.VPSet(cms.PSet( + # MIP constants + record = cms.string('ESIntercalibConstantsRcd'), + # ESIntercalibConstants_V01_offline is used up to May 2012 + tag = cms.string('ESIntercalibConstants_LG') # this is just a test tag for 2012D + + ))) + +process.ecalModule = cms.EDAnalyzer("StoreESCondition", + #gain = cms.uint32(2), # HG + gain = cms.uint32(1), # LG + logfile = cms.string('./logfile.log'), + toPut = cms.VPSet(cms.PSet( + + # MIP constants + conditionType = cms.untracked.string('ESIntercalibConstants'), + #inputFile = cms.untracked.string('CondTools/Ecal/test/preshower/calibration_constant_LG_Run2012A.txt') + # 2012/11/28 LG 2012 D for test + since = cms.untracked.uint32(1), + inputFile = cms.untracked.string('CondTools/Ecal/test/preshower/ESIntercalibConstants_LG.txt') + ))) + +process.p = cms.Path(process.ecalModule) + + + diff --git a/CondTools/Ecal/test/preshower/writeESMissingEnergyCalibration_HG.py b/CondTools/Ecal/test/preshower/writeESMissingEnergyCalibration_HG.py new file mode 100644 index 0000000000000..935e94656b117 --- /dev/null +++ b/CondTools/Ecal/test/preshower/writeESMissingEnergyCalibration_HG.py @@ -0,0 +1,47 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("TEST") +#process.load("CondCore.DBCommon.CondDBCommon_cfi") +process.load("CondCore.CondDB.CondDB_cfi") +#process.CondDBCommon.connect = 'oracle://cms_orcon_prod/CMS_COND_39X_PRESHOWER' +#process.CondDBCommon.DBParameters.authenticationPath = '/nfshome0/popcondev/conddb' +process.CondDB.connect = 'sqlite_file:ESMissingEnergyCalibration_HG.db' + +process.MessageLogger = cms.Service("MessageLogger", + debugModules = cms.untracked.vstring('*'), + destinations = cms.untracked.vstring('cout') + ) + +process.source = cms.Source("EmptyIOVSource", + firstValue = cms.uint64(1), + lastValue = cms.uint64(1), + timetype = cms.string('runnumber'), + interval = cms.uint64(1) + ) + +process.PoolDBOutputService = cms.Service("PoolDBOutputService", + process.CondDB, + timetype = cms.untracked.string('runnumber'), + toPut = cms.VPSet(cms.PSet( + # weights + record = cms.string('ESMissingEnergyCalibrationRcd'), + tag = cms.string('ESMissingEnergyCalibration_HG') + + ))) + +process.ecalModule = cms.EDAnalyzer("StoreESCondition", + logfile = cms.string('./logfile.log'), + gain = cms.uint32(1), + toPut = cms.VPSet(cms.PSet( + + # weights + conditionType = cms.untracked.string('ESMissingEnergyCalibration'), + since = cms.untracked.uint32(1), + inputFile = cms.untracked.string('CondTools/Ecal/test/preshower/ESMissingEnergyCalibration_HG.txt') + + ))) + +process.p = cms.Path(process.ecalModule) + + + diff --git a/CondTools/Ecal/test/preshower/writeESMissingEnergyCalibration_LG.py b/CondTools/Ecal/test/preshower/writeESMissingEnergyCalibration_LG.py new file mode 100644 index 0000000000000..bd323c15c5169 --- /dev/null +++ b/CondTools/Ecal/test/preshower/writeESMissingEnergyCalibration_LG.py @@ -0,0 +1,47 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("TEST") +#process.load("CondCore.DBCommon.CondDBCommon_cfi") +process.load("CondCore.CondDB.CondDB_cfi") +#process.CondDBCommon.connect = 'oracle://cms_orcon_prod/CMS_COND_39X_PRESHOWER' +#process.CondDBCommon.DBParameters.authenticationPath = '/nfshome0/popcondev/conddb' +process.CondDB.connect = 'sqlite_file:ESMissingEnergyCalibration_LG.db' + +process.MessageLogger = cms.Service("MessageLogger", + debugModules = cms.untracked.vstring('*'), + destinations = cms.untracked.vstring('cout') + ) + +process.source = cms.Source("EmptyIOVSource", + firstValue = cms.uint64(1), + lastValue = cms.uint64(1), + timetype = cms.string('runnumber'), + interval = cms.uint64(1) + ) + +process.PoolDBOutputService = cms.Service("PoolDBOutputService", + process.CondDB, + timetype = cms.untracked.string('runnumber'), + toPut = cms.VPSet(cms.PSet( + # weights + record = cms.string('ESMissingEnergyCalibrationRcd'), + tag = cms.string('ESMissingEnergyCalibration_LG') + + ))) + +process.ecalModule = cms.EDAnalyzer("StoreESCondition", + logfile = cms.string('./logfile.log'), + gain = cms.uint32(1), + toPut = cms.VPSet(cms.PSet( + + # weights + conditionType = cms.untracked.string('ESMissingEnergyCalibration'), + since = cms.untracked.uint32(1), + inputFile = cms.untracked.string('CondTools/Ecal/test/preshower/ESMissingEnergyCalibration_LG.txt') + + ))) + +process.p = cms.Path(process.ecalModule) + + + diff --git a/CondTools/Ecal/test/preshower/writeESPedestals_HG.py b/CondTools/Ecal/test/preshower/writeESPedestals_HG.py new file mode 100644 index 0000000000000..e522e0d95311a --- /dev/null +++ b/CondTools/Ecal/test/preshower/writeESPedestals_HG.py @@ -0,0 +1,47 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("TEST") +#process.load("CondCore.DBCommon.CondDBCommon_cfi") +process.load("CondCore.CondDB.CondDB_cfi") +#process.CondDBCommon.connect = 'oracle://cms_orcon_prod/CMS_COND_39X_PRESHOWER' +#process.CondDBCommon.DBParameters.authenticationPath = '/nfshome0/popcondev/conddb' +process.CondDB.connect = 'sqlite_file:ESPedestals_HG.db' + +process.MessageLogger = cms.Service("MessageLogger", + debugModules = cms.untracked.vstring('*'), + destinations = cms.untracked.vstring('cout') + ) + +process.source = cms.Source("EmptyIOVSource", + firstValue = cms.uint64(1), + lastValue = cms.uint64(1), + timetype = cms.string('runnumber'), + interval = cms.uint64(1) + ) + +process.PoolDBOutputService = cms.Service("PoolDBOutputService", + process.CondDB, + timetype = cms.untracked.string('runnumber'), + toPut = cms.VPSet(cms.PSet( + # Pedestals + record = cms.string('ESPedestalsRcd'), + tag = cms.string('ESPedestals_HG') + + ))) + +process.ecalModule = cms.EDAnalyzer("StoreESCondition", + logfile = cms.string('./logfile.log'), + gain = cms.uint32(2), + toPut = cms.VPSet(cms.PSet( + + # Pedestals + conditionType = cms.untracked.string('ESPedestals'), + since = cms.untracked.uint32(1), + inputFile = cms.untracked.string('CondTools/Ecal/test/preshower/ESPedestals_HG.txt') + + ))) + +process.p = cms.Path(process.ecalModule) + + + diff --git a/CondTools/Ecal/test/preshower/writeESPedestals_LG.py b/CondTools/Ecal/test/preshower/writeESPedestals_LG.py new file mode 100644 index 0000000000000..66070e5d4cd3d --- /dev/null +++ b/CondTools/Ecal/test/preshower/writeESPedestals_LG.py @@ -0,0 +1,47 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("TEST") +#process.load("CondCore.DBCommon.CondDBCommon_cfi") +process.load("CondCore.CondDB.CondDB_cfi") +#process.CondDBCommon.connect = 'oracle://cms_orcon_prod/CMS_COND_39X_PRESHOWER' +#process.CondDBCommon.DBParameters.authenticationPath = '/nfshome0/popcondev/conddb' +process.CondDB.connect = 'sqlite_file:ESPedestals_LG.db' + +process.MessageLogger = cms.Service("MessageLogger", + debugModules = cms.untracked.vstring('*'), + destinations = cms.untracked.vstring('cout') + ) + +process.source = cms.Source("EmptyIOVSource", + firstValue = cms.uint64(1), + lastValue = cms.uint64(1), + timetype = cms.string('runnumber'), + interval = cms.uint64(1) + ) + +process.PoolDBOutputService = cms.Service("PoolDBOutputService", + process.CondDB, + timetype = cms.untracked.string('runnumber'), + toPut = cms.VPSet(cms.PSet( + # Pedestals + record = cms.string('ESPedestalsRcd'), + tag = cms.string('ESPedestals_LG') + + ))) + +process.ecalModule = cms.EDAnalyzer("StoreESCondition", + logfile = cms.string('./logfile.log'), + gain = cms.uint32(1), + toPut = cms.VPSet(cms.PSet( + + # Pedestals + conditionType = cms.untracked.string('ESPedestals'), + since = cms.untracked.uint32(1), + inputFile = cms.untracked.string('CondTools/Ecal/test/preshower/ESPedestals_LG.txt') + + ))) + +process.p = cms.Path(process.ecalModule) + + + diff --git a/CondTools/Ecal/test/preshower/writeESRecHitRatioCuts_HG.py b/CondTools/Ecal/test/preshower/writeESRecHitRatioCuts_HG.py new file mode 100644 index 0000000000000..aaa0ef665a6f3 --- /dev/null +++ b/CondTools/Ecal/test/preshower/writeESRecHitRatioCuts_HG.py @@ -0,0 +1,46 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("TEST") +#process.load("CondCore.DBCommon.CondDBCommon_cfi") +process.load("CondCore.CondDB.CondDB_cfi") +#process.CondDBCommon.connect = 'oracle://cms_orcon_prod/CMS_COND_39X_PRESHOWER' +#process.CondDBCommon.DBParameters.authenticationPath = '/nfshome0/popcondev/conddb' +process.CondDB.connect = 'sqlite_file:ESRecHitRatioCuts_HG.db' + +process.MessageLogger = cms.Service("MessageLogger", + debugModules = cms.untracked.vstring('*'), + destinations = cms.untracked.vstring('cout') + ) + +process.source = cms.Source("EmptyIOVSource", + firstValue = cms.uint64(1), + lastValue = cms.uint64(1), + timetype = cms.string('runnumber'), + interval = cms.uint64(1) + ) + +process.PoolDBOutputService = cms.Service("PoolDBOutputService", + process.CondDB, + timetype = cms.untracked.string('runnumber'), + toPut = cms.VPSet(cms.PSet( + # RH ratio cuts + record = cms.string('ESRecHitRatioCutsRcd'), + tag = cms.string('ESRecHitRatioCuts_HG') + ))) + +process.ecalModule = cms.EDAnalyzer("StoreESCondition", + gain = cms.uint32(2), + logfile = cms.string('./logfile.log'), + toPut = cms.VPSet(cms.PSet( + + # RH ratio cuts + conditionType = cms.untracked.string('ESRecHitRatioCuts'), + since = cms.untracked.uint32(250000), + inputFile = cms.untracked.string('CondTools/Ecal/test/preshower/ESRecHitRatioCuts_HG.txt') + + ))) + +process.p = cms.Path(process.ecalModule) + + + diff --git a/CondTools/Ecal/test/preshower/writeESRecHitRatioCuts_LG.py b/CondTools/Ecal/test/preshower/writeESRecHitRatioCuts_LG.py new file mode 100644 index 0000000000000..ae3f17bc9b1b3 --- /dev/null +++ b/CondTools/Ecal/test/preshower/writeESRecHitRatioCuts_LG.py @@ -0,0 +1,46 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("TEST") +#process.load("CondCore.DBCommon.CondDBCommon_cfi") +process.load("CondCore.CondDB.CondDB_cfi") +#process.CondDBCommon.connect = 'oracle://cms_orcon_prod/CMS_COND_39X_PRESHOWER' +#process.CondDBCommon.DBParameters.authenticationPath = '/nfshome0/popcondev/conddb' +process.CondDB.connect = 'sqlite_file:ESRecHitRatioCuts_LG.db' + +process.MessageLogger = cms.Service("MessageLogger", + debugModules = cms.untracked.vstring('*'), + destinations = cms.untracked.vstring('cout') + ) + +process.source = cms.Source("EmptyIOVSource", + firstValue = cms.uint64(1), + lastValue = cms.uint64(1), + timetype = cms.string('runnumber'), + interval = cms.uint64(1) + ) + +process.PoolDBOutputService = cms.Service("PoolDBOutputService", + process.CondDB, + timetype = cms.untracked.string('runnumber'), + toPut = cms.VPSet(cms.PSet( + # RH ratio cuts + record = cms.string('ESRecHitRatioCutsRcd'), + tag = cms.string('ESRecHitRatioCuts_LG') + ))) + +process.ecalModule = cms.EDAnalyzer("StoreESCondition", + gain = cms.uint32(1), + logfile = cms.string('./logfile.log'), + toPut = cms.VPSet(cms.PSet( + + # RH ratio cuts + conditionType = cms.untracked.string('ESRecHitRatioCuts'), + since = cms.untracked.uint32(250000), + inputFile = cms.untracked.string('CondTools/Ecal/test/preshower/ESRecHitRatioCuts_LG.txt') + + ))) + +process.p = cms.Path(process.ecalModule) + + + diff --git a/CondTools/Ecal/test/preshower/writeESThresholds_HG.py b/CondTools/Ecal/test/preshower/writeESThresholds_HG.py new file mode 100644 index 0000000000000..208753f75a279 --- /dev/null +++ b/CondTools/Ecal/test/preshower/writeESThresholds_HG.py @@ -0,0 +1,47 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("TEST") +#process.load("CondCore.DBCommon.CondDBCommon_cfi") +process.load("CondCore.CondDB.CondDB_cfi") +#process.CondDBCommon.connect = 'oracle://cms_orcon_prod/CMS_COND_39X_PRESHOWER' +#process.CondDBCommon.DBParameters.authenticationPath = '/nfshome0/popcondev/conddb' +process.CondDB.connect = 'sqlite_file:ESThresholds_HG.db' + +process.MessageLogger = cms.Service("MessageLogger", + debugModules = cms.untracked.vstring('*'), + destinations = cms.untracked.vstring('cout') + ) + +process.source = cms.Source("EmptyIOVSource", + firstValue = cms.uint64(1), + lastValue = cms.uint64(1), + timetype = cms.string('runnumber'), + interval = cms.uint64(1) + ) + +process.PoolDBOutputService = cms.Service("PoolDBOutputService", + process.CondDB, + timetype = cms.untracked.string('runnumber'), + toPut = cms.VPSet(cms.PSet( + # Thresholds + record = cms.string('ESThresholdsRcd'), + tag = cms.string('ESThresholds_HG') + + ))) + +process.ecalModule = cms.EDAnalyzer("StoreESCondition", + logfile = cms.string('./logfile.log'), + gain = cms.uint32(2), + toPut = cms.VPSet(cms.PSet( + + # Thresholds + conditionType = cms.untracked.string('ESThresholds'), + since = cms.untracked.uint32(1), + inputFile = cms.untracked.string('CondTools/Ecal/test/preshower/ESThresholds_HG.txt') + + ))) + +process.p = cms.Path(process.ecalModule) + + + diff --git a/CondTools/Ecal/test/preshower/writeESThresholds_LG.py b/CondTools/Ecal/test/preshower/writeESThresholds_LG.py new file mode 100644 index 0000000000000..9b28387b046f0 --- /dev/null +++ b/CondTools/Ecal/test/preshower/writeESThresholds_LG.py @@ -0,0 +1,47 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("TEST") +#process.load("CondCore.DBCommon.CondDBCommon_cfi") +process.load("CondCore.CondDB.CondDB_cfi") +#process.CondDBCommon.connect = 'oracle://cms_orcon_prod/CMS_COND_39X_PRESHOWER' +#process.CondDBCommon.DBParameters.authenticationPath = '/nfshome0/popcondev/conddb' +process.CondDB.connect = 'sqlite_file:ESThresholds_LG.db' + +process.MessageLogger = cms.Service("MessageLogger", + debugModules = cms.untracked.vstring('*'), + destinations = cms.untracked.vstring('cout') + ) + +process.source = cms.Source("EmptyIOVSource", + firstValue = cms.uint64(1), + lastValue = cms.uint64(1), + timetype = cms.string('runnumber'), + interval = cms.uint64(1) + ) + +process.PoolDBOutputService = cms.Service("PoolDBOutputService", + process.CondDB, + timetype = cms.untracked.string('runnumber'), + toPut = cms.VPSet(cms.PSet( + # Thresholds + record = cms.string('ESThresholdsRcd'), + tag = cms.string('ESThresholds_LG') + + ))) + +process.ecalModule = cms.EDAnalyzer("StoreESCondition", + logfile = cms.string('./logfile.log'), + gain = cms.uint32(1), + toPut = cms.VPSet(cms.PSet( + + # Thresholds + conditionType = cms.untracked.string('ESThresholds'), + since = cms.untracked.uint32(1), + inputFile = cms.untracked.string('CondTools/Ecal/test/preshower/ESThresholds_LG.txt') + + ))) + +process.p = cms.Path(process.ecalModule) + + + diff --git a/CondTools/Ecal/test/preshower/writeESTimeSampleWeights_HG.py b/CondTools/Ecal/test/preshower/writeESTimeSampleWeights_HG.py new file mode 100644 index 0000000000000..760f26dc10012 --- /dev/null +++ b/CondTools/Ecal/test/preshower/writeESTimeSampleWeights_HG.py @@ -0,0 +1,47 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("TEST") +#process.load("CondCore.DBCommon.CondDBCommon_cfi") +process.load("CondCore.CondDB.CondDB_cfi") +#process.CondDBCommon.connect = 'oracle://cms_orcon_prod/CMS_COND_39X_PRESHOWER' +#process.CondDBCommon.DBParameters.authenticationPath = '/nfshome0/popcondev/conddb' +process.CondDB.connect = 'sqlite_file:ESTimeSampleWeights_HG.db' + +process.MessageLogger = cms.Service("MessageLogger", + debugModules = cms.untracked.vstring('*'), + destinations = cms.untracked.vstring('cout') + ) + +process.source = cms.Source("EmptyIOVSource", + firstValue = cms.uint64(1), + lastValue = cms.uint64(1), + timetype = cms.string('runnumber'), + interval = cms.uint64(1) + ) + +process.PoolDBOutputService = cms.Service("PoolDBOutputService", + process.CondDB, + timetype = cms.untracked.string('runnumber'), + toPut = cms.VPSet(cms.PSet( + # weights + record = cms.string('ESTimeSampleWeightsRcd'), + tag = cms.string('ESTimeSampleWeights_HG') + + ))) + +process.ecalModule = cms.EDAnalyzer("StoreESCondition", + logfile = cms.string('./logfile.log'), + gain = cms.uint32(2), + toPut = cms.VPSet(cms.PSet( + + # weights + conditionType = cms.untracked.string('ESTimeSampleWeights'), + since = cms.untracked.uint32(1), + inputFile = cms.untracked.string('CondTools/Ecal/test/preshower/ESTimeSampleWeights_HG.txt') + + ))) + +process.p = cms.Path(process.ecalModule) + + + diff --git a/CondTools/Ecal/test/preshower/writeESTimeSampleWeights_LG.py b/CondTools/Ecal/test/preshower/writeESTimeSampleWeights_LG.py new file mode 100644 index 0000000000000..3e129eff1ff4d --- /dev/null +++ b/CondTools/Ecal/test/preshower/writeESTimeSampleWeights_LG.py @@ -0,0 +1,47 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("TEST") +#process.load("CondCore.DBCommon.CondDBCommon_cfi") +process.load("CondCore.CondDB.CondDB_cfi") +#process.CondDBCommon.connect = 'oracle://cms_orcon_prod/CMS_COND_39X_PRESHOWER' +#process.CondDBCommon.DBParameters.authenticationPath = '/nfshome0/popcondev/conddb' +process.CondDB.connect = 'sqlite_file:ESTimeSampleWeights_LG.db' + +process.MessageLogger = cms.Service("MessageLogger", + debugModules = cms.untracked.vstring('*'), + destinations = cms.untracked.vstring('cout') + ) + +process.source = cms.Source("EmptyIOVSource", + firstValue = cms.uint64(1), + lastValue = cms.uint64(1), + timetype = cms.string('runnumber'), + interval = cms.uint64(1) + ) + +process.PoolDBOutputService = cms.Service("PoolDBOutputService", + process.CondDB, + timetype = cms.untracked.string('runnumber'), + toPut = cms.VPSet(cms.PSet( + # weights + record = cms.string('ESTimeSampleWeightsRcd'), + tag = cms.string('ESTimeSampleWeights_LG') + + ))) + +process.ecalModule = cms.EDAnalyzer("StoreESCondition", + logfile = cms.string('./logfile.log'), + gain = cms.uint32(1), + toPut = cms.VPSet(cms.PSet( + + # weights + conditionType = cms.untracked.string('ESTimeSampleWeights'), + since = cms.untracked.uint32(1), + inputFile = cms.untracked.string('CondTools/Ecal/test/preshower/ESTimeSampleWeights_LG.txt') + + ))) + +process.p = cms.Path(process.ecalModule) + + +