CMS 3D CMS Logo

Static Public Member Functions | Private Member Functions | Static Private Attributes

Numbers Class Reference

#include <Numbers.h>

List of all members.

Static Public Member Functions

static std::vector< DetId > * crystals (const EcalTrigTowerDetId &id) throw ( std::runtime_error )
static std::vector< DetId > * crystals (const EcalElectronicsId &id) throw ( std::runtime_error )
static std::vector< DetId > * crystals (int idcc, int isc) throw ( std::runtime_error )
static const EcalScDetId getEcalScDetId (const EEDetId &id) throw ( std::runtime_error )
static int icEB (const int ism, const int ix, const int iy)
static int icEE (const int ism, const int ix, const int iy) throw ( std::runtime_error )
static int iEB (const int ism) throw ( std::runtime_error )
static int iEE (const int ism) throw ( std::runtime_error )
static int indexEB (const int ism, const int ie, const int ip)
static int indexEE (const int ism, const int ix, const int iy)
static void initGeometry (const edm::EventSetup &setup, bool verbose=false)
static int iSC (const EcalScDetId &id) throw ( std::runtime_error )
static int iSC (const int ism, const EcalSubdetector subdet, const int i1, const int i2) throw ( std::runtime_error )
static int iSM (const EcalTrigTowerDetId &id) throw ( std::runtime_error )
static int iSM (const EcalElectronicsId &id) throw ( std::runtime_error )
static int iSM (const EcalPnDiodeDetId &id) throw ( std::runtime_error )
static int iSM (const EcalScDetId &id) throw ( std::runtime_error )
static int iSM (const EcalDCCHeaderBlock &id, const EcalSubdetector subdet) throw ( std::runtime_error )
static int iSM (const int ism, const EcalSubdetector subdet) throw ( std::runtime_error )
static int iSM (const EBDetId &id) throw ( std::runtime_error )
static int iSM (const EEDetId &id) throw ( std::runtime_error )
static int iTCC (const int ism, const EcalSubdetector subdet, const int i1, const int i2) throw ( std::runtime_error )
static int iTCC (const EcalTrigTowerDetId &id) throw ( std::runtime_error )
static int iTT (const int ism, const EcalSubdetector subdet, const int i1, const int i2) throw ( std::runtime_error )
static int iTT (const EcalTrigTowerDetId &id) throw ( std::runtime_error )
static int ix0EE (const int ism)
static int iy0EE (const int ism)
static int RtHalf (const EBDetId &id)
static int RtHalf (const EEDetId &id)
static std::string sEB (const int ism)
static std::string sEE (const int ism)
static EcalSubdetector subDet (const EcalPnDiodeDetId &id)
static EcalSubdetector subDet (const EcalElectronicsId &id)
static EcalSubdetector subDet (const EcalScDetId &id)
static EcalSubdetector subDet (const EcalTrigTowerDetId &id)
static EcalSubdetector subDet (const EcalDCCHeaderBlock &id) throw ( std::runtime_error )
static EcalSubdetector subDet (const EEDetId &id)
static EcalSubdetector subDet (const EBDetId &id)
static bool validEE (const int ism, const int ix, const int iy)

Private Member Functions

 Numbers ()
 ~Numbers ()

Static Private Attributes

static std::vector< DetIdcrystalsDCC_ [100 *54]
static std::vector< DetIdcrystalsTCC_ [100 *108]
static bool init = false
static const
EcalElectronicsMapping
map = 0
static const
EcalTrigTowerConstituentsMap
mapTT = 0

Detailed Description

Definition at line 35 of file Numbers.h.


Constructor & Destructor Documentation

Numbers::Numbers ( ) [inline, private]

Definition at line 119 of file Numbers.h.

{}; // Hidden to force static use
Numbers::~Numbers ( ) [inline, private]

Definition at line 120 of file Numbers.h.

{}; // Hidden to force static use

Member Function Documentation

std::vector< DetId > * Numbers::crystals ( const EcalTrigTowerDetId id) throw ( std::runtime_error ) [static]
std::vector< DetId > * Numbers::crystals ( const EcalElectronicsId id) throw ( std::runtime_error ) [static]

Definition at line 793 of file Numbers.cc.

References crystals(), and asciidump::s.

                                                                                           {

  if( Numbers::map ) {

    int idcc = id.dccId();
    int isc = id.towerId();

    return Numbers::crystals( idcc, isc );

  } else {

    std::ostringstream s;
    s << "ECAL Geometry not available";
    throw( std::runtime_error( s.str() ) );

  }

}
std::vector< DetId > * Numbers::crystals ( int  idcc,
int  isc 
) throw ( std::runtime_error ) [static]

Definition at line 814 of file Numbers.cc.

