CMS 3D CMS Logo

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

#include <DTHVHandler.h>

Public Member Functions

 DTHVHandler ()
 
 DTHVHandler (const DTHVStatus *dbObject)
 
int get (const DTWireId &id, int &flagA, int &flagC, int &flagS) const
 get content More...
 
const DTHVStatusgetDBObject () const
 access db object More...
 
int offChannelsNumber () const
 
int offChannelsNumber (const DTChamberId &id) const
 
 ~DTHVHandler ()
 

Private Attributes

const DTHVStatusobjectPtr
 

Detailed Description

Description: Class to analyze high voltage status

Date
2008/11/20 12:00:00
Revision
1.1
Author
Paolo Ronchese INFN Padova

Definition at line 37 of file DTHVHandler.h.

Constructor & Destructor Documentation

◆ DTHVHandler() [1/2]

DTHVHandler::DTHVHandler ( )

Constructor

Definition at line 36 of file DTHVHandler.cc.

36 : objectPtr(nullptr) {}

◆ DTHVHandler() [2/2]

DTHVHandler::DTHVHandler ( const DTHVStatus dbObject)

Definition at line 45 of file DTHVHandler.cc.

45 : objectPtr(dbObject) {}

◆ ~DTHVHandler()

DTHVHandler::~DTHVHandler ( )

Destructor

Definition at line 50 of file DTHVHandler.cc.

50 {}

Member Function Documentation

◆ get()

int DTHVHandler::get ( const DTWireId id,
int &  flagA,
int &  flagC,
int &  flagS 
) const

get content

Operations

Definition at line 55 of file DTHVHandler.cc.

55  {
56  /*
57  if ( objectPtr == 0 ) {
58  flagA = flagC = flagS = 0;
59  return 999;
60  }
61  return objectPtr->get( id.wheel(),
62  id.station(),
63  id.sector(),
64  id.superLayer(),
65  id.layer(),
66  findLayerPart( id ),
67  flagA, flagC, flagS );
68 */
69  flagA = flagC = flagS = 0;
70  if (objectPtr == nullptr)
71  return 999;
72  int iCell = id.wire();
73  int fCell;
74  int lCell;
75  int fCheck = objectPtr->get(
76  id.wheel(), id.station(), id.sector(), id.superLayer(), id.layer(), 0, fCell, lCell, flagA, flagC, flagS);
77  if ((fCheck == 0) && (fCell <= iCell) && (lCell >= iCell))
78  return 0;
79  fCheck = objectPtr->get(
80  id.wheel(), id.station(), id.sector(), id.superLayer(), id.layer(), 1, fCell, lCell, flagA, flagC, flagS);
81  if ((fCheck == 0) && (fCell <= iCell) && (lCell >= iCell))
82  return 0;
83  flagA = flagC = flagS = 0;
84  return 1;
85 }

References DTHVStatus::get(), objectPtr, relativeConstraints::station, and makeMuonMisalignmentScenario::wheel.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), util.rrapi.RRApi::columns(), rrapi.RRApi::columns(), util.rrapi.RRApi::count(), rrapi.RRApi::count(), rrapi.RRApi::data(), util.rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), rrapi.RRApi::report(), util.rrapi.RRApi::report(), rrapi.RRApi::reports(), util.rrapi.RRApi::reports(), util.rrapi.RRApi::tables(), rrapi.RRApi::tables(), rrapi.RRApi::tags(), util.rrapi.RRApi::tags(), rrapi.RRApi::templates(), util.rrapi.RRApi::templates(), util.rrapi.RRApi::workspaces(), and rrapi.RRApi::workspaces().

◆ getDBObject()

const DTHVStatus* DTHVHandler::getDBObject ( ) const

access db object

◆ offChannelsNumber() [1/2]

int DTHVHandler::offChannelsNumber ( ) const

Definition at line 87 of file DTHVHandler.cc.

87  {
88  int offNum = 0;
91  while (iter != iend) {
92  const std::pair<DTHVStatusId, DTHVStatusData>& entry = *iter++;
93  DTHVStatusId hvId = entry.first;
94  DTHVStatusData data = entry.second;
95  if (data.flagA || data.flagC || data.flagS)
96  offNum += (1 + data.lCell - data.fCell);
97  }
98  return offNum;
99 }

References DTHVStatus::begin(), data, DTHVStatus::end(), mps_splice::entry, and objectPtr.

◆ offChannelsNumber() [2/2]

int DTHVHandler::offChannelsNumber ( const DTChamberId id) const

Definition at line 101 of file DTHVHandler.cc.

101  {
102  int offNum = 0;
105  /*
106  while ( iter != iend ) {
107  const std::pair<DTHVStatusId,DTHVStatusData>& entry = *iter++;
108  DTHVStatusId idCh = entry.first;
109  DTHVStatusData data = entry.second;
110  DTLayerId idL( idCh.wheelId, idCh.stationId, idCh.sectorId,
111  idCh.slId, idCh.layerId );
112  int fCell;
113  int lCell;
114  getLayerEdges( idL, idCh.partId, fCell, lCell );
115  if ( data.flagA || data.flagC || data.flagS )
116  offNum += ( 1 + lCell - fCell );
117  }
118 */
119  while (iter != iend) {
120  const std::pair<DTHVStatusId, DTHVStatusData>& entry = *iter++;
121  DTHVStatusId hvId = entry.first;
122  DTHVStatusData data = entry.second;
123  if ((hvId.wheelId == id.wheel()) && (hvId.stationId == id.station()) && (hvId.sectorId == id.sector()) &&
124  (data.flagA || data.flagC || data.flagS))
125  offNum += (1 + data.lCell - data.fCell);
126  }
127  return offNum;
128  // return 0;
129 }

References DTHVStatus::begin(), data, DTHVStatus::end(), mps_splice::entry, objectPtr, DTHVStatusId::sectorId, DTHVStatusId::stationId, and DTHVStatusId::wheelId.

Member Data Documentation

◆ objectPtr

const DTHVStatus* DTHVHandler::objectPtr
private

Definition at line 60 of file DTHVHandler.h.

Referenced by get(), and offChannelsNumber().

DTHVStatusId::wheelId
int wheelId
Definition: DTHVStatus.h:46
relativeConstraints.station
station
Definition: relativeConstraints.py:67
mps_splice.entry
entry
Definition: mps_splice.py:68
DTHVStatusId::stationId
int stationId
Definition: DTHVStatus.h:47
DTHVStatus::const_iterator
std::vector< std::pair< DTHVStatusId, DTHVStatusData > >::const_iterator const_iterator
Access methods to data.
Definition: DTHVStatus.h:128
DTHVStatus::begin
const_iterator begin() const
Definition: DTHVStatus.cc:298
DTHVStatus::end
const_iterator end() const
Definition: DTHVStatus.cc:300
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
DTHVHandler::objectPtr
const DTHVStatus * objectPtr
Definition: DTHVHandler.h:60
DTHVStatus::get
int get(int wheelId, int stationId, int sectorId, int slId, int layerId, int partId, int &fCell, int &lCell, int &flagA, int &flagC, int &flagS) const
get content
Definition: DTHVStatus.cc:56
DTHVStatusId
Definition: DTHVStatus.h:41
DTHVStatusData
Definition: DTHVStatus.h:56
DTHVStatusId::sectorId
int sectorId
Definition: DTHVStatus.h:48