CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

DTStatusFlag Class Reference

#include <DTStatusFlag.h>

List of all members.

Public Types

typedef std::vector< std::pair
< DTStatusFlagId,
DTStatusFlagData >
>::const_iterator 
const_iterator
 Access methods to data.

Public Member Functions

const_iterator begin () const
int cellStatus (const DTWireId &id, bool &noiseFlag, bool &feMask, bool &tdcMask, bool &trigMask, bool &deadFlag, bool &nohvFlag) const
int cellStatus (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, bool &noiseFlag, bool &feMask, bool &tdcMask, bool &trigMask, bool &deadFlag, bool &nohvFlag) const
 get content
void clear ()
 reset content
 DTStatusFlag (const std::string &version)
 DTStatusFlag ()
const_iterator end () const
int get (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, bool &noiseFlag, bool &feMask, bool &tdcMask, bool &trigMask, bool &deadFlag, bool &nohvFlag) const
int get (const DTWireId &id, bool &noiseFlag, bool &feMask, bool &tdcMask, bool &trigMask, bool &deadFlag, bool &nohvFlag) const
int set (const DTWireId &id, bool noiseFlag, bool feMask, bool tdcMask, bool trigMask, bool deadFlag, bool nohvFlag)
int set (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, bool noiseFlag, bool feMask, bool tdcMask, bool trigMask, bool deadFlag, bool nohvFlag)
int setCellDead (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, bool flag)
int setCellDead (const DTWireId &id, bool flag)
int setCellFEMask (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, bool mask)
int setCellFEMask (const DTWireId &id, bool mask)
int setCellNoHV (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, bool flag)
int setCellNoHV (const DTWireId &id, bool flag)
int setCellNoise (const DTWireId &id, bool flag)
int setCellNoise (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, bool flag)
int setCellStatus (const DTWireId &id, bool noiseFlag, bool feMask, bool tdcMask, bool trigMask, bool deadFlag, bool nohvFlag)
int setCellStatus (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, bool noiseFlag, bool feMask, bool tdcMask, bool trigMask, bool deadFlag, bool nohvFlag)
int setCellTDCMask (const DTWireId &id, bool mask)
int setCellTDCMask (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, bool mask)
int setCellTrigMask (const DTWireId &id, bool mask)
int setCellTrigMask (int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, bool mask)
const std::string & version () const
 access version
std::string & version ()
 ~DTStatusFlag ()

Private Member Functions

void cacheMap () const
 read and store full content
std::string mapName () const

Private Attributes

std::vector< std::pair
< DTStatusFlagId,
DTStatusFlagData > > 
dataList
std::string dataVersion
DTBufferTree< int, int > * dBuf

Detailed Description

Description: Class to hold drift tubes status ( cell by cell noise and masks )

Date:
2010/01/20 18:20:08
Revision:
1.6
Author:
Paolo Ronchese INFN Padova

Definition at line 77 of file DTStatusFlag.h.


Member Typedef Documentation

Access methods to data.

Definition at line 255 of file DTStatusFlag.h.


Constructor & Destructor Documentation

DTStatusFlag::DTStatusFlag ( )

Constructor

Definition at line 29 of file DTStatusFlag.cc.

References dataList, and dBuf.

                          :
  dataVersion( " " ) {
  dataList.reserve( 1000 );
  dBuf = 0;
}
DTStatusFlag::DTStatusFlag ( const std::string &  version)

Definition at line 36 of file DTStatusFlag.cc.

References dataList, and dBuf.

                                                    :
  dataVersion( version ) {
  dataList.reserve( 1000 );
  dBuf = 0;
}
DTStatusFlag::~DTStatusFlag ( )

Destructor

Definition at line 66 of file DTStatusFlag.cc.

References dBuf.

                            {
//  DTDataBuffer<int,int>::dropBuffer( mapName() );
  delete dBuf;
}

Member Function Documentation

DTStatusFlag::const_iterator DTStatusFlag::begin ( void  ) const

Definition at line 594 of file DTStatusFlag.cc.

References dataList.

                                                     {
  return dataList.begin();
}
void DTStatusFlag::cacheMap ( ) const [private]

read and store full content

Definition at line 611 of file DTStatusFlag.cc.

References dataList, dBuf, DTBufferTree< Key, Content >::insert(), and DTStatusFlagId::stationId.