References crystalsDCC_, EcalElectronicsMapping::dccTowerConstituents(), getHLTprescales::index, asciidump::s, and findQualityFiles::size.

                                                                                 {

  if( Numbers::map ) {

    int index = 100*(idcc-1) + (isc-1);

    if ( Numbers::crystalsDCC_[index].size() == 0 ) {
      Numbers::crystalsDCC_[index] = Numbers::map->dccTowerConstituents(idcc, isc);
    }

    return &(Numbers::crystalsDCC_[index]);

  } else {

    std::ostringstream s;
    s << "ECAL Geometry not available";
    throw( std::runtime_error( s.str() ) );

  }

}
const EcalScDetId Numbers::getEcalScDetId ( const EEDetId id) throw ( std::runtime_error ) [static]

Definition at line 838 of file Numbers.cc.

References EcalElectronicsId::dccId(), EcalElectronicsMapping::getEcalScDetId(), EcalElectronicsMapping::getElectronicsId(), asciidump::s, and EcalElectronicsId::towerId().

Referenced by EESelectiveReadoutTask::readOutUnitOf().

                                                                                       {

  if( Numbers::map ) {

    const EcalElectronicsId& eid = Numbers::map->getElectronicsId(id);

    int idcc = eid.dccId();
    int isc = eid.towerId();

    const std::vector<EcalScDetId> ids = Numbers::map->getEcalScDetId( idcc, isc, true );

    return ids.size() > 0 ? ids[0] : EcalScDetId();

  } else {

    std::ostringstream s;
    s << "ECAL Geometry not available";
    throw( std::runtime_error( s.str() ) );

  }

}
int Numbers::icEB ( const int  ism,
const int  ix,
const int  iy 
) [static]

Definition at line 892 of file Numbers.cc.

Referenced by EBTimingClient::analyze(), EBTestPulseClient::analyze(), and EBLaserClient::analyze().

                                                             {

  return( (ip-1) + 20*(ie-1) + 1 );

}
int Numbers::icEE ( const int  ism,
const int  ix,
const int  iy 
) throw ( std::runtime_error ) [static]

Definition at line 900 of file Numbers.cc.

References EcalElectronicsMapping::getElectronicsId(), iSM(), ecalpyutils::ism(), asciidump::s, strip(), EcalElectronicsId::stripId(), EcalElectronicsId::towerId(), EEDetId::validDetId(), EcalElectronicsId::xtalId(), and EEDetId::XYMODE.

Referenced by EELedTask::analyze(), EETimingClient::analyze(), EESummaryClient::analyze(), EELaserTask::analyze(), EELaserClient::analyze(), EETestPulseClient::analyze(), EETestPulseTask::analyze(), and EELedClient::analyze().

                                                                                       {

  int iz = 0;

  if( ism >=  1 && ism <=  9 ) iz = -1;
  if( ism >= 10 && ism <= 18 ) iz = +1;

  if( EEDetId::validDetId(ix, iy, iz) ) {

    EEDetId id(ix, iy, iz, EEDetId::XYMODE);

    if( Numbers::iSM( id ) != ism ) return( -1 );

    if( Numbers::map ) {

      const EcalElectronicsId eid = Numbers::map->getElectronicsId(id);

      int vfe = eid.towerId();
      int strip = eid.stripId();
      int channel = eid.xtalId();

      // EE-05 & EE+05
      if( ism == 8 || ism == 17 ) {
        if( vfe > 17 ) vfe = vfe - 7;
      }

      return ( (vfe-1)*25 + (strip-1)*5 + channel );

    } else {

      std::ostringstream s;
      s << "ECAL Geometry not available";
      throw( std::runtime_error( s.str() ) );

    }

  } else {

    return( -1 );

  }

}
int Numbers::iEB ( const int  ism) throw ( std::runtime_error ) [static]

Definition at line 65 of file Numbers.cc.

References ecalpyutils::ism(), and asciidump::s.

Referenced by sEB().

                                                          {

  // EB-
  if( ism >=  1 && ism <= 18 ) return( -ism );

  // EB+
  if( ism >= 19 && ism <= 36 ) return( +ism - 18 );

  std::ostringstream s;
  s << "Wrong SM id determination: iSM = " << ism;
  throw( std::runtime_error( s.str() ) );

}
int Numbers::iEE ( const int  ism) throw ( std::runtime_error ) [static]

Definition at line 98 of file Numbers.cc.

References ecalpyutils::ism(), and asciidump::s.

