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)
static std::vector< DetId > * crystals (const EcalElectronicsId &id)
static std::vector< DetId > * crystals (unsigned idcc, unsigned isc)
static float eta (const DetId &id)
static const EcalScDetId getEcalScDetId (const EEDetId &id)
static const
EcalElectronicsMapping
getElectronicsMapping ()
static unsigned icEB (const unsigned ism, const unsigned ix, const unsigned iy)
static unsigned icEE (const unsigned ism, const unsigned ix, const unsigned iy)
static int iEB (const unsigned ism)
static int iEE (const unsigned ism)
static unsigned indexEB (const unsigned ism, const unsigned ie, const unsigned ip)
static unsigned indexEE (const unsigned ism, const unsigned ix, const unsigned iy)
static void initGeometry (const edm::EventSetup &setup, bool verbose=false)
static unsigned iSC (const EcalScDetId &id)
static unsigned iSC (const unsigned ism, const EcalSubdetector subdet, const unsigned i1, const unsigned i2)
static unsigned iSM (const EcalTrigTowerDetId &id)
static unsigned iSM (const EcalElectronicsId &id)
static unsigned iSM (const EcalPnDiodeDetId &id)
static unsigned iSM (const EcalScDetId &id)
static unsigned iSM (const EcalDCCHeaderBlock &id, const EcalSubdetector subdet)
static unsigned iSM (const unsigned ism, const EcalSubdetector subdet)
static unsigned iSM (const EBDetId &id)
static unsigned iSM (const EEDetId &id)
static unsigned iTCC (const unsigned ism, const EcalSubdetector subdet, const unsigned i1, const unsigned i2)
static unsigned iTCC (const EcalTrigTowerDetId &id)
static unsigned iTT (const unsigned ism, const EcalSubdetector subdet, const unsigned i1, const unsigned i2)
static unsigned iTT (const EcalTrigTowerDetId &id)
static int ix0EE (const unsigned ism)
static int ix0EEm (const unsigned ism)
static int iy0EE (const unsigned ism)
static unsigned nCCUs (const unsigned ism)
static unsigned nTTs (const unsigned itcc)
static float phi (const DetId &id)
static unsigned RtHalf (const EBDetId &id)
static unsigned RtHalf (const EEDetId &id)
static std::string sEB (const unsigned ism)
static std::string sEE (const unsigned ism)
static EcalSubdetector subDet (const EEDetId &id)
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 EBDetId &id)
static EcalSubdetector subDet (const EcalDCCHeaderBlock &id)
static bool validEE (const unsigned ism, const unsigned ix, const unsigned iy)
static bool validEESc (const unsigned ism, const unsigned ix, const unsigned iy)

Private Member Functions

 Numbers ()
 ~Numbers ()

Static Private Attributes

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

Detailed Description

Definition at line 37 of file Numbers.h.


Constructor & Destructor Documentation

Numbers::Numbers ( ) [inline, private]

Definition at line 137 of file Numbers.h.

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

Definition at line 138 of file Numbers.h.

{}; // Hidden to force static use

Member Function Documentation

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

Definition at line 644 of file Numbers.cc.

References crystals(), and Exception.

