CMS 3D CMS Logo

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, FedChannelFedCabling
 
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

◆ FedCabling

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

Map between LLD channel and FED channel

Definition at line 58 of file SiStripModule.h.

◆ PairOfU16

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

Pair containing FED id/channel.

Definition at line 40 of file SiStripModule.h.

Constructor & Destructor Documentation

◆ SiStripModule()

SiStripModule::SiStripModule ( const FedChannelConnection conn)

Constructor.

Definition at line 12 of file SiStripModule.cc.

References addDevices(), and getInfo::conn.

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

◆ ~SiStripModule()

SiStripModule::~SiStripModule ( )
inline

Default constructor.

Definition at line 32 of file SiStripModule.h.

32 { ; }

Member Function Documentation

◆ activeApv()

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

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

129  {
130  if (apv_address == 0 || apv_address == 32) {
131  return apv32_;
132  } else if (apv_address == 1 || apv_address == 33) {
133  return apv33_;
134  } else if (apv_address == 2 || apv_address == 34) {
135  return apv34_;
136  } else if (apv_address == 3 || apv_address == 35) {
137  return apv35_;
138  } else if (apv_address == 4 || apv_address == 36) {
139  return apv36_;
140  } else if (apv_address == 5 || apv_address == 37) {
141  return apv37_;
142  } else {
143  edm::LogWarning(mlCabling_) << "SiStripModule::" << __func__ << "]"
144  << " Unexpected I2C address or number (" << apv_address << ") for this module!";
145  }
146  static const uint16_t address = 0;
147  return address;
148 }
uint16_t apv35_
uint16_t apv37_
uint16_t apv33_
static const char mlCabling_[]
uint16_t apv32_
uint16_t apv34_
Log< level::Warning, false > LogWarning
uint16_t apv36_

◆ activeApvPair()

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

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

224  {
225  if (lld_channel == 1) {
226  return PairOfU16(apv32_, apv33_);
227  } else if (lld_channel == 2) {
228  return PairOfU16(apv34_, apv35_);
229  } else if (lld_channel == 3) {
230  return PairOfU16(apv36_, apv37_);
231  } else {
232  edm::LogWarning(mlCabling_) << "SiStripModule::" << __func__ << "]"
233  << " Unexpected LLD channel: " << lld_channel;
234  return PairOfU16(0, 0);
235  }
236 }
uint16_t apv35_
uint16_t apv37_
uint16_t apv33_
static const char mlCabling_[]
uint16_t apv32_
uint16_t apv34_
Log< level::Warning, false > LogWarning
std::pair< uint16_t, uint16_t > PairOfU16
Definition: SiStripModule.h:40
uint16_t apv36_

◆ activeApvs()

std::vector< uint16_t > SiStripModule::activeApvs ( ) const

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

Definition at line 104 of file SiStripModule.cc.

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

Referenced by print(), and terse().

104  {
105  std::vector<uint16_t> apvs;
106  if (apv32_) {
107  apvs.push_back(apv32_);
108  }
109  if (apv33_) {
110  apvs.push_back(apv33_);
111  }
112  if (apv34_) {
113  apvs.push_back(apv34_);
114  }
115  if (apv35_) {
116  apvs.push_back(apv35_);
117  }
118  if (apv36_) {
119  apvs.push_back(apv36_);
120  }
121  if (apv37_) {
122  apvs.push_back(apv37_);
123  }
124  return apvs;
125 }
uint16_t apv35_
uint16_t apv37_
uint16_t apv33_
uint16_t apv32_
uint16_t apv34_
uint16_t apv36_

◆ addApv()

void SiStripModule::addApv ( const uint16_t &  apv_address)

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

Definition at line 152 of file SiStripModule.cc.

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

Referenced by addDevices().

