20 fedIds_( pset.getParameter<
edm::FileInPath>(
"FedIdsFile") ),
23 findingRecord<SiStripFedCablingRcd>();
25 <<
"[SiStripFedCablingFakeESSource::" << __func__ <<
"]" 26 <<
" Constructing object...";
33 <<
"[SiStripFedCablingFakeESSource::" << __func__ <<
"]" 34 <<
" Destructing object...";
41 <<
"[SiStripFedCablingFakeESSource::" << __func__ <<
"]" 42 <<
" Building \"fake\" FED cabling map" 43 <<
" from real DetIds and FedIds (read from ascii file)";
50 typedef std::vector<uint32_t>
Dets;
55 typedef std::vector<uint16_t> Feds;
62 Dets::const_iterator idet = dets.begin();
63 Dets::const_iterator jdet = dets.end();
64 for ( ; idet != jdet; ++idet ) {
66 for ( uint16_t ipair = 0; ipair < npairs; ++ipair ) {
68 if ( npairs == 2 && ipair == 0 ) { addr = 32; }
69 else if ( npairs == 2 && ipair == 1 ) { addr = 36; }
70 else if ( npairs == 3 && ipair == 0 ) { addr = 32; }
71 else if ( npairs == 3 && ipair == 1 ) { addr = 34; }
72 else if ( npairs == 3 && ipair == 2 ) { addr = 36; }
75 <<
"[SiStripFedCablingFakeESSource::" << __func__ <<
"]" 76 <<
" Inconsistent values for nPairs (" << npairs
77 <<
") and ipair (" << ipair <<
")!";
99 bool insufficient =
false;
100 Feds::const_iterator ifed = feds.begin();
102 for ( std::vector<SiStripFecCrate>::const_iterator icrate = fec_cabling->
crates().begin(); icrate != fec_cabling->
crates().end(); icrate++ ) {
103 for ( std::vector<SiStripFec>::const_iterator ifec = icrate->fecs().begin(); ifec != icrate->fecs().end(); ifec++ ) {
104 for ( std::vector<SiStripRing>::const_iterator iring = ifec->rings().begin(); iring != ifec->rings().end(); iring++ ) {
105 for ( std::vector<SiStripCcu>::const_iterator iccu = iring->ccus().begin(); iccu != iring->ccus().end(); iccu++ ) {
106 for ( std::vector<SiStripModule>::const_iterator imod = iccu->modules().begin(); imod != iccu->modules().end(); imod++ ) {
108 for ( uint16_t ipair = 0; ipair < imod->nApvPairs(); ipair++ ) {
110 if ( ifed == feds.end() ) { fed_ch++; ifed = feds.begin(); }
111 if ( fed_ch == 96 ) {
116 std::pair<uint16_t,uint16_t> addr = imod->activeApvPair( imod->lldChannel(ipair) );
130 if ( 96-fed_ch < imod->nApvPairs() ) { ifed++; fed_ch = 0; }
131 for ( uint16_t ipair = 0; ipair < imod->nApvPairs(); ipair++ ) {
132 std::pair<uint16_t,uint16_t> addr = imod->activeApvPair( (*imod).lldChannel(ipair) );
148 if ( insufficient ) {
150 <<
"[SiStripFedCablingFakeESSource::" << __func__ <<
"]" 151 <<
" Insufficient FED channels to cable entire system!";
155 std::stringstream ss;
156 ss <<
"[SiStripFedCablingFakeESSource::" << __func__ <<
"]" 157 <<
" First count devices of FEC cabling " << std::endl;
162 std::vector<FedChannelConnection> conns;
Device and connection information at the level of a front-end module.
T getParameter(std::string const &) const
static uint16_t ccuAddr(const uint16_t &nth_module)
void print(std::stringstream &) const
static uint16_t fecCrate(const uint16_t &nth_module)
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
void addDevices(const FedChannelConnection &conn)
~SiStripFedCablingFakeESSource() override
static const IOVSyncValue & endOfTime()
const std::vector< SiStripFecCrate > & crates() const
static uint16_t fecSlot(const uint16_t &nth_module)
static uint16_t fecRing(const uint16_t &nth_module)
const uint32_t & key() const
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
static const char mlCabling_[]
const std::vector< uint32_t > & getAllDetIds() const
static const IOVSyncValue & beginOfTime()
void connections(std::vector< FedChannelConnection > &) const
Class containning control, module, detector and connection information, at the level of a FED channel...
Abstract base class for producer of SiStripFedCabling record.
SiStripFedCablingFakeESSource(const edm::ParameterSet &)
static uint16_t ccuChan(const uint16_t &nth_module)
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
SiStripFedCabling * make(const SiStripFedCablingRcd &) override
FedChannel fedCh(const uint16_t &apv_pair_num) const
std::string fullPath() const
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
NumberOfDevices countDevices() const