{

  if( !Numbers::map ) throw cms::Exception("ObjectUnavailable") << "ECAL Geometry not available";

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

  return Numbers::crystals( idcc, isc );

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

Definition at line 659 of file Numbers.cc.

References crystalsDCC_, crystalsDCCArraySize_, EcalElectronicsMapping::dccTowerConstituents(), Exception, getHLTprescales::index, and findQualityFiles::size.

{

  if( !Numbers::map ) throw cms::Exception("ObjectUnavailable") << "ECAL Geometry not available";

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

  if( index > crystalsDCCArraySize_ ) throw cms::Exception("InvalidParameter") << "DCC index " << index;

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

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

}
float Numbers::eta ( const DetId id) [static]

Definition at line 929 of file Numbers.cc.

References PV3DBase< T, PVType, FrameType >::eta(), geometry, CaloGeometry::getPosition(), and pos.

Referenced by EETimingClient::analyze().

{
  const GlobalPoint& pos = geometry->getPosition(id);
  return pos.eta();
}
const EcalScDetId Numbers::getEcalScDetId ( const EEDetId id) [static]

Definition at line 679 of file Numbers.cc.

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

Referenced by ecaldqm::fillME(), EESelectiveReadoutTask::readOutUnitOf(), ecaldqm::setBinContentME(), ecaldqm::setBinEntriesME(), and ecaldqm::setBinErrorME().

{

  if( !Numbers::map ) throw cms::Exception("ObjectUnavailable") << "ECAL Geometry not available";

  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();

}
const EcalElectronicsMapping * Numbers::getElectronicsMapping ( ) [static]

Definition at line 919 of file Numbers.cc.

References Exception, and map.

Referenced by EELedTask::analyze(), ecaldqm::fillME(), ecaldqm::setBinContentME(), ecaldqm::setBinEntriesME(), and ecaldqm::setBinErrorME().

{

  if( !Numbers::map ) throw cms::Exception("ObjectUnavailable") << "ECAL Geometry not available";

  return Numbers::map;

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

Definition at line 729 of file Numbers.cc.

References indexEB().

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

{

  return Numbers::indexEB( ism, ie, ip );

}
unsigned Numbers::icEE ( const unsigned  ism,
const unsigned  ix,
const unsigned  iy 
) [static]

Definition at line 739 of file Numbers.cc.

References Exception, EcalElectronicsMapping::getElectronicsId(), EEDetId::kSizeForDenseIndexing, strip(), EcalElectronicsId::stripId(), EcalElectronicsId::towerId(), EcalElectronicsId::xtalId(), and EEDetId::XYMODE.

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

{

  if( !Numbers::map ) throw cms::Exception("ObjectUnavailable") << "ECAL Geometry not available";

  int iz = 0;

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

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

  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;
  }

  unsigned ic = (vfe-1)*25 + (strip-1)*5 + channel;

  if( ic == 0 || ic > static_cast<unsigned>( EEDetId::kSizeForDenseIndexing ) ) throw cms::Exception("InvalidParameter") << "ic=" << ic;

  return ic;

}
int Numbers::iEB ( const unsigned  ism) [static]

Definition at line 78 of file Numbers.cc.

References Exception, and ecalpyutils::ism().

Referenced by sEB().

{

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

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

  throw cms::Exception("InvalidParameter") << "Wrong SM id determination: iSM = " << ism;

}
int Numbers::iEE ( const unsigned  ism) [static]

Definition at line 113 of file Numbers.cc.

References Exception, and ecalpyutils::ism().

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 );

  throw cms::Exception("InvalidParameter") << "Wrong SM id determination: iSM = " << ism;

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

Definition at line 698 of file Numbers.cc.

References EBDetId::kCrystalsPerSM.

Referenced by icEB().

{

  unsigned ic = (ip-1) + 20*(ie-1) + 1;

  if( ic == 0 || ic > static_cast<unsigned>( EBDetId::kCrystalsPerSM ) ) throw cms::Exception("InvalidParameter") << "ism=" << ism << " ie=" << ie << " ip=" << ip;

  return ic;

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

Definition at line 712 of file Numbers.cc.

References Exception, and 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) ) throw cms::Exception("InvalidParameter") << "ism=" << ism << " ix=" << ix << " iy=" << iy;

  return( 1000*ix + iy );

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

