CMS 3D CMS Logo

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

#include <DeadChannelsManager.h>

Public Member Functions

 DeadChannelsManager ()
 
 DeadChannelsManager (edm::ESHandle< TotemAnalysisMask > analysisMask)
 
void displayMap ()
 
bool isChannelDead (RPDetId detectorId, unsigned short stripNumber)
 

Static Public Member Functions

static uint32_t rawToDecId (uint32_t raw)
 

Private Attributes

edm::ESHandle< TotemAnalysisMaskanalysisMask
 
bool analysisMaskPresent
 

Detailed Description

Definition at line 14 of file DeadChannelsManager.h.

Constructor & Destructor Documentation

◆ DeadChannelsManager() [1/2]

DeadChannelsManager::DeadChannelsManager ( edm::ESHandle< TotemAnalysisMask analysisMask)

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

Definition at line 11 of file DeadChannelsManager.cc.

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

References analysisMask, and analysisMaskPresent.

◆ DeadChannelsManager() [2/2]

DeadChannelsManager::DeadChannelsManager ( )

Definition at line 9 of file DeadChannelsManager.cc.

9 { analysisMaskPresent = false; }

References analysisMaskPresent.

Member Function Documentation

◆ displayMap()

void DeadChannelsManager::displayMap ( )

Definition at line 38 of file DeadChannelsManager.cc.

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 }

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

◆ 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.

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 }

References analysisMask, TotemAnalysisMask::analysisMask, analysisMaskPresent, TotemVFATAnalysisMask::fullMask, TotemVFATAnalysisMask::maskedChannels, RPDisplacementGenerator::rawToDecId(), and TotemSymbID::symbolicID.

◆ rawToDecId()

static uint32_t DeadChannelsManager::rawToDecId ( uint32_t  raw)
static

Member Data Documentation

◆ analysisMask

edm::ESHandle<TotemAnalysisMask> DeadChannelsManager::analysisMask
private

Definition at line 16 of file DeadChannelsManager.h.

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

◆ analysisMaskPresent

bool DeadChannelsManager::analysisMaskPresent
private

Definition at line 17 of file DeadChannelsManager.h.

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

TotemVFATAnalysisMask::fullMask
bool fullMask
whether all channels of the VFAT shall be masked
Definition: TotemAnalysisMask.h:33
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
TotemAnalysisMask::analysisMask
std::map< TotemSymbID, TotemVFATAnalysisMask > analysisMask
Definition: TotemAnalysisMask.h:40
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
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
TotemVFATAnalysisMask
Contains data on masked channels of a VFAT.
Definition: TotemAnalysisMask.h:22
TotemVFATAnalysisMask::maskedChannels
std::set< unsigned char > maskedChannels
list of channels to be masked
Definition: TotemAnalysisMask.h:36