CMS 3D CMS Logo

Public Member Functions | Private Attributes

EcalDQMStatusReader Class Reference

#include <EcalDQMStatusReader.h>

Inheritance diagram for EcalDQMStatusReader:
edm::EDAnalyzer

List of all members.

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 EcalDQMStatusReader (const edm::ParameterSet &ps)
virtual ~EcalDQMStatusReader ()

Private Attributes

bool verbose_

Detailed Description

Definition at line 23 of file EcalDQMStatusReader.h.


Constructor & Destructor Documentation

EcalDQMStatusReader::EcalDQMStatusReader ( const edm::ParameterSet ps)

Definition at line 32 of file EcalDQMStatusReader.cc.

References edm::ParameterSet::getUntrackedParameter(), and verbose_.

                                                                  {

  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);

}
virtual EcalDQMStatusReader::~EcalDQMStatusReader ( ) [inline, virtual]

Definition at line 28 of file EcalDQMStatusReader.h.

{};

Member Function Documentation

void EcalDQMStatusReader::analyze ( const edm::Event e,
const edm::EventSetup c 
) [inline, virtual]

Implements edm::EDAnalyzer.

Definition at line 30 of file EcalDQMStatusReader.h.

{};
void EcalDQMStatusReader::beginRun ( const edm::Run r,
const edm::EventSetup c 
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 38 of file EcalDQMStatusReader.cc.

References gather_cfg::cout, EcalBarrel, EcalCondTowerObjectContainer< T >::end(), EcalCondObjectContainer< T >::end(), edm::EventSetup::find(), EcalCondObjectContainer< T >::find(), EcalCondTowerObjectContainer< T >::find(), edm::EventSetup::get(), EcalDQMStatusDictionary::getCodes(), EcalDQMStatusDictionary::getDictionary(), patZpeak::handle, i, errorMatrix2Lands_multiChannel::id, Numbers::indexEE(), Numbers::initGeometry(), Numbers::iSC(), Numbers::iSM(), ecalpyutils::ism(), edm::ESHandleBase::isValid(), Numbers::iTT(), edm::ESHandle< T >::product(), Numbers::sEB(), Numbers::sEE(), EBDetId::SMCRYSTALMODE, EEDetId::validDetId(), EcalTrigTowerDetId::validDetId(), EcalScDetId::validDetId(), and verbose_.

                                                                          {

  Numbers::initGeometry(c, verbose_);

  std::vector<EcalDQMStatusDictionary::codeDef> dictionary;
  EcalDQMStatusDictionary::getDictionary( dictionary );

  const EcalDQMChannelStatus* channelStatus = 0;
  if ( c.find( edm::eventsetup::EventSetupRecordKey::makeKey< EcalDQMChannelStatusRcd >() ) ) {
    edm::ESHandle< EcalDQMChannelStatus > handle;
    c.get< EcalDQMChannelStatusRcd >().get(handle);
    if ( handle.isValid() ) channelStatus = handle.product();
  }

  const EcalDQMTowerStatus* towerStatus = 0;
  if ( c.find( edm::eventsetup::EventSetupRecordKey::makeKey< EcalDQMTowerStatusRcd >() ) ) {
    edm::ESHandle< EcalDQMTowerStatus > handle;
    c.get< EcalDQMTowerStatusRcd >().get(handle);
    if ( handle.isValid() ) towerStatus = handle.product();
  }

  // barrel
  for ( int ism=1; ism<=36; ism++ ) {
    for ( int ic=1; ic<=1700; ic++ ) {
      int jsm = Numbers::iSM(ism, EcalBarrel);
      EBDetId id(jsm, ic, EBDetId::SMCRYSTALMODE);
      if ( channelStatus ) {
        EcalDQMChannelStatus::const_iterator it = channelStatus->find( id.rawId() );
        if ( it != channelStatus->end() ) {
          if ( it->getStatusCode() != 0 ) {
            if ( verbose_ ) std::cout << "# EB:channel, ic=" << ic << " hi=" << id.hashedIndex() << " status=" << it->getStatusCode() << std::endl;
            std::vector<EcalDQMStatusDictionary::codeDef> codes;
            EcalDQMStatusDictionary::getCodes( codes, it->getStatusCode() );
            for ( unsigned int i=0; i<codes.size(); i++ ) {
              std::cout << "Crystal " << Numbers::sEB(ism) << " " << ic << " " << codes[i].desc << std::endl;
            }
          }
        }
      }
    }
  }

  for ( int ix=1; ix<=17; ix++ ) {
    for ( int iy=1; iy<=72; iy++ ) {
      if ( EcalTrigTowerDetId::validDetId(+1, EcalBarrel, ix, iy) ) {
        EcalTrigTowerDetId id(+1, EcalBarrel, ix, iy);
        if ( towerStatus ) {
          EcalDQMTowerStatus::const_iterator it = towerStatus->find( id.rawId() );
          if ( it != towerStatus->end() ) {
            if ( it->getStatusCode() != 0 ) {
              if ( verbose_ ) std::cout << "# EB:tower, tt=" << Numbers::iTT(id) << " hi=" << id.hashedIndex() << " status=" << it->getStatusCode() << std::endl;
              std::vector<EcalDQMStatusDictionary::codeDef> codes;
              EcalDQMStatusDictionary::getCodes( codes, it->getStatusCode() );
              for ( unsigned int i=0; i<codes.size(); i++ ) {
                std::cout << "TT " << Numbers::sEB(Numbers::iSM(id)) << " " << Numbers::iTT(id) << " " << codes[i].desc << std::endl;
              }
            }
          }
        }
      }
      if ( EcalTrigTowerDetId::validDetId(-1, EcalBarrel, ix, iy) ) {
        EcalTrigTowerDetId id(-1, EcalBarrel, ix, iy);
        if ( towerStatus ) {
          EcalDQMTowerStatus::const_iterator it = towerStatus->find( id.rawId() );
          if ( it != towerStatus->end() ) {
            if ( it->getStatusCode() != 0 ) {
              if ( verbose_ ) std::cout << "# EB:tower, tt=" << Numbers::iTT(id) << " hi=" << id.hashedIndex() << " status=" << it->getStatusCode() << std::endl;
              std::vector<EcalDQMStatusDictionary::codeDef> codes;
              EcalDQMStatusDictionary::getCodes( codes, it->getStatusCode() );
              for ( unsigned int i=0; i<codes.size(); i++ ) {
                std::cout << "TT " << Numbers::sEB(Numbers::iSM(id)) << " " << Numbers::iTT(id) << " " << codes[i].desc << std::endl;
              }
            }
          }
        }
      }
    }
  }

  // endcap
  for ( int ix=1; ix<=100; ix++ ) {
    for ( int iy=1; iy<=100; iy++ ) {
      if ( EEDetId::validDetId(ix, iy, +1) ) {
        EEDetId id(ix, iy, +1);
        if ( channelStatus ) {
          EcalDQMChannelStatus::const_iterator it = channelStatus->find( id.rawId() );
          if ( it != channelStatus->end() ) {
            if ( it->getStatusCode() != 0 ) {
              if ( verbose_ ) std::cout << "# EE:channel, " << Numbers::indexEE(Numbers::iSM(id), ix, iy) << " hi=" << id.hashedIndex() << " " << it->getStatusCode() << std::endl;
              std::vector<EcalDQMStatusDictionary::codeDef> codes;
              EcalDQMStatusDictionary::getCodes( codes, it->getStatusCode() );
              for ( unsigned int i=0; i<codes.size(); i++ ) {
                std::cout << "Crystal " << Numbers::sEE(Numbers::iSM(id)) << " " << Numbers::indexEE(Numbers::iSM(id), ix, iy) << " " << codes[i].desc << std::endl;
              }
            }
          }
        }
      }
      if ( EEDetId::validDetId(ix, iy, -1) ) {
        EEDetId id(ix, iy, -1);
        if ( channelStatus ) {
          EcalDQMChannelStatus::const_iterator it = channelStatus->find( id.rawId() );
          if ( it != channelStatus->end() ) {
            if ( it->getStatusCode() != 0 ) {
              if ( verbose_ ) std::cout << "# EE:channel, " << Numbers::indexEE(Numbers::iSM(id), ix, iy) << " hi=" << id.hashedIndex() << " " << it->getStatusCode() << std::endl;
              std::vector<EcalDQMStatusDictionary::codeDef> codes;
              EcalDQMStatusDictionary::getCodes( codes, it->getStatusCode() );
              for ( unsigned int i=0; i<codes.size(); i++ ) {
                std::cout << "Crystal " << Numbers::sEE(Numbers::iSM(id)) << " " << Numbers::indexEE(Numbers::iSM(id), ix, iy) << " " << codes[i].desc << std::endl;
              }
            }
          }
        }
      }
    }
  }

  for ( int ix=1; ix<=20; ix++ ) {
    for ( int iy=1; iy<=20; iy++ ) {
      if ( EcalScDetId::validDetId(ix, iy, +1) ) {
        EcalScDetId id(ix, iy, +1);
        if ( towerStatus ) {
          EcalDQMTowerStatus::const_iterator it = towerStatus->find( id.rawId() );
          if ( it != towerStatus->end() ) {
            if ( it->getStatusCode() != 0 ) {
              if ( verbose_ ) std::cout << "# EE:tower, " << Numbers::iSC(id) << " hi=" << id.hashedIndex() << " " << it->getStatusCode() << std::endl;
              std::vector<EcalDQMStatusDictionary::codeDef> codes;
              EcalDQMStatusDictionary::getCodes( codes, it->getStatusCode() );
              for ( unsigned int i=0; i<codes.size(); i++ ) {
                std::cout << "TT " << Numbers::sEE(Numbers::iSM(id)) << " " << Numbers::iSC(id) << " " << codes[i].desc << std::endl;
              }
            }
          }
        }
      }
      if ( EcalScDetId::validDetId(ix, iy, -1) ) {
        EcalScDetId id(ix, iy, -1);
        if ( towerStatus ) {
          EcalDQMTowerStatus::const_iterator it = towerStatus->find( id.rawId() );
          if ( it != towerStatus->end() ) {
            if ( it->getStatusCode() != 0 ) {
              if ( verbose_ ) std::cout << "# EE:tower, " << Numbers::iSC(id) << " hi=" << id.hashedIndex() << " " << it->getStatusCode() << std::endl;
              std::vector<EcalDQMStatusDictionary::codeDef> codes;
              EcalDQMStatusDictionary::getCodes( codes, it->getStatusCode() );
              for ( unsigned int i=0; i<codes.size(); i++ ) {
                std::cout << "TT " << Numbers::sEE(Numbers::iSM(id)) << " " << Numbers::iSC(id) << " " << codes[i].desc << std::endl;
              }
            }
          }
        }
      }
    }
  }

}

Member Data Documentation

Definition at line 36 of file EcalDQMStatusReader.h.

Referenced by beginRun(), and EcalDQMStatusReader().