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 25 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 60 of file SiStripModule.h.

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

Pair containing FED id/channel.

Definition at line 43 of file SiStripModule.h.

Constructor & Destructor Documentation

SiStripModule::SiStripModule ( const FedChannelConnection conn)

Constructor.

Definition at line 13 of file SiStripModule.cc.

References addDevices().

14  : key_( conn.fecCrate(),
15  conn.fecSlot(),
16  conn.fecRing(),
17  conn.ccuAddr(),
18  conn.ccuChan() ),
19  apv32_(0),
20  apv33_(0),
21  apv34_(0),
22  apv35_(0),
23  apv36_(0),
24  apv37_(0),
25  dcu0x00_(0),
26  mux0x43_(0),
27  pll0x44_(0),
28  lld0x60_(0),
29  dcuId_(0),
30  detId_(0),
31  nApvPairs_(0),
32  cabling_(),
33  length_(0)
34 {
35  addDevices( conn );
36 }
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 35 of file SiStripModule.h.

35 {;}

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 126 of file SiStripModule.cc.

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

126  {
127  if ( apv_address == 0 || apv_address == 32 ) { return apv32_; }
128  else if ( apv_address == 1 || apv_address == 33 ) { return apv33_; }
129  else if ( apv_address == 2 || apv_address == 34 ) { return apv34_; }
130  else if ( apv_address == 3 || apv_address == 35 ) { return apv35_; }
131  else if ( apv_address == 4 || apv_address == 36 ) { return apv36_; }
132  else if ( apv_address == 5 || apv_address == 37 ) { return apv37_; }
133  else {
135  << "SiStripModule::" << __func__ << "]"
136  << " Unexpected I2C address or number ("
137  << apv_address << ") for this module!";
138  }
139  static const uint16_t address = 0;
140  return address;
141 }
uint16_t apv35_
char * address
Definition: mlp_lapack.h:14
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 204 of file SiStripModule.cc.

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

204  {
205  if ( lld_channel == 1 ) { return PairOfU16(apv32_,apv33_); }
206  else if ( lld_channel == 2 ) { return PairOfU16(apv34_,apv35_); }
207  else if ( lld_channel == 3 ) { return PairOfU16(apv36_,apv37_); }
208  else {
210  << "SiStripModule::" << __func__ << "]"
211  << " Unexpected LLD channel: " << lld_channel;
212  return PairOfU16(0,0);
213  }
214 }
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:43
uint16_t apv34_
uint16_t apv36_
std::vector< uint16_t > SiStripModule::activeApvs ( ) const

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

Definition at line 113 of file SiStripModule.cc.

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

Referenced by print(), and terse().

113  {
114  std::vector<uint16_t> apvs;
115  if ( apv32_ ) { apvs.push_back( apv32_ ); }
116  if ( apv33_ ) { apvs.push_back( apv33_ ); }
117  if ( apv34_ ) { apvs.push_back( apv34_ ); }
118  if ( apv35_ ) { apvs.push_back( apv35_ ); }
119  if ( apv36_ ) { apvs.push_back( apv36_ ); }
120  if ( apv37_ ) { apvs.push_back( apv37_ ); }
121  return apvs;
122 }
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 145 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().

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

