CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

EcalNextToDeadChannelESProducer Class Reference

Inheritance diagram for EcalNextToDeadChannelESProducer:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

List of all members.

Public Types

typedef boost::shared_ptr
< EcalNextToDeadChannel
ReturnType

Public Member Functions

 EcalNextToDeadChannelESProducer (const edm::ParameterSet &iConfig)
ReturnType produce (const EcalNextToDeadChannelRcd &iRecord)

Private Member Functions

void findNextToDeadChannelsCallback (const EcalChannelStatusRcd &chs)

Private Attributes

ReturnType returnRcd_
int statusThreshold_

Detailed Description

ESProducer to fill the EcalNextToDeadChannel record starting from EcalChannelStatus information

Author:
Stefano Argiro
Version:
Id:
EcalNextToDeadChannelESProducer.cc,v 1.1 2011/05/19 14:38:28 argiro Exp
Date:
18 May 2011

Definition at line 25 of file EcalNextToDeadChannelESProducer.cc.


Member Typedef Documentation

Definition at line 30 of file EcalNextToDeadChannelESProducer.cc.


Constructor & Destructor Documentation

EcalNextToDeadChannelESProducer::EcalNextToDeadChannelESProducer ( const edm::ParameterSet iConfig)

Member Function Documentation

void EcalNextToDeadChannelESProducer::findNextToDeadChannelsCallback ( const EcalChannelStatusRcd chs) [private]

Definition at line 68 of file EcalNextToDeadChannelESProducer.cc.

References cond::rpcobgas::detid, edm::eventsetup::EventSetupRecord::get(), h, EcalTools::isNextToDeadFromNeighbours(), EEDetId::IX_MAX, EEDetId::IX_MIN, EEDetId::IY_MAX, EEDetId::IY_MIN, EBDetId::MAX_IETA, EBDetId::MAX_IPHI, EBDetId::MIN_IPHI, returnRcd_, EcalCondObjectContainer< T >::setValue(), statusThreshold_, EEDetId::validDetId(), and EBDetId::validDetId().

Referenced by EcalNextToDeadChannelESProducer().

                                                               {

  

  EcalNextToDeadChannel* rcd= new EcalNextToDeadChannel;

  // Find channels next to dead ones and fill corresponding record

  edm::ESHandle <EcalChannelStatus> h;
  chs.get (h);
  
  for(int ieta=-EBDetId::MAX_IETA; ieta<=EBDetId::MAX_IETA; ++ieta) {
    if(ieta==0) continue;
    for(int iphi=EBDetId::MIN_IPHI; iphi<=EBDetId::MAX_IPHI; ++iphi) {
      if (EBDetId::validDetId(ieta,iphi)) {
        
        EBDetId detid(ieta,iphi);
        
        if (EcalTools::isNextToDeadFromNeighbours(detid,
                                                  *h,
                                                  statusThreshold_)){
          
          
          rcd->setValue(detid,1);
        };
      }
    } // for phi
  } // for eta
  
  // endcap

  for(int iX=EEDetId::IX_MIN; iX<=EEDetId::IX_MAX ;++iX) {
    for(int iY=EEDetId::IY_MIN; iY<=EEDetId::IY_MAX; ++iY) {
  
      if (EEDetId::validDetId(iX,iY,1)) {
        EEDetId detid(iX,iY,1);

        if (EcalTools::isNextToDeadFromNeighbours(detid,
                                                  *h,
                                                  statusThreshold_)){
          rcd->setValue(detid,1);
        };
        
      }

      if (EEDetId::validDetId(iX,iY,-1)) {
        EEDetId detid(iX,iY,-1);

        if (EcalTools::isNextToDeadFromNeighbours(detid,
                                                  *h,
                                                  statusThreshold_)){
     
          rcd->setValue(detid,1);
        };
      }
    } // for iy
  } // for ix
  
  returnRcd_.reset(rcd);
}
EcalNextToDeadChannelESProducer::ReturnType EcalNextToDeadChannelESProducer::produce ( const EcalNextToDeadChannelRcd iRecord)

Definition at line 60 of file EcalNextToDeadChannelESProducer.cc.

References returnRcd_.

                                                                               {
  
  return returnRcd_ ;
}

Member Data Documentation