CMS 3D CMS Logo

Public Member Functions

CaloGenericDetId Class Reference

#include <CaloGenericDetId.h>

Inheritance diagram for CaloGenericDetId:
DetId

List of all members.

Public Member Functions

 CaloGenericDetId (uint32_t rawid)
 CaloGenericDetId (const DetId &id)
 CaloGenericDetId (DetId::Detector iDet, int iSub, uint32_t iDenseIndex)
uint32_t denseIndex () const
bool isCalo () const
bool isCaloTower () const
bool isCastor () const
bool isEB () const
bool isEcal () const
bool isEE () const
bool isES () const
bool isHcal () const
bool isZDC () const
uint32_t sizeForDenseIndexing () const
bool validDetId () const

Detailed Description

Definition at line 12 of file CaloGenericDetId.h.


Constructor & Destructor Documentation

CaloGenericDetId::CaloGenericDetId ( uint32_t  rawid) [inline]

Definition at line 16 of file CaloGenericDetId.h.

: DetId( rawid ) {}
CaloGenericDetId::CaloGenericDetId ( const DetId id) [inline]

Definition at line 18 of file CaloGenericDetId.h.

: DetId ( id ) {}
CaloGenericDetId::CaloGenericDetId ( DetId::Detector  iDet,
int  iSub,
uint32_t  iDenseIndex 
)

Member Function Documentation

uint32_t CaloGenericDetId::denseIndex ( ) const

Definition at line 24 of file CaloGenericDetId.cc.

References dtNoiseDBValidation_cfg::cerr, DetId::det(), Exception, DetId::Hcal, isCaloTower(), isCastor(), isEB(), isEE(), isES(), isZDC(), and DetId::rawId().

Referenced by CaloSubdetectorGeometry::indexFor(), CaloTowerGeometry::newCell(), ZdcGeometry::newCell(), and CastorGeometry::newCell().

{
  if (det() == DetId::Hcal) { 
    std::cerr << "No support for HB/HE/HO/HF in CaloGenericDetId" << std::endl;
    cms::Exception("No support");
  } 

   return ( isEB() ? EBDetId( rawId() ).denseIndex() :
            ( isEE() ? EEDetId( rawId() ).denseIndex() :
              ( isES() ? ESDetId( rawId() ).denseIndex() :
                  ( isZDC() ? HcalZDCDetId( rawId() ).denseIndex() :
                    ( isCastor() ? HcalCastorDetId( rawId() ).denseIndex() :
                      ( isCaloTower() ? CaloTowerDetId( rawId() ).denseIndex() : ~0 ) ) ) ) ) ) ;
}
bool CaloGenericDetId::isCalo ( ) const [inline]

Definition at line 34 of file CaloGenericDetId.h.

References DetId::Calo, and DetId::det().

Referenced by isCaloTower(), isCastor(), and isZDC().

{ return det() == DetId::Calo ; }
bool CaloGenericDetId::isCaloTower ( ) const [inline]
bool CaloGenericDetId::isCastor ( ) const [inline]
bool CaloGenericDetId::isEB ( ) const [inline]

Definition at line 31 of file CaloGenericDetId.h.

References isEcal(), EBDetId::Subdet, and DetId::subdetId().

Referenced by CaloGenericDetId(), denseIndex(), sizeForDenseIndexing(), and validDetId().

{ return isEcal() && subdetId() == EBDetId::Subdet ; }
bool CaloGenericDetId::isEcal ( ) const [inline]

Definition at line 30 of file CaloGenericDetId.h.

References DetId::det(), and DetId::Ecal.

Referenced by isEB(), isEE(), and isES().

{ return det() == DetId::Ecal ; }
bool CaloGenericDetId::isEE ( ) const [inline]

Definition at line 32 of file CaloGenericDetId.h.

References isEcal(), EEDetId::Subdet, and DetId::subdetId().

Referenced by CaloGenericDetId(), denseIndex(), sizeForDenseIndexing(), and validDetId().

{ return isEcal() && subdetId() == EEDetId::Subdet ; }
bool CaloGenericDetId::isES ( ) const [inline]
bool CaloGenericDetId::isHcal ( ) const [inline]

Definition at line 35 of file CaloGenericDetId.h.

References DetId::det(), and DetId::Hcal.

{ return det() == DetId::Hcal ; }
bool CaloGenericDetId::isZDC ( ) const [inline]
uint32_t CaloGenericDetId::sizeForDenseIndexing ( ) const
bool CaloGenericDetId::validDetId ( ) const

Definition at line 56 of file CaloGenericDetId.cc.

References dtNoiseDBValidation_cfg::cerr, HcalZDCDetId::channel(), DetId::det(), Exception, DetId::Hcal, EBDetId::ieta(), CaloTowerDetId::ieta(), EBDetId::iphi(), CaloTowerDetId::iphi(), isCaloTower(), isCastor(), isEB(), isEE(), isES(), isZDC(), EEDetId::ix(), EEDetId::iy(), HcalCastorDetId::module(), ESDetId::plane(), DetId::rawId(), HcalCastorDetId::section(), HcalZDCDetId::section(), HcalCastorDetId::sector(), ESDetId::six(), ESDetId::siy(), ESDetId::strip(), ESDetId::zside(), HcalCastorDetId::zside(), and EEDetId::zside().

{
   bool returnValue ( false ) ;
   if( isEB() )
   {
      const EBDetId ebid ( rawId() ) ;
      returnValue = EBDetId::validDetId( ebid.ieta(),
                                         ebid.iphi() ) ;
   }
   else
   {
      if( isEE() )
      {
         const EEDetId eeid ( rawId() ) ;
         returnValue = EEDetId::validDetId( eeid.ix(), 
                                            eeid.iy(),
                                            eeid.zside() ) ;
      }
      else
      {
         if( isES() )
         {
            const ESDetId esid ( rawId() ) ;
            returnValue = ESDetId::validDetId( esid.strip(),
                                               esid.six(),
                                               esid.siy(), 
                                               esid.plane(),
                                               esid.zside() ) ;
         }
         else
         {
           if (det() == DetId::Hcal) { 
             std::cerr << "No support for HB/HE/HO/HF in CaloGenericDetId" << std::endl;
             cms::Exception("No support");

             returnValue = false;
           }
           else
             {
               if( isZDC() )
                 {
                   const HcalZDCDetId zdid ( rawId() ) ;
                   returnValue = HcalZDCDetId::validDetId( zdid.section(),
                                                           zdid.channel()    ) ;
                 }
               else
               {
                  if( isCastor() )
                  {
                     const HcalCastorDetId zdid ( rawId() ) ;
                     returnValue = HcalCastorDetId::validDetId( zdid.section(),
                                                                zdid.zside()>0,
                                                                zdid.sector(),
                                                                zdid.module() ) ;
                  }
                  else
                  {
                     if( isCaloTower() )
                     {
                        const CaloTowerDetId ctid ( rawId() ) ;
                        returnValue = CaloTowerDetId::validDetId( ctid.ieta(),
                                                                  ctid.iphi() ) ;
                     }
                  }
               }
            }
         }
      }
   }
   return returnValue ;
}