152  {
153  // Some checks on value of APV I2C address
154  if (apv_address == 0) {
155  edm::LogWarning(mlCabling_) << "SiStripModule::" << __func__ << "]"
156  << " Null APV I2C address!";
157  return;
158  } else if (apv_address < 32 || apv_address > 37) {
159  edm::LogWarning(mlCabling_) << "SiStripModule::" << __func__ << "]"
160  << " Unexpected I2C address (" << apv_address << ") for APV!";
161  return;
162  }
163 
164  bool added_apv = false;
165  if (!apv32_ && apv_address == 32) {
166  apv32_ = 32;
167  added_apv = true;
168  } else if (!apv33_ && apv_address == 33) {
169  apv33_ = 33;
170  added_apv = true;
171  } else if (!apv34_ && apv_address == 34) {
172  apv34_ = 34;
173  added_apv = true;
174  } else if (!apv35_ && apv_address == 35) {
175  apv35_ = 35;
176  added_apv = true;
177  } else if (!apv36_ && apv_address == 36) {
178  apv36_ = 36;
179  added_apv = true;
180  } else if (!apv37_ && apv_address == 37) {
181  apv37_ = 37;
182  added_apv = true;
183  }
184 
185  std::stringstream ss;
186  ss << "SiStripModule::" << __func__ << "]";
187  if (added_apv) {
188  ss << " Added new APV for";
189  } else {
190  ss << " APV already exists for";
191  }
192  ss << " Crate/FEC/Ring/CCU/Module: " << key_.fecCrate() << "/" << key_.fecSlot() << "/" << key_.fecRing() << "/"
193  << key_.ccuAddr() << "/" << key_.ccuChan() << "/" << apv_address;
194  // if ( added_apv ) { LogTrace(mlCabling_) << ss.str(); }
195  /* else */ if (!added_apv) {
196  edm::LogWarning(mlCabling_) << ss.str();
197  }
198 }
uint16_t apv35_
SiStripFecKey key_
const uint16_t & ccuAddr() const
const uint16_t & ccuChan() const
uint16_t apv37_
uint16_t apv33_
static const char mlCabling_[]
uint16_t apv32_
const uint16_t & fecSlot() const
uint16_t apv34_
Log< level::Warning, false > LogWarning
const uint16_t & fecRing() const
const uint16_t & fecCrate() const
uint16_t apv36_

◆ addDevices()

void SiStripModule::addDevices ( const FedChannelConnection conn)

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

Definition at line 34 of file SiStripModule.cc.

References addApv(), SiStripFecKey::ccuAddr(), SiStripFecKey::ccuChan(), getInfo::conn, dcu0x00_, dcuId(), detId(), SiStripFecKey::fecCrate(), SiStripFecKey::fecRing(), SiStripFecKey::fecSlot(), fedCh(), key_, lld0x60_, sistrip::mlCabling_, mux0x43_, nApvPairs(), and pll0x44_.

Referenced by SiStripModule().

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

◆ apvPairNumber()

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

References sistrip::mlCabling_, and nApvPairs_.

265  {
266  if (lld_channel < 1 || lld_channel > 3) {
267  edm::LogWarning(mlCabling_) << "SiStripModule::" << __func__ << "]"
268  << " Unexpected LLD channel: " << lld_channel;
269  return 0;
270  }
271  if (nApvPairs_ != 2 && nApvPairs_ != 3) {
272  edm::LogWarning(mlCabling_) << "SiStripModule::" << __func__ << "]"
273  << " Unexpected number of APV pairs: " << nApvPairs_;
274  return 0;
275  }
276  if (nApvPairs_ == 2 && lld_channel == 3) {
277  return 1;
278  } else if (nApvPairs_ == 2 && lld_channel == 2) {
279  edm::LogWarning(mlCabling_) << "SiStripModule::" << __func__ << "]"
280  << " LLD channel is incompatible with"
281  << " respect to number of APV pairs!";
282  return 0;
283  } else {
284  return lld_channel - 1;
285  }
286 }
static const char mlCabling_[]
uint16_t nApvPairs_
Log< level::Warning, false > LogWarning

◆ ccuAddr()

const uint16_t & SiStripModule::ccuAddr ( ) const
inline

Definition at line 193 of file SiStripModule.h.

References SiStripFecKey::ccuAddr(), and key_.

