Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:05

0001 //
0002 // F.Ratnikov (UMd), Dec. 14, 2005
0003 //
0004 #ifndef HcalDbHardcodeIn_h
0005 #define HcalDbHardcodeIn_h
0006 
0007 #include "DataFormats/HcalDetId/interface/HcalGenericDetId.h"
0008 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
0009 #include "DataFormats/HcalDetId/interface/HcalZDCDetId.h"
0010 #include "CondFormats/HcalObjects/interface/HcalPedestal.h"
0011 #include "CondFormats/HcalObjects/interface/HcalPedestalWidth.h"
0012 #include "CondFormats/HcalObjects/interface/HcalGain.h"
0013 #include "CondFormats/HcalObjects/interface/HcalGainWidth.h"
0014 #include "CondFormats/HcalObjects/interface/HcalPFCut.h"
0015 #include "CondFormats/HcalObjects/interface/HcalZSThreshold.h"
0016 #include "CondFormats/HcalObjects/interface/HcalQIECoder.h"
0017 #include "CondFormats/HcalObjects/interface/HcalQIEShape.h"
0018 #include "CondFormats/HcalObjects/interface/HcalQIEType.h"
0019 #include "CondFormats/HcalObjects/interface/HcalCalibrationQIECoder.h"
0020 #include "CondFormats/HcalObjects/interface/HcalElectronicsMap.h"
0021 #include "CondFormats/HcalObjects/interface/HcalFrontEndMap.h"
0022 #include "DataFormats/HcalDetId/interface/HcalDcsDetId.h"
0023 #include "CondFormats/HcalObjects/interface/HcalDcsMap.h"
0024 #include "CondFormats/HcalObjects/interface/HcalRecoParam.h"
0025 #include "CondFormats/HcalObjects/interface/HcalTimingParam.h"
0026 #include "CondFormats/HcalObjects/interface/HcalMCParam.h"
0027 #include "CondFormats/HcalObjects/interface/HcalSiPMParameter.h"
0028 #include "CondFormats/HcalObjects/interface/HcalSiPMCharacteristics.h"
0029 #include "CondFormats/HcalObjects/interface/HcalTPParameters.h"
0030 #include "CondFormats/HcalObjects/interface/HcalTPChannelParameters.h"
0031 #include "CalibCalorimetry/HcalAlgos/interface/HcalHardcodeParameters.h"
0032 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0033 #include "Geometry/CaloTopology/interface/HcalTopology.h"
0034 
0035 #include <vector>
0036 #include <map>
0037 #include <utility>
0038 
0039 /**
0040 
0041    \class HcalDbHardcode
0042    \brief Hardcode implementation of some conditions data
0043    \author Fedor Ratnikov
0044    
0045 */
0046 class HcalDbHardcode {
0047 public:
0048   //constructor
0049   HcalDbHardcode();
0050 
0051   //destructor
0052   virtual ~HcalDbHardcode() {}
0053 
0054   //setters
0055   void setHB(HcalHardcodeParameters p) {
0056     theHBParameters_ = p;
0057     setHB_ = true;
0058   }
0059   void setHE(HcalHardcodeParameters p) {
0060     theHEParameters_ = p;
0061     setHE_ = true;
0062   }
0063   void setHF(HcalHardcodeParameters p) {
0064     theHFParameters_ = p;
0065     setHF_ = true;
0066   }
0067   void setHO(HcalHardcodeParameters p) {
0068     theHOParameters_ = p;
0069     setHO_ = true;
0070   }
0071   void setHBUpgrade(HcalHardcodeParameters p) {
0072     theHBUpgradeParameters_ = p;
0073     setHBUpgrade_ = true;
0074   }
0075   void setHEUpgrade(HcalHardcodeParameters p) {
0076     theHEUpgradeParameters_ = p;
0077     setHEUpgrade_ = true;
0078   }
0079   void setHFUpgrade(HcalHardcodeParameters p) {
0080     theHFUpgradeParameters_ = p;
0081     setHFUpgrade_ = true;
0082   }
0083   void useHBUpgrade(bool b) { useHBUpgrade_ = b; }
0084   void useHEUpgrade(bool b) { useHEUpgrade_ = b; }
0085   void useHOUpgrade(bool b) { useHOUpgrade_ = b; }
0086   void useHFUpgrade(bool b) { useHFUpgrade_ = b; }
0087   void testHFQIE10(bool b) { testHFQIE10_ = b; }
0088   void testHEPlan1(bool b) { testHEPlan1_ = b; }
0089   void setSiPMCharacteristics(std::vector<edm::ParameterSet> vps) { theSiPMCharacteristics_ = vps; }
0090   void setKillHE(bool b) { killHE_ = b; }
0091 
0092   //getters
0093   const bool useHBUpgrade() const { return useHBUpgrade_; }
0094   const bool useHEUpgrade() const { return useHEUpgrade_; }
0095   const bool useHOUpgrade() const { return useHOUpgrade_; }
0096   const bool useHFUpgrade() const { return useHFUpgrade_; }
0097   const HcalHardcodeParameters& getParameters(HcalGenericDetId fId) const;
0098   const int getGainIndex(HcalGenericDetId fId) const;
0099   const bool killHE() const { return killHE_; }
0100   HcalPedestal makePedestal(HcalGenericDetId fId, bool fSmear, bool eff, const HcalTopology* topo, double intlumi);
0101   HcalPedestalWidth makePedestalWidth(HcalGenericDetId fId, bool eff, const HcalTopology* topo, double intlumi);
0102   HcalGain makeGain(HcalGenericDetId fId, bool fSmear = false) const;
0103   HcalGainWidth makeGainWidth(HcalGenericDetId fId) const;
0104   HcalPFCut makePFCut(HcalGenericDetId fId, double intlumi, bool noHE) const;
0105   HcalZSThreshold makeZSThreshold(HcalGenericDetId fId) const;
0106   HcalQIECoder makeQIECoder(HcalGenericDetId fId) const;
0107   HcalCalibrationQIECoder makeCalibrationQIECoder(HcalGenericDetId fId) const;
0108   HcalQIEShape makeQIEShape() const;
0109   HcalQIEType makeQIEType(HcalGenericDetId fId) const;
0110   HcalRecoParam makeRecoParam(HcalGenericDetId fId) const;
0111   HcalMCParam makeMCParam(HcalGenericDetId fId) const;
0112   HcalTimingParam makeTimingParam(HcalGenericDetId fId) const;
0113   std::unique_ptr<HcalElectronicsMap> makeHardcodeMap(const std::vector<HcalGenericDetId>& cells) const;
0114   std::unique_ptr<HcalDcsMap> makeHardcodeDcsMap() const;
0115   void makeHardcodeFrontEndMap(HcalFrontEndMap& emap, const std::vector<HcalGenericDetId>& cells) const;
0116   std::unique_ptr<HcalFrontEndMap> makeHardcodeFrontEndMap(const std::vector<HcalGenericDetId>& cells) const;
0117   HcalSiPMParameter makeHardcodeSiPMParameter(HcalGenericDetId fId, const HcalTopology* topo, double intlumi);
0118   std::unique_ptr<HcalSiPMCharacteristics> makeHardcodeSiPMCharacteristics() const;
0119   HcalTPChannelParameter makeHardcodeTPChannelParameter(HcalGenericDetId fId) const;
0120   void makeHardcodeTPParameters(HcalTPParameters& tppar) const;
0121   int getLayersInDepth(int ieta, int depth, const HcalTopology* topo);
0122   bool isHEPlan1(HcalGenericDetId fId) const;
0123 
0124 private:
0125   //member variables
0126   HcalHardcodeParameters theDefaultParameters_;
0127   HcalHardcodeParameters theHBParameters_, theHEParameters_, theHFParameters_, theHOParameters_;
0128   HcalHardcodeParameters theHBUpgradeParameters_, theHEUpgradeParameters_, theHFUpgradeParameters_;
0129   bool setHB_, setHE_, setHF_, setHO_, setHBUpgrade_, setHEUpgrade_, setHFUpgrade_, killHE_;
0130   bool useHBUpgrade_, useHEUpgrade_, useHOUpgrade_, useHFUpgrade_, testHFQIE10_, testHEPlan1_;
0131   std::vector<edm::ParameterSet> theSiPMCharacteristics_;
0132   std::map<std::pair<int, int>, int> theLayersInDepths_;
0133 };
0134 
0135 #endif