Definition at line 50 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(), EEPedestalTask::beginRun(), EBPedestalOnlineTask::beginRun(), EcalDQMStatusReader::beginRun(), EEPedestalOnlineTask::beginRun(), EELedTask::beginRun(), EEIntegrityTask::beginRun(), EBSelectiveReadoutTask::beginRun(), EEClusterTaskExtras::beginRun(), EELaserTask::beginRun(), EBPedestalTask::beginRun(), EETestPulseTask::beginRun(), EEStatusFlagsTask::beginRun(), EESelectiveReadoutTask::beginRun(), EERawDataTask::beginRun(), EEClusterTask::beginRun(), EBTrendTask::beginRun(), EBIntegrityTask::beginRun(), EcalBarrelMonitorClient::beginRun(), EETriggerTowerTask::beginRun(), EBTimingTask::beginRun(), EBTestPulseTask::beginRun(), EBOccupancyTask::beginRun(), EBClusterTask::beginRun(), EcalEndcapMonitorClient::beginRun(), EcalDQMStatusWriter::beginRun(), EBClusterTaskExtras::beginRun(), EECosmicTask::beginRun(), EBTriggerTowerTask::beginRun(), EBStatusFlagsTask::beginRun(), EETimingTask::beginRun(), EBCosmicTask::beginRun(), EETrendTask::beginRun(), EEOccupancyTask::beginRun(), EBRawDataTask::beginRun(), and EBLaserTask::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();

  edm::ESHandle<CaloGeometry> handleGeom;
  setup.get<CaloGeometryRecord>().get(handleGeom);
  Numbers::geometry = handleGeom.product();

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

}
unsigned Numbers::iSC ( const EcalScDetId id) [static]

Definition at line 437 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 static_cast<unsigned>(dccsc.second);

}
unsigned Numbers::iSC ( const unsigned  ism,
const EcalSubdetector  subdet,
const unsigned  i1,
const unsigned  i2 
) [static]

Definition at line 449 of file Numbers.cc.

References EcalBarrel, EcalEndcap, Exception, EcalElectronicsMapping::getElectronicsId(), EcalElectronicsId::towerId(), 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 ) {

    if( !Numbers::map ) throw( std::runtime_error( "ECAL Geometry not available" ) );

    // use ism only for determination of +/-

    int iz = 0;

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

    EEDetId id(i1, i2, iz, EEDetId::XYMODE); // throws an exception if invalid

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

    return( static_cast<unsigned>( eid.towerId() ));

  }

  throw cms::Exception("InvalidParameter") << "Invalid subdetector: subdet = " << subdet;

}
unsigned Numbers::iSM ( const EcalTrigTowerDetId id) [static]

Definition at line 314 of file Numbers.cc.

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

{

  if( !Numbers::map ) throw cms::Exception("ObjectUnavailable") << "ECAL Geometry not available";

  EcalSubdetector subdet = Numbers::subDet( id );

  if( subdet == EcalBarrel ) {

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

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

    throw cms::Exception("InvalidParameter") << "Wrong DCC id: dcc = " << idcc;

  } else if( subdet ==  EcalEndcap) {

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

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

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

    throw cms::Exception("InvalidParameter") << "Wrong DCC id: dcc = " << idcc;

  }

  throw cms::Exception("InvalidParameter") << "Invalid subdetector: subdet = " << subdet;

}
unsigned Numbers::iSM ( const EcalElectronicsId id) [static]

Definition at line 351 of file Numbers.cc.

References Exception.

{

  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 );

  throw cms::Exception("InvalidParameter") << "Wrong DCC id: dcc = " << idcc;

}
unsigned Numbers::iSM ( const EcalPnDiodeDetId id) [static]

Definition at line 372 of file Numbers.cc.

References Exception.

{

  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 );

  throw cms::Exception("InvalidParameter") << "Wrong DCC id: dcc = " << idcc;

}
unsigned Numbers::iSM ( const EcalScDetId id) [static]

Definition at line 393 of file Numbers.cc.

References Exception, and EcalElectronicsMapping::getDCCandSC().

{

  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 );

  throw cms::Exception("InvalidParameter") << "Wrong DCC id: dcc = " << idcc;

}
unsigned Numbers::iSM ( const EcalDCCHeaderBlock id,
const EcalSubdetector  subdet 
) [static]

Definition at line 416 of file Numbers.cc.

