00001 #ifndef SimCalorimetry_EcalTrigPrimProducers_EcalTrigPrimESProducer_H
00002 #define SimCalorimetry_EcalTrigPrimProducers_EcalTrigPrimESProducer_H
00003
00004
00005 #include "FWCore/Framework/interface/ModuleFactory.h"
00006 #include "FWCore/Framework/interface/ESProducer.h"
00007
00008 #include "FWCore/Framework/interface/ESHandle.h"
00009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00010
00011 #include "CondFormats/EcalObjects/interface/EcalTPGPedestals.h"
00012 #include "CondFormats/EcalObjects/interface/EcalTPGLinearizationConst.h"
00013 #include "CondFormats/EcalObjects/interface/EcalTPGSlidingWindow.h"
00014 #include "CondFormats/EcalObjects/interface/EcalTPGFineGrainEBIdMap.h"
00015 #include "CondFormats/EcalObjects/interface/EcalTPGFineGrainStripEE.h"
00016 #include "CondFormats/EcalObjects/interface/EcalTPGFineGrainTowerEE.h"
00017 #include "CondFormats/EcalObjects/interface/EcalTPGLutIdMap.h"
00018 #include "CondFormats/EcalObjects/interface/EcalTPGWeightIdMap.h"
00019 #include "CondFormats/EcalObjects/interface/EcalTPGWeightGroup.h"
00020 #include "CondFormats/EcalObjects/interface/EcalTPGLutGroup.h"
00021 #include "CondFormats/EcalObjects/interface/EcalTPGFineGrainEBGroup.h"
00022 #include "CondFormats/EcalObjects/interface/EcalTPGPhysicsConst.h"
00023 #include "CondFormats/DataRecord/interface/EcalTPGPedestalsRcd.h"
00024 #include "CondFormats/DataRecord/interface/EcalTPGLinearizationConstRcd.h"
00025 #include "CondFormats/DataRecord/interface/EcalTPGSlidingWindowRcd.h"
00026 #include "CondFormats/DataRecord/interface/EcalTPGFineGrainEBIdMapRcd.h"
00027 #include "CondFormats/DataRecord/interface/EcalTPGFineGrainStripEERcd.h"
00028 #include "CondFormats/DataRecord/interface/EcalTPGFineGrainTowerEERcd.h"
00029 #include "CondFormats/DataRecord/interface/EcalTPGLutIdMapRcd.h"
00030 #include "CondFormats/DataRecord/interface/EcalTPGWeightIdMapRcd.h"
00031 #include "CondFormats/DataRecord/interface/EcalTPGWeightGroupRcd.h"
00032 #include "CondFormats/DataRecord/interface/EcalTPGLutGroupRcd.h"
00033 #include "CondFormats/DataRecord/interface/EcalTPGFineGrainEBGroupRcd.h"
00034 #include "CondFormats/DataRecord/interface/EcalTPGPhysicsConstRcd.h"
00035
00036 #include "zlib.h"
00037
00038
00039
00040
00041
00042 class EcalTrigPrimESProducer : public edm::ESProducer {
00043 public:
00044 EcalTrigPrimESProducer(const edm::ParameterSet&);
00045 ~EcalTrigPrimESProducer();
00046
00047 std::auto_ptr<EcalTPGPedestals> producePedestals(const EcalTPGPedestalsRcd &) ;
00048 std::auto_ptr<EcalTPGLinearizationConst> produceLinearizationConst(const EcalTPGLinearizationConstRcd &) ;
00049 std::auto_ptr<EcalTPGSlidingWindow> produceSlidingWindow(const EcalTPGSlidingWindowRcd &) ;
00050 std::auto_ptr<EcalTPGFineGrainEBIdMap> produceFineGrainEB(const EcalTPGFineGrainEBIdMapRcd &) ;
00051 std::auto_ptr<EcalTPGFineGrainStripEE> produceFineGrainEEstrip(const EcalTPGFineGrainStripEERcd &) ;
00052 std::auto_ptr<EcalTPGFineGrainTowerEE> produceFineGrainEEtower(const EcalTPGFineGrainTowerEERcd &) ;
00053 std::auto_ptr<EcalTPGLutIdMap> produceLUT(const EcalTPGLutIdMapRcd &) ;
00054 std::auto_ptr<EcalTPGWeightIdMap> produceWeight(const EcalTPGWeightIdMapRcd &) ;
00055 std::auto_ptr<EcalTPGWeightGroup> produceWeightGroup(const EcalTPGWeightGroupRcd &) ;
00056 std::auto_ptr<EcalTPGLutGroup> produceLutGroup(const EcalTPGLutGroupRcd &) ;
00057 std::auto_ptr<EcalTPGFineGrainEBGroup> produceFineGrainEBGroup(const EcalTPGFineGrainEBGroupRcd &) ;
00058 std::auto_ptr<EcalTPGPhysicsConst> producePhysicsConst(const EcalTPGPhysicsConstRcd &) ;
00059
00060 private:
00061
00062 void parseTextFile() ;
00063 std::vector<int> getRange(int subdet, int smNb, int towerNbInSm, int stripNbInTower=0, int xtalNbInStrip=0) ;
00064
00065
00066 std::string dbFilename_;
00067 std::map<uint32_t, std::vector<uint32_t> > mapXtal_ ;
00068 std::map<uint32_t, std::vector<uint32_t> > mapStrip_[2] ;
00069 std::map<uint32_t, std::vector<uint32_t> > mapTower_[2] ;
00070 std::map<uint32_t, std::vector<uint32_t> > mapWeight_ ;
00071 std::map<uint32_t, std::vector<uint32_t> > mapFg_ ;
00072 std::map<uint32_t, std::vector<uint32_t> > mapLut_ ;
00073 std::map<uint32_t, std::vector<float> > mapPhys_ ;
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083 };
00084
00085
00086 #endif