193 { return key_.ccuAddr(); }
SiStripFecKey key_
const uint16_t & ccuAddr() const

◆ ccuChan()

const uint16_t & SiStripModule::ccuChan ( ) const
inline

Definition at line 194 of file SiStripModule.h.

References SiStripFecKey::ccuChan(), and key_.

194 { return key_.ccuChan(); }
SiStripFecKey key_
const uint16_t & ccuChan() const

◆ dcu()

const uint16_t & SiStripModule::dcu ( ) const
inline

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

Definition at line 219 of file SiStripModule.h.

References dcu0x00_.

219 { return dcu0x00_; }
uint16_t dcu0x00_

◆ dcuId() [1/2]

const uint32_t & SiStripModule::dcuId ( ) const
inline

Returns DCU id for this module.

Definition at line 198 of file SiStripModule.h.

References dcuId_.

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

198 { return dcuId_; }
uint32_t dcuId_

◆ dcuId() [2/2]

void SiStripModule::dcuId ( const uint32_t &  dcu_id)
inline

Set DCU id for this module.

Definition at line 203 of file SiStripModule.h.

References dcu0x00_, and dcuId_.

203  {
204  if (dcu_id) {
205  dcuId_ = dcu_id;
206  dcu0x00_ = true;
207  }
208 }
uint32_t dcuId_
uint16_t dcu0x00_

◆ detId() [1/2]

const uint32_t & SiStripModule::detId ( ) const
inline

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

Definition at line 199 of file SiStripModule.h.

References detId_.

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

199 { return detId_; }
uint32_t detId_

◆ detId() [2/2]

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  {
210  if (det_id) {
211  detId_ = det_id;
212  }
213 }
uint32_t detId_

◆ fecCrate()

const uint16_t & SiStripModule::fecCrate ( ) const
inline

Definition at line 190 of file SiStripModule.h.

References SiStripFecKey::fecCrate(), and key_.

190 { return key_.fecCrate(); }
SiStripFecKey key_
const uint16_t & fecCrate() const

◆ fecRing()

const uint16_t & SiStripModule::fecRing ( ) const
inline

Definition at line 192 of file SiStripModule.h.

References SiStripFecKey::fecRing(), and key_.

192 { return key_.fecRing(); }
SiStripFecKey key_
const uint16_t & fecRing() const

◆ fecSlot()

const uint16_t & SiStripModule::fecSlot ( ) const
inline

Definition at line 191 of file SiStripModule.h.

References SiStripFecKey::fecSlot(), and key_.

191 { return key_.fecSlot(); }
SiStripFecKey key_
const uint16_t & fecSlot() const

◆ fedCh() [1/2]

SiStripModule::FedChannel SiStripModule::fedCh ( const uint16_t &  apv_pair_num) const

Returns FedChannel for a given apvPairNumber.

Definition at line 290 of file SiStripModule.cc.

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

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

290  {
291  FedChannel fed_ch(0, 0, 0, 0);
292 
293  if (!nApvPairs()) {
294  edm::LogWarning(mlCabling_) << "SiStripModule::" << __func__ << "]"
295  << " No APV pairs exist!";
296  return fed_ch;
297 
298  } else {
299  uint16_t lld_ch = 0;
300  if (nApvPairs() == 2) {
301  if (apv_pair == 0) {
302  lld_ch = 1;
303  } else if (apv_pair == 1) {
304  lld_ch = 3;
305  } else {
306  edm::LogWarning(mlCabling_) << "SiStripModule::" << __func__ << "]"
307  << " Unexpected pair number! " << apv_pair;
308  }
309 
310  } else if (nApvPairs() == 3) {
311  if (apv_pair == 0) {
312  lld_ch = 1;
313  } else if (apv_pair == 1) {
314  lld_ch = 2;
315  } else if (apv_pair == 2) {
316  lld_ch = 3;
317  } else {
318  edm::LogWarning(mlCabling_) << "SiStripModule::" << __func__ << "]"
319  << " Unexpected pair number! " << apv_pair;
320  }
321 
322  } else {
323  edm::LogWarning(mlCabling_) << "SiStripModule::" << __func__ << "]"
324  << " Unexpected number of APV pairs: " << nApvPairs();
325  }
326 
327  FedCabling::const_iterator ipair = cabling_.find(lld_ch);
328  if (ipair != cabling_.end()) {
329  return (*ipair).second;
330  } else {
331  return fed_ch;
332  }
333  }
334 }
const uint16_t & nApvPairs() const
static const char mlCabling_[]
FedCabling cabling_
Log< level::Warning, false > LogWarning

