CMS 3D CMS Logo

List of all members | Public Member Functions
pos::PixelConfigurationVerifier Class Reference

This class performs various tests to make sure that configurations are consistent. More...

#include "interface/PixelConfigurationVerifier.h"

Public Member Functions

void checkChannelEnable (PixelFEDCard *theFEDCard, PixelNameTranslation *theNameTranslation, PixelDetectorConfig *theDetConfig)
 
 PixelConfigurationVerifier ()
 
virtual ~PixelConfigurationVerifier ()
 

Detailed Description

This class performs various tests to make sure that configurations are consistent.

This class collects the information about the range of DAC settings used in scans of the DACs.

A longer explanation will be placed here later

Definition at line 23 of file PixelConfigurationVerifier.h.

Constructor & Destructor Documentation

◆ PixelConfigurationVerifier()

pos::PixelConfigurationVerifier::PixelConfigurationVerifier ( )
inline

Definition at line 25 of file PixelConfigurationVerifier.h.

25 {}

◆ ~PixelConfigurationVerifier()

virtual pos::PixelConfigurationVerifier::~PixelConfigurationVerifier ( )
inlinevirtual

Definition at line 26 of file PixelConfigurationVerifier.h.

26 {}

Member Function Documentation

◆ checkChannelEnable()

void PixelConfigurationVerifier::checkChannelEnable ( PixelFEDCard theFEDCard,
PixelNameTranslation theNameTranslation,
PixelDetectorConfig theDetConfig 
)

Definition at line 15 of file PixelConfigurationVerifier.cc.

17  {
18  std::string mthn = "[PixelConfigurationVerifier::checkChannelEnable()]\t\t ";
19  set<PixelChannel> channels = theNameTranslation->getChannels(*theDetConfig);
20 
21  unsigned int fedid = theFEDCard->fedNumber;
22 
23  //use slots 1-36
24 
25  vector<bool> usedChannel(37);
26  for (unsigned int i = 1; i < 37; i++) {
27  usedChannel[i] = false;
28  }
29 
30  set<PixelChannel>::const_iterator iChannel = channels.begin();
31 
32  map<int, int> nrocs;
33  for (; iChannel != channels.end(); ++iChannel) {
34  PixelHdwAddress hdw = theNameTranslation->getHdwAddress(*iChannel);
35  if (fedid == hdw.fednumber()) {
36  unsigned int fedchannel = hdw.fedchannel();
37  assert(fedchannel > 0 && fedchannel < 37);
38  usedChannel[fedchannel] = true;
39  nrocs[fedchannel] = theNameTranslation->getROCsFromChannel(*iChannel).size();
40  }
41  }
42 
43  map<PixelROCName, PixelROCStatus> roclistcopy = theDetConfig->getROCsList();
44  //Now check the channels
45 
46  for (unsigned int jChannel = 1; jChannel < 37; jChannel++) {
47  bool used = theFEDCard->useChannel(jChannel);
48  // if (!used) cout << "Channel="<<jChannel<<" is not used"<<endl;
49  if (used) {
50  // cout << "Channel="<<jChannel<<" is used"<<endl;
51  //check that nROCs is the same from theNameTranslation and theFEDCard
52  if (nrocs[jChannel] != theFEDCard->NRocs[jChannel - 1]) {
53  cout << "[PixelConfigurationVerifier] Warning in FED#" << fedid << ", channel#" << jChannel
54  << ": number of ROCs mismatch: theNameTranslation=" << nrocs[jChannel]
55  << "; theFEDCard=" << theFEDCard->NRocs[jChannel - 1] << endl;
56  }
57  }
58 
59  //only do these checks if the channel exists
60  if (theNameTranslation->FEDChannelExist(fedid, jChannel)) {
61  //make sure that all rocs on a channel have the same noAnalogSignal status
62  vector<PixelROCName> rocsOnThisChannel = theNameTranslation->getROCsFromFEDChannel(fedid, jChannel);
63  bool onehasNAS = false, onedoesnothaveNAS = false;
64  vector<PixelROCName>::const_iterator jROC = rocsOnThisChannel.begin();
65  for (; jROC != rocsOnThisChannel.end(); ++jROC) {
66  PixelROCStatus thisROCstatus = roclistcopy[*jROC];
67  if (thisROCstatus.get(PixelROCStatus::noAnalogSignal))
68  onehasNAS = true;
69  else
70  onedoesnothaveNAS = true;
71  }
72  if (onehasNAS && onedoesnothaveNAS) {
73  cout << "[PixelConfigurationVerifier] Error in FED#" << fedid << ", channel#" << jChannel
74  << ": not all ROCs have the same noAnalogSignal state." << endl;
75  assert(0);
76  }
77 
78  //now if onehasNAS is true, then all must be noAnalogSignal --> turn off this FED channel!
79  if (onehasNAS) {
80  cout << "[PixelConfigurationVerifier] FEDid=" << fedid << ", channel=" << jChannel
81  << ": Channel disabled because ROCs are set to noAnalogSignal" << endl;
82  theFEDCard->setChannel(jChannel, false); //false should disable the channel
83  }
84 
85  if (!onehasNAS && (used != usedChannel[jChannel])) {
86  cout << __LINE__ << "]\t" << mthn << "*******************************************************" << endl;
87  cout << __LINE__ << "]\t" << mthn << "WARNING for fedid=" << fedid << " and channel=" << jChannel
88  << " found that fedcard has channel as " << endl;
89  if (used)
90  cout << __LINE__ << "]\t" << mthn << "used while configuration not using this channel" << endl;
91  if (!used)
92  cout << __LINE__ << "]\t" << mthn << "not used while configuration uses this channel" << endl;
93  cout << __LINE__ << "]\t" << mthn << "The fedcard will be modifed to agree with configuration" << endl;
94  cout << __LINE__ << "]\t" << mthn << "*******************************************************" << endl;
95  theFEDCard->setChannel(jChannel, usedChannel[jChannel]);
96  }
97  }
98  }
99 }

