CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/CalibTracker/SiStripCommon/interface/SiStripDetInfoFileReader.h

Go to the documentation of this file.
00001 #ifndef CalibTracker_SiStripChannelGain_SiStripDetInfoFileReader_h
00002 #define CalibTracker_SiStripChannelGain_SiStripDetInfoFileReader_h
00003 // -*- C++ -*-
00004 //
00005 // Package:    SiStripDetInfoFileReader
00006 // Class:      SiStripDetInfoFileReader
00007 // 
00015 //
00016 // Original Author:  G. Bruno
00017 //         Created:  Mon Nov 20 10:04:31 CET 2006
00018 // $Id: SiStripDetInfoFileReader.h,v 1.4 2008/09/19 16:53:10 giordano Exp $
00019 //
00020 //
00021 
00022 #include <map>
00023 #include <vector>
00024 #include <string>
00025 #include <iostream>
00026 #include <fstream>
00027 #include <boost/cstdint.hpp>
00028 #include "FWCore/ServiceRegistry/interface/Service.h"
00029 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00030 
00031 class SiStripDetInfoFileReader  {
00032 
00033 public:
00034 
00035   struct DetInfo{
00036     
00037     DetInfo(){};
00038     DetInfo(unsigned short _nApvs, double _stripLength, float _thickness):
00039     nApvs(_nApvs),stripLength(_stripLength),thickness(_thickness){};
00040 
00041     unsigned short nApvs;
00042     double stripLength;
00043     float thickness;
00044   };
00045 
00046   explicit SiStripDetInfoFileReader(){};
00047   explicit SiStripDetInfoFileReader(const edm::ParameterSet&,
00048                                     const edm::ActivityRegistry&);
00049 
00050   explicit SiStripDetInfoFileReader(std::string filePath);
00051   explicit SiStripDetInfoFileReader(const SiStripDetInfoFileReader&);
00052 
00053   ~SiStripDetInfoFileReader();
00054 
00055   SiStripDetInfoFileReader& operator=(const SiStripDetInfoFileReader &copy);
00056 
00057   const std::vector<uint32_t> & getAllDetIds() const {return detIds_;}
00058 
00059   const std::pair<unsigned short, double>  getNumberOfApvsAndStripLength(uint32_t detId) const;
00060 
00061   const float & getThickness(uint32_t detId) const;
00062 
00063   const std::map<uint32_t, DetInfo > & getAllData() const {return detData_;}
00064 
00065 
00066 private:
00067 
00068   void reader(std::string filePath);
00069 
00070   std::ifstream inputFile_; 
00071   //  std::string filePath_;
00072 
00073   std::map<uint32_t, DetInfo> detData_;
00074   //  std::map<uint32_t, std::pair<unsigned short, double> > detData_;
00075   //std::map<uint32_t, float > detThickness_;
00076   std::vector<uint32_t> detIds_;
00077 
00078 };
00079 #endif