CMS 3D CMS Logo

CastorTextCalibrations.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/CastorCalib/interface/CastorDbASCIIIO.h"
#include "CondFormats/CastorObjects/interface/CastorPedestals.h"
#include "CondFormats/CastorObjects/interface/CastorPedestalWidths.h"
#include "CondFormats/CastorObjects/interface/CastorGains.h"
#include "CondFormats/CastorObjects/interface/CastorGainWidths.h"
#include "CondFormats/CastorObjects/interface/CastorElectronicsMap.h"
#include "CondFormats/CastorObjects/interface/CastorChannelQuality.h"
#include "CondFormats/CastorObjects/interface/CastorQIEData.h"
#include "CondFormats/DataRecord/interface/CastorPedestalsRcd.h"
#include "CondFormats/DataRecord/interface/CastorPedestalWidthsRcd.h"
#include "CondFormats/DataRecord/interface/CastorGainsRcd.h"
#include "CondFormats/DataRecord/interface/CastorGainWidthsRcd.h"
#include "CondFormats/DataRecord/interface/CastorElectronicsMapRcd.h"
#include "CondFormats/DataRecord/interface/CastorChannelQualityRcd.h"
#include "CondFormats/DataRecord/interface/CastorQIEDataRcd.h"
#include "CastorTextCalibrations.h"

Go to the source code of this file.

Functions

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


Function Documentation

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

Definition at line 100 of file CastorTextCalibrations.cc.

References TestMuL1L2Filter_cff::cerr, lat::endl(), Exception, CastorDbASCIIIO::getObject(), and HLT_VtxMuL3::result.

00100                                                      {
00101   std::auto_ptr<T> result (new T ());
00102   std::ifstream inStream (fFile.c_str ());
00103   if (!inStream.good ()) {
00104     std::cerr << "CastorTextCalibrations-> Unable to open file '" << fFile << "'" << std::endl;
00105     throw cms::Exception("FileNotFound") << "Unable to open '" << fFile << "'" << std::endl;
00106   }
00107   if (!CastorDbASCIIIO::getObject (inStream, &*result)) {
00108     std::cerr << "CastorTextCalibrations-> Can not read object from file '" << fFile << "'" << std::endl;
00109     throw cms::Exception("ReadError") << "Can not read object from file '" << fFile << "'" << std::endl;
00110   }
00111   return result;
00112 }


Generated on Tue Jun 9 17:50:58 2009 for CMSSW by  doxygen 1.5.4