Referenced by sEE().

                                                          {

  // EE-
  if( ism ==  1 ) return( -7 );
  if( ism ==  2 ) return( -8 );
  if( ism ==  3 ) return( -9 );
  if( ism ==  4 ) return( -1 );
  if( ism ==  5 ) return( -2 );
  if( ism ==  6 ) return( -3 );
  if( ism ==  7 ) return( -4 );
  if( ism ==  8 ) return( -5 );
  if( ism ==  9 ) return( -6 );

  // EE+
  if( ism == 10 ) return( +7 );
  if( ism == 11 ) return( +8 );
  if( ism == 12 ) return( +9 );
  if( ism == 13 ) return( +1 );
  if( ism == 14 ) return( +2 );
  if( ism == 15 ) return( +3 );
  if( ism == 16 ) return( +4 );
  if( ism == 17 ) return( +5 );
  if( ism == 18 ) return( +6 );

  std::ostringstream s;
  s << "Wrong SM id determination: iSM = " << ism;
  throw( std::runtime_error( s.str() ) );

}
int Numbers::indexEB ( const int  ism,
const int  ie,
const int  ip 
) [static]

Definition at line 863 of file Numbers.cc.

                                                                {

  return( (ip-1) + 20*(ie-1) + 1 );

}
int Numbers::indexEE ( const int  ism,
const int  ix,
const int  iy 
) [static]

Definition at line 871 of file Numbers.cc.

References EEDetId::validDetId().

Referenced by EcalDQMStatusReader::beginRun().

                                                                {

  int iz = 0;

  if( ism >=  1 && ism <=  9 ) iz = -1;
  if( ism >= 10 && ism <= 18 ) iz = +1;

  if( EEDetId::validDetId(ix, iy, iz) ) {

    return( 1000*ix + iy );

  } else {

    return( -1 );

  }

}
void Numbers::initGeometry ( const edm::EventSetup setup,
bool  verbose = false 
) [static]

Definition at line 43 of file Numbers.cc.

References gather_cfg::cout, edm::EventSetup::get(), patZpeak::handle, init, and edm::ESHandle< T >::product().

Referenced by EcalEndcapMonitorModule::analyze(), EcalBarrelMonitorModule::analyze(), EBPedestalOnlineTask::beginRun(), EEPedestalTask::beginRun(), EcalDQMStatusReader::beginRun(), EEBeamCaloTask::beginRun(), EEBeamHodoTask::beginRun(), EELedTask::beginRun(), EEPedestalOnlineTask::beginRun(), EEIntegrityTask::beginRun(), EEClusterTaskExtras::beginRun(), EBSelectiveReadoutTask::beginRun(), EELaserTask::beginRun(), EBPedestalTask::beginRun(), EETestPulseTask::beginRun(), EESelectiveReadoutTask::beginRun(), EEStatusFlagsTask::beginRun(), EcalBarrelMonitorClient::beginRun(), EBIntegrityTask::beginRun(), EBTrendTask::beginRun(), EEClusterTask::beginRun(), EERawDataTask::beginRun(), EBClusterTask::beginRun(), EBOccupancyTask::beginRun(), EBTestPulseTask::beginRun(), EBTimingTask::beginRun(), EETriggerTowerTask::beginRun(), EBBeamCaloTask::beginRun(), EBBeamHodoTask::beginRun(), EBClusterTaskExtras::beginRun(), EcalDQMStatusWriter::beginRun(), EcalEndcapMonitorClient::beginRun(), EBStatusFlagsTask::beginRun(), EBTriggerTowerTask::beginRun(), EECosmicTask::beginRun(), EBCosmicTask::beginRun(), EETimingTask::beginRun(), EBLaserTask::beginRun(), EBRawDataTask::beginRun(), EEOccupancyTask::beginRun(), and EETrendTask::beginRun().

                                                                     {

  if( Numbers::init ) return;

  if ( verbose ) std::cout << "Initializing EcalElectronicsMapping ..." << std::endl;

  Numbers::init = true;

  edm::ESHandle<EcalElectronicsMapping> handle;
  setup.get<EcalMappingRcd>().get(handle);
  Numbers::map = handle.product();

  edm::ESHandle<EcalTrigTowerConstituentsMap> handleTT;
  setup.get<IdealGeometryRecord>().get(handleTT);
  Numbers::mapTT = handleTT.product();

  if ( verbose ) std::cout << "done." << std::endl;

}
int Numbers::iSC ( const EcalScDetId id) throw ( std::runtime_error ) [static]

Definition at line 456 of file Numbers.cc.

References EcalElectronicsMapping::getDCCandSC().

Referenced by EESelectiveReadoutTask::anaDigi(), EESelectiveReadoutTask::analyze(), EcalDQMStatusReader::beginRun(), and iTT().

                                                                  {

    std::pair<int, int> dccsc = Numbers::map->getDCCandSC( id );

    return dccsc.second;

}
int Numbers::iSC ( const int  ism,
const EcalSubdetector  subdet,
const int  i1,
const int  i2 
) throw ( std::runtime_error ) [static]

Definition at line 466 of file Numbers.cc.

