CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Private Attributes
SiStripModule Class Reference

Device and connection information at the level of a front-end module. More...

#include <SiStripModule.h>

Classes

class  FedChannel
 

Public Types

typedef std::map< uint16_t,
FedChannel
FedCabling
 
typedef std::pair< uint16_t,
uint16_t > 
PairOfU16
 

Public Member Functions

const uint16_t & activeApv (const uint16_t &apv_address) const
 
PairOfU16 activeApvPair (const uint16_t &lld_channel) const
 
std::vector< uint16_t > activeApvs () const
 
void addApv (const uint16_t &apv_address)
 
void addDevices (const FedChannelConnection &conn)
 
uint16_t apvPairNumber (const uint16_t &lld_channel) const
 
const uint16_t & ccuAddr () const
 
const uint16_t & ccuChan () const
 
const uint16_t & dcu () const
 
const uint32_t & dcuId () const
 
void dcuId (const uint32_t &dcu_id)
 
const uint32_t & detId () const
 
void detId (const uint32_t &det_id)
 
const uint16_t & fecCrate () const
 
const uint16_t & fecRing () const
 
const uint16_t & fecSlot () const
 
FedChannel fedCh (const uint16_t &apv_pair_num) const
 
bool fedCh (const uint16_t &apv_address, const FedChannel &fed_ch)
 
const FedCablingfedChannels () const
 
const SiStripFecKeykey () const
 
const uint16_t & length () const
 
void length (const uint16_t &length)
 
const uint16_t & lld () const
 
uint16_t lldChannel (const uint16_t &apv_pair_num) const
 
const uint16_t & mux () const
 
const uint16_t & nApvPairs () const
 
void nApvPairs (const uint16_t &npairs)
 
uint16_t nDetStrips () const
 
const uint16_t & pll () const
 
void print (std::stringstream &) const
 
 SiStripModule (const FedChannelConnection &conn)
 
void terse (std::stringstream &) const
 
 ~SiStripModule ()
 

Private Attributes

uint16_t apv32_
 
uint16_t apv33_
 
uint16_t apv34_
 
uint16_t apv35_
 
uint16_t apv36_
 
uint16_t apv37_
 
FedCabling cabling_
 
uint16_t dcu0x00_
 
uint32_t dcuId_
 
uint32_t detId_
 
SiStripFecKey key_
 
uint16_t length_
 
uint16_t lld0x60_
 
uint16_t mux0x43_
 
uint16_t nApvPairs_
 
uint16_t pll0x44_
 

Detailed Description

Device and connection information at the level of a front-end module.

Author
R.Bainbridge

Definition at line 24 of file SiStripModule.h.

Member Typedef Documentation

typedef std::map< uint16_t, FedChannel > SiStripModule::FedCabling

Map between LLD channel and FED channel

Definition at line 59 of file SiStripModule.h.

typedef std::pair<uint16_t,uint16_t> SiStripModule::PairOfU16

Pair containing FED id/channel.

Definition at line 42 of file SiStripModule.h.

Constructor & Destructor Documentation

SiStripModule::SiStripModule ( const FedChannelConnection conn)

Constructor.

Definition at line 12 of file SiStripModule.cc.

References addDevices().

13  : key_( conn.fecCrate(),
14  conn.fecSlot(),
15  conn.fecRing(),
16  conn.ccuAddr(),
17  conn.ccuChan() ),
18  apv32_(0),
19  apv33_(0),
20  apv34_(0),
21  apv35_(0),
22  apv36_(0),
23  apv37_(0),
24  dcu0x00_(0),
25  mux0x43_(0),
26  pll0x44_(0),
27  lld0x60_(0),
28  dcuId_(0),
29  detId_(0),
30  nApvPairs_(0),
31  cabling_(),
32  length_(0)
33 {
34  addDevices( conn );
35 }
const uint16_t & fecSlot() const
uint16_t apv35_
const uint16_t & fecCrate() const
uint16_t pll0x44_
SiStripFecKey key_
uint32_t dcuId_
uint16_t apv37_
void addDevices(const FedChannelConnection &conn)
uint16_t apv33_
const uint16_t & fecRing() const
uint16_t apv32_
uint16_t mux0x43_
const uint16_t & ccuChan() const
uint32_t detId_
const uint16_t & ccuAddr() const
FedCabling cabling_
uint16_t lld0x60_
uint16_t length_
uint16_t apv34_
uint16_t nApvPairs_
uint16_t apv36_
uint16_t dcu0x00_
SiStripModule::~SiStripModule ( )
inline

Default constructor.

Definition at line 34 of file SiStripModule.h.

34 {;}

Member Function Documentation

