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 }
MessageLogger.h
TotemVFATAnalysisMask::fullMask
bool fullMask
whether all channels of the VFAT shall be masked
Definition: TotemAnalysisMask.h:33
TotemSymbId.h
TotemDAQMapping.h
DeadChannelsManager::analysisMask
edm::ESHandle< TotemAnalysisMask > analysisMask
Definition: DeadChannelsManager.h:16
DeadChannelsManager::analysisMaskPresent
bool analysisMaskPresent
Definition: DeadChannelsManager.h:17
RPDisplacementGenerator::rawToDecId
static uint32_t rawToDecId(uint32_t raw)
Definition: RPDisplacementGenerator.cc:92
RPDisplacementGenerator.h
TotemAnalysisMask::analysisMask
std::map< TotemSymbID, TotemVFATAnalysisMask > analysisMask
Definition: TotemAnalysisMask.h:40
edm::ESHandle< TotemAnalysisMask >
DeadChannelsManager::isChannelDead
bool isChannelDead(RPDetId detectorId, unsigned short stripNumber)
Definition: DeadChannelsManager.cc:16
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
TotemSymbID
Symbolic ID describing an entity of a TOTEM subdetector.
Definition: TotemSymbId.h:16
TotemSymbID::symbolicID
unsigned int symbolicID
chip ID, raw integer representation of DetId class
Definition: TotemSymbId.h:24
createfilelist.int
int
Definition: createfilelist.py:10
DeadChannelsManager::DeadChannelsManager
DeadChannelsManager()
Definition: DeadChannelsManager.cc:9
RPDetId
uint32_t RPDetId
Definition: RPSimTypes.h:11
DeadChannelsManager.h
TotemRPDetId.h
TotemVFATAnalysisMask
Contains data on masked channels of a VFAT.
Definition: TotemAnalysisMask.h:22
DeadChannelsManager::displayMap
void displayMap()
Definition: DeadChannelsManager.cc:38
TotemVFATAnalysisMask::maskedChannels
std::set< unsigned char > maskedChannels
list of channels to be masked
Definition: TotemAnalysisMask.h:36