References EcalBarrel, EcalEndcap, EcalElectronicsMapping::getElectronicsId(), iSM(), ecalpyutils::ism(), asciidump::s, EcalElectronicsId::towerId(), EEDetId::validDetId(), and EEDetId::XYMODE.

                                                                                                                    {

  if( subdet == EcalBarrel ) {

    int iet = 1 + ((i1-1)/5);
    int ipt = 1 + ((i2-1)/5);

    return( (ipt-1) + 4*(iet-1) + 1 );

  } else if( subdet == EcalEndcap ) {

    int iz = 0;

    if( ism >=  1 && ism <=  9 ) iz = -1;
    if( ism >= 10 && ism <= 18 ) iz = +1;

    if( EEDetId::validDetId(i1, i2, iz) ) {

      EEDetId id(i1, i2, iz, EEDetId::XYMODE);

      if( Numbers::iSM( id ) != ism ) return( -1 );

      if( Numbers::map ) {

        const EcalElectronicsId eid = Numbers::map->getElectronicsId(id);

        return( eid.towerId() );

      } else {

        std::ostringstream s;
        s << "ECAL Geometry not available";
        throw( std::runtime_error( s.str() ) );

      }

    } else {

      return( -1 );

    }

  } else {

    std::ostringstream s;
    s << "Invalid subdetector: subdet = " << subdet;
    throw( std::runtime_error( s.str() ) );

  }

}
int Numbers::iSM ( const EcalTrigTowerDetId id) throw ( std::runtime_error ) [static]

Definition at line 309 of file Numbers.cc.

References EcalElectronicsMapping::DCCid(), EcalBarrel, EcalEndcap, asciidump::s, and subDet().

                                                                         {

  EcalSubdetector subdet = Numbers::subDet( id );

  if( subdet == EcalBarrel ) {

    if( Numbers::map ) {

      int idcc = Numbers::map->DCCid(id);

      // EB-/EB+
      if( idcc >= 10 && idcc <= 45 ) return( idcc - 9 );

      std::ostringstream s;
      s << "Wrong DCC id: dcc = " << idcc;
      throw( std::runtime_error( s.str() ) );

    } else {

      std::ostringstream s;
      s << "ECAL Geometry not available";
      throw( std::runtime_error( s.str() ) );

    }

  } else if( subdet ==  EcalEndcap) {

    if( Numbers::map ) {

      int idcc = Numbers::map->DCCid(id);

      // EE-
      if( idcc >=  1 && idcc <=  9 ) return( idcc );

      // EE+
      if( idcc >= 46 && idcc <= 54 ) return( idcc - 45 + 9 );

      std::ostringstream s;
      s << "Wrong DCC id: dcc = " << idcc;
      throw( std::runtime_error( s.str() ) );

    } else {

      std::ostringstream s;
      s << "ECAL Geometry not available";
      throw( std::runtime_error( s.str() ) );

    }

  } else {

    std::ostringstream s;
    s << "Invalid subdetector: subdet = " << subdet;
    throw( std::runtime_error( s.str() ) );

  }

}
int Numbers::iSM ( const EcalElectronicsId id) throw ( std::runtime_error ) [static]

Definition at line 370 of file Numbers.cc.

References asciidump::s.

                                                                        {

  int idcc = id.dccId();

  // EE-
  if( idcc >=  1 && idcc <=  9 ) return( idcc );

  // EB-/EB+
  if( idcc >= 10 && idcc <= 45 ) return( idcc - 9 );

  // EE+
  if( idcc >= 46 && idcc <= 54 ) return( idcc - 45 + 9 );

  std::ostringstream s;
  s << "Wrong DCC id: dcc = " << idcc;
  throw( std::runtime_error( s.str() ) );

}
int Numbers::iSM ( const EcalPnDiodeDetId id) throw ( std::runtime_error ) [static]

Definition at line 391 of file Numbers.cc.

References asciidump::s.

                                                                       {

  int idcc = id.iDCCId();

  // EE-
  if( idcc >=  1 && idcc <=  9 ) return( idcc );

  // EB-/EB+
  if( idcc >= 10 && idcc <= 45 ) return( idcc - 9 );

  // EE+
  if( idcc >= 46 && idcc <= 54 ) return( idcc - 45 + 9 );

  std::ostringstream s;
  s << "Wrong DCC id: dcc = " << idcc;
  throw( std::runtime_error( s.str() ) );

}
int Numbers::iSM ( const EcalScDetId id) throw ( std::runtime_error ) [static]

Definition at line 412 of file Numbers.cc.

References EcalElectronicsMapping::getDCCandSC(), and asciidump::s.

                                                                  {

    std::pair<int, int> dccsc = Numbers::map->getDCCandSC( id );

    int idcc = dccsc.first;

  // EE-
  if( idcc >=  1 && idcc <=  9 ) return( idcc );

  // EB-/EB+
  if( idcc >= 10 && idcc <= 45 ) return( idcc - 9 );

  // EE+
  if( idcc >= 46 && idcc <= 54 ) return( idcc - 45 + 9 );

  std::ostringstream s;
  s << "Wrong DCC id: dcc = " << idcc;
  throw( std::runtime_error( s.str() ) );

}
int Numbers::iSM ( const EcalDCCHeaderBlock id,
const EcalSubdetector  subdet 
) throw ( std::runtime_error ) [static]