const uint16_t & SiStripModule::activeApv ( const uint16_t &  apv_address) const

Identifies whether APV of a given I2C address (32->37) or footprint position on the hybrid (0->5) is active or not. Returns device I2C address or zero if not active.

Definition at line 125 of file SiStripModule.cc.

References apv32_, apv33_, apv34_, apv35_, apv36_, apv37_, and sistrip::mlCabling_.

125  {
126  if ( apv_address == 0 || apv_address == 32 ) { return apv32_; }
127  else if ( apv_address == 1 || apv_address == 33 ) { return apv33_; }
128  else if ( apv_address == 2 || apv_address == 34 ) { return apv34_; }
129  else if ( apv_address == 3 || apv_address == 35 ) { return apv35_; }
130  else if ( apv_address == 4 || apv_address == 36 ) { return apv36_; }
131  else if ( apv_address == 5 || apv_address == 37 ) { return apv37_; }
132  else {
134  << "SiStripModule::" << __func__ << "]"
135  << " Unexpected I2C address or number ("
136  << apv_address << ") for this module!";
137  }
138  static const uint16_t address = 0;
139  return address;
140 }
uint16_t apv35_
uint16_t apv37_
uint16_t apv33_
static const char mlCabling_[]
uint16_t apv32_
uint16_t apv34_
uint16_t apv36_
SiStripModule::PairOfU16 SiStripModule::activeApvPair ( const uint16_t &  lld_channel) const

Identifies APV pairs that are active for given LLD channel (1->3). Returns device I2C address or zero if not active.

Definition at line 203 of file SiStripModule.cc.

References apv32_, apv33_, apv34_, apv35_, apv36_, apv37_, and sistrip::mlCabling_.

203  {
204  if ( lld_channel == 1 ) { return PairOfU16(apv32_,apv33_); }
205  else if ( lld_channel == 2 ) { return PairOfU16(apv34_,apv35_); }
206  else if ( lld_channel == 3 ) { return PairOfU16(apv36_,apv37_); }
207  else {
209  << "SiStripModule::" << __func__ << "]"
210  << " Unexpected LLD channel: " << lld_channel;
211  return PairOfU16(0,0);
212  }
213 }
uint16_t apv35_
uint16_t apv37_
uint16_t apv33_
static const char mlCabling_[]
uint16_t apv32_
std::pair< uint16_t, uint16_t > PairOfU16
Definition: SiStripModule.h:42
uint16_t apv34_
uint16_t apv36_
std::vector< uint16_t > SiStripModule::activeApvs ( ) const

Returns I2C addresses of active ("found") APVs.

Definition at line 112 of file SiStripModule.cc.

References apv32_, apv33_, apv34_, apv35_, apv36_, and apv37_.

Referenced by print(), and terse().

112  {
113  std::vector<uint16_t> apvs;
114  if ( apv32_ ) { apvs.push_back( apv32_ ); }
115  if ( apv33_ ) { apvs.push_back( apv33_ ); }
116  if ( apv34_ ) { apvs.push_back( apv34_ ); }
117  if ( apv35_ ) { apvs.push_back( apv35_ ); }
118  if ( apv36_ ) { apvs.push_back( apv36_ ); }
119  if ( apv37_ ) { apvs.push_back( apv37_ ); }
120  return apvs;
121 }
uint16_t apv35_
uint16_t apv37_
uint16_t apv33_
uint16_t apv32_
uint16_t apv34_
uint16_t apv36_
void SiStripModule::addApv ( const uint16_t &  apv_address)

Add APV to module using I2C address (32->37).

Definition at line 144 of file SiStripModule.cc.

References apv32_, apv33_, apv34_, apv35_, apv36_, apv37_, SiStripFecKey::ccuAddr(), SiStripFecKey::ccuChan(), SiStripFecKey::fecCrate(), SiStripFecKey::fecRing(), SiStripFecKey::fecSlot(), key_, and sistrip::mlCabling_.

Referenced by addDevices().

