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 (std::vector<SiStripFecCrate>::iterator icrate = fec_cabling->
crates().begin();
99 icrate != fec_cabling->
crates().end();
101 for (std::vector<SiStripFec>::iterator ifec = icrate->fecs().begin(); ifec != icrate->fecs().end(); ifec++) {
102 for (std::vector<SiStripRing>::iterator iring = ifec->rings().begin(); iring != ifec->rings().end(); iring++) {
103 for (std::vector<SiStripCcu>::iterator iccu = iring->ccus().begin(); iccu != iring->ccus().end(); iccu++) {
104 for (std::vector<SiStripModule>::iterator imod = iccu->modules().begin(); imod != iccu->modules().end();
106 if (populateAllFeds) {
107 for (uint16_t ipair = 0; ipair < imod->nApvPairs(); ipair++) {
108 if (ifed ==
feds.end()) {
117 std::pair<uint16_t, uint16_t>
addr = imod->activeApvPair(imod->lldChannel(ipair));
122 imod->fedCh(
addr.first, fed_channel);
130 if (96 - fed_ch < imod->nApvPairs()) {
134 for (uint16_t ipair = 0; ipair < imod->nApvPairs(); ipair++) {
135 std::pair<uint16_t, uint16_t>
addr = imod->activeApvPair(imod->lldChannel(ipair));
140 imod->fedCh(
addr.first, fed_channel);
152 <<
" Insufficient FED channels to cable entire system!";
156 std::stringstream
ss;
157 ss <<
"[SiStripFedCablingFakeESSource::" << __func__ <<
"]" 158 <<
" First count devices of FEC cabling " << std::endl;
163 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