CMS 3D CMS Logo

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