144  {
145 
146  // Some checks on value of APV I2C address
147  if ( apv_address == 0 ) {
149  << "SiStripModule::" << __func__ << "]"
150  << " Null APV I2C address!";
151  return;
152  } else if ( apv_address < 32 && apv_address > 37 ) {
154  << "SiStripModule::" << __func__ << "]"
155  << " Unexpected I2C address ("
156  << apv_address << ") for APV!";
157  return;
158  }
159 
160  bool added_apv = false;
161  if ( !apv32_ && apv_address == 32 ) { apv32_ = 32; added_apv = true; }
162  else if ( !apv33_ && apv_address == 33 ) { apv33_ = 33; added_apv = true; }
163  else if ( !apv34_ && apv_address == 34 ) { apv34_ = 34; added_apv = true; }
164  else if ( !apv35_ && apv_address == 35 ) { apv35_ = 35; added_apv = true; }
165  else if ( !apv36_ && apv_address == 36 ) { apv36_ = 36; added_apv = true; }
166  else if ( !apv37_ && apv_address == 37 ) { apv37_ = 37; added_apv = true; }
167 
168  std::stringstream ss;
169  ss << "SiStripModule::" << __func__ << "]";
170  if ( added_apv ) { ss << " Added new APV for"; }
171  else { ss << " APV already exists for"; }
172  ss << " Crate/FEC/Ring/CCU/Module: "
173  << key_.fecCrate() << "/"
174  << key_.fecSlot() << "/"
175  << key_.fecRing() << "/"
176  << key_.ccuAddr() << "/"
177  << key_.ccuChan() << "/"
178  << apv_address;
179  //if ( added_apv ) { LogTrace(mlCabling_) << ss.str(); }
180  /* else */ if ( !added_apv ) { edm::LogWarning(mlCabling_) << ss.str(); }
181 
182 }
uint16_t apv35_
SiStripFecKey key_
const uint16_t & fecRing() const
uint16_t apv37_
const uint16_t & fecSlot() const
uint16_t apv33_
static const char mlCabling_[]
uint16_t apv32_
const uint16_t & fecCrate() const
const uint16_t & ccuAddr() const
const uint16_t & ccuChan() const
uint16_t apv34_
uint16_t apv36_
void SiStripModule::addDevices ( const FedChannelConnection conn)

Sets device info (addresses, DetID, etc) for this module.

Definition at line 39 of file SiStripModule.cc.

References addApv(), SiStripFecKey::ccuAddr(), FedChannelConnection::ccuAddr(), SiStripFecKey::ccuChan(), FedChannelConnection::ccuChan(), FedChannelConnection::dcu(), dcu0x00_, FedChannelConnection::dcuId(), dcuId(), FedChannelConnection::detId(), detId(), SiStripFecKey::fecCrate(), FedChannelConnection::fecCrate(), SiStripFecKey::fecRing(), FedChannelConnection::fecRing(), SiStripFecKey::fecSlot(), FedChannelConnection::fecSlot(), FedChannelConnection::fedCh(), fedCh(), FedChannelConnection::fedCrate(), FedChannelConnection::fedId(), FedChannelConnection::fedSlot(), FedChannelConnection::i2cAddr(), key_, FedChannelConnection::lld(), lld0x60_, sistrip::mlCabling_, FedChannelConnection::mux(), mux0x43_, FedChannelConnection::nApvPairs(), nApvPairs(), FedChannelConnection::pll(), and pll0x44_.

Referenced by SiStripCcu::addDevices(), and SiStripModule().

