14 using namespace sistrip;
20 detIds_( pset.getParameter<edm::
FileInPath>(
"DetIdsFile") ),
21 fedIds_( pset.getParameter<edm::
FileInPath>(
"FedIdsFile") ),
24 findingRecord<SiStripFedCablingRcd>();
26 <<
"[SiStripFedCablingFakeESSource::" << __func__ <<
"]"
27 <<
" Constructing object...";
34 <<
"[SiStripFedCablingFakeESSource::" << __func__ <<
"]"
35 <<
" Destructing object...";
42 <<
"[SiStripFedCablingFakeESSource::" << __func__ <<
"]"
43 <<
" Building \"fake\" FED cabling map"
44 <<
" from real DetIds and FedIds (read from ascii file)";
51 typedef std::vector<uint32_t> Dets;
56 typedef std::vector<uint16_t> Feds;
63 Dets::const_iterator idet = dets.begin();
64 Dets::const_iterator jdet = dets.end();
65 for ( ; idet != jdet; ++idet ) {
66 uint16_t npairs = Detreader.getNumberOfApvsAndStripLength(*idet).first / 2;
67 for ( uint16_t ipair = 0; ipair < npairs; ++ipair ) {
69 if ( npairs == 2 && ipair == 0 ) { addr = 32; }
70 else if ( npairs == 2 && ipair == 1 ) { addr = 36; }
71 else if ( npairs == 3 && ipair == 0 ) { addr = 32; }
72 else if ( npairs == 3 && ipair == 1 ) { addr = 34; }
73 else if ( npairs == 3 && ipair == 2 ) { addr = 36; }
76 <<
"[SiStripFedCablingFakeESSource::" << __func__ <<
"]"
77 <<
" Inconsistent values for nPairs (" << npairs
78 <<
") and ipair (" << ipair <<
")!";
100 bool insufficient =
false;
101 Feds::const_iterator ifed = feds.begin();
103 for ( std::vector<SiStripFecCrate>::const_iterator icrate = fec_cabling->
crates().begin(); icrate != fec_cabling->
crates().end(); icrate++ ) {
104 for ( std::vector<SiStripFec>::const_iterator ifec = icrate->fecs().begin(); ifec != icrate->fecs().end(); ifec++ ) {
105 for ( std::vector<SiStripRing>::const_iterator iring = ifec->rings().begin(); iring != ifec->rings().end(); iring++ ) {
106 for ( std::vector<SiStripCcu>::const_iterator iccu = iring->ccus().begin(); iccu != iring->ccus().end(); iccu++ ) {
107 for ( std::vector<SiStripModule>::const_iterator imod = iccu->modules().begin(); imod != iccu->modules().end(); imod++ ) {
109 for ( uint16_t ipair = 0; ipair < imod->nApvPairs(); ipair++ ) {
111 if ( ifed == feds.end() ) { fed_ch++; ifed = feds.begin(); }
112 if ( fed_ch == 96 ) {
117 std::pair<uint16_t,uint16_t> addr = imod->activeApvPair( imod->lldChannel(ipair) );
131 if ( 96-fed_ch < imod->nApvPairs() ) { ifed++; fed_ch = 0; }
132 for ( uint16_t ipair = 0; ipair < imod->nApvPairs(); ipair++ ) {
133 std::pair<uint16_t,uint16_t> addr = imod->activeApvPair( (*imod).lldChannel(ipair) );
149 if ( insufficient ) {
151 <<
"[SiStripFedCablingFakeESSource::" << __func__ <<
"]"
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;
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)
virtual SiStripFedCabling * make(const SiStripFedCablingRcd &)
void addDevices(const FedChannelConnection &conn)
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 &)
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
static uint16_t ccuChan(const uint16_t &nth_module)
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
FedChannel fedCh(const uint16_t &apv_pair_num) const
~SiStripFedCablingFakeESSource()
virtual void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)
std::string fullPath() const
for(const auto &isodef:isoDefs)
NumberOfDevices countDevices() const