17 static const unsigned maxTableSize(100);
20 MESet(_fullPath, _otype, _btype, _kind),
28 throw_(
"Unsupported MonitorElement kind");
39 throw_(
"MESetChannel configured with wrong binning type");
43 MESetChannel::MESetChannel(MESetChannel
const& _orig) :
45 meTable_(_orig.meTable_)
49 MESetChannel::~MESetChannel()
54 MESetChannel::operator=(MESet
const& _rhs)
56 MESetChannel
const* pRhs(dynamic_cast<MESetChannel const*>(&_rhs));
57 if(pRhs) meTable_ = pRhs->meTable_;
65 if(_path !=
"")
path_ = _path;
66 MESet*
copy(
new MESetChannel(*
this));
98 dqmStore_->rmdir(
path_.substr(0,
path_.find_last_of(
'/')));
107 unsigned iME(preparePlot_(getIndex_(_id)));
108 if(iME ==
unsigned(-1))
return;
111 mes_[iME]->Fill(0.5, _w);
119 unsigned iME(preparePlot_(getIndex_(_id)));
120 if(iME ==
unsigned(-1))
return;
123 mes_[iME]->Fill(0.5, _w);
127 MESetChannel::setBinContent(
DetId const& _id,
double _content)
131 unsigned iME(preparePlot_(getIndex_(_id)));
132 if(iME ==
unsigned(-1))
return;
135 mes_[iME]->setBinContent(1, _content);
143 unsigned iME(preparePlot_(getIndex_(_id)));
144 if(iME ==
unsigned(-1))
return;
147 mes_[iME]->setBinContent(1, _content);
151 MESetChannel::setBinError(
DetId const& _id,
double _error)
155 unsigned iME(preparePlot_(getIndex_(_id)));
156 if(iME ==
unsigned(-1))
return;
159 mes_[iME]->setBinError(1, _error);
167 unsigned iME(preparePlot_(getIndex_(_id)));
168 if(iME ==
unsigned(-1))
return;
171 mes_[iME]->setBinError(1, _error);
175 MESetChannel::setBinEntries(
DetId const& _id,
double _entries)
179 unsigned iME(preparePlot_(getIndex_(_id)));
180 if(iME ==
unsigned(-1))
return;
183 mes_[iME]->setBinEntries(1, _entries);
191 unsigned iME(preparePlot_(getIndex_(_id)));
192 if(iME ==
unsigned(-1))
return;
195 mes_[iME]->setBinEntries(1, _entries);
199 MESetChannel::getBinContent(
DetId const& _id,
int)
const
201 if(!active_)
return 0.;
203 unsigned iME(findPlot_(getIndex_(_id)));
204 if(iME ==
unsigned(-1))
return 0.;
207 return mes_[iME]->getBinContent(1);
213 if(!active_)
return 0.;
215 unsigned iME(findPlot_(getIndex_(_id)));
216 if(iME ==
unsigned(-1))
return 0.;
219 return mes_[iME]->getBinContent(1);
223 MESetChannel::getBinError(
DetId const& _id,
int)
const
225 if(!active_)
return 0.;
227 unsigned iME(findPlot_(getIndex_(_id)));
228 if(iME ==
unsigned(-1))
return 0.;
231 return mes_[iME]->getBinError(1);
237 if(!active_)
return 0.;
239 unsigned iME(findPlot_(getIndex_(_id)));
240 if(iME ==
unsigned(-1))
return 0.;
243 return mes_[iME]->getBinError(1);
247 MESetChannel::getBinEntries(
DetId const& _id,
int)
const
249 if(!active_)
return 0.;
251 unsigned iME(findPlot_(getIndex_(_id)));
252 if(iME ==
unsigned(-1))
return 0.;
255 return mes_[iME]->getBinEntries(1);
261 if(!active_)
return 0.;
263 unsigned iME(findPlot_(getIndex_(_id)));
264 if(iME ==
unsigned(-1))
return 0.;
267 return mes_[iME]->getBinEntries(1);
275 if(_content == 0. && _entries == 0.){
278 dqmStore_->rmdir(
path_);
282 unsigned nME(mes_.size());
283 for(
unsigned iME(0); iME < nME; iME++){
284 mes_[iME]->setBinContent(1, _content);
285 mes_[iME]->setBinError(1, _err);
287 mes_[iME]->setBinEntries(1, _entries);
292 MESetChannel::checkDirectory()
const
296 vector<MonitorElement*> storeMEs(dqmStore_->getContents(
path_));
298 unsigned nME(storeMEs.size());
299 for(
unsigned iME(0); iME < nME; iME++){
301 if(
find(mes_.begin(), mes_.end(), me) != mes_.end())
continue;
306 meTable_[id] = mes_.size() - 1;
312 MESetChannel::preparePlot_(uint32_t _rawId)
const
314 if(_rawId == 0)
return -1;
316 std::map<uint32_t, unsigned>::iterator tableItr(meTable_.find(_rawId));
317 if(tableItr == meTable_.end()){
318 if(meTable_.size() == maxTableSize){
325 dqmStore_->setCurrentFolder(
path_);
329 me = dqmStore_->book1D(
name,
name, 1, 0., 1.);
333 dqmStore_->setCurrentFolder(
pwd);
337 tableItr = meTable_.insert(std::pair<uint32_t, unsigned>(_rawId, mes_.size() - 1)).first;
340 if(tableItr == meTable_.end()){
345 return tableItr->second;
349 MESetChannel::findPlot_(uint32_t _rawId)
const
351 if(_rawId == 0)
return -1;
353 std::map<uint32_t, unsigned>::const_iterator tableItr(meTable_.find(_rawId));
355 if(tableItr == meTable_.end())
return -1;
357 return tableItr->second;
361 MESetChannel::getIndex_(
DetId const& _id)
const
370 return EcalElectronicsId(pnid.iDCCId(), pnid.iPnId() < 6 ? 69 : 70, 1, (pnid.iPnId() - 1) % 5 + 1).
rawId();
virtual void clear() const
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
EcalElectronicsMapping const * getElectronicsMap()
unsigned tccId(DetId const &)
int towerId() const
get the tower id
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
bool isEndcapTTId(DetId const &)
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
tuple path
else: Piece not in the list, fine.
const T & max(const T &a, const T &b)
EcalTrigTowerConstituentsMap const * getTrigTowerMap()
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
uint32_t idFromName(std::string const &)
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
std::string channelName(uint32_t, BinningType _btype=kDCC)
bool isEcalScDetId(DetId const &)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
bool isCrystalId(DetId const &)
virtual MESet & operator=(MESet const &)
unsigned dccId(DetId const &)
void reset(double vett[256])
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...