Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "CalibMuon/CSCCalibration/test/stubs/CSCDBGasGainCorrectionHandler.h"
0002 #include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
0003 #include <iostream>
0004 
0005 #include "CalibMuon/CSCCalibration/interface/CSCGasGainCorrectionDBConditions.h"
0006 #include "CondFormats/CSCObjects/interface/CSCDBGasGainCorrection.h"
0007 
0008 popcon::CSCDBGasGainCorrectionImpl::CSCDBGasGainCorrectionImpl(const edm::ParameterSet &pset) {
0009   m_name = (pset.getUntrackedParameter<std::string>("name", "CSCDBGasGainCorrectionImpl"));
0010   isForMC = (pset.getUntrackedParameter<bool>("isForMC", true));
0011   dataCorrFileName = (pset.getUntrackedParameter<std::string>("dataCorrFileName", "empty.txt"));
0012 }
0013 
0014 popcon::CSCDBGasGainCorrectionImpl::~CSCDBGasGainCorrectionImpl() {}
0015 
0016 void popcon::CSCDBGasGainCorrectionImpl::getNewObjects() {
0017   std::cout << "CSCGasGainCorrectionHandler - time before filling object:" << std::endl;
0018   std::cout << "------- CSC src - > getNewObjects\n" << m_name;
0019 
0020   // fill object from file
0021   // bool isForMC = iConfig.getUntrackedParameter<bool>("isForMC",true);
0022   // string dataCorrFileName=
0023   // iConfig.getUntrackedParameter<std::string>("dataCorrFileName","empty.txt");
0024   CSCDBGasGainCorrection *cngasgain =
0025       CSCGasGainCorrectionDBConditions::prefillDBGasGainCorrection(isForMC, dataCorrFileName);
0026 
0027   std::cout << "CSCGasGainCorrectionHandler - time after filling object:" << std::endl;
0028 
0029   // check whats already inside of database
0030 
0031   std::cerr << "got offlineInfo" << std::endl;
0032   std::cerr << tagInfo().name << " , last object valid since " << tagInfo().lastInterval.since << std::endl;
0033 
0034   unsigned int snc;
0035   std::cout << "Source implementation test ::getNewObjects : enter since ? \n";
0036   std::cin >> snc;
0037   std::cout << "getNewObjects : enter till ? \n";
0038 
0039   m_to_transfer.push_back(std::make_pair(cngasgain, snc));
0040 
0041   std::cout << "------- " << m_name << "CSC src - > getNewObjects -----------\n" << std::endl;
0042   std::cout << "CSCGasGainCorrectionHandler - time before writing into DB:" << std::endl;
0043 }