References Exception.

{

  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 );

  throw cms::Exception("InvalidParameter") << "Wrong DCC id: dcc = " << idcc;

}
unsigned Numbers::iSM ( const unsigned  ism,
const EcalSubdetector  subdet 
) [static]

Definition at line 246 of file Numbers.cc.

References EcalBarrel, EcalEndcap, Exception, and ecalpyutils::ism().

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(), Masks::maskChannel(), EETriggerTowerTask::processDigis(), EBTriggerTowerTask::processDigis(), EcalDQMStatusWriter::readEcalDQMChannelStatusFromFile(), RtHalf(), validEE(), and validEESc().

{

  if( subdet == EcalBarrel ) {

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

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

    throw cms::Exception("InvalidParameter") << "Wrong SM id: iSM = " << ism;

  } else if( subdet == EcalEndcap ) {

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

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

    throw cms::Exception("InvalidParameter") << "Wrong SM id: iSM = " << ism;

  }

  throw cms::Exception("InvalidParameter") << "Invalid subdetector: subdet = " << subdet;

}
unsigned Numbers::iSM ( const EBDetId id) [static]

Definition at line 274 of file Numbers.cc.

References EcalElectronicsId::dccId(), Exception, and EcalElectronicsMapping::getElectronicsId().

{

  if( !Numbers::map ) throw cms::Exception("ObjectUnavailable") << "ECAL Geometry not available";

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

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

  throw cms::Exception("InvalidParameter") << "Wrong DCC id: dcc = " << idcc;

}
unsigned Numbers::iSM ( const EEDetId id) [static]

Definition at line 293 of file Numbers.cc.

References EcalElectronicsId::dccId(), Exception, and EcalElectronicsMapping::getElectronicsId().

{

  if( !Numbers::map ) throw cms::Exception("ObjectUnavailable") << "ECAL Geometry not available";

  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 );

  throw cms::Exception("InvalidParameter") << "Wrong DCC id: dcc = " << idcc;

}
unsigned Numbers::iTCC ( const unsigned  ism,
const EcalSubdetector  subdet,
const unsigned  i1,
const unsigned  i2 
) [static]

Definition at line 534 of file Numbers.cc.

References EcalBarrel, EcalEndcap, EBDetId::ETAPHIMODE, Exception, EcalTrigTowerConstituentsMap::towerOf(), and EEDetId::XYMODE.

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

{

  if( !Numbers::mapTT ) throw cms::Exception("ObjectUnavailable") << "ECAL Geometry not available";

  if( subdet == EcalBarrel ) {

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

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

    return( static_cast<unsigned>( Numbers::map->TCCid(towid) ) );

  } else if( subdet ==  EcalEndcap) {

    int iz = 0;

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

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

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

    return( static_cast<unsigned>( Numbers::map->TCCid(towid) ) );

  }

  throw cms::Exception("InvalidSubdetector") << "subdet = " << subdet;

}
unsigned Numbers::iTCC ( const EcalTrigTowerDetId id) [static]

Definition at line 569 of file Numbers.cc.

References EcalBarrel, EcalEndcap, Exception, and subDet().

{

  if( !Numbers::map ) throw cms::Exception("ObjectUnavailable") << "ECAL Geometry not available";

  EcalSubdetector subdet = Numbers::subDet( id );

  if( subdet == EcalBarrel || subdet == EcalEndcap ) return( static_cast<unsigned>( Numbers::map->TCCid(id) ) );

  throw cms::Exception("InvalidParameter") << "Invalid subdetector: subdet = " << subdet;

}
unsigned Numbers::iTT ( const unsigned  ism,
const EcalSubdetector  subdet,
const unsigned  i1,
const unsigned  i2 
) [static]

Definition at line 485 of file Numbers.cc.

References EcalBarrel, EcalEndcap, Exception, iSC(), EcalTrigTowerConstituentsMap::towerOf(), and EEDetId::XYMODE.

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