◆ fedCh() [2/2]

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

References cabling_, and sistrip::mlCabling_.

338  {
339  // Determine LLD channel
340  int16_t lld_ch = 1;
341  if (apv_address == 32 || apv_address == 33) {
342  lld_ch = 1;
343  } else if (apv_address == 34 || apv_address == 35) {
344  lld_ch = 2;
345  } else if (apv_address == 36 || apv_address == 37) {
346  lld_ch = 3;
347  } else if (apv_address == 0) {
348  ;
349  } //@@ do nothing?
350  else {
351  edm::LogWarning(mlCabling_) << "[SiStripModule::fedCh]"
352  << " Unexpected I2C address (" << apv_address << ") for APV!";
353  return false;
354  }
355  // Search for entry in std::map
356  //@@ use FedKey as key instead of lld chan? what about "duplicates"?
357  //@@ always append to std::map? then can have >3 entries. useful for debug?
358  FedCabling::iterator ipair = cabling_.find(lld_ch);
359  if (ipair == cabling_.end()) {
360  cabling_[lld_ch] = fed_ch;
361  } else {
362  ipair->second = fed_ch;
363  }
364  return true;
365 }
static const char mlCabling_[]
FedCabling cabling_
Log< level::Warning, false > LogWarning

◆ fedChannels()

const SiStripModule::FedCabling & SiStripModule::fedChannels ( ) const
inline

Returns map of apvPairNumber and FedChannel.

Definition at line 214 of file SiStripModule.h.

References cabling_.

Referenced by print(), and terse().

214 { return cabling_; }
FedCabling cabling_

◆ key()

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

References key_.

Referenced by print(), and terse().

196 { return key_; }
SiStripFecKey key_

◆ length() [1/2]

const uint16_t & SiStripModule::length ( ) const
inline

Returns cable length.

Definition at line 216 of file SiStripModule.h.

References length_.

Referenced by length().

216 { return length_; }
uint16_t length_

◆ length() [2/2]

void SiStripModule::length ( const uint16_t &  length)
inline

Sets cable length.

Definition at line 217 of file SiStripModule.h.

References length(), and length_.

217 { length_ = length; }
uint16_t length_
const uint16_t & length() const

◆ lld()

const uint16_t & SiStripModule::lld ( ) const
inline

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

Definition at line 222 of file SiStripModule.h.

References lld0x60_.

222 { return lld0x60_; }
uint16_t lld0x60_

◆ lldChannel()

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

References sistrip::mlCabling_, and nApvPairs_.

240  {
241  if (apv_pair_num > 2) {
242  edm::LogWarning(mlCabling_) << "SiStripModule::" << __func__ << "]"
243  << " Unexpected APV pair number: " << apv_pair_num;
244  return 0;
245  }
246  if (nApvPairs_ != 2 && nApvPairs_ != 3) {
247  edm::LogWarning(mlCabling_) << "SiStripModule::" << __func__ << "]"
248  << " Unexpected number of APV pairs: " << nApvPairs_;
249  return 0;
250  }
251  if (nApvPairs_ == 2 && apv_pair_num == 1) {
252  return 3;
253  } else if (nApvPairs_ == 2 && apv_pair_num == 2) {
254  edm::LogWarning(mlCabling_) << "[SiStripFecCabling::" << __func__ << "]"
255  << " APV pair number is incompatible with"
256  << " respect to number of !";
257  return 0;
258  } else {
259  return apv_pair_num + 1;
260  }
261 }
static const char mlCabling_[]
uint16_t nApvPairs_
Log< level::Warning, false > LogWarning