Referenced by get(), and set().

                                  {

//  std::string mName = mapName();
//  DTBufferTree<int,int>* dBuf =
//  DTDataBuffer<int,int>::openBuffer( mName );
  DTBufferTree<int,int>** pBuf;
  pBuf = const_cast<DTBufferTree<int,int>**>( &dBuf );
  *pBuf = new DTBufferTree<int,int>;

  int entryNum = 0;
  int entryMax = dataList.size();
  std::vector<int> chanKey;
  chanKey.reserve(6);
  while ( entryNum < entryMax ) {

    const DTStatusFlagId& chan = dataList[entryNum].first;

    chanKey.clear();
    chanKey.push_back( chan.  wheelId );
    chanKey.push_back( chan.stationId );
    chanKey.push_back( chan. sectorId );
    chanKey.push_back( chan.     slId );
    chanKey.push_back( chan.  layerId );
    chanKey.push_back( chan.   cellId );
    dBuf->insert( chanKey.begin(), chanKey.end(), entryNum++ );

  }

  return;

}
int DTStatusFlag::cellStatus ( const DTWireId id,
bool &  noiseFlag,
bool &  feMask,
bool &  tdcMask,
bool &  trigMask,
bool &  deadFlag,
bool &  nohvFlag 
) const [inline]

Definition at line 108 of file DTStatusFlag.h.

      { return get( id,
                    noiseFlag, feMask, tdcMask, trigMask,
                    deadFlag, nohvFlag ); };
int DTStatusFlag::cellStatus ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
bool &  noiseFlag,
bool &  feMask,
bool &  tdcMask,
bool &  trigMask,
bool &  deadFlag,
bool &  nohvFlag 
) const [inline]

get content

Operations

Definition at line 93 of file DTStatusFlag.h.

      { return get( wheelId, stationId, sectorId, slId, layerId, cellId,
                    noiseFlag, feMask, tdcMask, trigMask,
                    deadFlag, nohvFlag); };
void DTStatusFlag::clear ( void  )

reset content

Definition at line 167 of file DTStatusFlag.cc.

References dataList, and dBuf.

                         {
//  DTDataBuffer<int,int>::dropBuffer( mapName() );
  delete dBuf;
  dBuf = 0;
  dataList.clear();
  return;
}
DTStatusFlag::const_iterator DTStatusFlag::end ( void  ) const

Definition at line 599 of file DTStatusFlag.cc.

References dataList.

                                                   {
  return dataList.end();
}
int DTStatusFlag::get ( const DTWireId id,
bool &  noiseFlag,
bool &  feMask,
bool &  tdcMask,
bool &  trigMask,
bool &  deadFlag,
bool &  nohvFlag 
) const

Definition at line 138 of file DTStatusFlag.cc.

                                               {
  return get( id.wheel(),
              id.station(),
              id.sector(),
              id.superLayer(),
              id.layer(),
              id.wire(),
              noiseFlag,   feMask,  tdcMask,
               trigMask, deadFlag, nohvFlag );
}
int DTStatusFlag::get ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
bool &  noiseFlag,
bool &  feMask,
bool &  tdcMask,
bool &  trigMask,
bool &  deadFlag,
bool &  nohvFlag 
) const

Definition at line 83 of file DTStatusFlag.cc.

References cacheMap(), data, dataList, dBuf, DTBufferTree< Key, Content >::find(), DTStatusFlagData::noiseFlag, and edm::second().

                                               {

  noiseFlag =
     feMask =
    tdcMask =
   trigMask =
   deadFlag =
   nohvFlag = false;

//  std::string mName = mapName();
//  DTBufferTree<int,int>* dBuf =
//  DTDataBuffer<int,int>::findBuffer( mName );
//  if ( dBuf == 0 ) {
//    cacheMap();
//    dBuf =
//    DTDataBuffer<int,int>::findBuffer( mName );
//  }
  if ( dBuf == 0 ) cacheMap();

  std::vector<int> chanKey;
  chanKey.reserve(6);
  chanKey.push_back(   wheelId );
  chanKey.push_back( stationId );
  chanKey.push_back(  sectorId );
  chanKey.push_back(      slId );
  chanKey.push_back(   layerId );
  chanKey.push_back(    cellId );
  int ientry;
  int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), ientry );
  if ( !searchStatus ) {
    const DTStatusFlagData& data( dataList[ientry].second );
    noiseFlag = data.noiseFlag;
       feMask = data.   feMask;
      tdcMask = data.  tdcMask;
     trigMask = data. trigMask;
     deadFlag = data. deadFlag;
     nohvFlag = data. nohvFlag;
  }

  return searchStatus;

}
std::string DTStatusFlag::mapName ( ) const [private]