39  {
40 
41  if ( key_.fecCrate() && key_.fecCrate() != conn.fecCrate() ) {
43  << "SiStripModule::" << __func__ << "]"
44  << " Unexpected FEC crate ("
45  << conn.fecCrate() << ") for this module ("
46  << key_.fecCrate() << ")!";
47  return;
48  }
49 
50  if ( key_.fecSlot() && key_.fecSlot() != conn.fecSlot() ) {
52  << "SiStripModule::" << __func__ << "]"
53  << " Unexpected FEC slot ("
54  << conn.fecSlot() << ") for this module ("
55  << key_.fecSlot() << ")!";
56  return;
57  }
58 
59  if ( key_.fecRing() && key_.fecRing() != conn.fecRing() ) {
61  << "SiStripModule::" << __func__ << "]"
62  << " Unexpected FEC ring ("
63  << conn.fecRing() << ") for this module ("
64  << key_.fecRing() << ")!";
65  return;
66  }
67 
68  if ( key_.ccuAddr() && key_.ccuAddr() != conn.ccuAddr() ) {
70  << "SiStripModule::" << __func__ << "]"
71  << " Unexpected CCU addr ("
72  << conn.ccuAddr() << ") for this module ("
73  << key_.ccuAddr() << ")!";
74  return;
75  }
76 
77  if ( key_.ccuChan() && key_.ccuChan() != conn.ccuChan() ) {
79  << "SiStripModule::" << __func__ << "]"
80  << " Unexpected CCU chan ("
81  << conn.ccuChan() << ") for this module ("
82  << key_.ccuChan() << ")!";
83  return;
84  }
85 
86  // APVs
87  if ( conn.i2cAddr(0) ) { addApv( conn.i2cAddr(0) ); }
88  if ( conn.i2cAddr(1) ) { addApv( conn.i2cAddr(1) ); }
89 
90  // Detector
91  dcuId( conn.dcuId() );
92  detId( conn.detId() );
93  nApvPairs( conn.nApvPairs() );
94 
95  // FED cabling
96  FedChannel fed_ch( conn.fedCrate(),
97  conn.fedSlot(),
98  conn.fedId(),
99  conn.fedCh() );
100  fedCh( conn.i2cAddr(0), fed_ch );
101 
102  // DCU, MUX, PLL, LLD
103  if ( conn.dcu() ) { dcu0x00_ = true; }
104  if ( conn.mux() ) { mux0x43_ = true; }
105  if ( conn.pll() ) { pll0x44_ = true; }
106  if ( conn.lld() ) { lld0x60_ = true; }
107 
108 }
const uint16_t & fecSlot() const
const uint16_t & fecCrate() const
const bool & lld() const
uint16_t pll0x44_
SiStripFecKey key_
const uint16_t & fecRing() const
const uint16_t & fedCh() const
const uint16_t & fecSlot() const
const uint16_t & fedId() const
static const char mlCabling_[]
const uint16_t & fecRing() const
const uint16_t & fedSlot() const
const uint32_t & detId() const
uint16_t mux0x43_
const uint16_t & ccuChan() const
void addApv(const uint16_t &apv_address)
const bool & mux() const
const bool & dcu() const
const uint16_t & ccuAddr() const
const uint32_t & dcuId() const
const uint16_t & fecCrate() const
const uint16_t & nApvPairs() const
const uint32_t & dcuId() const
const uint16_t & nApvPairs() const
const uint16_t & ccuAddr() const
const bool & pll() const
const uint32_t & detId() const
const uint16_t & fedCrate() const
uint16_t lld0x60_
FedChannel fedCh(const uint16_t &apv_pair_num) const
const uint16_t & ccuChan() const
const uint16_t & i2cAddr(const uint16_t &apv0_or_1) const
uint16_t dcu0x00_
uint16_t SiStripModule::apvPairNumber ( const uint16_t &  lld_channel) const

Returns APV pair (0->1 or 0->2) for given LLD channel (1->3).

Definition at line 242 of file SiStripModule.cc.

References sistrip::mlCabling_, and nApvPairs_.

242  {
243  if ( lld_channel < 1 || lld_channel > 3 ) {
245  << "SiStripModule::" << __func__ << "]"
246  << " Unexpected LLD channel: " << lld_channel;
247  return 0;
248  }
249  if ( nApvPairs_ != 2 && nApvPairs_ != 3 ) {
251  << "SiStripModule::" << __func__ << "]"
252  << " Unexpected number of APV pairs: " << nApvPairs_;
253  return 0;
254  }
255  if ( nApvPairs_ == 2 && lld_channel == 3 ) { return 1; }
256  else if ( nApvPairs_ == 2 && lld_channel == 2 ) {
258  << "SiStripModule::" << __func__ << "]"
259  << " LLD channel is incompatible with"
260  << " respect to number of APV pairs!";
261  return 0;
262  } else { return lld_channel - 1; }
263 }
static const char mlCabling_[]
uint16_t nApvPairs_
const uint16_t & SiStripModule::ccuAddr ( ) const
inline

Definition at line 197 of file SiStripModule.h.

References SiStripFecKey::ccuAddr(), and key_.

197 { return key_.ccuAddr(); }
SiStripFecKey key_
const uint16_t & ccuAddr() const
const uint16_t & SiStripModule::ccuChan ( ) const
inline

Definition at line 198 of file SiStripModule.h.

References SiStripFecKey::ccuChan(), and key_.

198 { return key_.ccuChan(); }
SiStripFecKey key_
const uint16_t & ccuChan() const
const uint16_t & SiStripModule::dcu ( ) const
inline

Identifies whether the DCU device is active ("found") or not.

Definition at line 214 of file SiStripModule.h.

References dcu0x00_.

214 { return dcu0x00_; }
uint16_t dcu0x00_
const uint32_t & SiStripModule::dcuId ( ) const
inline

Returns DCU id for this module.

Definition at line 202 of file SiStripModule.h.

References dcuId_.

Referenced by addDevices(), SiStripFedCablingBuilderFromDb::assignDcuAndDetIds(), print(), and terse().

202 { return dcuId_; }
uint32_t dcuId_
void SiStripModule::dcuId ( const uint32_t &  dcu_id)
inline

Set DCU id for this module.

Definition at line 207 of file SiStripModule.h.

References dcu0x00_, and dcuId_.