Definition at line 435 of file Numbers.cc.

References asciidump::s.

                                                                                                       {

  int idcc = id.id();

  // EE-
  if( idcc >=  1 && idcc <=  9 ) return( idcc );

  // EB-/EB+
  if( idcc >= 10 && idcc <= 45 ) return( idcc - 9 );

  // EE+
  if( idcc >= 46 && idcc <= 54 ) return( idcc - 45 + 9 );

  std::ostringstream s;
  s << "Wrong DCC id: dcc = " << idcc;
  throw( std::runtime_error( s.str() ) );

}
int Numbers::iSM ( const int  ism,
const EcalSubdetector  subdet 
) throw ( std::runtime_error ) [static]

Definition at line 216 of file Numbers.cc.

References EcalBarrel, EcalEndcap, ecalpyutils::ism(), and asciidump::s.

Referenced by EESelectiveReadoutTask::anaDigi(), EBSelectiveReadoutTask::anaDigi(), EcalEndcapMonitorModule::analyze(), EEIntegrityTask::analyze(), EELedTask::analyze(), EBLaserTask::analyze(), EBRawDataTask::analyze(), EESelectiveReadoutTask::analyze(), EBClusterTaskExtras::analyze(), EBCosmicTask::analyze(), EBStatusFlagsTask::analyze(), EBTestPulseTask::analyze(), EELaserTask::analyze(), EcalBarrelMonitorModule::analyze(), EERawDataTask::analyze(), EECosmicTask::analyze(), EBPedestalOnlineTask::analyze(), EEOccupancyTask::analyze(), EETimingTask::analyze(), EEClusterTaskExtras::analyze(), EBIntegrityTask::analyze(), EBOccupancyTask::analyze(), EBPedestalTask::analyze(), EEPedestalOnlineTask::analyze(), EETestPulseTask::analyze(), EBTimingTask::analyze(), EEClusterTask::analyze(), EBSelectiveReadoutTask::analyze(), EEPedestalTask::analyze(), EEStatusFlagsTask::analyze(), EcalDQMStatusReader::beginRun(), icEE(), iSC(), iTCC(), iTT(), Masks::maskChannel(), EETriggerTowerTask::processDigis(), EBTriggerTowerTask::processDigis(), EcalDQMStatusWriter::readEcalDQMChannelStatusFromFile(), RtHalf(), and validEE().

                                                                                        {

  if( subdet == EcalBarrel ) {

    // EB-
    if( ism >=  1 && ism <= 18 ) return( ism+18 );

    // EB+
    if( ism >= 19 && ism <= 36 ) return( ism-18 );

    std::ostringstream s;
    s << "Wrong SM id: iSM = " << ism;
    throw( std::runtime_error( s.str() ) );

  } else if( subdet == EcalEndcap ) {

    // EE-
    if( ism >=  1 && ism <=  9 ) return( ism+9 );

    // EE+
    if (ism >= 10 && ism <= 18 ) return( ism-9 );

    std::ostringstream s;
    s << "Wrong SM id: iSM = " << ism;
    throw( std::runtime_error( s.str() ) );

  } else {

    std::ostringstream s;
    s << "Invalid subdetector: subdet = " << subdet;
    throw( std::runtime_error( s.str() ) );

  }

}
int Numbers::iSM ( const EBDetId id) throw ( std::runtime_error ) [static]

Definition at line 254 of file Numbers.cc.

References EcalElectronicsId::dccId(), EcalElectronicsMapping::getElectronicsId(), and asciidump::s.

                                                              {

  if( Numbers::map ) {

    const EcalElectronicsId eid = Numbers::map->getElectronicsId(id);
    int idcc = eid.dccId();

    // EB-/EB+
    if( idcc >= 10 && idcc <= 45 ) return( idcc - 9 );

    std::ostringstream s;
    s << "Wrong DCC id: dcc = " << idcc;
    throw( std::runtime_error( s.str() ) );

  } else {

    std::ostringstream s;
    s << "ECAL Geometry not available";
    throw( std::runtime_error( s.str() ) );

  }

}
int Numbers::iSM ( const EEDetId id) throw ( std::runtime_error ) [static]

Definition at line 280 of file Numbers.cc.