References cms::cuda::assert(), ewkTauDQM_cfi::channels, gather_cfg::cout, pos::PixelHdwAddress::fedchannel(), pos::PixelNameTranslation::FEDChannelExist(), PixelSLinkDataInputSource_cfi::fedid, pos::PixelHdwAddress::fednumber(), pos::PixelFEDCard::fedNumber, pos::PixelROCStatus::get(), pos::PixelNameTranslation::getChannels(), pos::PixelNameTranslation::getHdwAddress(), pos::PixelNameTranslation::getROCsFromChannel(), pos::PixelNameTranslation::getROCsFromFEDChannel(), pos::PixelDetectorConfig::getROCsList(), mps_fire::i, pos::PixelROCStatus::noAnalogSignal, DeadROCCounter::nrocs, pos::PixelFEDCard::NRocs, pos::PixelFEDCard::setChannel(), AlCaHLTBitMon_QueryRunRegistry::string, and pos::PixelFEDCard::useChannel().

mps_fire.i
i
Definition: mps_fire.py:355
pos::PixelNameTranslation::getROCsFromChannel
const std::vector< PixelROCName > & getROCsFromChannel(const PixelChannel &aChannel) const
Definition: PixelNameTranslation.cc:850
pos::PixelFEDCard::useChannel
bool useChannel(unsigned int iChannel)
Definition: PixelFEDCard.cc:2019
pos::PixelHdwAddress::fednumber
unsigned int fednumber() const
Definition: PixelHdwAddress.h:43
gather_cfg.cout
cout
Definition: gather_cfg.py:144
cms::cuda::assert
assert(be >=bs)
pos::PixelFEDCard::NRocs
int NRocs[36]
Definition: PixelFEDCard.h:115
pos::PixelNameTranslation::getHdwAddress
const PixelHdwAddress * getHdwAddress(const PixelROCName &aROC) const
Definition: PixelNameTranslation.cc:449
pos::PixelNameTranslation::getROCsFromFEDChannel
const std::vector< PixelROCName > & getROCsFromFEDChannel(unsigned int fednumber, unsigned int fedchannel) const
Definition: PixelNameTranslation.cc:516
pos::PixelFEDCard::setChannel
void setChannel(unsigned int iChannel, bool mode)
Definition: PixelFEDCard.cc:2024
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
pos::PixelNameTranslation::FEDChannelExist
bool FEDChannelExist(unsigned int fednumber, unsigned int fedchannel) const
Definition: PixelNameTranslation.cc:620
pos::PixelNameTranslation::getChannels
std::set< PixelChannel > getChannels() const
Definition: PixelNameTranslation.cc:426
pos::PixelHdwAddress::fedchannel
unsigned int fedchannel() const
Definition: PixelHdwAddress.h:44
pos::PixelHdwAddress
Store mfec, mfecchannel etc.
Definition: PixelHdwAddress.h:23
PixelSLinkDataInputSource_cfi.fedid
fedid
Definition: PixelSLinkDataInputSource_cfi.py:6
pos::PixelDetectorConfig::getROCsList
const std::map< PixelROCName, PixelROCStatus > & getROCsList() const
Definition: PixelDetectorConfig.h:53
pos::PixelROCStatus::noAnalogSignal
Definition: PixelROCStatus.h:26
ewkTauDQM_cfi.channels
channels
Definition: ewkTauDQM_cfi.py:14
DeadROCCounter.nrocs
nrocs
Definition: DeadROCCounter.py:57
pos::PixelROCStatus
This class implements..
Definition: PixelROCStatus.h:20
pos::PixelFEDCard::fedNumber
unsigned long fedNumber
Definition: PixelFEDCard.h:146
pos::PixelROCStatus::get
bool get(ROCstatus stat) const
Definition: PixelROCStatus.cc:57