207 { if ( dcu_id ) { dcuId_ = dcu_id; dcu0x00_ = true; } }
uint32_t dcuId_
uint16_t dcu0x00_
const uint32_t & SiStripModule::detId ( ) const
inline

Returns unique (geometry-based) identifier for this module.

Definition at line 203 of file SiStripModule.h.

References detId_.

Referenced by addDevices(), SiStripFedCablingBuilderFromDb::assignDcuAndDetIds(), print(), and terse().

203 { return detId_; }
uint32_t detId_
void SiStripModule::detId ( const uint32_t &  det_id)
inline

Set DetId for this module.

Definition at line 208 of file SiStripModule.h.

References detId_.

208 { if ( det_id ) { detId_ = det_id; } }
uint32_t detId_
const uint16_t & SiStripModule::fecCrate ( ) const
inline

Definition at line 194 of file SiStripModule.h.

References SiStripFecKey::fecCrate(), and key_.

194 { return key_.fecCrate(); }
SiStripFecKey key_
const uint16_t & fecCrate() const
const uint16_t & SiStripModule::fecRing ( ) const
inline

Definition at line 196 of file SiStripModule.h.

References SiStripFecKey::fecRing(), and key_.

196 { return key_.fecRing(); }
SiStripFecKey key_
const uint16_t & fecRing() const
const uint16_t & SiStripModule::fecSlot ( ) const
inline

Definition at line 195 of file SiStripModule.h.

References SiStripFecKey::fecSlot(), and key_.

195 { return key_.fecSlot(); }
SiStripFecKey key_
const uint16_t & fecSlot() const
SiStripModule::FedChannel SiStripModule::fedCh ( const uint16_t &  apv_pair_num) const

Returns FedChannel for a given apvPairNumber.

Definition at line 267 of file SiStripModule.cc.

References cabling_, sistrip::mlCabling_, and nApvPairs().

Referenced by addDevices(), SiStripFedCablingBuilderFromDb::buildFecCablingFromDetIds(), SiStripFedCablingBuilderFromDb::buildFecCablingFromDevices(), and SiStripFedCablingFakeESSource::make().

267  {
268 
269  FedChannel fed_ch(0,0,0,0);
270 
271  if ( !nApvPairs() ) {
272 
274  << "SiStripModule::" << __func__ << "]"
275  << " No APV pairs exist!";
276  return fed_ch;
277 
278  } else {
279 
280  uint16_t lld_ch = 0;
281  if ( nApvPairs() == 2 ) {
282 
283  if ( apv_pair == 0 ) { lld_ch = 1; }
284  else if ( apv_pair == 1 ) { lld_ch = 3; }
285  else {
287  << "SiStripModule::" << __func__ << "]"
288  << " Unexpected pair number! " << apv_pair;
289  }
290 
291  } else if ( nApvPairs() == 3 ) {
292 
293  if ( apv_pair == 0 ) { lld_ch = 1; }
294  else if ( apv_pair == 1 ) { lld_ch = 2; }
295  else if ( apv_pair == 2 ) { lld_ch = 3; }
296  else {
298  << "SiStripModule::" << __func__ << "]"
299  << " Unexpected pair number! " << apv_pair;
300  }
301 
302  } else {
303 
305  << "SiStripModule::" << __func__ << "]"
306  << " Unexpected number of APV pairs: " << nApvPairs();
307 
308  }
309 
310  FedCabling::const_iterator ipair = cabling_.find( lld_ch );
311  if ( ipair != cabling_.end() ) { return (*ipair).second; }
312  else { return fed_ch; }
313 
314  }
315 
316 }
static const char mlCabling_[]
const uint16_t & nApvPairs() const
FedCabling cabling_
bool SiStripModule::fedCh ( const uint16_t &  apv_address,
const FedChannel fed_ch 
)

Sets FedChannel for given APV address (32->37). Returns true if connection made, false otherwise.

Definition at line 320 of file SiStripModule.cc.

References cabling_, and sistrip::mlCabling_.

321  {
322  // Determine LLD channel
323  int16_t lld_ch = 1;
324  if ( apv_address == 32 || apv_address == 33 ) { lld_ch = 1; }
325  else if ( apv_address == 34 || apv_address == 35 ) { lld_ch = 2; }
326  else if ( apv_address == 36 || apv_address == 37 ) { lld_ch = 3; }
327  else if ( apv_address == 0 ) { ; } //@@ do nothing?
328  else {
329  edm::LogWarning(mlCabling_) << "[SiStripModule::fedCh]"
330  << " Unexpected I2C address ("
331  << apv_address << ") for APV!";
332  return false;
333  }
334  // Search for entry in std::map
335  //@@ use FedKey as key instead of lld chan? what about "duplicates"?
336  //@@ always append to std::map? then can have >3 entries. useful for debug?
337  FedCabling::iterator ipair = cabling_.find( lld_ch );
338  if ( ipair == cabling_.end() ) { cabling_[lld_ch] = fed_ch; }
339  else { ipair->second = fed_ch; }
340  return true;
341 }
static const char mlCabling_[]
FedCabling cabling_
const SiStripModule::FedCabling & SiStripModule::fedChannels ( ) const
inline

