Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:47:33

0001 #include <fstream>
0002 #include <memory>
0003 
0004 #include "CalibMuon/CSCCalibration/interface/CSCChipSpeedCorrectionDBConditions.h"
0005 #include "CondFormats/CSCObjects/interface/CSCDBChipSpeedCorrection.h"
0006 #include "CondFormats/DataRecord/interface/CSCDBChipSpeedCorrectionRcd.h"
0007 
0008 CSCChipSpeedCorrectionDBConditions::CSCChipSpeedCorrectionDBConditions(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   dataOffset = 170.;
0014   // added by Zhen (changed since 1_2_0)
0015   setWhatProduced(this, &CSCChipSpeedCorrectionDBConditions::produceDBChipSpeedCorrection);
0016   findingRecord<CSCDBChipSpeedCorrectionRcd>();
0017   // now do what ever other initialization is needed
0018 }
0019 
0020 CSCChipSpeedCorrectionDBConditions::~CSCChipSpeedCorrectionDBConditions() {
0021   // do anything here that needs to be done at desctruction time
0022   // (e.g. close files, deallocate resources etc.)
0023 }
0024 
0025 //
0026 // member functions
0027 //
0028 
0029 // ------------ method called to produce the data  ------------
0030 CSCChipSpeedCorrectionDBConditions::ReturnType CSCChipSpeedCorrectionDBConditions::produceDBChipSpeedCorrection(
0031     const CSCDBChipSpeedCorrectionRcd &iRecord) {
0032   // need a new object so to not be deleted at exit
0033   return CSCChipSpeedCorrectionDBConditions::ReturnType(
0034       prefillDBChipSpeedCorrection(isForMC, dataCorrFileName, dataOffset));
0035 }
0036 
0037 void CSCChipSpeedCorrectionDBConditions::setIntervalFor(const edm::eventsetup::EventSetupRecordKey &,
0038                                                         const edm::IOVSyncValue &,
0039                                                         edm::ValidityInterval &oValidity) {
0040   oValidity = edm::ValidityInterval(edm::IOVSyncValue::beginOfTime(), edm::IOVSyncValue::endOfTime());
0041 }