File indexing completed on 2024-04-06 12:02:39
0001 #ifndef CondFormats_SiStripObjects_Phase2TrackerCabling_H
0002 #define CondFormats_SiStripObjects_Phase2TrackerCabling_H
0003
0004 #include "CondFormats/Serialization/interface/Serializable.h"
0005 #include <CondFormats/SiStripObjects/interface/Phase2TrackerModule.h>
0006 #include <vector>
0007 #include <algorithm>
0008
0009 class Phase2TrackerCabling {
0010 typedef std::vector<Phase2TrackerModule> store;
0011 typedef std::vector<Phase2TrackerModule>::const_iterator key;
0012 typedef std::vector<key> cabling;
0013
0014 public:
0015
0016 Phase2TrackerCabling(const std::vector<Phase2TrackerModule>& cons);
0017
0018
0019 Phase2TrackerCabling(const Phase2TrackerCabling& src);
0020
0021
0022 Phase2TrackerCabling() {}
0023
0024
0025 virtual ~Phase2TrackerCabling() {}
0026
0027
0028 void initializeCabling();
0029
0030
0031 const std::vector<Phase2TrackerModule>& connections() const { return connections_; }
0032
0033
0034 const Phase2TrackerModule& findFedCh(std::pair<unsigned int, unsigned int> fedch) const;
0035
0036
0037 const Phase2TrackerModule& findDetid(uint32_t detid) const;
0038
0039
0040 const Phase2TrackerModule& findGbtid(uint32_t gbtid) const;
0041
0042
0043 Phase2TrackerCabling filterByCoolingLine(uint32_t coolingLine) const;
0044
0045
0046 Phase2TrackerCabling filterByPowerGroup(uint32_t powerGroup) const;
0047
0048
0049 std::string summaryDescription() const;
0050
0051
0052 std::string description(bool compact = false) const;
0053
0054 private:
0055
0056 store connections_;
0057
0058
0059 cabling fedCabling_ COND_TRANSIENT;
0060 cabling gbtCabling_ COND_TRANSIENT;
0061 cabling detCabling_ COND_TRANSIENT;
0062
0063 private:
0064
0065 static bool chOrdering(key a, key b);
0066 static bool chComp(key a, std::pair<unsigned int, unsigned int> b);
0067 static bool fedeq(key a, key b);
0068 static bool detidOrdering(key a, key b);
0069 static bool detidComp(key a, uint32_t b);
0070 static bool gbtidOrdering(key a, key b);
0071 static bool gbtidComp(key a, uint32_t b);
0072 static bool coolingOrdering(const Phase2TrackerModule& a, const Phase2TrackerModule& b);
0073 static bool coolingComp(const Phase2TrackerModule& a, uint32_t b);
0074 static bool cooleq(const Phase2TrackerModule& a, const Phase2TrackerModule& b);
0075 static bool powerOrdering(const Phase2TrackerModule& a, const Phase2TrackerModule& b);
0076 static bool powerComp(const Phase2TrackerModule& a, uint32_t b);
0077 static bool poweq(const Phase2TrackerModule& a, const Phase2TrackerModule& b);
0078
0079 COND_SERIALIZABLE;
0080 };
0081
0082 #endif