{

  if( subdet == EcalBarrel ) {

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

  } else if( subdet == EcalEndcap ) {

    if( !Numbers::mapTT ) throw cms::Exception("ObjectUnavailable") << "ECAL Geometry not available";

    // use ism only for determination of +/-

    int iz = 0;

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

    EEDetId id(i1, i2, iz, EEDetId::XYMODE); // throws an exception if invalid

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

    return( static_cast<unsigned>( iTT(towid) ) );

  }

  throw cms::Exception("InvalidParameter") << "Invalid subdetector: subdet = " << subdet;

}
unsigned Numbers::iTT ( const EcalTrigTowerDetId id) [static]

Definition at line 518 of file Numbers.cc.

References EcalBarrel, EcalEndcap, Exception, iTT(), and subDet().

{

  if( !Numbers::map ) throw cms::Exception("ObjectUnavailable") << "ECAL Geometry not available";

  EcalSubdetector subdet = Numbers::subDet( id );

  if( subdet == EcalBarrel || subdet ==  EcalEndcap ) return( static_cast<unsigned>( Numbers::map->iTT(id) ) );

  throw cms::Exception("InvalidParameter") << "Invalid subdetector: subdet = " << subdet;

}
int Numbers::ix0EE ( const unsigned  ism) [static]
int Numbers::ix0EEm ( const unsigned  ism) [static]

Definition at line 793 of file Numbers.cc.

References ix0EE().

{

  switch( ism ){
  case 1: return -105;
  case 2: return -100;
  case 3: return -90;
  case 4: return -60;
  case 5: return -50;
  case 6: return -45;
  case 7: return -50;
  case 8: return -75;
  case 9: return -100;
  }

  return ix0EE( ism );
}
int Numbers::iy0EE ( const unsigned  ism) [static]
unsigned Numbers::nCCUs ( const unsigned  ism) [static]

Definition at line 875 of file Numbers.cc.

{
  switch(ism){
  case 8:
  case 17:
    return 41;
  case 1:
  case 6:
  case 10:
  case 15:
    return 34;
  case 3:
  case 12:
  case 4:
  case 13:
  case 7:
  case 16:
  case 9:
  case 18:
    return 33;
  case 2:
  case 11:
  case 5:
  case 14:
    return 32;
  default:
    return 0;
  }
}
unsigned Numbers::nTTs ( const unsigned  itcc) [static]

Definition at line 906 of file Numbers.cc.

References crystals(), mapTT, and EcalTrigTowerConstituentsMap::towerOf().

{
  using namespace std;
  vector<DetId> crystals(map->tccConstituents(itcc));

  set<int> itts;
  for(vector<DetId>::iterator cItr(crystals.begin()); cItr != crystals.end(); ++cItr)
    itts.insert(map->iTT(mapTT->towerOf(*cItr)));

  return itts.size();
}
float Numbers::phi ( const DetId id) [static]

Definition at line 936 of file Numbers.cc.

References geometry, CaloGeometry::getPosition(), PV3DBase< T, PVType, FrameType >::phi(), and pos.

Referenced by EETimingClient::analyze().

{
  const GlobalPoint& pos = geometry->getPosition(id);
  return pos.phi();
}
unsigned Numbers::RtHalf ( const EBDetId id) [static]

Definition at line 608 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;

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

Definition at line 624 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 unsigned  ism) [static]

Definition at line 94 of file Numbers.cc.

References iEB(), and alignCSCRings::s.

Referenced by EBTriggerTowerClient::analyze(), EBTimingClient::analyze(), EBStatusFlagsClient::analyze(), EBSummaryClient::analyze(), EBCosmicClient::analyze(), EBOccupancyClient::analyze(), EBTestPulseClient::analyze(), EBLaserClient::analyze(), EBPedestalOnlineClient::analyze(), EBPedestalClient::analyze(), EBIntegrityClient::analyze(), EBDataCertificationTask::beginJob(), EBDcsInfoTask::beginJob(), EBDaqInfoTask::beginJob(), EcalDQMStatusReader::beginRun(), EcalBarrelMonitorClient::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(), 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 unsigned  ism) [static]

