21 findingRecord<SiStripFedCablingRcd>();
23 edm::LogVerbatim(
"FedCabling") <<
"[SiStripFedCablingFakeESSource::" << __func__ <<
"]" 24 <<
" Constructing object...";
30 edm::LogVerbatim(
"FedCabling") <<
"[SiStripFedCablingFakeESSource::" << __func__ <<
"]" 31 <<
" Destructing object...";
37 edm::LogVerbatim(
"FedCabling") <<
"[SiStripFedCablingFakeESSource::" << __func__ <<
"]" 38 <<
" Building \"fake\" FED cabling map" 39 <<
" from real DetIds and FedIds (read from ascii file)";
45 typedef std::vector<uint32_t> Dets;
49 typedef std::vector<uint16_t> Feds;
56 Dets::const_iterator idet = dets.begin();
57 Dets::const_iterator jdet = dets.end();
58 for (; idet != jdet; ++idet) {
60 for (uint16_t ipair = 0; ipair < npairs; ++ipair) {
62 if (npairs == 2 && ipair == 0) {
64 }
else if (npairs == 2 && ipair == 1) {
66 }
else if (npairs == 3 && ipair == 0) {
68 }
else if (npairs == 3 && ipair == 1) {
70 }
else if (npairs == 3 && ipair == 2) {
73 edm::LogWarning(
"FedCabling") <<
"[SiStripFedCablingFakeESSource::" << __func__ <<
"]" 74 <<
" Inconsistent values for nPairs (" << npairs <<
") and ipair (" << ipair
95 bool insufficient =
false;
96 Feds::const_iterator ifed =
feds.begin();
98 for (
auto& icrate : fec_cabling->
crates()) {
99 for (
auto& ifec : icrate.fecs()) {
100 for (
auto& iring : ifec.rings()) {
101 for (
auto& iccu : iring.ccus()) {
102 for (
auto& imod : iccu.modules()) {
103 if (populateAllFeds) {
104 for (uint16_t ipair = 0; ipair < imod.nApvPairs(); ipair++) {
105 if (ifed ==
feds.end()) {
114 std::pair<uint16_t, uint16_t>
addr = imod.activeApvPair(imod.lldChannel(ipair));
119 imod.fedCh(
addr.first, fed_channel);
127 if (96 - fed_ch < imod.nApvPairs()) {
131 for (uint16_t ipair = 0; ipair < imod.nApvPairs(); ipair++) {
132 std::pair<uint16_t, uint16_t>
addr = imod.activeApvPair(imod.lldChannel(ipair));
137 imod.fedCh(
addr.first, fed_channel);
149 <<
" Insufficient FED channels to cable entire system!";
153 std::stringstream
ss;
154 ss <<
"[SiStripFedCablingFakeESSource::" << __func__ <<
"]" 155 <<
" First count devices of FEC cabling " << std::endl;
160 std::vector<FedChannelConnection> conns;
Log< level::Info, true > LogVerbatim
static uint16_t ccuAddr(const uint16_t &nth_module)
T getParameter(std::string const &) const
static uint16_t fecCrate(const uint16_t &nth_module)
std::string fullPath() const
for(int i=first, nt=offsets[nh];i< nt;i+=gridDim.x *blockDim.x)
void addDevices(const FedChannelConnection &conn)
~SiStripFedCablingFakeESSource() override
NumberOfDevices countDevices() const
static const IOVSyncValue & endOfTime()
static uint16_t fecSlot(const uint16_t &nth_module)
static uint16_t fecRing(const uint16_t &nth_module)
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
static const char mlCabling_[]
static const IOVSyncValue & beginOfTime()
Class containning control, module, detector and connection information, at the level of a FED channel...
void print(std::stringstream &) const
const uint32_t & key() const
Abstract base class for producer of SiStripFedCabling record.
void connections(std::vector< FedChannelConnection > &) const
SiStripDetInfo read(std::string filePath)
const std::vector< SiStripFecCrate > & crates() const
SiStripFedCablingFakeESSource(const edm::ParameterSet &)
static uint16_t ccuChan(const uint16_t &nth_module)
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
SiStripFedCabling * make(const SiStripFedCablingRcd &) override
Log< level::Warning, false > LogWarning
const std::vector< uint32_t > & getAllDetIds() const noexcept
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override