Returns map of apvPairNumber and FedChannel.

Definition at line 209 of file SiStripModule.h.

References cabling_.

Referenced by print(), and terse().

209 { return cabling_; }
FedCabling cabling_
const SiStripFecKey & SiStripModule::key ( ) const
inline

Returns control "key" for this module, containing address information on FEC crate, slot, ring, CCU, and module.

Definition at line 200 of file SiStripModule.h.

References key_.

Referenced by SiStripCommissioningSource::fillCablingHistos(), print(), and terse().

200 { return key_; }
SiStripFecKey key_
const uint16_t & SiStripModule::length ( ) const
inline
void SiStripModule::length ( const uint16_t &  length)
inline
const uint16_t & SiStripModule::lld ( ) const
inline

Identifies whether the LLD device is active ("found") or not.

Definition at line 217 of file SiStripModule.h.

References lld0x60_.

217 { return lld0x60_; }
uint16_t lld0x60_
uint16_t SiStripModule::lldChannel ( const uint16_t &  apv_pair_num) const

Returns LLD channel (1->3) for given APV pair (0->1 or 0->2).

Definition at line 217 of file SiStripModule.cc.

References sistrip::mlCabling_, and nApvPairs_.

217  {
218  if ( apv_pair_num > 2 ) {
220  << "SiStripModule::" << __func__ << "]"
221  << " Unexpected APV pair number: " << apv_pair_num;
222  return 0;
223  }
224  if ( nApvPairs_ != 2 && nApvPairs_ != 3 ) {
226  << "SiStripModule::" << __func__ << "]"
227  << " Unexpected number of APV pairs: " << nApvPairs_;
228  return 0;
229  }
230  if ( nApvPairs_ == 2 && apv_pair_num == 1 ) { return 3; }
231  else if ( nApvPairs_ == 2 && apv_pair_num == 2 ) {
233  << "[SiStripFecCabling::" << __func__ << "]"
234  << " APV pair number is incompatible with"
235  << " respect to number of !";
236  return 0;
237  } else { return apv_pair_num + 1; }
238 }
static const char mlCabling_[]
uint16_t nApvPairs_
const uint16_t & SiStripModule::mux ( ) const
inline

Identifies whether the MUX device is active ("found") or not.

Definition at line 215 of file SiStripModule.h.

References mux0x43_.

215 { return mux0x43_; }
uint16_t mux0x43_
const uint16_t & SiStripModule::nApvPairs ( ) const
inline

Returns number of APV pairs for this module.

Definition at line 204 of file SiStripModule.h.

References nApvPairs_.

Referenced by addDevices(), SiStripFedCablingBuilderFromDb::assignDcuAndDetIds(), SiStripFedCablingBuilderFromDb::buildFecCablingFromDevices(), fedCh(), print(), and terse().

204 { return nApvPairs_; }
uint16_t nApvPairs_
void SiStripModule::nApvPairs ( const uint16_t &  npairs)

Set number of detector strips for this module.

Definition at line 186 of file SiStripModule.cc.

References apv32_, apv33_, apv34_, apv35_, apv36_, apv37_, sistrip::mlCabling_, and nApvPairs_.

186  {
187  if ( npairs == 2 || npairs == 3 ) { nApvPairs_ = npairs; }
188  else if ( npairs == 0 ) {
189  nApvPairs_ = 0;
190  if ( apv32_ || apv33_ ) { nApvPairs_++; }
191  if ( apv34_ || apv35_ ) { nApvPairs_++; }
192  if ( apv36_ || apv37_ ) { nApvPairs_++; }
193  } else {
195  << "SiStripModule::" << __func__ << "]"
196  << " Unexpected number of APV pairs: "
197  << npairs;
198  }
199 }
uint16_t apv35_
uint16_t apv37_
uint16_t apv33_
static const char mlCabling_[]
uint16_t apv32_
uint16_t apv34_
uint16_t nApvPairs_
uint16_t apv36_
uint16_t SiStripModule::nDetStrips ( ) const
inline

Returns number of detector strips for this module.

Definition at line 205 of file SiStripModule.h.

References nApvPairs_.

