CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
EcalNextToDeadChannelESProducer Class Reference
Inheritance diagram for EcalNextToDeadChannelESProducer:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Types

typedef std::shared_ptr< EcalNextToDeadChannelReturnType
 

Public Member Functions

 EcalNextToDeadChannelESProducer (const edm::ParameterSet &iConfig)
 
ReturnType produce (const EcalNextToDeadChannelRcd &iRecord)
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename Record >
void updateFromMayConsumes (unsigned int iIndex, const Record &iRecord)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Private Types

using HostType = edm::ESProductHost< EcalNextToDeadChannel, EcalChannelStatusRcd >
 

Private Member Functions

void setupNextToDeadChannels (const EcalChannelStatusRcd &, EcalNextToDeadChannel *)
 

Private Attributes

const edm::ESGetToken< EcalChannelStatus, EcalChannelStatusRcdchannelToken_
 
edm::ReusableObjectHolder< HostTypeholder_
 
int statusThreshold_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

Detailed Description

ESProducer to fill the EcalNextToDeadChannel record starting from EcalChannelStatus information

Author
Stefano Argiro
Date
18 May 2011

Definition at line 23 of file EcalNextToDeadChannelESProducer.cc.

Member Typedef Documentation

◆ HostType

Definition at line 34 of file EcalNextToDeadChannelESProducer.cc.

◆ ReturnType

Definition at line 27 of file EcalNextToDeadChannelESProducer.cc.

Constructor & Destructor Documentation

◆ EcalNextToDeadChannelESProducer()

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

Definition at line 43 of file EcalNextToDeadChannelESProducer.cc.

44  : channelToken_(setWhatProduced(this).consumesFrom<EcalChannelStatus, EcalChannelStatusRcd>()) {
45  statusThreshold_ = iConfig.getParameter<int>("channelStatusThresholdForDead");
46 }

References edm::ParameterSet::getParameter(), and statusThreshold_.

Member Function Documentation

◆ produce()

EcalNextToDeadChannelESProducer::ReturnType EcalNextToDeadChannelESProducer::produce ( const EcalNextToDeadChannelRcd iRecord)

Definition at line 48 of file EcalNextToDeadChannelESProducer.cc.

49  {
50  auto host = holder_.makeOrGet([]() { return new HostType; });
51 
52  host->ifRecordChanges<EcalChannelStatusRcd>(
53  iRecord, [this, h = host.get()](auto const& rec) { setupNextToDeadChannels(rec, h); });
54 
55  return host;
56 }

References holder_, query::host, edm::ReusableObjectHolder< T, Deleter >::makeOrGet(), and setupNextToDeadChannels().

◆ setupNextToDeadChannels()

void EcalNextToDeadChannelESProducer::setupNextToDeadChannels ( const EcalChannelStatusRcd chs,
EcalNextToDeadChannel rcd 
)
private

Definition at line 58 of file EcalNextToDeadChannelESProducer.cc.

59  {
60  rcd->clear();
61 
62  // Find channels next to dead ones and fill corresponding record
63 
64  EcalChannelStatus const& h = chs.get(channelToken_);
65 
66  for (int ieta = -EBDetId::MAX_IETA; ieta <= EBDetId::MAX_IETA; ++ieta) {
67  if (ieta == 0)
68  continue;
69  for (int iphi = EBDetId::MIN_IPHI; iphi <= EBDetId::MAX_IPHI; ++iphi) {
71  EBDetId detid(ieta, iphi);
72 
74  rcd->setValue(detid, 1);
75  };
76  }
77  } // for phi
78  } // for eta
79 
80  // endcap
81 
82  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
83  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
84  if (EEDetId::validDetId(iX, iY, 1)) {
85  EEDetId detid(iX, iY, 1);
86 
88  rcd->setValue(detid, 1);
89  };
90  }
91 
92  if (EEDetId::validDetId(iX, iY, -1)) {
93  EEDetId detid(iX, iY, -1);
94 
96  rcd->setValue(detid, 1);
97  };
98  }
99  } // for iy
100  } // for ix
101 }

