Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:21

0001 #include <fstream>
0002 #include <memory>
0003 
0004 #include "CalibMuon/CSCCalibration/interface/CSCGasGainCorrectionDBConditions.h"
0005 #include "CondFormats/CSCObjects/interface/CSCDBGasGainCorrection.h"
0006 #include "CondFormats/DataRecord/interface/CSCDBGasGainCorrectionRcd.h"
0007 
0008 CSCGasGainCorrectionDBConditions::CSCGasGainCorrectionDBConditions(const edm::ParameterSet &iConfig) {
0009   // the following line is needed to tell the framework what
0010   // data is being produced
0011   isForMC = iConfig.getUntrackedParameter<bool>("isForMC", true);
0012   dataCorrFileName = iConfig.getUntrackedParameter<std::string>("dataCorrFileName", "empty.txt");
0013   // added by Zhen (changed since 1_2_0)
0014   setWhatProduced(this, &CSCGasGainCorrectionDBConditions::produceDBGasGainCorrection);
0015   findingRecord<CSCDBGasGainCorrectionRcd>();
0016   // now do what ever other initialization is needed
0017 }
0018 
0019 CSCGasGainCorrectionDBConditions::~CSCGasGainCorrectionDBConditions() {
0020   // do anything here that needs to be done at desctruction time
0021   // (e.g. close files, deallocate resources etc.)
0022 }
0023 
0024 //
0025 // member functions
0026 //
0027 
0028 // ------------ method called to produce the data  ------------
0029 CSCGasGainCorrectionDBConditions::ReturnType CSCGasGainCorrectionDBConditions::produceDBGasGainCorrection(
0030     const CSCDBGasGainCorrectionRcd &iRecord) {
0031   // need a new object so to not be deleted at exit
0032   return CSCGasGainCorrectionDBConditions::ReturnType(prefillDBGasGainCorrection(isForMC, dataCorrFileName));
0033 }
0034 
0035 void CSCGasGainCorrectionDBConditions::setIntervalFor(const edm::eventsetup::EventSetupRecordKey &,
0036                                                       const edm::IOVSyncValue &,
0037                                                       edm::ValidityInterval &oValidity) {
0038   oValidity = edm::ValidityInterval(edm::IOVSyncValue::beginOfTime(), edm::IOVSyncValue::endOfTime());
0039 }