◆ mux()

const uint16_t & SiStripModule::mux ( ) const
inline

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

Definition at line 220 of file SiStripModule.h.

References mux0x43_.

220 { return mux0x43_; }
uint16_t mux0x43_

◆ nApvPairs() [1/2]

const uint16_t & SiStripModule::nApvPairs ( ) const
inline

Returns number of APV pairs for this module.

Definition at line 200 of file SiStripModule.h.

References nApvPairs_.

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

200 { return nApvPairs_; }
uint16_t nApvPairs_

◆ nApvPairs() [2/2]

void SiStripModule::nApvPairs ( const uint16_t &  npairs)

Set number of detector strips for this module.

Definition at line 202 of file SiStripModule.cc.

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

202  {
203  if (npairs == 2 || npairs == 3) {
204  nApvPairs_ = npairs;
205  } else if (npairs == 0) {
206  nApvPairs_ = 0;
207  if (apv32_ || apv33_) {
208  nApvPairs_++;
209  }
210  if (apv34_ || apv35_) {
211  nApvPairs_++;
212  }
213  if (apv36_ || apv37_) {
214  nApvPairs_++;
215  }
216  } else {
217  edm::LogWarning(mlCabling_) << "SiStripModule::" << __func__ << "]"
218  << " Unexpected number of APV pairs: " << npairs;
219  }
220 }
uint16_t apv35_
uint16_t apv37_
uint16_t apv33_
static const char mlCabling_[]
uint16_t apv32_
uint16_t apv34_
uint16_t nApvPairs_
Log< level::Warning, false > LogWarning
uint16_t apv36_

◆ nDetStrips()

uint16_t SiStripModule::nDetStrips ( ) const
inline

Returns number of detector strips for this module.

Definition at line 201 of file SiStripModule.h.

References nApvPairs_.

201 { return 256 * nApvPairs_; }
uint16_t nApvPairs_

◆ pll()

const uint16_t & SiStripModule::pll ( ) const
inline

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

Definition at line 221 of file SiStripModule.h.

References pll0x44_.

221 { return pll0x44_; }
uint16_t pll0x44_

◆ print()

void SiStripModule::print ( std::stringstream &  ss) const

Prints some debug information for this module.

Definition at line 369 of file SiStripModule.cc.

References activeApvs(), nano_mu_local_reco_cff::bool, SiStripFecKey::ccuAddr(), SiStripFecKey::ccuChan(), ewkTauDQM_cfi::channels, dcu0x00_, dcuId(), TauDecayModes::dec, detId(), SiStripFecKey::fecCrate(), SiStripFecKey::fecRing(), SiStripFecKey::fecSlot(), fedChannels(), key(), lld0x60_, mux0x43_, nApvPairs(), pll0x44_, and contentValuesCheck::ss.

Referenced by operator<<().

369  {
370  ss << " [SiStripModule::" << __func__ << "]" << std::endl
371  << " Crate/FEC/Ring/CCU/Module : " << key().fecCrate() << "/" << key().fecSlot() << "/"
372  << key().fecRing() << "/" << key().ccuAddr() << "/" << key().ccuChan() << std::endl;
373 
374  ss << " ActiveApvs : ";
375  std::vector<uint16_t> apvs = activeApvs();
376  if (apvs.empty()) {
377  ss << "NONE!";
378  }
379  std::vector<uint16_t>::const_iterator iapv = apvs.begin();
380  for (; iapv != apvs.end(); ++iapv) {
381  ss << *iapv << ", ";
382  }
383  ss << std::endl;
384 
385  ss << " DcuId/DetId/nPairs : " << std::hex << "0x" << std::setfill('0') << std::setw(8)
386  << dcuId() << "/"
387  << "0x" << std::setfill('0') << std::setw(8) << detId() << "/" << std::dec << nApvPairs() << std::endl;
388 
390  ss << " ApvPairNum/FedCrate/FedSlot/FedId/FedCh : ";
391  FedCabling::const_iterator ichan = channels.begin();
392  for (; ichan != channels.end(); ++ichan) {
393  ss << ichan->first << "/" << ichan->second.fedCrate_ << "/" << ichan->second.fedSlot_ << "/" << ichan->second.fedId_
394  << "/" << ichan->second.fedCh_ << ", ";
395  }
396  ss << std::endl;
397 
398  ss << " DCU/MUX/PLL/LLD found : " << bool(dcu0x00_) << "/" << bool(mux0x43_) << "/"
399  << bool(pll0x44_) << "/" << bool(lld0x60_);
400 }
std::vector< uint16_t > activeApvs() const
uint16_t pll0x44_
const uint16_t & ccuAddr() const
const uint16_t & ccuChan() const
const uint16_t & nApvPairs() const
std::map< uint16_t, FedChannel > FedCabling
Definition: SiStripModule.h:58
const uint32_t & detId() const
uint16_t mux0x43_
const SiStripFecKey & key() const
const FedCabling & fedChannels() const
const uint16_t & fecSlot() const
uint16_t lld0x60_
const uint32_t & dcuId() const
const uint16_t & fecRing() const
const uint16_t & fecCrate() const
uint16_t dcu0x00_

