CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalNextToDeadChannelESProducer.cc
Go to the documentation of this file.
1 
2 
3 #include "boost/shared_ptr.hpp"
13 
25 
26 public:
28 
29  typedef boost::shared_ptr<EcalNextToDeadChannel> ReturnType;
30 
32 
33 
34 
35 private:
36 
38 
39  // threshold above which a channel will be considered "dead"
41 
43 };
44 
46  //the following line is needed to tell the framework what
47  // data is being produced
48  setWhatProduced(this,
50 
51  statusThreshold_= iConfig.getParameter<int>("channelStatusThresholdForDead");
52 
54 }
55 
56 
57 
60 
61  return returnRcd_ ;
62 }
63 
64 
65 void
68 
69 
70 
72 
73  // Find channels next to dead ones and fill corresponding record
74 
76  chs.get (h);
77 
78  for(int ieta=-EBDetId::MAX_IETA; ieta<=EBDetId::MAX_IETA; ++ieta) {
79  if(ieta==0) continue;
80  for(int iphi=EBDetId::MIN_IPHI; iphi<=EBDetId::MAX_IPHI; ++iphi) {
81  if (EBDetId::validDetId(ieta,iphi)) {
82 
83  EBDetId detid(ieta,iphi);
84 
86  *h,
88 
89 
90  rcd->setValue(detid,1);
91  };
92  }
93  } // for phi
94  } // for eta
95 
96  // endcap
97 
98  for(int iX=EEDetId::IX_MIN; iX<=EEDetId::IX_MAX ;++iX) {
99  for(int iY=EEDetId::IY_MIN; iY<=EEDetId::IY_MAX; ++iY) {
100 
101  if (EEDetId::validDetId(iX,iY,1)) {
102  EEDetId detid(iX,iY,1);
103 
105  *h,
107  rcd->setValue(detid,1);
108  };
109 
110  }
111 
112  if (EEDetId::validDetId(iX,iY,-1)) {
113  EEDetId detid(iX,iY,-1);
114 
116  *h,
118 
119  rcd->setValue(detid,1);
120  };
121  }
122  } // for iy
123  } // for ix
124 
125  returnRcd_.reset(rcd);
126 }
127 
128 //define this as a plug-in
130 
131 
132 
133 
134 
135 
136 
137 
138 // Configure (x)emacs for this file ...
139 // Local Variables:
140 // mode:c++
141 // compile-command: "cd .. ; scram b"
142 // End:
T getParameter(std::string const &) const
depends_on::OneHolder< T, TDependsOnRecord > dependsOn(void(T::*iT)(const TDependsOnRecord &))
static const int MIN_IPHI
Definition: EBDetId.h:142
EcalNextToDeadChannelESProducer(const edm::ParameterSet &iConfig)
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
boost::shared_ptr< EcalNextToDeadChannel > ReturnType
EcalCondObjectContainer< uint8_t > EcalNextToDeadChannel
static const int IX_MIN
Definition: EEDetId.h:294
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
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 findNextToDeadChannelsCallback(const EcalChannelStatusRcd &chs)
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
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
static const int IY_MAX
Definition: EEDetId.h:306
ReturnType produce(const EcalNextToDeadChannelRcd &iRecord)