Definition at line 226 of file Numbers.cc.

References iEE(), and alignCSCRings::s.

Referenced by EEPedestalClient::analyze(), EETimingClient::analyze(), EESummaryClient::analyze(), EELaserClient::analyze(), EEIntegrityClient::analyze(), EEStatusFlagsClient::analyze(), EETestPulseClient::analyze(), EEPedestalOnlineClient::analyze(), EETriggerTowerClient::analyze(), EELedClient::analyze(), EEOccupancyClient::analyze(), EECosmicClient::analyze(), EEDaqInfoTask::beginJob(), EEDcsInfoTask::beginJob(), EEDataCertificationTask::beginJob(), EcalDQMStatusReader::beginRun(), EcalEndcapMonitorClient::beginRun(), EEDataCertificationTask::endLuminosityBlock(), EcalEndcapMonitorClient::endRun(), EEPedestalClient::setup(), EEPedestalOnlineTask::setup(), EELaserClient::setup(), EELaserTask::setup(), EETriggerTowerClient::setup(), EEStatusFlagsTask::setup(), EEPedestalOnlineClient::setup(), EEIntegrityTask::setup(), EETimingClient::setup(), EESelectiveReadoutTask::setup(), EETestPulseClient::setup(), EcalEndcapMonitorModule::setup(), EECosmicTask::setup(), EERawDataTask::setup(), EELedClient::setup(), EEOccupancyTask::setup(), EETimingTask::setup(), EETriggerTowerTask::setup(), EELedTask::setup(), EEPedestalTask::setup(), EETestPulseTask::setup(), EEIntegrityClient::setup(), and EESummaryClient::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 EEDetId id) [static]

Definition at line 155 of file Numbers.cc.

{

  return( id.subdet() );

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

Definition at line 195 of file Numbers.cc.

{

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

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

Definition at line 185 of file Numbers.cc.

{

  return( id.subdet() );

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

Definition at line 175 of file Numbers.cc.

{

  return( id.subdet() );

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

Definition at line 165 of file Numbers.cc.

References subDet().

{

  return( id.subDet() );

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

Definition at line 205 of file Numbers.cc.

References EcalBarrel, EcalEndcap, and Exception.

{

  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 );

  throw cms::Exception("InvalidParameter") << "Wrong DCC id: dcc = " << idcc;

}
bool Numbers::validEE ( const unsigned  ism,
const unsigned  ix,
const unsigned  iy 
) [static]
bool Numbers::validEESc ( const unsigned  ism,
const unsigned  ix,
const unsigned  iy 
) [static]

Definition at line 855 of file Numbers.cc.

References iSM(), and EcalScDetId::validDetId().

Referenced by EESummaryClient::analyze().

{

  int iz = 0;

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

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

    EcalScDetId id(ix, iy, iz);

    if( Numbers::iSM( id ) == ism ) return true;

  }

  return false;
}

Member Data Documentation

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

Definition at line 151 of file Numbers.h.

Referenced by crystals().

const unsigned Numbers::crystalsDCCArraySize_ = 100 * 54 [static, private]

Definition at line 148 of file Numbers.h.

Referenced by crystals().

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

Definition at line 150 of file Numbers.h.

Referenced by crystals().

const unsigned Numbers::crystalsTCCArraySize_ = 100 * 108 [static, private]

Definition at line 147 of file Numbers.h.

Referenced by crystals().

const CaloGeometry * Numbers::geometry = 0 [static, private]

Definition at line 145 of file Numbers.h.

Referenced by eta(), and phi().

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

Definition at line 138 of file Numbers.h.

Referenced by initGeometry().

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

Definition at line 142 of file Numbers.h.

Referenced by getElectronicsMapping().

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

Definition at line 143 of file Numbers.h.

Referenced by nTTs().