CMS 3D CMS Logo

Public Member Functions | Private Attributes

DTHVHandler Class Reference

#include <DTHVHandler.h>

List of all members.

Public Member Functions

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

Private Attributes

const DTHVStatusobjectPtr

Detailed Description

Description: Class to analyze high voltage status

Date:
2009/03/26 14:11:03
Revision:
1.1
Author:
Paolo Ronchese INFN Padova

Definition at line 38 of file DTHVHandler.h.


Constructor & Destructor Documentation

DTHVHandler::DTHVHandler ( )

Constructor

Definition at line 38 of file DTHVHandler.cc.

                        :
  objectPtr ( 0 ) {
}
DTHVHandler::DTHVHandler ( const DTHVStatus dbObject)

Definition at line 50 of file DTHVHandler.cc.

                                                    :
  objectPtr( dbObject ) {
}
DTHVHandler::~DTHVHandler ( )

Destructor

Definition at line 58 of file DTHVHandler.cc.

                          {
}

Member Function Documentation

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

get content

Operations

Definition at line 65 of file DTHVHandler.cc.

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

                                                 {
/*
  if ( objectPtr == 0 ) {
    flagA = flagC = flagS = 0;
    return 999;
  }
  return objectPtr->get( id.wheel(),
                         id.station(),
                         id.sector(),
                         id.superLayer(),
                         id.layer(),
                         findLayerPart( id ),
                         flagA, flagC, flagS );
*/
  flagA = flagC = flagS = 0;
  if ( objectPtr == 0 ) return 999;
  int iCell = id.wire();
  int fCell;
  int lCell;
  int
  fCheck = objectPtr->get( id.wheel(),
                           id.station(),
                           id.sector(),
                           id.superLayer(),
                           id.layer(),
                           0,     fCell, lCell,
                           flagA, flagC, flagS );
  if ( ( fCheck == 0 ) &&
       ( fCell <= iCell ) &&
       ( lCell >= iCell ) ) return 0;
  fCheck = objectPtr->get( id.wheel(),
                           id.station(),
                           id.sector(),
                           id.superLayer(),
                           id.layer(),
                           1,     fCell, lCell,
                           flagA, flagC, flagS );
  if ( ( fCheck == 0 ) &&
       ( fCell <= iCell ) &&
       ( lCell >= iCell ) ) return 0;
  flagA = flagC = flagS = 0;
  return 1;
}
const DTHVStatus* DTHVHandler::getDBObject ( ) const

access db object

int DTHVHandler::offChannelsNumber ( const DTChamberId id) const

Definition at line 128 of file DTHVHandler.cc.

References DTHVStatus::begin(), AlCaHLTBitMon_QueryRunRegistry::data, DTHVStatus::end(), DTHVStatusData::fCell, DTHVStatusData::flagA, DTHVStatusData::flagC, DTHVStatusData::flagS, DTHVStatusData::lCell, objectPtr, and DTHVStatusId::stationId.

                                                                {
  int offNum = 0;
  DTHVStatus::const_iterator iter = objectPtr->begin();
  DTHVStatus::const_iterator iend = objectPtr->end();
/*
  while ( iter != iend ) {
    const std::pair<DTHVStatusId,DTHVStatusData>& entry = *iter++;
    DTHVStatusId   idCh = entry.first;
    DTHVStatusData data = entry.second;
    DTLayerId idL( idCh.wheelId, idCh.stationId, idCh.sectorId,
                   idCh.slId,    idCh.layerId );
    int fCell;
    int lCell;
    getLayerEdges( idL, idCh.partId, fCell, lCell );
    if ( data.flagA || data.flagC || data.flagS )
         offNum += ( 1 + lCell - fCell );
  }
*/
  while ( iter != iend ) {
    const std::pair<DTHVStatusId,DTHVStatusData>& entry = *iter++;
    DTHVStatusId   hvId = entry.first;
    DTHVStatusData data = entry.second;
    if ( ( hvId.  wheelId == id.  wheel() ) &&
         ( hvId.stationId == id.station() ) &&
         ( hvId. sectorId == id. sector() ) &&
         ( data.flagA || data.flagC || data.flagS ) )
           offNum += ( 1 + data.lCell - data.fCell );
  }
  return offNum;
//  return 0;
}
int DTHVHandler::offChannelsNumber ( ) const

Definition at line 113 of file DTHVHandler.cc.

References DTHVStatus::begin(), AlCaHLTBitMon_QueryRunRegistry::data, DTHVStatus::end(), DTHVStatusData::fCell, DTHVStatusData::flagA, DTHVStatusData::flagC, DTHVStatusData::flagS, DTHVStatusData::lCell, and objectPtr.

                                         {
  int offNum = 0;
  DTHVStatus::const_iterator iter = objectPtr->begin();
  DTHVStatus::const_iterator iend = objectPtr->end();
  while ( iter != iend ) {
    const std::pair<DTHVStatusId,DTHVStatusData>& entry = *iter++;
    DTHVStatusId   hvId = entry.first;
    DTHVStatusData data = entry.second;
    if (   data.flagA || data.flagC || data.flagS   )
           offNum += ( 1 + data.lCell - data.fCell );
  }
  return offNum;
}

Member Data Documentation

Definition at line 67 of file DTHVHandler.h.

Referenced by get(), and offChannelsNumber().