Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-04 02:02:11

0001 #ifndef CalibCalorimetry_EcalTrivialCondModules_ESTrivialConditionRetriever_H
0002 #define CalibCalorimetry_EcalTrivialCondModules_ESTrivialConditionRetriever_H
0003 // system include files
0004 #include <string>
0005 #include <vector>
0006 
0007 // user include files
0008 #include "FWCore/Framework/interface/ESProducer.h"
0009 #include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h"
0010 
0011 #include "CondFormats/ESObjects/interface/ESPedestals.h"
0012 #include "CondFormats/DataRecord/interface/ESPedestalsRcd.h"
0013 
0014 #include "CondFormats/ESObjects/interface/ESStripGroupId.h"
0015 #include "CondFormats/ESObjects/interface/ESWeightStripGroups.h"
0016 #include "CondFormats/DataRecord/interface/ESWeightStripGroupsRcd.h"
0017 
0018 #include "CondFormats/ESObjects/interface/ESWeight.h"
0019 #include "CondFormats/ESObjects/interface/ESWeightSet.h"
0020 #include "CondFormats/ESObjects/interface/ESTBWeights.h"
0021 #include "CondFormats/DataRecord/interface/ESTBWeightsRcd.h"
0022 
0023 #include "CondFormats/ESObjects/interface/ESIntercalibConstants.h"
0024 #include "CondFormats/DataRecord/interface/ESIntercalibConstantsRcd.h"
0025 
0026 #include "CondFormats/ESObjects/interface/ESADCToGeVConstant.h"
0027 #include "CondFormats/DataRecord/interface/ESADCToGeVConstantRcd.h"
0028 
0029 #include "CondFormats/ESObjects/interface/ESChannelStatus.h"
0030 #include "CondFormats/DataRecord/interface/ESChannelStatusRcd.h"
0031 
0032 #include "FWCore/Framework/interface/IOVSyncValue.h"
0033 
0034 // forward declarations
0035 
0036 namespace edm {
0037   class ParameterSet;
0038 }
0039 
0040 class ESTrivialConditionRetriever : public edm::ESProducer, public edm::EventSetupRecordIntervalFinder {
0041 public:
0042   ESTrivialConditionRetriever(const edm::ParameterSet& pset);
0043   ESTrivialConditionRetriever(const ESTrivialConditionRetriever&) = delete;                   // stop default
0044   const ESTrivialConditionRetriever& operator=(const ESTrivialConditionRetriever&) = delete;  // stop default
0045   ~ESTrivialConditionRetriever() override;
0046 
0047   // ---------- member functions ---------------------------
0048   virtual std::unique_ptr<ESPedestals> produceESPedestals(const ESPedestalsRcd&);
0049   virtual std::unique_ptr<ESWeightStripGroups> produceESWeightStripGroups(const ESWeightStripGroupsRcd&);
0050   virtual std::unique_ptr<ESIntercalibConstants> produceESIntercalibConstants(const ESIntercalibConstantsRcd&);
0051 
0052   //  virtual std::unique_ptr<ESIntercalibErrors> produceESIntercalibErrors( const ESIntercalibErrorsRcd& );
0053   //  virtual std::unique_ptr<ESIntercalibErrors>  getIntercalibErrorsFromConfiguration ( const ESIntercalibErrorsRcd& ) ;
0054 
0055   virtual std::unique_ptr<ESADCToGeVConstant> produceESADCToGeVConstant(const ESADCToGeVConstantRcd&);
0056   virtual std::unique_ptr<ESTBWeights> produceESTBWeights(const ESTBWeightsRcd&);
0057   //  virtual std::unique_ptr<ESIntercalibConstants>  getIntercalibConstantsFromConfiguration ( const ESIntercalibConstantsRcd& ) ;
0058 
0059   virtual std::unique_ptr<ESChannelStatus> produceESChannelStatus(const ESChannelStatusRcd&);
0060   virtual std::unique_ptr<ESChannelStatus> getChannelStatusFromConfiguration(const ESChannelStatusRcd&);
0061 
0062 protected:
0063   //overriding from ContextRecordIntervalFinder
0064   void setIntervalFor(const edm::eventsetup::EventSetupRecordKey&,
0065                       const edm::IOVSyncValue&,
0066                       edm::ValidityInterval&) override;
0067 
0068 private:
0069   void getWeightsFromConfiguration(const edm::ParameterSet& ps);
0070 
0071   // data members
0072   double adcToGeVLowConstant_;   // ADC -> GeV scale low
0073   double adcToGeVHighConstant_;  // ADC -> GeV scale high
0074 
0075   double intercalibConstantMean_;   // mean of intercalib constant. default: 1.0
0076   double intercalibConstantSigma_;  // sigma of intercalib constant
0077                                     // Gaussian used to generate intercalib constants for
0078                                     // each channel. no smearing if sigma=0.0 (default)
0079   // double intercalibErrorMean_;  // mean of intercalib constant error
0080 
0081   double ESpedMean_;  // pedestal mean pedestal at gain 12
0082   double ESpedRMS_;   // pedestal rms at gain 12
0083 
0084   ESWeightSet amplWeights_;  // weights to compute amplitudes low
0085 
0086   std::string amplWeightsFile_;
0087   std::string intercalibConstantsFile_;
0088   std::string channelStatusFile_;
0089 
0090   bool getWeightsFromFile_;
0091   bool producedESPedestals_;
0092   bool producedESWeights_;
0093   bool producedESIntercalibConstants_;
0094   bool producedESADCToGeVConstant_;
0095   bool producedESChannelStatus_;
0096 
0097   int verbose_;  // verbosity
0098 };
0099 #endif