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 
26 
27 public:
29 
30  typedef boost::shared_ptr<EcalNextToDeadChannel> ReturnType;
31 
33 
34 
35 
36 private:
37 
39 
40  // threshold above which a channel will be considered "dead"
42 
44 };
45 
47  //the following line is needed to tell the framework what
48  // data is being produced
49  setWhatProduced(this,
51 
52  statusThreshold_= iConfig.getParameter<int>("channelStatusThresholdForDead");
53 
55 }
56 
57 
58 
61 
62  return returnRcd_ ;
63 }
64 
65 
66 void
69 
70 
71 
73 
74  // Find channels next to dead ones and fill corresponding record
75 
77  chs.get (h);
78 
79  for(int ieta=-EBDetId::MAX_IETA; ieta<=EBDetId::MAX_IETA; ++ieta) {
80  if(ieta==0) continue;
81  for(int iphi=EBDetId::MIN_IPHI; iphi<=EBDetId::MAX_IPHI; ++iphi) {
82  if (EBDetId::validDetId(ieta,iphi)) {
83 
84  EBDetId detid(ieta,iphi);
85 
87  *h,
89 
90 
91  rcd->setValue(detid,1);
92  };
93  }
94  } // for phi
95  } // for eta
96 
97  // endcap
98 
99  for(int iX=EEDetId::IX_MIN; iX<=EEDetId::IX_MAX ;++iX) {
100  for(int iY=EEDetId::IY_MIN; iY<=EEDetId::IY_MAX; ++iY) {
101 
102  if (EEDetId::validDetId(iX,iY,1)) {
103  EEDetId detid(iX,iY,1);
104 
106  *h,
108  rcd->setValue(detid,1);
109  };
110 
111  }
112 
113  if (EEDetId::validDetId(iX,iY,-1)) {
114  EEDetId detid(iX,iY,-1);
115 
117  *h,
119 
120  rcd->setValue(detid,1);
121  };
122  }
123  } // for iy
124  } // for ix
125 
126  returnRcd_.reset(rcd);
127 }
128 
129 //define this as a plug-in
131 
132 
133 
134 
135 
136 
137 
138 
139 // Configure (x)emacs for this file ...
140 // Local Variables:
141 // mode:c++
142 // compile-command: "cd .. ; scram b"
143 // End:
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.cc:59
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:121
EcalNextToDeadChannelESProducer(const edm::ParameterSet &iConfig)
boost::shared_ptr< EcalNextToDeadChannel > ReturnType
EcalCondObjectContainer< uint8_t > EcalNextToDeadChannel
static const int IX_MIN
Definition: EEDetId.h:271
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.cc:562
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
static const int IY_MIN
Definition: EEDetId.h:275
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:279
static bool isNextToDeadFromNeighbours(const DetId &id, const EcalChannelStatus &chs, int chStatusThreshold)
same as isNextToDead, but will use information from the neighbour
Definition: EcalTools.cc:72
static const int MAX_IPHI
Definition: EBDetId.h:123
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
static const int MAX_IETA
Definition: EBDetId.h:122
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:56
static const int IY_MAX
Definition: EEDetId.h:283
ReturnType produce(const EcalNextToDeadChannelRcd &iRecord)