CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/SimCalorimetry/EcalTrigPrimProducers/plugins/EcalTrigPrimESProducer.h

Go to the documentation of this file.
00001 #ifndef SimCalorimetry_EcalTrigPrimProducers_EcalTrigPrimESProducer_H
00002 #define SimCalorimetry_EcalTrigPrimProducers_EcalTrigPrimESProducer_H
00003 
00004 // user include files
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/EcalObjects/interface/EcalTPGCrystalStatus.h"
00024 #include "CondFormats/EcalObjects/interface/EcalTPGTowerStatus.h"
00025 #include "CondFormats/DataRecord/interface/EcalTPGPedestalsRcd.h"
00026 #include "CondFormats/DataRecord/interface/EcalTPGLinearizationConstRcd.h"
00027 #include "CondFormats/DataRecord/interface/EcalTPGSlidingWindowRcd.h"
00028 #include "CondFormats/DataRecord/interface/EcalTPGFineGrainEBIdMapRcd.h"
00029 #include "CondFormats/DataRecord/interface/EcalTPGFineGrainStripEERcd.h"
00030 #include "CondFormats/DataRecord/interface/EcalTPGFineGrainTowerEERcd.h"
00031 #include "CondFormats/DataRecord/interface/EcalTPGLutIdMapRcd.h"
00032 #include "CondFormats/DataRecord/interface/EcalTPGWeightIdMapRcd.h"
00033 #include "CondFormats/DataRecord/interface/EcalTPGWeightGroupRcd.h"
00034 #include "CondFormats/DataRecord/interface/EcalTPGLutGroupRcd.h"
00035 #include "CondFormats/DataRecord/interface/EcalTPGFineGrainEBGroupRcd.h"
00036 #include "CondFormats/DataRecord/interface/EcalTPGPhysicsConstRcd.h"
00037 #include "CondFormats/DataRecord/interface/EcalTPGCrystalStatusRcd.h"
00038 #include "CondFormats/DataRecord/interface/EcalTPGTowerStatusRcd.h"
00039 
00040 #include "zlib.h"
00041 
00042 //
00043 // class declaration
00044 //
00045 
00046 class EcalTrigPrimESProducer : public edm::ESProducer {
00047  public:
00048   EcalTrigPrimESProducer(const edm::ParameterSet&);
00049   ~EcalTrigPrimESProducer();
00050 
00051   std::auto_ptr<EcalTPGPedestals> producePedestals(const EcalTPGPedestalsRcd &) ;
00052   std::auto_ptr<EcalTPGLinearizationConst> produceLinearizationConst(const EcalTPGLinearizationConstRcd &) ;
00053   std::auto_ptr<EcalTPGSlidingWindow> produceSlidingWindow(const EcalTPGSlidingWindowRcd &) ;
00054   std::auto_ptr<EcalTPGFineGrainEBIdMap> produceFineGrainEB(const EcalTPGFineGrainEBIdMapRcd &) ;
00055   std::auto_ptr<EcalTPGFineGrainStripEE> produceFineGrainEEstrip(const EcalTPGFineGrainStripEERcd &) ;
00056   std::auto_ptr<EcalTPGFineGrainTowerEE> produceFineGrainEEtower(const EcalTPGFineGrainTowerEERcd &) ;
00057   std::auto_ptr<EcalTPGLutIdMap> produceLUT(const EcalTPGLutIdMapRcd &) ;
00058   std::auto_ptr<EcalTPGWeightIdMap> produceWeight(const EcalTPGWeightIdMapRcd &) ;
00059   std::auto_ptr<EcalTPGWeightGroup> produceWeightGroup(const EcalTPGWeightGroupRcd &) ;
00060   std::auto_ptr<EcalTPGLutGroup> produceLutGroup(const EcalTPGLutGroupRcd &) ;
00061   std::auto_ptr<EcalTPGFineGrainEBGroup> produceFineGrainEBGroup(const EcalTPGFineGrainEBGroupRcd &) ;
00062   std::auto_ptr<EcalTPGPhysicsConst> producePhysicsConst(const EcalTPGPhysicsConstRcd &) ;
00063   std::auto_ptr<EcalTPGCrystalStatus> produceBadX(const EcalTPGCrystalStatusRcd &) ;
00064   std::auto_ptr<EcalTPGTowerStatus> produceBadTT(const EcalTPGTowerStatusRcd &) ;
00065   
00066  private:
00067 
00068   void parseTextFile() ;
00069   std::vector<int> getRange(int subdet, int smNb, int towerNbInSm, int stripNbInTower=0, int xtalNbInStrip=0) ;
00070 
00071   // ----------member data ---------------------------
00072   std::string dbFilename_;
00073   std::map<uint32_t, std::vector<uint32_t> > mapXtal_ ;
00074   std::map<uint32_t, std::vector<uint32_t> > mapStrip_[2] ;
00075   std::map<uint32_t, std::vector<uint32_t> > mapTower_[2] ;
00076   std::map<uint32_t, std::vector<uint32_t> > mapWeight_ ;
00077   std::map<uint32_t, std::vector<uint32_t> > mapFg_ ;
00078   std::map<uint32_t, std::vector<uint32_t> > mapLut_ ;
00079   std::map<uint32_t, std::vector<float> > mapPhys_ ;
00080 
00081 //   typedef voidp gzFile;
00082 //   bool getNextString(gzFile &gzf);
00083 //   int converthex();
00084 //   char buf_[100];
00085 //   std::string bufString_;
00086 //   std::string sub_;
00087 //   int bufpos_;
00088 
00089 };
00090 
00091 
00092 #endif