CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/CalibTracker/SiStripChannelGain/plugins/SiStripGainFromAsciiFile.h

Go to the documentation of this file.
00001 #ifndef CalibTracker_SiStripChannelGain_SiStripGainFromAsciiFile_h
00002 #define CalibTracker_SiStripChannelGain_SiStripGainFromAsciiFile_h
00003 
00004 #include "FWCore/ParameterSet/interface/FileInPath.h"
00005 
00006 #include "CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h"
00007 #include "CondFormats/SiStripObjects/interface/SiStripApvGain.h"
00008 #include <vector>
00009 
00010 #include <ext/hash_map>
00011 
00012 class SiStripGainFromAsciiFile : public ConditionDBWriter<SiStripApvGain> {
00013 
00014 public:
00015 
00016   explicit SiStripGainFromAsciiFile(const edm::ParameterSet&);
00017   ~SiStripGainFromAsciiFile();
00018 
00019 private:
00020 
00021   SiStripApvGain * getNewObject();
00022 
00023 private:
00024 
00025   struct FibersGain{
00026     float fiber[3];
00027 
00028     void soft_reset(){ for (int i=0;i<3;++i) if(fiber[i]==-1)fiber[i]=1; }
00029     void hard_reset(float val){ for (int i=0;i<3;++i) fiber[i]=val; }
00030     
00031   };
00032 
00033   std::string Asciifilename_;
00034   float referenceValue_;
00035   edm::FileInPath fp_;
00036 
00037   __gnu_cxx::hash_map< unsigned int,FibersGain>  GainsMap;
00038   //std::map< unsigned int,FibersGain>  GainsMap;
00039 
00040 };
00041 #endif