References EcalElectronicsId::dccId(), EcalElectronicsMapping::getElectronicsId(), and asciidump::s.

                                                              {

  if( Numbers::map ) {

    const EcalElectronicsId eid = Numbers::map->getElectronicsId(id);
    int idcc = eid.dccId();

    // EE-
    if( idcc >=  1 && idcc <=  9 ) return( idcc );

    // EE+
    if( idcc >= 46 && idcc <= 54 ) return( idcc - 45 + 9 );

    std::ostringstream s;
    s << "Wrong DCC id: dcc = " << idcc;
    throw( std::runtime_error( s.str() ) );

  } else {

    std::ostringstream s;
    s << "ECAL Geometry not available";
    throw( std::runtime_error( s.str() ) );

  }

}
int Numbers::iTCC ( const int  ism,
const EcalSubdetector  subdet,
const int  i1,
const int  i2 
) throw ( std::runtime_error ) [static]

Definition at line 615 of file Numbers.cc.

References EcalBarrel, EcalEndcap, EBDetId::ETAPHIMODE, iSM(), ecalpyutils::ism(), asciidump::s, EcalTrigTowerConstituentsMap::towerOf(), EEDetId::validDetId(), EBDetId::validDetId(), and EEDetId::XYMODE.

Referenced by EESelectiveReadoutTask::anaDigi(), EESelectiveReadoutTask::analyze(), EETriggerTowerTask::processDigis(), and EBTriggerTowerTask::processDigis().

                                                                                                                     {

  if( subdet == EcalBarrel ) {
   
    if( EBDetId::validDetId(i1, i2) ) {

      EBDetId id = EBDetId(i1, i2, EBDetId::ETAPHIMODE);

      if( Numbers::iSM( id ) != ism ) return( -1 );

      if( Numbers::mapTT ) {

        const EcalTrigTowerDetId towid = Numbers::mapTT->towerOf(id);

        return( Numbers::map->TCCid(towid) );

      } else {

        std::ostringstream s;
        s << "ECAL Geometry not available";
        throw( std::runtime_error( s.str() ) );

      }

    } else {

      return( -1 );

    }

  } else if( subdet ==  EcalEndcap) {

    int iz = 0;

    if( ism >=  1 && ism <=  9 ) iz = -1;
    if( ism >= 10 && ism <= 18 ) iz = +1;

    if( EEDetId::validDetId(i1, i2, iz) ) {

      EEDetId id(i1, i2, iz, EEDetId::XYMODE);

      if( Numbers::iSM( id ) != ism ) return( -1 );

      if( Numbers::mapTT ) {

        const EcalTrigTowerDetId towid = Numbers::mapTT->towerOf(id);

        return( Numbers::map->TCCid(towid) );

      } else {

        std::ostringstream s;
        s << "ECAL Geometry not available";
        throw( std::runtime_error( s.str() ) );

      }

    } else {

      return( -1 );

    }

  } else {

    std::ostringstream s;
    s << "Invalid subdetector: subdet = " << subdet;
    throw( std::runtime_error( s.str() ) );

  }

}
int Numbers::iTCC ( const EcalTrigTowerDetId id) throw ( std::runtime_error ) [static]

Definition at line 690 of file Numbers.cc.

References EcalBarrel, EcalEndcap, asciidump::s, and subDet().

                                                                          {

  EcalSubdetector subdet = Numbers::subDet( id );

  if( subdet == EcalBarrel ) {

    if( Numbers::map ) {

      return( Numbers::map->TCCid(id) );

    } else {

      std::ostringstream s;
      s << "ECAL Geometry not available";
      throw( std::runtime_error( s.str() ) );

    }

  } else if( subdet ==  EcalEndcap) {

    if( Numbers::map ) {

      return( Numbers::map->TCCid(id) );

    } else {

      std::ostringstream s;
      s << "ECAL Geometry not available";
      throw( std::runtime_error( s.str() ) );

    }

  } else {

    std::ostringstream s;
    s << "Invalid subdetector: subdet = " << subdet;
    throw( std::runtime_error( s.str() ) );

  }

}
int Numbers::iTT ( const int  ism,
const EcalSubdetector  subdet,
const int  i1,
const int  i2 
) throw ( std::runtime_error ) [static]

Definition at line 520 of file Numbers.cc.

References EcalBarrel, EcalEndcap, iSC(), iSM(), ecalpyutils::ism(), asciidump::s, EcalTrigTowerConstituentsMap::towerOf(), EEDetId::validDetId(), and EEDetId::XYMODE.

