Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:30

0001 #ifndef SimCalorimetry_EcalTrigPrimProducers_EcalTrigPrimESProducer_H
0002 #define SimCalorimetry_EcalTrigPrimProducers_EcalTrigPrimESProducer_H
0003 
0004 // user include files
0005 #include "FWCore/Framework/interface/ESProducer.h"
0006 #include "FWCore/Framework/interface/ModuleFactory.h"
0007 
0008 #include "FWCore/Framework/interface/ESHandle.h"
0009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0010 
0011 #include "CondFormats/DataRecord/interface/EcalTPGCrystalStatusRcd.h"
0012 #include "CondFormats/DataRecord/interface/EcalTPGFineGrainEBGroupRcd.h"
0013 #include "CondFormats/DataRecord/interface/EcalTPGFineGrainEBIdMapRcd.h"
0014 #include "CondFormats/DataRecord/interface/EcalTPGFineGrainStripEERcd.h"
0015 #include "CondFormats/DataRecord/interface/EcalTPGFineGrainTowerEERcd.h"
0016 #include "CondFormats/DataRecord/interface/EcalTPGLinearizationConstRcd.h"
0017 #include "CondFormats/DataRecord/interface/EcalTPGLutGroupRcd.h"
0018 #include "CondFormats/DataRecord/interface/EcalTPGLutIdMapRcd.h"
0019 #include "CondFormats/DataRecord/interface/EcalTPGPedestalsRcd.h"
0020 #include "CondFormats/DataRecord/interface/EcalTPGPhysicsConstRcd.h"
0021 #include "CondFormats/DataRecord/interface/EcalTPGSlidingWindowRcd.h"
0022 #include "CondFormats/DataRecord/interface/EcalTPGSpikeRcd.h"
0023 #include "CondFormats/DataRecord/interface/EcalTPGStripStatusRcd.h"
0024 #include "CondFormats/DataRecord/interface/EcalTPGTowerStatusRcd.h"
0025 #include "CondFormats/DataRecord/interface/EcalTPGWeightGroupRcd.h"
0026 #include "CondFormats/DataRecord/interface/EcalTPGWeightIdMapRcd.h"
0027 #include "CondFormats/DataRecord/interface/EcalTPGOddWeightGroupRcd.h"
0028 #include "CondFormats/DataRecord/interface/EcalTPGOddWeightIdMapRcd.h"
0029 #include "CondFormats/DataRecord/interface/EcalTPGTPModeRcd.h"
0030 #include "CondFormats/EcalObjects/interface/EcalTPGCrystalStatus.h"
0031 #include "CondFormats/EcalObjects/interface/EcalTPGFineGrainEBGroup.h"
0032 #include "CondFormats/EcalObjects/interface/EcalTPGFineGrainEBIdMap.h"
0033 #include "CondFormats/EcalObjects/interface/EcalTPGFineGrainStripEE.h"
0034 #include "CondFormats/EcalObjects/interface/EcalTPGFineGrainTowerEE.h"
0035 #include "CondFormats/EcalObjects/interface/EcalTPGLinearizationConst.h"
0036 #include "CondFormats/EcalObjects/interface/EcalTPGLutGroup.h"
0037 #include "CondFormats/EcalObjects/interface/EcalTPGLutIdMap.h"
0038 #include "CondFormats/EcalObjects/interface/EcalTPGPedestals.h"
0039 #include "CondFormats/EcalObjects/interface/EcalTPGPhysicsConst.h"
0040 #include "CondFormats/EcalObjects/interface/EcalTPGSlidingWindow.h"
0041 #include "CondFormats/EcalObjects/interface/EcalTPGSpike.h"
0042 #include "CondFormats/EcalObjects/interface/EcalTPGStripStatus.h"
0043 #include "CondFormats/EcalObjects/interface/EcalTPGTowerStatus.h"
0044 #include "CondFormats/EcalObjects/interface/EcalTPGWeightGroup.h"
0045 #include "CondFormats/EcalObjects/interface/EcalTPGWeightIdMap.h"
0046 #include "CondFormats/EcalObjects/interface/EcalTPGOddWeightGroup.h"
0047 #include "CondFormats/EcalObjects/interface/EcalTPGOddWeightIdMap.h"
0048 #include "CondFormats/EcalObjects/interface/EcalTPGTPMode.h"
0049 
0050 #include "zlib.h"
0051 
0052 //
0053 // class declaration
0054 //
0055 
0056 class EcalTrigPrimESProducer : public edm::ESProducer {
0057 public:
0058   EcalTrigPrimESProducer(const edm::ParameterSet &);
0059   ~EcalTrigPrimESProducer() override;
0060 
0061   std::unique_ptr<EcalTPGPedestals> producePedestals(const EcalTPGPedestalsRcd &);
0062   std::unique_ptr<EcalTPGLinearizationConst> produceLinearizationConst(const EcalTPGLinearizationConstRcd &);
0063   std::unique_ptr<EcalTPGSlidingWindow> produceSlidingWindow(const EcalTPGSlidingWindowRcd &);
0064   std::unique_ptr<EcalTPGFineGrainEBIdMap> produceFineGrainEB(const EcalTPGFineGrainEBIdMapRcd &);
0065   std::unique_ptr<EcalTPGFineGrainStripEE> produceFineGrainEEstrip(const EcalTPGFineGrainStripEERcd &);
0066   std::unique_ptr<EcalTPGFineGrainTowerEE> produceFineGrainEEtower(const EcalTPGFineGrainTowerEERcd &);
0067   std::unique_ptr<EcalTPGLutIdMap> produceLUT(const EcalTPGLutIdMapRcd &);
0068   std::unique_ptr<EcalTPGWeightIdMap> produceWeight(const EcalTPGWeightIdMapRcd &);
0069   std::unique_ptr<EcalTPGWeightGroup> produceWeightGroup(const EcalTPGWeightGroupRcd &);
0070   std::unique_ptr<EcalTPGOddWeightIdMap> produceOddWeight(const EcalTPGOddWeightIdMapRcd &);
0071   std::unique_ptr<EcalTPGOddWeightGroup> produceOddWeightGroup(const EcalTPGOddWeightGroupRcd &);
0072   std::unique_ptr<EcalTPGTPMode> produceTPMode(const EcalTPGTPModeRcd &);
0073   std::unique_ptr<EcalTPGLutGroup> produceLutGroup(const EcalTPGLutGroupRcd &);
0074   std::unique_ptr<EcalTPGFineGrainEBGroup> produceFineGrainEBGroup(const EcalTPGFineGrainEBGroupRcd &);
0075   std::unique_ptr<EcalTPGPhysicsConst> producePhysicsConst(const EcalTPGPhysicsConstRcd &);
0076   std::unique_ptr<EcalTPGCrystalStatus> produceBadX(const EcalTPGCrystalStatusRcd &);
0077   std::unique_ptr<EcalTPGStripStatus> produceBadStrip(const EcalTPGStripStatusRcd &);
0078   std::unique_ptr<EcalTPGTowerStatus> produceBadTT(const EcalTPGTowerStatusRcd &);
0079   std::unique_ptr<EcalTPGSpike> produceSpike(const EcalTPGSpikeRcd &);
0080 
0081 private:
0082   void parseTextFile();
0083   std::vector<int> getRange(int subdet, int smNb, int towerNbInSm, int stripNbInTower = 0, int xtalNbInStrip = 0);
0084 
0085   // ----------member data ---------------------------
0086   std::string dbFilename_;
0087   bool flagPrint_;
0088   std::map<uint32_t, std::vector<uint32_t>> mapXtal_;
0089   std::map<uint32_t, std::vector<uint32_t>> mapStrip_[2];
0090   std::map<uint32_t, std::vector<uint32_t>> mapTower_[2];
0091   std::map<uint32_t, std::vector<uint32_t>> mapWeight_;
0092   std::map<uint32_t, std::vector<uint32_t>> mapWeight_odd_;
0093   std::map<uint32_t, std::vector<uint32_t>> mapFg_;
0094   std::map<uint32_t, std::vector<uint32_t>> mapLut_;
0095   std::map<uint32_t, std::vector<float>> mapPhys_;
0096   std::vector<uint32_t> tpMode_;
0097 
0098   //   typedef voidp gzFile;
0099   //   bool getNextString(gzFile &gzf);
0100   //   int converthex();
0101   //   char buf_[100];
0102   //   std::string bufString_;
0103   //   std::string sub_;
0104   //   int bufpos_;
0105 };
0106 
0107 #endif