Definition at line 604 of file DTStatusFlag.cc.

References dataVersion, and mergeVDriftHistosByStation::name.

                                      {
  std::stringstream name;
  name << dataVersion << "_map_StatusFlag" << this;
  return name.str();
}
int DTStatusFlag::set ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
bool  noiseFlag,
bool  feMask,
bool  tdcMask,
bool  trigMask,
bool  deadFlag,
bool  nohvFlag 
)

Definition at line 176 of file DTStatusFlag.cc.

References cacheMap(), data, dataList, dBuf, DTBufferTree< Key, Content >::find(), DTBufferTree< Key, Content >::insert(), combine::key, DTStatusFlagData::noiseFlag, edm::second(), and DTStatusFlagId::stationId.

Referenced by DTStatusFlagHandler::getNewObjects().

                                        {

//  std::string mName = mapName();
//  DTBufferTree<int,int>* dBuf =
//  DTDataBuffer<int,int>::findBuffer( mName );
//  if ( dBuf == 0 ) {
//    cacheMap();
//    dBuf =
//    DTDataBuffer<int,int>::findBuffer( mName );
//  }
  if ( dBuf == 0 ) cacheMap();
  std::vector<int> chanKey;
  chanKey.reserve(6);
  chanKey.push_back(   wheelId );
  chanKey.push_back( stationId );
  chanKey.push_back(  sectorId );
  chanKey.push_back(      slId );
  chanKey.push_back(   layerId );
  chanKey.push_back(    cellId );
  int ientry;
  int searchStatus = dBuf->find( chanKey.begin(), chanKey.end(), ientry );

  if ( !searchStatus ) {
    DTStatusFlagData& data( dataList[ientry].second );
    data.noiseFlag = noiseFlag;
    data.   feMask =    feMask;
    data.  tdcMask =   tdcMask;
    data. trigMask =  trigMask;
    data. deadFlag =  deadFlag;
    data. nohvFlag =  nohvFlag;
    return -1;
  }
  else {
    DTStatusFlagId key;
    key.  wheelId =   wheelId;
    key.stationId = stationId;
    key. sectorId =  sectorId;
    key.     slId =      slId;
    key.  layerId =   layerId;
    key.   cellId =    cellId;
    DTStatusFlagData data;
    data.noiseFlag = noiseFlag;
    data.   feMask =    feMask;
    data.  tdcMask =   tdcMask;
    data. trigMask =  trigMask;
    data. deadFlag =  deadFlag;
    data. nohvFlag =  nohvFlag;
    ientry = dataList.size();
    dataList.push_back( std::pair<const DTStatusFlagId,
                                        DTStatusFlagData>( key, data ) );
    dBuf->insert( chanKey.begin(), chanKey.end(), ientry );
    return 0;
  }

  return 99;

}
int DTStatusFlag::set ( const DTWireId id,
bool  noiseFlag,
bool  feMask,
bool  tdcMask,
bool  trigMask,
bool  deadFlag,
bool  nohvFlag 
)

Definition at line 246 of file DTStatusFlag.cc.

                                         {
  return set( id.wheel(),
              id.station(),
              id.sector(),
              id.superLayer(),
              id.layer(),
              id.wire(),
              noiseFlag,   feMask,  tdcMask,
              trigMask, deadFlag, nohvFlag );
}
int DTStatusFlag::setCellDead ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
bool  flag 
)

Definition at line 484 of file DTStatusFlag.cc.

References ntuplemaker::status.

Referenced by setCellDead().

                                           {

  bool noiseFlag;
  bool    feMask;
  bool   tdcMask;
  bool  trigMask;
  bool  deadFlag;
  bool  nohvFlag;
  int status = get(   wheelId,
                    stationId,
                     sectorId,
                         slId,
                      layerId,
                       cellId,
                    noiseFlag,
                       feMask,
                      tdcMask,
                     trigMask,
                     deadFlag,
                     nohvFlag );
  set(   wheelId,
       stationId,
        sectorId,
            slId,
         layerId,
          cellId,
       noiseFlag,
          feMask,
         tdcMask,
        trigMask,
            flag,
        nohvFlag );
  return status;

}
int DTStatusFlag::setCellDead ( const DTWireId id,
bool  flag 
)