40  {
41 
42  if ( key_.fecCrate() && key_.fecCrate() != conn.fecCrate() ) {
44  << "SiStripModule::" << __func__ << "]"
45  << " Unexpected FEC crate ("
46  << conn.fecCrate() << ") for this module ("
47  << key_.fecCrate() << ")!";
48  return;
49  }
50 
51  if ( key_.fecSlot() && key_.fecSlot() != conn.fecSlot() ) {
53  << "SiStripModule::" << __func__ << "]"
54  << " Unexpected FEC slot ("
55  << conn.fecSlot() << ") for this module ("
56  << key_.fecSlot() << ")!";
57  return;
58  }
59 
60  if ( key_.fecRing() && key_.fecRing() != conn.fecRing() ) {
62  << "SiStripModule::" << __func__ << "]"
63  << " Unexpected FEC ring ("
64  << conn.fecRing() << ") for this module ("
65  << key_.fecRing() << ")!";
66  return;
67  }
68 
69  if ( key_.ccuAddr() && key_.ccuAddr() != conn.ccuAddr() ) {
71  << "SiStripModule::" << __func__ << "]"
72  << " Unexpected CCU addr ("
73  << conn.ccuAddr() << ") for this module ("
74  << key_.ccuAddr() << ")!";
75  return;
76  }
77 
78  if ( key_.ccuChan() && key_.ccuChan() != conn.ccuChan() ) {
80  << "SiStripModule::" << __func__ << "]"
81  << " Unexpected CCU chan ("
82  << conn.ccuChan() << ") for this module ("
83  << key_.ccuChan() << ")!";
84  return;
85  }
86 
87  // APVs
88  if ( conn.i2cAddr(0) ) { addApv( conn.i2cAddr(0) ); }
89  if ( conn.i2cAddr(1) ) { addApv( conn.i2cAddr(1) ); }
90 
91  // Detector
92  dcuId( conn.dcuId() );
93  detId( conn.detId() );
94  nApvPairs( conn.nApvPairs() );
95 
96  // FED cabling
97  FedChannel fed_ch( conn.fedCrate(),
98  conn.fedSlot(),
99  conn.fedId(),
100  conn.fedCh() );
101  fedCh( conn.i2cAddr(0), fed_ch );
102 
103  // DCU, MUX, PLL, LLD
104  if ( conn.dcu() ) { dcu0x00_ = true; }
105  if ( conn.mux() ) { mux0x43_ = true; }
106  if ( conn.pll() ) { pll0x44_ = true; }
107  if ( conn.lld() ) { lld0x60_ = true; }
108 
109 }
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 243 of file SiStripModule.cc.

References sistrip::mlCabling_, and nApvPairs_.

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

Definition at line 198 of file SiStripModule.h.

References SiStripFecKey::ccuAddr(), and key_.

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

Definition at line 199 of file SiStripModule.h.

References SiStripFecKey::ccuChan(), and key_.