Referenced by EESelectiveReadoutTask::anaDigi(), EBSelectiveReadoutTask::anaDigi(), EESelectiveReadoutTask::analyze(), EBSelectiveReadoutTask::analyze(), EcalDQMStatusReader::beginRun(), EETriggerTowerTask::processDigis(), and EBTriggerTowerTask::processDigis().

                                                                                                                    {

  if( subdet == EcalBarrel ) {

    return( Numbers::iSC(ism, subdet, i1, i2) );

  } else if( subdet == EcalEndcap ) {

    int iz = 0;

    if( ism >=  1 && ism <=  9 ) iz = -1;
    if( ism >= 10 && ism <= 18 ) iz = +1;

    if( EEDetId::validDetId(i1, i2, iz) ) {

      EEDetId id(i1, i2, iz, EEDetId::XYMODE);

      if( Numbers::iSM( id ) != ism ) return( -1 );

      if( Numbers::mapTT ) {

        const EcalTrigTowerDetId towid = Numbers::mapTT->towerOf(id);

        return( iTT(towid) );

      } else {

        std::ostringstream s;
        s << "ECAL Geometry not available";
        throw( std::runtime_error( s.str() ) );

      }

    } else {

      return( -1 );

    }

  } else {

    std::ostringstream s;
    s << "Invalid subdetector: subdet = " << subdet;
    throw( std::runtime_error( s.str() ) );

  }

}
int Numbers::iTT ( const EcalTrigTowerDetId id) throw ( std::runtime_error ) [static]

Definition at line 571 of file Numbers.cc.

References EcalBarrel, EcalEndcap, asciidump::s, and subDet().

                                                                         {

  EcalSubdetector subdet = Numbers::subDet( id );

  if( subdet == EcalBarrel ) {

    if( Numbers::map ) {

      return( Numbers::map->iTT(id) );

    } else {

      std::ostringstream s;
      s << "ECAL Geometry not available";
      throw( std::runtime_error( s.str() ) );

    }

  } else if( subdet ==  EcalEndcap) {

    if( Numbers::map ) {

      return( Numbers::map->iTT(id) );

    } else {

      std::ostringstream s;
      s << "ECAL Geometry not available";
      throw( std::runtime_error( s.str() ) );

    }

  } else {

    std::ostringstream s;
    s << "Invalid subdetector: subdet = " << subdet;
    throw( std::runtime_error( s.str() ) );

  }

}
int Numbers::ix0EE ( const int  ism) [static]
int Numbers::iy0EE ( const int  ism) [static]
int Numbers::RtHalf ( const EBDetId id) [static]

Definition at line 761 of file Numbers.cc.

Referenced by EELedTask::analyze(), EBLaserTask::analyze(), and EELaserTask::analyze().

                                     {

  int ic = id.ic();
  int ie = (ic-1)/20 + 1;
  int ip = (ic-1)%20 + 1;

  if( ie > 5 && ip < 11 ) return 1;

  return 0;

}
int Numbers::RtHalf ( const EEDetId id) [static]

Definition at line 775 of file Numbers.cc.

References iSM(), and ecalpyutils::ism().

                                     {

  int ix = id.ix();

  int ism = Numbers::iSM( id );

  // EE-05
  if ( ism ==  8 && ix > 50 ) return 1;

  // EE+05
  if ( ism == 17 && ix > 50 ) return 1;

  return 0;

}
std::string Numbers::sEB ( const int  ism) [static]

Definition at line 81 of file Numbers.cc.

References iEB(), and asciidump::s.

Referenced by EBTriggerTowerClient::analyze(), EBTimingClient::analyze(), EBStatusFlagsClient::analyze(), EBSummaryClient::analyze(), EBCosmicClient::analyze(), EBOccupancyClient::analyze(), EBTestPulseClient::analyze(), EBLaserClient::analyze(), EBBeamHodoClient::analyze(), EBPedestalOnlineClient::analyze(), EBPedestalClient::analyze(), EBIntegrityClient::analyze(), EcalBarrelMonitorClient::beginJob(), EBDataCertificationTask::beginJob(), EBDcsInfoTask::beginJob(), EBDaqInfoTask::beginJob(), EcalDQMStatusReader::beginRun(), EBDataCertificationTask::endLuminosityBlock(), EcalBarrelMonitorClient::endRun(), EBTimingTask::setup(), EBTestPulseTask::setup(), EBIntegrityTask::setup(), EBStatusFlagsTask::setup(), EcalBarrelMonitorModule::setup(), EBTriggerTowerClient::setup(), EBPedestalTask::setup(), EBSelectiveReadoutTask::setup(), EBTestPulseClient::setup(), EBIntegrityClient::setup(), EBOccupancyTask::setup(), EBTimingClient::setup(), EBRawDataTask::setup(), EBCosmicTask::setup(), EBTriggerTowerTask::setup(), EBPedestalOnlineClient::setup(), EBLaserTask::setup(), EBPedestalClient::setup(), EBSummaryClient::setup(), EBBeamHodoTask::setup(), EBLaserClient::setup(), and EBPedestalOnlineTask::setup().

                                       {

  int ieb = Numbers::iEB( ism );

  std::ostringstream s;
  s << "EB" << std::setw(3) << std::setfill('0')
    << std::setiosflags( std::ios::showpos )
    << std::setiosflags( std::ios::internal )
    << ieb
    << std::resetiosflags( std::ios::showpos )
    << std::resetiosflags( std::ios::internal );
  return( s.str() );

}
std::string Numbers::sEE ( const int  ism) [static]

