Go to the documentation of this file.00001 #ifndef SiPixelSummary_h
00002 #define SiPixelSummary_h
00003
00004 #include<vector>
00005 #include<map>
00006 #include <string>
00007 #include<iostream>
00008 #include<boost/cstdint.hpp>
00009 #include "FWCore/Utilities/interface/Exception.h"
00010
00017 namespace sipixelsummary {
00018 enum TrackerRegion {
00019 TRACKER = 0,
00020 Barrel = 1,
00021 Shell_mI = 2,
00022 Shell_mO = 3,
00023 Shell_pI = 4,
00024 Shell_pO = 5,
00025 Endcap = 6,
00026 HalfCylinder_mI = 7,
00027 HalfCylinder_mO = 8,
00028 HalfCylinder_pI = 9,
00029 HalfCylinder_pO = 10
00030 };
00031
00032
00033
00034 }
00035
00036 class SiPixelSummary {
00037
00038 public:
00039
00040 struct DetRegistry{
00041 uint32_t detid;
00042 uint32_t ibegin;
00043 };
00044
00045 class StrictWeakOrdering{
00046 public:
00047 bool operator() (const DetRegistry& p,const uint32_t& i) const {return p.detid < i;}
00048 };
00049
00050
00051
00052
00053
00054 typedef std::vector<float>::const_iterator ContainerIterator;
00055 typedef std::pair<ContainerIterator, ContainerIterator> Range;
00056 typedef std::vector<DetRegistry> Registry;
00057 typedef Registry::const_iterator RegistryIterator;
00058 typedef std::vector<float> InputVector;
00059
00060
00061 SiPixelSummary(std::vector<std::string>& userDBContent);
00062 SiPixelSummary(const SiPixelSummary& input);
00063 SiPixelSummary(){};
00064 ~SiPixelSummary(){};
00065
00066
00067 ContainerIterator getDataVectorBegin() const {return v_sum_.begin(); }
00068 ContainerIterator getDataVectorEnd() const {return v_sum_.end(); }
00069 RegistryIterator getRegistryVectorBegin() const {return indexes_.begin();}
00070 RegistryIterator getRegistryVectorEnd() const {return indexes_.end(); }
00071
00072
00073
00074 const Range getRange(const uint32_t& detID) const;
00075
00076
00077
00078
00079 std::vector<uint32_t> getDetIds() const;
00080
00081
00082
00083
00084 bool put(const uint32_t& detID, InputVector &input, std::vector<std::string>& userContent );
00085 bool put(sipixelsummary::TrackerRegion region, InputVector &input, std::vector<std::string>& userContent );
00086 void setObj(const uint32_t& detID, std::string elementName, float value);
00087
00088
00089
00090
00091
00092
00093 std::vector<float> getSummaryObj(uint32_t& detID, std::vector<std::string> list) const;
00094 std::vector<float> getSummaryObj(sipixelsummary::TrackerRegion region, std::vector<std::string> list) const;
00095
00096
00097
00098 std::vector<float> getSummaryObj(std::string elementName) const;
00099
00100
00101 std::vector<float> getSummaryObj(uint32_t& detID) const;
00102
00103
00104 std::vector<float> getSummaryObj() const;
00105
00106
00107
00108
00109 inline void setUserDBContent(std::vector<std::string> userDBContent) { userDBContent_ = userDBContent;}
00110 inline void setRunNr(int inputRunNr) { runNr_ = inputRunNr; }
00111 inline void setTimeValue(unsigned long long inputTimeValue){ timeValue_=inputTimeValue;}
00112
00113 inline unsigned long long getTimeValue() const { return timeValue_; }
00114 inline std::vector<std::string> getUserDBContent() const { return userDBContent_; }
00115 inline int getRunNr() const { return runNr_; }
00116
00117
00118
00119
00120 void print();
00121
00122
00123
00124
00125 std::vector<std::string> userDBContent_;
00126 std::vector<float> v_sum_;
00127 std::vector<DetRegistry> indexes_;
00128
00129 int runNr_;
00130 unsigned long long timeValue_;
00131
00132
00133 protected:
00134
00135
00136 const short getPosition(std::string elementName) const;
00137
00138
00139 };
00140
00141
00142 #endif