199 { 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 215 of file SiStripModule.h.

References dcu0x00_.

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

Returns DCU id for this module.

Definition at line 203 of file SiStripModule.h.

References dcuId_.

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

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

Set DCU id for this module.

Definition at line 208 of file SiStripModule.h.

References dcu0x00_, and dcuId_.

208 { 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 204 of file SiStripModule.h.

References detId_.

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

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

Set DetId for this module.

Definition at line 209 of file SiStripModule.h.

References detId_.

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

Definition at line 195 of file SiStripModule.h.

References SiStripFecKey::fecCrate(), and key_.

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

Definition at line 197 of file SiStripModule.h.

References SiStripFecKey::fecRing(), and key_.

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

Definition at line 196 of file SiStripModule.h.

References SiStripFecKey::fecSlot(), and key_.

196 { 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 268 of file SiStripModule.cc.

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

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

268  {
269 
270  FedChannel fed_ch(0,0,0,0);
271 
272  if ( !nApvPairs() ) {
273 
275  << "SiStripModule::" << __func__ << "]"
276  << " No APV pairs exist!";
277  return fed_ch;
278 
279  } else {
280 
281  uint16_t lld_ch = 0;
282  if ( nApvPairs() == 2 ) {
283 
284  if ( apv_pair == 0 ) { lld_ch = 1; }
285  else if ( apv_pair == 1 ) { lld_ch = 3; }
286  else {
288  << "SiStripModule::" << __func__ << "]"
289  << " Unexpected pair number! " << apv_pair;
290  }
291 
292  } else if ( nApvPairs() == 3 ) {
293 
294  if ( apv_pair == 0 ) { lld_ch = 1; }
295  else if ( apv_pair == 1 ) { lld_ch = 2; }
296  else if ( apv_pair == 2 ) { lld_ch = 3; }
297  else {
299  << "SiStripModule::" << __func__ << "]"
300  << " Unexpected pair number! " << apv_pair;
301  }
302 
303  } else {
304 
306  << "SiStripModule::" << __func__ << "]"
307  << " Unexpected number of APV pairs: " << nApvPairs();
308 
309  }
310 
311  FedCabling::const_iterator ipair = cabling_.find( lld_ch );
312  if ( ipair != cabling_.end() ) { return (*ipair).second; }
313  else { return fed_ch; }
314 
315  }
316 
317 }
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 321 of file SiStripModule.cc.

References cabling_, and sistrip::mlCabling_.

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

Returns map of apvPairNumber and FedChannel.

Definition at line 210 of file SiStripModule.h.

References cabling_.

Referenced by print(), and terse().

210 { 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 201 of file SiStripModule.h.

References key_.

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

201 { 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 218 of file SiStripModule.h.

References lld0x60_.

218 { 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 218 of file SiStripModule.cc.

References sistrip::mlCabling_, and nApvPairs_.

218  {
219  if ( apv_pair_num > 2 ) {
221  << "SiStripModule::" << __func__ << "]"
222  << " Unexpected APV pair number: " << apv_pair_num;
223  return 0;
224  }
225  if ( nApvPairs_ != 2 && nApvPairs_ != 3 ) {
227  << "SiStripModule::" << __func__ << "]"
228  << " Unexpected number of APV pairs: " << nApvPairs_;
229  return 0;
230  }
231  if ( nApvPairs_ == 2 && apv_pair_num == 1 ) { return 3; }
232  else if ( nApvPairs_ == 2 && apv_pair_num == 2 ) {
234  << "[SiStripFecCabling::" << __func__ << "]"
235  << " APV pair number is incompatible with"
236  << " respect to number of !";
237  return 0;
238  } else { return apv_pair_num + 1; }
239 }
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 216 of file SiStripModule.h.

References mux0x43_.

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

Returns number of APV pairs for this module.

Definition at line 205 of file SiStripModule.h.

References nApvPairs_.

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

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

Set number of detector strips for this module.

Definition at line 187 of file SiStripModule.cc.

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

187  {
188  if ( npairs == 2 || npairs == 3 ) { nApvPairs_ = npairs; }
189  else if ( npairs == 0 ) {
190  nApvPairs_ = 0;
191  if ( apv32_ || apv33_ ) { nApvPairs_++; }
192  if ( apv34_ || apv35_ ) { nApvPairs_++; }
193  if ( apv36_ || apv37_ ) { nApvPairs_++; }
194  } else {
196  << "SiStripModule::" << __func__ << "]"
197  << " Unexpected number of APV pairs: "
198  << npairs;
199  }
200 }
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 206 of file SiStripModule.h.

References nApvPairs_.

206 { 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 217 of file SiStripModule.h.

References pll0x44_.

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

Prints some debug information for this module.

Definition at line 346 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<<().

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

Prints some terse debug information for this module.

Definition at line 392 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_.

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

Member Data Documentation

uint16_t SiStripModule::apv32_
private

Definition at line 169 of file SiStripModule.h.

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

uint16_t SiStripModule::apv33_
private

Definition at line 170 of file SiStripModule.h.

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

uint16_t SiStripModule::apv34_
private

Definition at line 171 of file SiStripModule.h.

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

uint16_t SiStripModule::apv35_
private

Definition at line 172 of file SiStripModule.h.

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

uint16_t SiStripModule::apv36_
private

Definition at line 173 of file SiStripModule.h.

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

uint16_t SiStripModule::apv37_
private

Definition at line 174 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 188 of file SiStripModule.h.

Referenced by fedCh(), and fedChannels().

uint16_t SiStripModule::dcu0x00_
private

Definition at line 177 of file SiStripModule.h.

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

uint32_t SiStripModule::dcuId_
private

Definition at line 183 of file SiStripModule.h.

Referenced by dcuId().

uint32_t SiStripModule::detId_
private

Definition at line 184 of file SiStripModule.h.

Referenced by detId().

SiStripFecKey SiStripModule::key_
private

Control key/path for this module.

Definition at line 166 of file SiStripModule.h.

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

uint16_t SiStripModule::length_
private

Definition at line 189 of file SiStripModule.h.

Referenced by length().

uint16_t SiStripModule::lld0x60_
private

Definition at line 180 of file SiStripModule.h.

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

uint16_t SiStripModule::mux0x43_
private

Definition at line 178 of file SiStripModule.h.

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

uint16_t SiStripModule::nApvPairs_
private

Definition at line 185 of file SiStripModule.h.

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

uint16_t SiStripModule::pll0x44_
private

Definition at line 179 of file SiStripModule.h.

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