Definition at line 199 of file Numbers.cc.

References iEE(), and asciidump::s.

Referenced by EETimingClient::analyze(), EEPedestalClient::analyze(), EESummaryClient::analyze(), EELaserClient::analyze(), EEIntegrityClient::analyze(), EETestPulseClient::analyze(), EEStatusFlagsClient::analyze(), EEPedestalOnlineClient::analyze(), EETriggerTowerClient::analyze(), EELedClient::analyze(), EEBeamHodoClient::analyze(), EEOccupancyClient::analyze(), EECosmicClient::analyze(), EEDcsInfoTask::beginJob(), EEDaqInfoTask::beginJob(), EcalEndcapMonitorClient::beginJob(), EEDataCertificationTask::beginJob(), EcalDQMStatusReader::beginRun(), EEDataCertificationTask::endLuminosityBlock(), EcalEndcapMonitorClient::endRun(), EEPedestalClient::setup(), EEPedestalOnlineTask::setup(), EELaserTask::setup(), EELaserClient::setup(), EEStatusFlagsTask::setup(), EETriggerTowerClient::setup(), EEPedestalOnlineClient::setup(), EEIntegrityTask::setup(), EEBeamHodoTask::setup(), EESelectiveReadoutTask::setup(), EETimingClient::setup(), EECosmicTask::setup(), EcalEndcapMonitorModule::setup(), EETestPulseClient::setup(), EERawDataTask::setup(), EETriggerTowerTask::setup(), EETimingTask::setup(), EEOccupancyTask::setup(), EELedClient::setup(), EETestPulseTask::setup(), EEPedestalTask::setup(), EELedTask::setup(), EESummaryClient::setup(), and EEIntegrityClient::setup().

                                       {

  int iee = Numbers::iEE( ism );

  std::ostringstream s;
  s << "EE" << std::setw(3) << std::setfill('0')
    << std::setiosflags( std::ios::showpos )
    << std::setiosflags( std::ios::internal )
    << iee
    << std::resetiosflags( std::ios::showpos )
    << std::resetiosflags( std::ios::internal );
  return( s.str() );

}
EcalSubdetector Numbers::subDet ( const EcalPnDiodeDetId id) [static]

Definition at line 170 of file Numbers.cc.

                                                            {

  return( (EcalSubdetector) id.iEcalSubDetectorId() );

}
EcalSubdetector Numbers::subDet ( const EcalElectronicsId id) [static]

Definition at line 162 of file Numbers.cc.

                                                             {

  return( id.subdet() );

}
EcalSubdetector Numbers::subDet ( const EcalScDetId id) [static]

Definition at line 154 of file Numbers.cc.

                                                       {

  return( id.subdet() );

}
EcalSubdetector Numbers::subDet ( const EcalTrigTowerDetId id) [static]

Definition at line 146 of file Numbers.cc.

References subDet().

                                                              {

  return( id.subDet() );

}
EcalSubdetector Numbers::subDet ( const EcalDCCHeaderBlock id) throw ( std::runtime_error ) [static]

Definition at line 178 of file Numbers.cc.

References EcalBarrel, EcalEndcap, and asciidump::s.

                                                                                        {

  int idcc = id.id();

  // EE-
  if ( idcc >=  1 && idcc <=  9 ) return( EcalEndcap );

  // EB-/EB+
  if ( idcc >= 10 && idcc <= 45 ) return( EcalBarrel);

  // EE+
  if ( idcc >= 46 && idcc <= 54 ) return( EcalEndcap );

  std::ostringstream s;
  s << "Wrong DCC id: dcc = " << idcc;
  throw( std::runtime_error( s.str() ) );

}
EcalSubdetector Numbers::subDet ( const EEDetId id) [static]

Definition at line 138 of file Numbers.cc.

                                                   {

  return( id.subdet() );

}
EcalSubdetector Numbers::subDet ( const EBDetId id) [static]
bool Numbers::validEE ( const int  ism,
const int  ix,
const int  iy 
) [static]

Member Data Documentation

std::vector< DetId > Numbers::crystalsDCC_ [static, private]

Definition at line 128 of file Numbers.h.

Referenced by crystals().

std::vector< DetId > Numbers::crystalsTCC_ [static, private]

Definition at line 127 of file Numbers.h.

Referenced by crystals().

bool Numbers::init = false [static, private]

Definition at line 120 of file Numbers.h.

Referenced by initGeometry().

const EcalElectronicsMapping * Numbers::map = 0 [static, private]

Definition at line 124 of file Numbers.h.

const EcalTrigTowerConstituentsMap * Numbers::mapTT = 0 [static, private]

Definition at line 125 of file Numbers.h.