CMS 3D CMS Logo

Static Public Member Functions

DetIdInfo Class Reference

#include <DetIdInfo.h>

List of all members.

Static Public Member Functions

static std::string info (const DetId &)
static std::string info (const std::vector< DetId > &)
static std::string info (const std::set< DetId > &)

Detailed Description

Description: Helper class to get human readable informationa about given DetId

Definition at line 15 of file DetIdInfo.h.


Member Function Documentation

std::string DetIdInfo::info ( const DetId id) [static]

Definition at line 28 of file DetIdInfo.cc.

References DetId::Calo, CSCDetId::chamber(), MuonSubdetId::CSC, HcalDetId::depth(), MuonSubdetId::DT, DetId::Ecal, EcalBarrel, EcalEndcap, EcalLaserPnDiode, EcalPreshower, EcalTriggerTower, CSCDetId::endcap(), DetId::Hcal, HcalBarrel, HcalEmpty, HcalEndcap, HcalForward, HcalOther, HcalOuter, HcalTriggerTower, EEDetId::ic(), EBDetId::ieta(), CaloTowerDetId::ieta(), HcalDetId::ieta(), HcalDetId::iphi(), EBDetId::iphi(), CaloTowerDetId::iphi(), EEDetId::iquadrant(), EEDetId::isc(), EEDetId::ix(), EEDetId::iy(), TIBDetId::layer(), TOBDetId::layer(), PXBDetId::layer(), CSCDetId::layer(), RPCDetId::layer(), DetId::Muon, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, RPCDetId::region(), RPCDetId::ring(), CSCDetId::ring(), RPCDetId::roll(), MuonSubdetId::RPC, DTChamberId::sector(), RPCDetId::sector(), RPCDetId::station(), DTChamberId::station(), CSCDetId::station(), HcalDetId::subdet(), RPCDetId::subsector(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, EBDetId::tower_ieta(), EBDetId::tower_iphi(), DetId::Tracker, TIDDetId::wheel(), DTChamberId::wheel(), and TECDetId::wheel().

Referenced by info().

                                         {
   std::ostringstream oss;
   
   oss << "DetId: " << id.rawId() << "\n";
   
   switch ( id.det() ) {
    
     case DetId::Tracker:
       switch ( id.subdetId() ) {
        case StripSubdetector::TIB:
             {
               oss <<"TIB "<<TIBDetId(id).layer();
             }
           break;
        case StripSubdetector::TOB:
             {
               oss <<"TOB "<<TOBDetId(id).layer();
             }
           break;
        case StripSubdetector::TEC:
             {
               oss <<"TEC "<<TECDetId(id).wheel();
             }
           break;
        case StripSubdetector::TID:
             {
               oss <<"TID "<<TIDDetId(id).wheel();
             }
           break;
        case (int) PixelSubdetector::PixelBarrel:
             {
               oss <<"PixBarrel "<< PXBDetId(id).layer();
             }
           break;
        case (int) PixelSubdetector::PixelEndcap:
             {
               oss <<"PixEndcap "<< PXBDetId(id).layer();
             }
           break;
         }
        break;

    case DetId::Muon:
      switch ( id.subdetId() ) {
       case MuonSubdetId::DT:
           { 
              DTChamberId detId(id.rawId());
              oss << "DT chamber (wheel, station, sector): "
                << detId.wheel() << ", "
                << detId.station() << ", "
                << detId.sector();
           }
         break;
       case MuonSubdetId::CSC:
           {
              CSCDetId detId(id.rawId());
              oss << "CSC chamber (endcap, station, ring, chamber, layer): "
                << detId.endcap() << ", "
                << detId.station() << ", "
                << detId.ring() << ", "
                << detId.chamber() << ", "
                << detId.layer();
           }
         break;
       case MuonSubdetId::RPC:
           { 
              RPCDetId detId(id.rawId());
              oss << "RPC chamber ";
              switch ( detId.region() ) {
               case 0:
                 oss << "/ barrel / (wheel, station, sector, layer, subsector, roll): "
                   << detId.ring() << ", "
                   << detId.station() << ", "
                   << detId.sector() << ", "
                   << detId.layer() << ", "
                   << detId.subsector() << ", "
                   << detId.roll();
                 break;
               case 1:
                 oss << "/ forward endcap / (wheel, station, sector, layer, subsector, roll): "
                   << detId.ring() << ", "
                   << detId.station() << ", "
                   << detId.sector() << ", "
                   << detId.layer() << ", "
                   << detId.subsector() << ", "
                   << detId.roll();
                 break;
               case -1:
                 oss << "/ backward endcap / (wheel, station, sector, layer, subsector, roll): "
                   << detId.ring() << ", "
                   << detId.station() << ", "
                   << detId.sector() << ", "
                   << detId.layer() << ", "
                   << detId.subsector() << ", "
                   << detId.roll();
                 break;
              }
           }
         break;
      }
      break;
    
    case DetId::Calo:
        {
           CaloTowerDetId detId( id.rawId() );
           oss << "CaloTower (ieta, iphi): "
             << detId.ieta() << ", "
             << detId.iphi();
        }
      break;
    
    case DetId::Ecal:
      switch ( id.subdetId() ) {
       case EcalBarrel:
           {
              EBDetId detId(id);
              oss << "EcalBarrel (ieta, iphi, tower_ieta, tower_iphi): "
                << detId.ieta() << ", "
                << detId.iphi() << ", "
                << detId.tower_ieta() << ", "
                << detId.tower_iphi();
           }
         break;
       case EcalEndcap:
           {
              EEDetId detId(id);
              oss << "EcalEndcap (ix, iy, SuperCrystal, crystal, quadrant): "
                << detId.ix() << ", "
                << detId.iy() << ", "
                << detId.isc() << ", "
                << detId.ic() << ", "
                << detId.iquadrant();
           }
         break;
       case EcalPreshower:
         oss << "EcalPreshower";
         break;
       case EcalTriggerTower:
         oss << "EcalTriggerTower";
         break;
       case EcalLaserPnDiode:
         oss << "EcalLaserPnDiode";
         break;
      }
      break;
      
    case DetId::Hcal:
        {
           HcalDetId detId(id);
           switch ( detId.subdet() ) {
            case HcalEmpty:
              oss << "HcalEmpty ";
              break;
            case HcalBarrel:
              oss << "HcalBarrel ";
              break;
            case HcalEndcap:
              oss << "HcalEndcap ";
              break;
            case HcalOuter:
              oss << "HcalOuter ";
              break;
            case HcalForward:
              oss << "HcalForward ";
              break;
            case HcalTriggerTower:
              oss << "HcalTriggerTower ";
              break;
            case HcalOther:
              oss << "HcalOther ";
              break;
           }
           oss << "(ieta, iphi, depth):"
             << detId.ieta() << ", "
             << detId.iphi() << ", "
             << detId.depth();
        }
      break;
    default :;
   }
   return oss.str();
}
std::string DetIdInfo::info ( const std::vector< DetId > &  idSet) [static]

Definition at line 222 of file DetIdInfo.cc.

References info(), AlCaHLTBitMon_QueryRunRegistry::string, and runonSM::text.

                                                       {
   std::string text;
   for(std::vector<DetId>::const_iterator id = idSet.begin(); id != idSet.end(); id++)
     {
        text += info(*id);
        text += "\n";
     }
   return text;
}
std::string DetIdInfo::info ( const std::set< DetId > &  idSet) [static]

Definition at line 212 of file DetIdInfo.cc.

References info(), AlCaHLTBitMon_QueryRunRegistry::string, and runonSM::text.

                                                    {
   std::string text;
   for(std::set<DetId>::const_iterator id = idSet.begin(); id != idSet.end(); id++)
     {
        text += info(*id);
        text += "\n";
     }
   return text;
}