Definition at line 527 of file DTStatusFlag.cc.

References setCellDead(), relativeConstraints::station, and createXMLFile::wire.

                                           {
  return setCellDead( id.wheel(),
                      id.station(),
                      id.sector(),
                      id.superLayer(),
                      id.layer(),
                      id.wire(),
                      flag );
}
int DTStatusFlag::setCellFEMask ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
bool  mask 
)

Definition at line 319 of file DTStatusFlag.cc.

References ntuplemaker::status.

Referenced by setCellFEMask().

                                             {

  bool noiseFlag;
  bool    feMask;
  bool   tdcMask;
  bool  trigMask;
  bool  deadFlag;
  bool  nohvFlag;
  int status = get(   wheelId,
                    stationId,
                     sectorId,
                         slId,
                      layerId,
                       cellId,
                    noiseFlag,
                       feMask,
                      tdcMask,
                     trigMask,
                     deadFlag,
                     nohvFlag );
  set(   wheelId,
       stationId,
        sectorId,
            slId,
         layerId,
          cellId,
       noiseFlag,
            mask,
         tdcMask,
        trigMask,
        deadFlag,
        nohvFlag );
  return status;

}
int DTStatusFlag::setCellFEMask ( const DTWireId id,
bool  mask 
)

Definition at line 362 of file DTStatusFlag.cc.

References setCellFEMask(), relativeConstraints::station, and createXMLFile::wire.

                                             {
  return setCellFEMask( id.wheel(),
                        id.station(),
                        id.sector(),
                        id.superLayer(),
                        id.layer(),
                        id.wire(),
                        mask );
}
int DTStatusFlag::setCellNoHV ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
bool  flag 
)

Definition at line 539 of file DTStatusFlag.cc.

References ntuplemaker::status.

Referenced by setCellNoHV().

                                           {

  bool noiseFlag;
  bool    feMask;
  bool   tdcMask;
  bool  trigMask;
  bool  deadFlag;
  bool  nohvFlag;
  int status = get(   wheelId,
                    stationId,
                     sectorId,
                         slId,
                      layerId,
                       cellId,
                    noiseFlag,
                       feMask,
                      tdcMask,
                     trigMask,
                     deadFlag,
                     nohvFlag );
  set(   wheelId,
       stationId,
        sectorId,
            slId,
         layerId,
          cellId,
       noiseFlag,
          feMask,
         tdcMask,
        trigMask,
        deadFlag,
            flag );
  return status;

}
int DTStatusFlag::setCellNoHV ( const DTWireId id,
bool  flag 
)

Definition at line 582 of file DTStatusFlag.cc.

References setCellNoHV(), relativeConstraints::station, and createXMLFile::wire.

                                           {
  return setCellNoHV( id.wheel(),
                      id.station(),
                      id.sector(),
                      id.superLayer(),
                      id.layer(),
                      id.wire(),
                      flag );
}
int DTStatusFlag::setCellNoise ( const DTWireId id,
bool  flag 
)

Definition at line 307 of file DTStatusFlag.cc.

References setCellNoise(), relativeConstraints::station, and createXMLFile::wire.

                                            {
  return setCellNoise( id.wheel(),
                       id.station(),
                       id.sector(),
                       id.superLayer(),
                       id.layer(),
                       id.wire(),
                       flag );
}
int DTStatusFlag::setCellNoise ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
bool  flag 
)

Definition at line 264 of file DTStatusFlag.cc.

References ntuplemaker::status.

Referenced by setCellNoise().

                                            {

  bool noiseFlag;
  bool    feMask;
  bool   tdcMask;
  bool  trigMask;
  bool  deadFlag;
  bool  nohvFlag;
  int status = get(   wheelId,
                    stationId,
                     sectorId,
                         slId,
                      layerId,
                       cellId,
                    noiseFlag,
                       feMask,
                      tdcMask,
                     trigMask,
                     deadFlag,
                     nohvFlag );
  set(   wheelId,
       stationId,
        sectorId,
            slId,
         layerId,
          cellId,
            flag,
          feMask,
         tdcMask,
        trigMask,
        deadFlag,
        nohvFlag );
  return status;

}
int DTStatusFlag::setCellStatus ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
bool  noiseFlag,
bool  feMask,
bool  tdcMask,
bool  trigMask,
bool  deadFlag,
bool  nohvFlag 
) [inline]

