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

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

222  {
223  if (lld_channel == 1) {
224  return PairOfU16(apv32_, apv33_);
225  } else if (lld_channel == 2) {
226  return PairOfU16(apv34_, apv35_);
227  } else if (lld_channel == 3) {
228  return PairOfU16(apv36_, apv37_);
229  } else {
230  edm::LogWarning(mlCabling_) << "SiStripModule::" << __func__ << "]"
231  << " Unexpected LLD channel: " << lld_channel;
232  return PairOfU16(0, 0);
233  }
234 }
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) { edm::LogWarning(mlCabling_) << ss.str(); }
196 }
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 263 of file SiStripModule.cc.

References sistrip::mlCabling_, and nApvPairs_.

263  {
264  if (lld_channel < 1 || lld_channel > 3) {
265  edm::LogWarning(mlCabling_) << "SiStripModule::" << __func__ << "]"
266  << " Unexpected LLD channel: " << lld_channel;
267  return 0;
268  }
269  if (nApvPairs_ != 2 && nApvPairs_ != 3) {
270  edm::LogWarning(mlCabling_) << "SiStripModule::" << __func__ << "]"
271  << " Unexpected number of APV pairs: " << nApvPairs_;
272  return 0;
273  }
274  if (nApvPairs_ == 2 && lld_channel == 3) {
275  return 1;
276  } else if (nApvPairs_ == 2 && lld_channel == 2) {
277  edm::LogWarning(mlCabling_) << "SiStripModule::" << __func__ << "]"
278  << " LLD channel is incompatible with"
279  << " respect to number of APV pairs!";
280  return 0;
281  } else {
282  return lld_channel - 1;
283  }
284 }
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 288 of file SiStripModule.cc.

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

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

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

References cabling_, and sistrip::mlCabling_.

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

References sistrip::mlCabling_, and nApvPairs_.

238  {
239  if (apv_pair_num > 2) {
240  edm::LogWarning(mlCabling_) << "SiStripModule::" << __func__ << "]"
241  << " Unexpected APV pair number: " << apv_pair_num;
242  return 0;
243  }
244  if (nApvPairs_ != 2 && nApvPairs_ != 3) {
245  edm::LogWarning(mlCabling_) << "SiStripModule::" << __func__ << "]"
246  << " Unexpected number of APV pairs: " << nApvPairs_;
247  return 0;
248  }
249  if (nApvPairs_ == 2 && apv_pair_num == 1) {
250  return 3;
251  } else if (nApvPairs_ == 2 && apv_pair_num == 2) {
252  edm::LogWarning(mlCabling_) << "[SiStripFecCabling::" << __func__ << "]"
253  << " APV pair number is incompatible with"
254  << " respect to number of !";
255  return 0;
256  } else {
257  return apv_pair_num + 1;
258  }
259 }
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 200 of file SiStripModule.cc.

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

200  {
201  if (npairs == 2 || npairs == 3) {
202  nApvPairs_ = npairs;
203  } else if (npairs == 0) {
204  nApvPairs_ = 0;
205  if (apv32_ || apv33_) {
206  nApvPairs_++;
207  }
208  if (apv34_ || apv35_) {
209  nApvPairs_++;
210  }
211  if (apv36_ || apv37_) {
212  nApvPairs_++;
213  }
214  } else {
215  edm::LogWarning(mlCabling_) << "SiStripModule::" << __func__ << "]"
216  << " Unexpected number of APV pairs: " << npairs;
217  }
218 }
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 367 of file SiStripModule.cc.

References activeApvs(), electrons_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<<().

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

References activeApvs(), electrons_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.

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