CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
HcalTextCalibrations.cc File Reference
#include <memory>
#include <iostream>
#include <fstream>
#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/ParameterSet/interface/FileInPath.h"
#include "FWCore/Framework/interface/ValidityInterval.h"
#include "CalibCalorimetry/HcalAlgos/interface/HcalDbASCIIIO.h"
#include "CondFormats/DataRecord/interface/HcalAllRcds.h"
#include "HcalTextCalibrations.h"

Go to the source code of this file.

Functions

template<class T >
std::auto_ptr< Tproduce_impl (const std::string &fFile)
 

Function Documentation

template<class T >
std::auto_ptr<T> produce_impl ( const std::string &  fFile)

Definition at line 162 of file HcalTextCalibrations.cc.

References dtNoiseDBValidation_cfg::cerr, edm::hlt::Exception, HcalDbASCIIIO::getObject(), and query::result.

162  {
163  std::auto_ptr<T> result (new T ());
164  // std::auto_ptr<T> result;
165  std::ifstream inStream (fFile.c_str ());
166  if (!inStream.good ()) {
167  std::cerr << "HcalTextCalibrations-> Unable to open file '" << fFile << "'" << std::endl;
168  throw cms::Exception("FileNotFound") << "Unable to open '" << fFile << "'" << std::endl;
169  }
170  if (!HcalDbASCIIIO::getObject (inStream, &*result)) {
171  std::cerr << "HcalTextCalibrations-> Can not read object from file '" << fFile << "'" << std::endl;
172  throw cms::Exception("ReadError") << "Can not read object from file '" << fFile << "'" << std::endl;
173  }
174  return result;
175 }
tuple result
Definition: query.py:137
bool getObject(std::istream &fInput, HcalPedestals *fObject)
long double T