Definition at line 146 of file DTStatusFlag.h.

      { return set( wheelId, stationId, sectorId, slId, layerId, cellId,
                    noiseFlag, feMask, tdcMask, trigMask,
                    deadFlag, nohvFlag); };
int DTStatusFlag::setCellStatus ( const DTWireId id,
bool  noiseFlag,
bool  feMask,
bool  tdcMask,
bool  trigMask,
bool  deadFlag,
bool  nohvFlag 
) [inline]

Definition at line 161 of file DTStatusFlag.h.

      { return set( id,
                    noiseFlag, feMask, tdcMask, trigMask,
                    deadFlag, nohvFlag ); };
int DTStatusFlag::setCellTDCMask ( const DTWireId id,
bool  mask 
)

Definition at line 417 of file DTStatusFlag.cc.

References setCellTDCMask(), relativeConstraints::station, and createXMLFile::wire.

                                              {
  return setCellTDCMask( id.wheel(),
                         id.station(),
                         id.sector(),
                         id.superLayer(),
                         id.layer(),
                         id.wire(),
                         mask );
}
int DTStatusFlag::setCellTDCMask ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
bool  mask 
)

Definition at line 374 of file DTStatusFlag.cc.

References ntuplemaker::status.

Referenced by setCellTDCMask().

                                              {

  bool noiseFlag;
  bool    feMask;
  bool   tdcMask;
  bool  trigMask;
  bool  deadFlag;
  bool  nohvFlag;
  int status = get(   wheelId,
                    stationId,
                     sectorId,
                         slId,
                      layerId,
                       cellId,
                    noiseFlag,
                       feMask,
                      tdcMask,
                     trigMask,
                     deadFlag,
                     nohvFlag );
  set(   wheelId,
       stationId,
        sectorId,
            slId,
         layerId,
          cellId,
       noiseFlag,
          feMask,
            mask,
        trigMask,
        deadFlag,
        nohvFlag );
  return status;

}
int DTStatusFlag::setCellTrigMask ( const DTWireId id,
bool  mask 
)

Definition at line 472 of file DTStatusFlag.cc.

References setCellTrigMask(), relativeConstraints::station, and createXMLFile::wire.

                                               {
  return setCellTrigMask( id.wheel(),
                          id.station(),
                          id.sector(),
                          id.superLayer(),
                          id.layer(),
                          id.wire(),
                          mask );
}
int DTStatusFlag::setCellTrigMask ( int  wheelId,
int  stationId,
int  sectorId,
int  slId,
int  layerId,
int  cellId,
bool  mask 
)

Definition at line 429 of file DTStatusFlag.cc.

References ntuplemaker::status.

Referenced by setCellTrigMask().

                                               {

  bool noiseFlag;
  bool    feMask;
  bool   tdcMask;
  bool  trigMask;
  bool  deadFlag;
  bool  nohvFlag;
  int status = get(   wheelId,
                    stationId,
                     sectorId,
                         slId,
                      layerId,
                       cellId,
                    noiseFlag,
                       feMask,
                      tdcMask,
                     trigMask,
                     deadFlag,
                     nohvFlag );
  set(   wheelId,
       stationId,
        sectorId,
            slId,
         layerId,
          cellId,
       noiseFlag,
          feMask,
         tdcMask,
            mask,
        deadFlag,
        nohvFlag );
  return status;

}
const std::string & DTStatusFlag::version ( ) const

access version

Definition at line 157 of file DTStatusFlag.cc.

References dataVersion.

                                       {
  return dataVersion;
}
std::string & DTStatusFlag::version ( )

Definition at line 162 of file DTStatusFlag.cc.

References dataVersion.

                                 {
  return dataVersion;
}

Member Data Documentation

std::vector< std::pair<DTStatusFlagId,DTStatusFlagData> > DTStatusFlag::dataList [private]

Definition at line 263 of file DTStatusFlag.h.

Referenced by begin(), cacheMap(), clear(), DTStatusFlag(), end(), get(), and set().

std::string DTStatusFlag::dataVersion [private]

Definition at line 261 of file DTStatusFlag.h.

Referenced by mapName(), and version().

DTBufferTree<int,int>* DTStatusFlag::dBuf [private]

Definition at line 265 of file DTStatusFlag.h.

Referenced by cacheMap(), clear(), DTStatusFlag(), get(), set(), and ~DTStatusFlag().