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 Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 

Public Member Functions

 EcalNextToDeadChannelESProducer (const edm::ParameterSet &iConfig)
 
ReturnType produce (const EcalNextToDeadChannelRcd &iRecord)
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
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

edm::ReusableObjectHolder< HostTypeholder_
 
int statusThreshold_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::ESProducer
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- 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 eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 

Detailed Description

ESProducer to fill the EcalNextToDeadChannel record starting from EcalChannelStatus information

Author
Stefano Argiro
Date
18 May 2011

Definition at line 26 of file EcalNextToDeadChannelESProducer.cc.

Member Typedef Documentation

Definition at line 43 of file EcalNextToDeadChannelESProducer.cc.

Definition at line 31 of file EcalNextToDeadChannelESProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 51 of file EcalNextToDeadChannelESProducer.cc.

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

51  {
52  //the following line is needed to tell the framework what
53  // data is being produced
54  setWhatProduced(this);
55 
56  statusThreshold_= iConfig.getParameter<int>("channelStatusThresholdForDead");
57 }
T getParameter(std::string const &) const
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115

Member Function Documentation

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

Definition at line 62 of file EcalNextToDeadChannelESProducer.cc.

References h, holder_, query::host, and setupNextToDeadChannels().

62  {
63 
64  auto host = holder_.makeOrGet([]() {
65  return new HostType;
66  });
67 
68  host->ifRecordChanges<EcalChannelStatusRcd>(iRecord,
69  [this,h=host.get()](auto const& rec) {
71  });
72 
73  return host;
74 }
host
Definition: query.py:115
void setupNextToDeadChannels(const EcalChannelStatusRcd &, EcalNextToDeadChannel *)
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
edm::ESProductHost< EcalNextToDeadChannel, EcalChannelStatusRcd > HostType
edm::ReusableObjectHolder< HostType > holder_
void EcalNextToDeadChannelESProducer::setupNextToDeadChannels ( const EcalChannelStatusRcd chs,
EcalNextToDeadChannel rcd 
)
private

Definition at line 79 of file EcalNextToDeadChannelESProducer.cc.

References EcalCondObjectContainer< T >::clear(), DEFINE_FWK_EVENTSETUP_MODULE, 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, EcalCondObjectContainer< T >::setValue(), statusThreshold_, EBDetId::validDetId(), and EEDetId::validDetId().

Referenced by produce().

80  {
81 
82  rcd->clear();
83 
84  // Find channels next to dead ones and fill corresponding record
85 
87  chs.get (h);
88 
89  for(int ieta=-EBDetId::MAX_IETA; ieta<=EBDetId::MAX_IETA; ++ieta) {
90  if(ieta==0) continue;
91  for(int iphi=EBDetId::MIN_IPHI; iphi<=EBDetId::MAX_IPHI; ++iphi) {
92  if (EBDetId::validDetId(ieta,iphi)) {
93 
94  EBDetId detid(ieta,iphi);
95 
97  *h,
99 
100 
101  rcd->setValue(detid,1);
102  };
103  }
104  } // for phi
105  } // for eta
106 
107  // endcap
108 
109  for(int iX=EEDetId::IX_MIN; iX<=EEDetId::IX_MAX ;++iX) {
110  for(int iY=EEDetId::IY_MIN; iY<=EEDetId::IY_MAX; ++iY) {
111 
112  if (EEDetId::validDetId(iX,iY,1)) {
113  EEDetId detid(iX,iY,1);
114 
116  *h,
118  rcd->setValue(detid,1);
119  };
120 
121  }
122 
123  if (EEDetId::validDetId(iX,iY,-1)) {
124  EEDetId detid(iX,iY,-1);
125 
127  *h,
129 
130  rcd->setValue(detid,1);
131  };
132  }
133  } // for iy
134  } // for ix
135 }
static const int MIN_IPHI
Definition: EBDetId.h:142
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
static const int IX_MIN
Definition: EEDetId.h:294
static const int IY_MIN
Definition: EEDetId.h:298
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.h:124
void setValue(const uint32_t id, const Item &item)
void get(HolderT &iHolder) const
static const int IX_MAX
Definition: EEDetId.h:302
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
static const int MAX_IPHI
Definition: EBDetId.h:144
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
static const int MAX_IETA
Definition: EBDetId.h:143
static const int IY_MAX
Definition: EEDetId.h:306

Member Data Documentation

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

Definition at line 45 of file EcalNextToDeadChannelESProducer.cc.

Referenced by produce().

int EcalNextToDeadChannelESProducer::statusThreshold_
private