CMS 3D CMS Logo

DeadChannelsManager.cc
Go to the documentation of this file.
6 #include <map>
8 
10 
12  analysisMask = _analysisMask;
13  analysisMaskPresent = true;
14 }
15 
16 bool DeadChannelsManager::isChannelDead(RPDetId detectorId, unsigned short stripNumber) {
17  unsigned int symbolicId = RPDisplacementGenerator::rawToDecId(detectorId) * 10; //convert to symbolic ID
18 
19  unsigned int vfat = stripNumber / 128;
20  symbolicId += vfat; //add vfatID to symbolic ID
21  stripNumber = stripNumber - vfat * 128; //convert strip number to a number from range <0; 127>
22  TotemSymbID totemSymbolicId;
23  totemSymbolicId.symbolicID = symbolicId;
24  if (analysisMaskPresent) {
25  std::map<TotemSymbID, TotemVFATAnalysisMask>::const_iterator vfatIter =
26  analysisMask->analysisMask.find(totemSymbolicId);
27  if (vfatIter != analysisMask->analysisMask.end()) {
28  TotemVFATAnalysisMask vfatMask = vfatIter->second;
29  //if channel is dead return true
30  if (vfatMask.fullMask || vfatMask.maskedChannels.find(stripNumber) != vfatMask.maskedChannels.end()) {
31  return true;
32  }
33  }
34  }
35  return false;
36 }
37 
39  if (analysisMaskPresent) {
40  std::map<TotemSymbID, TotemVFATAnalysisMask>::const_iterator vfatIter;
41  for (vfatIter = analysisMask->analysisMask.begin(); vfatIter != analysisMask->analysisMask.end(); vfatIter++) {
42  LogDebug("PPSDigiProducer::DeadChannelsManager") << vfatIter->first.symbolicID << "\n";
43  TotemVFATAnalysisMask am = vfatIter->second;
44  if (am.fullMask) {
45  LogDebug("PPSDigiProducer::DeadChannelsManager") << " full mask\n";
46  } else {
47  std::set<unsigned char>::iterator setIterator;
48  for (setIterator = am.maskedChannels.begin(); setIterator != am.maskedChannels.end(); setIterator++) {
49  LogDebug("PPSDigiProducer::DeadChannelsManager") << " " << (int)(*setIterator) << "\n";
50  }
51  }
52  }
53  }
54 }
Contains data on masked channels of a VFAT.
Channel-mask mapping.
std::map< TotemSymbID, TotemVFATAnalysisMask > analysisMask
static uint32_t rawToDecId(uint32_t raw)
Symbolic ID describing an entity of a TOTEM subdetector.
Definition: TotemSymbId.h:18
bool fullMask
whether all channels of the VFAT shall be masked
uint32_t RPDetId
Definition: RPSimTypes.h:12
unsigned int symbolicID
chip ID, raw integer representation of DetId class
Definition: TotemSymbId.h:21
const TotemAnalysisMask * analysisMask
std::set< unsigned char > maskedChannels
list of channels to be masked
bool isChannelDead(RPDetId detectorId, unsigned short stripNumber)
#define LogDebug(id)