00001 // 00002 // $Id: EcalTrivialConditionRetriever.h,v 1.16 2008/02/19 11:33:51 ferriff Exp $ 00003 // Created: 2 Mar 2006 00004 // Shahram Rahatlou, University of Rome & INFN 00005 // 00006 #ifndef CalibCalorimetry_EcalPlugins_EcalTrivialConditionRetriever_H 00007 #define CalibCalorimetry_EcalPlugins_EcalTrivialConditionRetriever_H 00008 // system include files 00009 #include <string> 00010 #include <vector> 00011 00012 // user include files 00013 #include "FWCore/Framework/interface/ESProducer.h" 00014 #include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h" 00015 00016 #include "CondFormats/EcalObjects/interface/EcalPedestals.h" 00017 #include "CondFormats/DataRecord/interface/EcalPedestalsRcd.h" 00018 00019 #include "CondFormats/EcalObjects/interface/EcalXtalGroupId.h" 00020 #include "CondFormats/EcalObjects/interface/EcalWeightXtalGroups.h" 00021 #include "CondFormats/DataRecord/interface/EcalWeightXtalGroupsRcd.h" 00022 00023 #include "CondFormats/EcalObjects/interface/EcalWeight.h" 00024 #include "CondFormats/EcalObjects/interface/EcalWeightSet.h" 00025 #include "CondFormats/EcalObjects/interface/EcalTBWeights.h" 00026 #include "CondFormats/DataRecord/interface/EcalTBWeightsRcd.h" 00027 00028 #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" 00029 #include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h" 00030 00031 #include "CondFormats/EcalObjects/interface/EcalIntercalibErrors.h" 00032 #include "CondFormats/DataRecord/interface/EcalIntercalibErrorsRcd.h" 00033 00034 #include "CondFormats/EcalObjects/interface/EcalMGPAGainRatio.h" 00035 #include "CondFormats/EcalObjects/interface/EcalGainRatios.h" 00036 #include "CondFormats/DataRecord/interface/EcalGainRatiosRcd.h" 00037 00038 #include "CondFormats/EcalObjects/interface/EcalADCToGeVConstant.h" 00039 #include "CondFormats/DataRecord/interface/EcalADCToGeVConstantRcd.h" 00040 00041 #include "CondFormats/EcalObjects/interface/EcalLaserAlphas.h" 00042 #include "CondFormats/DataRecord/interface/EcalLaserAlphasRcd.h" 00043 00044 #include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatiosRef.h" 00045 #include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRefRcd.h" 00046 00047 #include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatios.h" 00048 #include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRcd.h" 00049 00050 #include "CondFormats/EcalObjects/interface/EcalChannelStatus.h" 00051 #include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h" 00052 00053 00054 #include "FWCore/Framework/interface/IOVSyncValue.h" 00055 00056 // forward declarations 00057 00058 namespace edm{ 00059 class ParameterSet; 00060 } 00061 00062 class EcalTrivialConditionRetriever : public edm::ESProducer, 00063 public edm::EventSetupRecordIntervalFinder 00064 { 00065 00066 public: 00067 EcalTrivialConditionRetriever(const edm::ParameterSet& pset); 00068 virtual ~EcalTrivialConditionRetriever(); 00069 00070 // ---------- member functions --------------------------- 00071 virtual std::auto_ptr<EcalPedestals> produceEcalPedestals( const EcalPedestalsRcd& ); 00072 virtual std::auto_ptr<EcalWeightXtalGroups> produceEcalWeightXtalGroups( const EcalWeightXtalGroupsRcd& ); 00073 virtual std::auto_ptr<EcalIntercalibConstants> produceEcalIntercalibConstants( const EcalIntercalibConstantsRcd& ); 00074 virtual std::auto_ptr<EcalIntercalibErrors> produceEcalIntercalibErrors( const EcalIntercalibErrorsRcd& ); 00075 virtual std::auto_ptr<EcalGainRatios> produceEcalGainRatios( const EcalGainRatiosRcd& ); 00076 virtual std::auto_ptr<EcalADCToGeVConstant> produceEcalADCToGeVConstant( const EcalADCToGeVConstantRcd& ); 00077 virtual std::auto_ptr<EcalTBWeights> produceEcalTBWeights( const EcalTBWeightsRcd& ); 00078 virtual std::auto_ptr<EcalIntercalibConstants> getIntercalibConstantsFromConfiguration ( const EcalIntercalibConstantsRcd& ) ; 00079 virtual std::auto_ptr<EcalIntercalibErrors> getIntercalibErrorsFromConfiguration ( const EcalIntercalibErrorsRcd& ) ; 00080 00081 virtual std::auto_ptr<EcalLaserAlphas> produceEcalLaserAlphas( const EcalLaserAlphasRcd& ); 00082 virtual std::auto_ptr<EcalLaserAPDPNRatiosRef> produceEcalLaserAPDPNRatiosRef( const EcalLaserAPDPNRatiosRefRcd& ); 00083 virtual std::auto_ptr<EcalLaserAPDPNRatios> produceEcalLaserAPDPNRatios( const EcalLaserAPDPNRatiosRcd& ); 00084 00085 virtual std::auto_ptr<EcalChannelStatus> produceEcalChannelStatus( const EcalChannelStatusRcd& ); 00086 virtual std::auto_ptr<EcalChannelStatus> getChannelStatusFromConfiguration( const EcalChannelStatusRcd& ); 00087 00088 protected: 00089 //overriding from ContextRecordIntervalFinder 00090 virtual void setIntervalFor( const edm::eventsetup::EventSetupRecordKey&, 00091 const edm::IOVSyncValue& , 00092 edm::ValidityInterval& ) ; 00093 private: 00094 EcalTrivialConditionRetriever( const EcalTrivialConditionRetriever& ); // stop default 00095 const EcalTrivialConditionRetriever& operator=( const EcalTrivialConditionRetriever& ); // stop default 00096 00097 void getWeightsFromConfiguration(const edm::ParameterSet& ps); 00098 00099 // data members 00100 double adcToGeVEBConstant_; // ADC -> GeV scale for barrel 00101 double adcToGeVEEConstant_; // ADC -> GeV scale for endcap 00102 00103 double intercalibConstantMean_; // mean of intercalib constant. default: 1.0 00104 double intercalibConstantSigma_; // sigma of intercalib constant 00105 // Gaussian used to generate intercalib constants for 00106 // each channel. no smearing if sigma=0.0 (default) 00107 double intercalibErrorMean_; // mean of intercalib constant error 00108 00109 // laser 00110 double laserAlphaMean_; 00111 double laserAlphaSigma_; 00112 double laserAPDPNRefMean_; 00113 double laserAPDPNRefSigma_; 00114 double laserAPDPNMean_; 00115 double laserAPDPNSigma_; 00116 00117 double EBpedMeanX12_; // pedestal mean pedestal at gain 12 00118 double EBpedRMSX12_; // pedestal rms at gain 12 00119 double EBpedMeanX6_; // pedestal mean pedestal at gain 6 00120 double EBpedRMSX6_; // pedestal rms at gain 6 00121 double EBpedMeanX1_; // pedestal mean pedestal at gain 1 00122 double EBpedRMSX1_; // pedestal rms at gain 1 00123 00124 double EEpedMeanX12_; // pedestal mean pedestal at gain 12 00125 double EEpedRMSX12_; // pedestal rms at gain 12 00126 double EEpedMeanX6_; // pedestal mean pedestal at gain 6 00127 double EEpedRMSX6_; // pedestal rms at gain 6 00128 double EEpedMeanX1_; // pedestal mean pedestal at gain 1 00129 double EEpedRMSX1_; // pedestal rms at gain 1 00130 00131 double gainRatio12over6_; // ratio of MGPA gain12 / gain6 00132 double gainRatio6over1_; // ratio of MGPA gain6 / gain1 00133 00134 std::vector< ROOT::Math::SVector<double,EcalDataFrame::MAXSAMPLES> > amplWeights_; // weights to compute amplitudes after ped subtraction 00135 std::vector< ROOT::Math::SVector<double,EcalDataFrame::MAXSAMPLES> > amplWeightsAft_; // weights to compute amplitudes after ped subtraction 00136 00137 std::vector< ROOT::Math::SVector<double,EcalDataFrame::MAXSAMPLES> > pedWeights_; // weights to compute amplitudes w/o ped subtraction 00138 std::vector< ROOT::Math::SVector<double,EcalDataFrame::MAXSAMPLES> > pedWeightsAft_; // weights to compute amplitudes w/o ped subtraction 00139 00140 std::vector< ROOT::Math::SVector<double,EcalDataFrame::MAXSAMPLES> > jittWeights_; // weights to compute jitter 00141 std::vector< ROOT::Math::SVector<double,EcalDataFrame::MAXSAMPLES> > jittWeightsAft_; // weights to compute jitter 00142 00143 std::vector< EcalWeightSet::EcalChi2WeightMatrix > chi2Matrix_; 00144 std::vector< EcalWeightSet::EcalChi2WeightMatrix > chi2MatrixAft_; 00145 00146 std::string amplWeightsFile_; 00147 std::string amplWeightsAftFile_; 00148 std::string pedWeightsFile_; 00149 std::string pedWeightsAftFile_; 00150 std::string jittWeightsFile_; 00151 std::string jittWeightsAftFile_; 00152 std::string chi2MatrixFile_; 00153 std::string chi2MatrixAftFile_; 00154 std::string intercalibConstantsFile_ ; 00155 std::string intercalibErrorsFile_ ; 00156 std::string channelStatusFile_ ; 00157 00158 int nTDCbins_; 00159 00160 bool getWeightsFromFile_; 00161 bool weightsForAsynchronousRunning_; 00162 bool producedEcalPedestals_; 00163 bool producedEcalWeights_; 00164 bool producedEcalIntercalibConstants_; 00165 bool producedEcalIntercalibErrors_; 00166 bool producedEcalGainRatios_; 00167 bool producedEcalADCToGeVConstant_; 00168 bool producedEcalLaserCorrection_; 00169 bool producedEcalChannelStatus_; 00170 00171 int verbose_; // verbosity 00172 00173 }; 00174 #endif