CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/CalibCalorimetry/EcalTrivialCondModules/interface/ESTrivialConditionRetriever.h

Go to the documentation of this file.
00001 #ifndef CalibCalorimetry_EcalTrivialCondModules_ESTrivialConditionRetriever_H
00002 #define CalibCalorimetry_EcalTrivialCondModules_ESTrivialConditionRetriever_H
00003 // system include files
00004 #include <string>
00005 #include <vector>
00006 
00007 // user include files
00008 #include "FWCore/Framework/interface/ESProducer.h"
00009 #include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h"
00010 
00011 #include "CondFormats/ESObjects/interface/ESPedestals.h"
00012 #include "CondFormats/DataRecord/interface/ESPedestalsRcd.h"
00013 
00014 #include "CondFormats/ESObjects/interface/ESStripGroupId.h"
00015 #include "CondFormats/ESObjects/interface/ESWeightStripGroups.h"
00016 #include "CondFormats/DataRecord/interface/ESWeightStripGroupsRcd.h"
00017 
00018 #include "CondFormats/ESObjects/interface/ESWeight.h"
00019 #include "CondFormats/ESObjects/interface/ESWeightSet.h"
00020 #include "CondFormats/ESObjects/interface/ESTBWeights.h"
00021 #include "CondFormats/DataRecord/interface/ESTBWeightsRcd.h"
00022 
00023 #include "CondFormats/ESObjects/interface/ESIntercalibConstants.h"
00024 #include "CondFormats/DataRecord/interface/ESIntercalibConstantsRcd.h"
00025 
00026 #include "CondFormats/ESObjects/interface/ESADCToGeVConstant.h"
00027 #include "CondFormats/DataRecord/interface/ESADCToGeVConstantRcd.h"
00028 
00029 #include "CondFormats/ESObjects/interface/ESChannelStatus.h"
00030 #include "CondFormats/DataRecord/interface/ESChannelStatusRcd.h"
00031 
00032 #include "FWCore/Framework/interface/IOVSyncValue.h"
00033 
00034 // forward declarations
00035 
00036 namespace edm{
00037   class ParameterSet;
00038 }
00039 
00040 class ESTrivialConditionRetriever : public edm::ESProducer, 
00041                                       public edm::EventSetupRecordIntervalFinder
00042 {
00043 
00044 public:
00045   ESTrivialConditionRetriever(const edm::ParameterSet&  pset);
00046   virtual ~ESTrivialConditionRetriever();
00047 
00048   // ---------- member functions ---------------------------
00049   virtual std::auto_ptr<ESPedestals> produceESPedestals( const ESPedestalsRcd& );
00050   virtual std::auto_ptr<ESWeightStripGroups> produceESWeightStripGroups( const ESWeightStripGroupsRcd& );
00051   virtual std::auto_ptr<ESIntercalibConstants> produceESIntercalibConstants( const ESIntercalibConstantsRcd& );
00052 
00053   //  virtual std::auto_ptr<ESIntercalibErrors> produceESIntercalibErrors( const ESIntercalibErrorsRcd& );
00054   //  virtual std::auto_ptr<ESIntercalibErrors>  getIntercalibErrorsFromConfiguration ( const ESIntercalibErrorsRcd& ) ;
00055 
00056   virtual std::auto_ptr<ESADCToGeVConstant> produceESADCToGeVConstant( const ESADCToGeVConstantRcd& );
00057   virtual std::auto_ptr<ESTBWeights> produceESTBWeights( const ESTBWeightsRcd& );
00058   //  virtual std::auto_ptr<ESIntercalibConstants>  getIntercalibConstantsFromConfiguration ( const ESIntercalibConstantsRcd& ) ;
00059 
00060   virtual std::auto_ptr<ESChannelStatus> produceESChannelStatus( const ESChannelStatusRcd& );
00061   virtual std::auto_ptr<ESChannelStatus> getChannelStatusFromConfiguration( const ESChannelStatusRcd& );
00062 
00063 protected:
00064   //overriding from ContextRecordIntervalFinder
00065   virtual void setIntervalFor( const edm::eventsetup::EventSetupRecordKey&,
00066                                const edm::IOVSyncValue& ,
00067                                edm::ValidityInterval& ) ;
00068 private:
00069   ESTrivialConditionRetriever( const ESTrivialConditionRetriever& ); // stop default
00070   const  ESTrivialConditionRetriever& operator=( const ESTrivialConditionRetriever& ); // stop default
00071 
00072   void getWeightsFromConfiguration(const edm::ParameterSet& ps);
00073 
00074   // data members
00075   double adcToGeVLowConstant_;      // ADC -> GeV scale low
00076   double adcToGeVHighConstant_;      // ADC -> GeV scale high
00077 
00078   double intercalibConstantMean_;  // mean of intercalib constant. default: 1.0
00079   double intercalibConstantSigma_; // sigma of intercalib constant
00080                                   // Gaussian used to generate intercalib constants for
00081                                   // each channel. no smearing if sigma=0.0 (default)
00082   // double intercalibErrorMean_;  // mean of intercalib constant error
00083 
00084   double ESpedMean_;              // pedestal mean pedestal at gain 12
00085   double ESpedRMS_;               // pedestal rms at gain 12
00086 
00087   ESWeightSet amplWeights_;  // weights to compute amplitudes low
00088 
00089   std::string amplWeightsFile_;
00090   std::string intercalibConstantsFile_ ;
00091   std::string channelStatusFile_ ;
00092 
00093   bool getWeightsFromFile_;
00094   bool producedESPedestals_;
00095   bool producedESWeights_;
00096   bool producedESIntercalibConstants_;
00097   bool producedESADCToGeVConstant_;
00098   bool producedESChannelStatus_;
00099 
00100   int    verbose_; // verbosity
00101 
00102 };
00103 #endif