205 { return 256*nApvPairs_; }
uint16_t nApvPairs_
const uint16_t & SiStripModule::pll ( ) const
inline

Identifies whether the PLL device is active ("found") or not.

Definition at line 216 of file SiStripModule.h.

References pll0x44_.

216 { return pll0x44_; }
uint16_t pll0x44_
void SiStripModule::print ( std::stringstream &  ss) const

Prints some debug information for this module.

Definition at line 345 of file SiStripModule.cc.

References activeApvs(), SiStripFecKey::ccuAddr(), SiStripFecKey::ccuChan(), dcu0x00_, dcuId(), detId(), SiStripFecKey::fecCrate(), SiStripFecKey::fecRing(), SiStripFecKey::fecSlot(), fedChannels(), key(), lld0x60_, mux0x43_, nApvPairs(), and pll0x44_.

Referenced by operator<<().

345  {
346 
347  ss << " [SiStripModule::" << __func__ << "]" << std::endl
348  << " Crate/FEC/Ring/CCU/Module : "
349  << key().fecCrate() << "/"
350  << key().fecSlot() << "/"
351  << key().fecRing() << "/"
352  << key().ccuAddr() << "/"
353  << key().ccuChan() << std::endl;
354 
355  ss << " ActiveApvs : ";
356  std::vector<uint16_t> apvs = activeApvs();
357  if ( apvs.empty() ) { ss << "NONE!"; }
358  std::vector<uint16_t>::const_iterator iapv = apvs.begin();
359  for ( ; iapv != apvs.end(); iapv++ ) { ss << *iapv << ", "; }
360  ss << std::endl;
361 
362  ss << " DcuId/DetId/nPairs : "
363  << std::hex
364  << "0x" << std::setfill('0') << std::setw(8) << dcuId() << "/"
365  << "0x" << std::setfill('0') << std::setw(8) << detId() << "/"
366  << std::dec
367  << nApvPairs() << std::endl;
368 
369  FedCabling channels = fedChannels();
370  ss << " ApvPairNum/FedCrate/FedSlot/FedId/FedCh : ";
371  FedCabling::const_iterator ichan = channels.begin();
372  for ( ; ichan != channels.end(); ichan++ ) {
373  ss << ichan->first << "/"
374  << ichan->second.fedCrate_ << "/"
375  << ichan->second.fedSlot_ << "/"
376  << ichan->second.fedId_ << "/"
377  << ichan->second.fedCh_ << ", ";
378  }
379  ss << std::endl;
380 
381  ss << " DCU/MUX/PLL/LLD found : "
382  << bool(dcu0x00_) << "/"
383  << bool(mux0x43_) << "/"
384  << bool(pll0x44_) << "/"
385  << bool(lld0x60_);
386 
387 }
uint16_t pll0x44_
std::vector< uint16_t > activeApvs() const
const uint16_t & fecRing() const
const SiStripFecKey & key() const
const uint16_t & fecSlot() const
const FedCabling & fedChannels() const
uint16_t mux0x43_
const uint16_t & fecCrate() const
const uint16_t & nApvPairs() const
const uint32_t & dcuId() const
const uint16_t & ccuAddr() const
const uint32_t & detId() const
uint16_t lld0x60_
const uint16_t & ccuChan() const
std::map< uint16_t, FedChannel > FedCabling
Definition: SiStripModule.h:59
uint16_t dcu0x00_
void SiStripModule::terse ( std::stringstream &  ss) const

Prints some terse debug information for this module.

Definition at line 391 of file SiStripModule.cc.

References activeApvs(), SiStripFecKey::ccuAddr(), SiStripFecKey::ccuChan(), dcu0x00_, dcuId(), detId(), SiStripFecKey::fecCrate(), SiStripFecKey::fecRing(), SiStripFecKey::fecSlot(), fedChannels(), key(), lld0x60_, mux0x43_, nApvPairs(), and pll0x44_.