◆ terse()

void SiStripModule::terse ( std::stringstream &  ss) const

Prints some terse debug information for this module.

Definition at line 404 of file SiStripModule.cc.

References activeApvs(), nano_mu_local_reco_cff::bool, SiStripFecKey::ccuAddr(), SiStripFecKey::ccuChan(), ewkTauDQM_cfi::channels, dcu0x00_, dcuId(), TauDecayModes::dec, detId(), SiStripFecKey::fecCrate(), SiStripFecKey::fecRing(), SiStripFecKey::fecSlot(), fedChannels(), key(), lld0x60_, mux0x43_, nApvPairs(), pll0x44_, and contentValuesCheck::ss.

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

Member Data Documentation

◆ apv32_

uint16_t SiStripModule::apv32_
private

Definition at line 165 of file SiStripModule.h.

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

◆ apv33_

uint16_t SiStripModule::apv33_
private

Definition at line 166 of file SiStripModule.h.

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

◆ apv34_

uint16_t SiStripModule::apv34_
private

Definition at line 167 of file SiStripModule.h.

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

◆ apv35_

uint16_t SiStripModule::apv35_
private

Definition at line 168 of file SiStripModule.h.

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

◆ apv36_

uint16_t SiStripModule::apv36_
private

Definition at line 169 of file SiStripModule.h.

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

◆ apv37_

uint16_t SiStripModule::apv37_
private

Definition at line 170 of file SiStripModule.h.

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

◆ cabling_

FedCabling SiStripModule::cabling_
private

KEY = LLD channel, DATA = FedId + FedCh

Definition at line 184 of file SiStripModule.h.

Referenced by fedCh(), and fedChannels().

◆ dcu0x00_

uint16_t SiStripModule::dcu0x00_
private

Definition at line 173 of file SiStripModule.h.

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

◆ dcuId_

uint32_t SiStripModule::dcuId_
private

Definition at line 179 of file SiStripModule.h.

Referenced by dcuId().

◆ detId_

uint32_t SiStripModule::detId_
private

Definition at line 180 of file SiStripModule.h.

Referenced by detId().

◆ key_

SiStripFecKey SiStripModule::key_
private

Control key/path for this module.

Definition at line 162 of file SiStripModule.h.

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

◆ length_

uint16_t SiStripModule::length_
private

Definition at line 185 of file SiStripModule.h.

Referenced by length().

◆ lld0x60_

uint16_t SiStripModule::lld0x60_
private

Definition at line 176 of file SiStripModule.h.

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

◆ mux0x43_

uint16_t SiStripModule::mux0x43_
private

Definition at line 174 of file SiStripModule.h.

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

◆ nApvPairs_

uint16_t SiStripModule::nApvPairs_
private

Definition at line 181 of file SiStripModule.h.

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

◆ pll0x44_

uint16_t SiStripModule::pll0x44_
private

Definition at line 175 of file SiStripModule.h.

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