Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
#include "CalibMuon/CSCCalibration/test/stubs/CSCDBGasGainCorrectionHandler.h"
#include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
#include <iostream>

#include "CalibMuon/CSCCalibration/interface/CSCGasGainCorrectionDBConditions.h"
#include "CondFormats/CSCObjects/interface/CSCDBGasGainCorrection.h"

popcon::CSCDBGasGainCorrectionImpl::CSCDBGasGainCorrectionImpl(const edm::ParameterSet &pset) {
  m_name = (pset.getUntrackedParameter<std::string>("name", "CSCDBGasGainCorrectionImpl"));
  isForMC = (pset.getUntrackedParameter<bool>("isForMC", true));
  dataCorrFileName = (pset.getUntrackedParameter<std::string>("dataCorrFileName", "empty.txt"));
}

popcon::CSCDBGasGainCorrectionImpl::~CSCDBGasGainCorrectionImpl() {}

void popcon::CSCDBGasGainCorrectionImpl::getNewObjects() {
  std::cout << "CSCGasGainCorrectionHandler - time before filling object:" << std::endl;
  std::cout << "------- CSC src - > getNewObjects\n" << m_name;

  // fill object from file
  // bool isForMC = iConfig.getUntrackedParameter<bool>("isForMC",true);
  // string dataCorrFileName=
  // iConfig.getUntrackedParameter<std::string>("dataCorrFileName","empty.txt");
  CSCDBGasGainCorrection *cngasgain =
      CSCGasGainCorrectionDBConditions::prefillDBGasGainCorrection(isForMC, dataCorrFileName);

  std::cout << "CSCGasGainCorrectionHandler - time after filling object:" << std::endl;

  // check whats already inside of database

  std::cerr << "got offlineInfo" << std::endl;
  std::cerr << tagInfo().name << " , last object valid since " << tagInfo().lastInterval.since << std::endl;

  unsigned int snc;
  std::cout << "Source implementation test ::getNewObjects : enter since ? \n";
  std::cin >> snc;
  std::cout << "getNewObjects : enter till ? \n";

  m_to_transfer.push_back(std::make_pair(cngasgain, snc));

  std::cout << "------- " << m_name << "CSC src - > getNewObjects -----------\n" << std::endl;
  std::cout << "CSCGasGainCorrectionHandler - time before writing into DB:" << std::endl;
}