391  {
392 
393  ss << " [SiStripModule::" << __func__ << "]" << std::endl
394  << " Crate/FEC/Ring/CCU/Module : "
395  << key().fecCrate() << "/"
396  << key().fecSlot() << "/"
397  << key().fecRing() << "/"
398  << key().ccuAddr() << "/"
399  << key().ccuChan() << std::endl;
400 
401  ss << " ActiveApvs : ";
402  std::vector<uint16_t> apvs = activeApvs();
403  if ( apvs.empty() ) { ss << "NONE!"; }
404  std::vector<uint16_t>::const_iterator iapv = apvs.begin();
405  for ( ; iapv != apvs.end(); iapv++ ) { ss << *iapv << ", "; }
406  ss << std::endl;
407 
408  ss << " DcuId/DetId/nPairs : "
409  << std::hex
410  << "0x" << std::setfill('0') << std::setw(8) << dcuId() << "/"
411  << "0x" << std::setfill('0') << std::setw(8) << detId() << "/"
412  << std::dec
413  << nApvPairs() << std::endl;
414 
415  FedCabling channels = fedChannels();
416  ss << " ApvPairNum/FedCrate/FedSlot/FedId/FedCh : ";
417  FedCabling::const_iterator ichan = channels.begin();
418  for ( ; ichan != channels.end(); ichan++ ) {
419  ss << ichan->first << "/"
420  << ichan->second.fedCrate_ << "/"
421  << ichan->second.fedSlot_ << "/"
422  << ichan->second.fedId_ << "/"
423  << ichan->second.fedCh_ << ", ";
424  }
425  ss << std::endl;
426 
427  ss << " DCU/MUX/PLL/LLD found : "
428  << bool(dcu0x00_) << "/"
429  << bool(mux0x43_) << "/"
430  << bool(pll0x44_) << "/"
431  << bool(lld0x60_);
432 
433 }
uint16_t pll0x44_
std::vector< uint16_t > activeApvs() const
const uint16_t & fecRing() const
const SiStripFecKey & key() const
const uint16_t & fecSlot() const
const FedCabling & fedChannels() const
uint16_t mux0x43_
const uint16_t & fecCrate() const
const uint16_t & nApvPairs() const
const uint32_t & dcuId() const
const uint16_t & ccuAddr() const
const uint32_t & detId() const
uint16_t lld0x60_
const uint16_t & ccuChan() const
std::map< uint16_t, FedChannel > FedCabling
Definition: SiStripModule.h:59
uint16_t dcu0x00_

Member Data Documentation

uint16_t SiStripModule::apv32_
private

Definition at line 168 of file SiStripModule.h.

Referenced by activeApv(), activeApvPair(), activeApvs(), addApv(), and nApvPairs().

uint16_t SiStripModule::apv33_
private

Definition at line 169 of file SiStripModule.h.

Referenced by activeApv(), activeApvPair(), activeApvs(), addApv(), and nApvPairs().

uint16_t SiStripModule::apv34_
private

Definition at line 170 of file SiStripModule.h.

Referenced by activeApv(), activeApvPair(), activeApvs(), addApv(), and nApvPairs().

uint16_t SiStripModule::apv35_
private

Definition at line 171 of file SiStripModule.h.

Referenced by activeApv(), activeApvPair(), activeApvs(), addApv(), and nApvPairs().

uint16_t SiStripModule::apv36_
private

Definition at line 172 of file SiStripModule.h.

Referenced by activeApv(), activeApvPair(), activeApvs(), addApv(), and nApvPairs().

uint16_t SiStripModule::apv37_
private

Definition at line 173 of file SiStripModule.h.

Referenced by activeApv(), activeApvPair(), activeApvs(), addApv(), and nApvPairs().

FedCabling SiStripModule::cabling_
private

KEY = LLD channel, DATA = FedId + FedCh

Definition at line 187 of file SiStripModule.h.

Referenced by fedCh(), and fedChannels().

uint16_t SiStripModule::dcu0x00_
private

Definition at line 176 of file SiStripModule.h.

Referenced by addDevices(), dcu(), dcuId(), print(), and terse().

uint32_t SiStripModule::dcuId_
private

Definition at line 182 of file SiStripModule.h.

Referenced by dcuId().

uint32_t SiStripModule::detId_
private

Definition at line 183 of file SiStripModule.h.

Referenced by detId().

SiStripFecKey SiStripModule::key_
private

Control key/path for this module.

Definition at line 165 of file SiStripModule.h.

Referenced by addApv(), addDevices(), ccuAddr(), ccuChan(), fecCrate(), fecRing(), fecSlot(), and key().

uint16_t SiStripModule::length_
private

Definition at line 188 of file SiStripModule.h.

Referenced by length().

uint16_t SiStripModule::lld0x60_
private

Definition at line 179 of file SiStripModule.h.

Referenced by addDevices(), lld(), print(), and terse().

uint16_t SiStripModule::mux0x43_
private

Definition at line 177 of file SiStripModule.h.

Referenced by addDevices(), mux(), print(), and terse().

uint16_t SiStripModule::nApvPairs_
private

Definition at line 184 of file SiStripModule.h.

Referenced by apvPairNumber(), lldChannel(), nApvPairs(), and nDetStrips().

uint16_t SiStripModule::pll0x44_
private

Definition at line 178 of file SiStripModule.h.

Referenced by addDevices(), pll(), print(), and terse().