Go to the documentation of this file.00001 #ifndef SiStripObjects_SiStripDetCabling_h
00002 #define SiStripObjects_SiStripDetCabling_h
00003
00004
00005
00006
00011
00012
00013
00014 #include "CondFormats/SiStripObjects/interface/SiStripFedCabling.h"
00015 #include "CondFormats/SiStripObjects/interface/FedChannelConnection.h"
00016 #include <boost/cstdint.hpp>
00017 #include <vector>
00018 #include <string>
00019 #include <map>
00020 class SiStripDetCabling
00021 {
00022 public:
00023 SiStripDetCabling();
00024 virtual ~SiStripDetCabling();
00025 SiStripDetCabling(const SiStripFedCabling &);
00026 void addDevices(const FedChannelConnection &, std::map< uint32_t, std::vector<FedChannelConnection> >&);
00027 void addDevices(const FedChannelConnection &);
00028
00029 inline const std::map< uint32_t, std::vector<FedChannelConnection> >& getDetCabling() const { return fullcabling_; }
00030
00031 void addActiveDetectorsRawIds(std::vector<uint32_t> &) const;
00032 void addAllDetectorsRawIds(std::vector<uint32_t> & vector_to_fill_with_detids ) const;
00033 void getAllDetectorsContiguousIds(std::map<uint32_t, unsigned int>&) const;
00034 void getActiveDetectorsContiguousIds(std::map<uint32_t, unsigned int>&) const;
00035
00036 void addConnected ( std::map<uint32_t, std::vector<int> > &) const;
00037 void addDetected ( std::map<uint32_t, std::vector<int> > &) const;
00038 void addUnDetected( std::map<uint32_t, std::vector<int> > &) const;
00039 void addNotConnectedAPVs( std::map<uint32_t, std::vector<int> > &) const;
00040
00041 const std::vector<FedChannelConnection>& getConnections( uint32_t det_id ) const;
00042 const FedChannelConnection& getConnection( uint32_t det_id, unsigned short apv_pair ) const;
00043 const unsigned int getDcuId( uint32_t det_id ) const;
00044 const uint16_t nApvPairs(uint32_t det_id) const;
00045 bool IsConnected(const uint32_t& det_id) const;
00046 bool IsDetected(const uint32_t& det_id) const;
00047 bool IsUndetected(const uint32_t& det_id) const;
00048
00050 void print( std::stringstream& ) const;
00051
00053 void printSummary(std::stringstream& ss) const;
00055 void printDebug(std::stringstream& ss) const;
00056
00057
00058 uint32_t connectedNumber(const std::string & subDet, const uint16_t layer) const { return detNumber(subDet, layer, 0); }
00059 uint32_t detectedNumber(const std::string & subDet, const uint16_t layer) const { return detNumber(subDet, layer, 1); }
00060 uint32_t undetectedNumber(const std::string & subDet, const uint16_t layer) const { return detNumber(subDet, layer, 2); }
00061 inline const SiStripFedCabling * fedCabling() const {return fedCabling_;}
00062
00063 private:
00064 SiStripDetCabling(const SiStripDetCabling&);
00065 const SiStripDetCabling& operator=(const SiStripDetCabling&);
00066 void addFromSpecificConnection( std::map<uint32_t, std::vector<int> > & , const std::map< uint32_t, std::vector<int> > &, const int connectionType = -1 ) const;
00067 bool IsInMap(const uint32_t& det_id, const std::map<uint32_t, std::vector<int> > &) const;
00068 int16_t layerSearch( const uint32_t detId ) const;
00069 uint32_t detNumber(const std::string & subDet, const uint16_t layer, const int connectionType) const;
00070
00071
00072
00073 std::map< uint32_t, std::vector<FedChannelConnection> > fullcabling_;
00074
00075 std::map< uint32_t, std::vector<int> > connected_;
00076 std::map< uint32_t, std::vector<int> > detected_;
00077 std::map< uint32_t, std::vector<int> > undetected_;
00078
00079
00080
00081
00082
00083
00084 mutable std::map< int16_t, uint32_t > connectionCount[3];
00085 const SiStripFedCabling * fedCabling_;
00086 };
00087 #endif