CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DeadChannelsManager Class Reference

#include <DeadChannelsManager.h>

Public Member Functions

 DeadChannelsManager (const TotemAnalysisMask *analysisMask)
 
 DeadChannelsManager ()
 
void displayMap ()
 
bool isChannelDead (RPDetId detectorId, unsigned short stripNumber)
 

Private Attributes

const TotemAnalysisMaskanalysisMask
 
bool analysisMaskPresent
 

Detailed Description

Definition at line 13 of file DeadChannelsManager.h.

Constructor & Destructor Documentation

◆ DeadChannelsManager() [1/2]

DeadChannelsManager::DeadChannelsManager ( const TotemAnalysisMask analysisMask)

This constructor allows us to set analysisMask. The analysisMask can be read from EventSetup.

Definition at line 11 of file DeadChannelsManager.cc.

References analysisMask, and analysisMaskPresent.

11  {
12  analysisMask = _analysisMask;
13  analysisMaskPresent = true;
14 }
const TotemAnalysisMask * analysisMask

◆ DeadChannelsManager() [2/2]

DeadChannelsManager::DeadChannelsManager ( )

Definition at line 9 of file DeadChannelsManager.cc.

References analysisMaskPresent.

Member Function Documentation

◆ displayMap()

void DeadChannelsManager::displayMap ( )

Definition at line 38 of file DeadChannelsManager.cc.

References analysisMask, TotemAnalysisMask::analysisMask, analysisMaskPresent, TotemVFATAnalysisMask::fullMask, createfilelist::int, LogDebug, and TotemVFATAnalysisMask::maskedChannels.

38  {
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.
std::map< TotemSymbID, TotemVFATAnalysisMask > analysisMask
bool fullMask
whether all channels of the VFAT shall be masked
const TotemAnalysisMask * analysisMask
std::set< unsigned char > maskedChannels
list of channels to be masked
#define LogDebug(id)

◆ isChannelDead()

bool DeadChannelsManager::isChannelDead ( RPDetId  detectorId,
unsigned short  stripNumber 
)

This function answers the question whether given channel is dead or not. RPDetId - detector ID given in raw form, this function has to convert raw ID to symbolic stripNumber - ID of the strip, it is a number from range <0; 511>, this function has to convert it into a vfat ID and a number from range <0; 127>

It is assumed that: channels 0 - 127 are in vfat number 0 channels 128 - 255 are in vfat number 1 channels 256 - 383 are in vfat number 2 channels 384 - 511 are in vfat number 3

Definition at line 16 of file DeadChannelsManager.cc.

References analysisMask, TotemAnalysisMask::analysisMask, analysisMaskPresent, RPDisplacementGenerator::rawToDecId(), TotemSymbID::symbolicID, and nano_mu_digi_cff::vfatMask.

16  {
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 }
Contains data on masked channels of a VFAT.
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
unsigned int symbolicID
chip ID, raw integer representation of DetId class
Definition: TotemSymbId.h:21
const TotemAnalysisMask * analysisMask

Member Data Documentation

◆ analysisMask

const TotemAnalysisMask* DeadChannelsManager::analysisMask
private

Definition at line 15 of file DeadChannelsManager.h.

Referenced by DeadChannelsManager(), displayMap(), and isChannelDead().

◆ analysisMaskPresent

bool DeadChannelsManager::analysisMaskPresent
private

Definition at line 16 of file DeadChannelsManager.h.

Referenced by DeadChannelsManager(), displayMap(), and isChannelDead().