References channelToken_, EcalCondObjectContainer< T >::clear(), edm::eventsetup::EventSetupRecordImplementation< T >::get(), LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, EcalTools::isNextToDeadFromNeighbours(), EEDetId::IX_MAX, EEDetId::IX_MIN, EEDetId::IY_MAX, EEDetId::IY_MIN, EBDetId::MAX_IETA, EBDetId::MAX_IPHI, EBDetId::MIN_IPHI, EcalCondObjectContainer< T >::setValue(), statusThreshold_, EBDetId::validDetId(), and EEDetId::validDetId().

Referenced by produce().

Member Data Documentation

◆ channelToken_

const edm::ESGetToken<EcalChannelStatus, EcalChannelStatusRcd> EcalNextToDeadChannelESProducer::channelToken_
private

Definition at line 38 of file EcalNextToDeadChannelESProducer.cc.

Referenced by setupNextToDeadChannels().

◆ holder_

edm::ReusableObjectHolder<HostType> EcalNextToDeadChannelESProducer::holder_
private

Definition at line 36 of file EcalNextToDeadChannelESProducer.cc.

Referenced by produce().

◆ statusThreshold_

int EcalNextToDeadChannelESProducer::statusThreshold_
private
EcalNextToDeadChannelESProducer::channelToken_
const edm::ESGetToken< EcalChannelStatus, EcalChannelStatusRcd > channelToken_
Definition: EcalNextToDeadChannelESProducer.cc:38
EcalNextToDeadChannelESProducer::statusThreshold_
int statusThreshold_
Definition: EcalNextToDeadChannelESProducer.cc:40
EcalNextToDeadChannelESProducer::setupNextToDeadChannels
void setupNextToDeadChannels(const EcalChannelStatusRcd &, EcalNextToDeadChannel *)
Definition: EcalNextToDeadChannelESProducer.cc:58
EcalTools::isNextToDeadFromNeighbours
static bool isNextToDeadFromNeighbours(const DetId &id, const EcalChannelStatus &chs, int chStatusThreshold)
same as isNextToDead, but will use information from the neighbour
Definition: EcalTools.cc:71
EBDetId
Definition: EBDetId.h:17
EcalNextToDeadChannelESProducer::HostType
edm::ESProductHost< EcalNextToDeadChannel, EcalChannelStatusRcd > HostType
Definition: EcalNextToDeadChannelESProducer.cc:34
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
EEDetId::IX_MIN
static const int IX_MIN
Definition: EEDetId.h:290
EEDetId::IY_MIN
static const int IY_MIN
Definition: EEDetId.h:294
EcalCondObjectContainer< EcalChannelStatusCode >
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
query.host
host
Definition: query.py:115
edm::ReusableObjectHolder::makeOrGet
std::shared_ptr< T > makeOrGet(F iFunc)
If there isn't an object already available, creates a new one using iFunc.
Definition: ReusableObjectHolder.h:126
EcalNextToDeadChannelESProducer::holder_
edm::ReusableObjectHolder< HostType > holder_
Definition: EcalNextToDeadChannelESProducer.cc:36
EBDetId::MAX_IPHI
static const int MAX_IPHI
Definition: EBDetId.h:137
EEDetId::IY_MAX
static const int IY_MAX
Definition: EEDetId.h:302
h
EEDetId
Definition: EEDetId.h:14
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
EcalCondObjectContainer::setValue
void setValue(const uint32_t id, const Item &item)
Definition: EcalCondObjectContainer.h:78
EcalChannelStatusRcd
Definition: EcalChannelStatusRcd.h:5
EEDetId::IX_MAX
static const int IX_MAX
Definition: EEDetId.h:298
EBDetId::validDetId
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.h:118
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
EEDetId::validDetId
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
edm::eventsetup::EventSetupRecordImplementation::get
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
Definition: EventSetupRecordImplementation.h:74
EBDetId::MAX_IETA
static const int MAX_IETA
Definition: EBDetId.h:136
EBDetId::MIN_IPHI
static const int MIN_IPHI
Definition: EBDetId.h:135
EcalCondObjectContainer::clear
void clear()
Definition: EcalCondObjectContainer.h:25