CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes
EcalDQMBinningService Class Reference

#include <EcalDQMBinningService.h>

Classes

struct  AxisSpecs
 

Public Types

enum  BinningType {
  kCrystal, kTriggerTower, kSuperCrystal, kTCC,
  kDCC, kProjEta, kProjPhi, kUser,
  kReport, kTrend, nBinType
}
 
enum  Constants {
  nPlotType = kEcal + 1, nPresetBinnings = kProjPhi + 1, nDCC = 54, nDCCMEM = 44,
  nTCC = 108, kEEmTCCLow = 0, kEEmTCCHigh = 35, kEEpTCCLow = 72,
  kEEpTCCHigh = 107, kEBTCCLow = 36, kEBTCCHigh = 71, nEBSMEta = 85,
  nEBSMPhi = 20, nEBSMBins = nEBSMEta * nEBSMPhi, nEESMX = 40, nEESMY = 40,
  nEESMBins = nEESMX * nEESMY, nEESMXExt = 45, nEESMBinsExt = nEESMXExt * nEESMY, nEBEtaBins = 34,
  nEEEtaBins = 20, nPhiBins = 36
}
 
enum  ObjectType {
  kEB, kEBMEM, kEE, kEEm,
  kEEp, kEEMEM, kSM, kSMMEM,
  kEcal, kEcal2P, kEcal3P, kEcalMEM2P,
  kChannel, nObjType
}
 

Public Member Functions

std::string channelName (uint32_t, BinningType _btype=kDCC) const
 
 EcalDQMBinningService (const edm::ParameterSet &, edm::ActivityRegistry &)
 
std::pair< unsigned,
std::vector< int > > 
findBins (ObjectType, BinningType, const DetId &) const
 
std::pair< unsigned,
std::vector< int > > 
findBins (ObjectType, BinningType, const EcalElectronicsId &) const
 
std::pair< unsigned,
std::vector< int > > 
findBins (ObjectType, BinningType, unsigned) const
 
std::pair< unsigned,
std::vector< int > > 
findBinsNoMap (ObjectType, BinningType, const DetId &) const
 
std::pair< unsigned,
std::vector< int > > 
findBinsNoMap (ObjectType, BinningType, const EcalElectronicsId &) const
 
unsigned findOffset (ObjectType, const DetId &) const
 
unsigned findOffset (ObjectType, const EcalElectronicsId &) const
 
unsigned findOffset (ObjectType, BinningType, unsigned) const
 
const std::vector< int > * getBinMap (ObjectType &, BinningType &) const
 
std::vector< AxisSpecsgetBinning (ObjectType, BinningType, bool _isMap=true, unsigned _objOffset=0) const
 
uint32_t idFromName (std::string const &) const
 
ObjectType objectFromOffset (ObjectType, unsigned) const
 
void postBeginRun (const edm::Run &, const edm::EventSetup &)
 
int smOffsetBins (ObjectType, BinningType, unsigned) const
 
int xlow (int) const
 
int ylow (int) const
 
 ~EcalDQMBinningService ()
 

Private Member Functions

void findBinsCrystal_ (const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
 
void findBinsDCC_ (const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
 
void findBinsProjEta_ (const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
 
void findBinsProjPhi_ (const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
 
void findBinsSuperCrystal_ (const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
 
void findBinsTCC_ (const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
 
void findBinsTriggerTower_ (const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
 
const std::vector< int > * getBinMapEB_ (BinningType) const
 
const std::vector< int > * getBinMapEBMEM_ (BinningType) const
 
const std::vector< int > * getBinMapEcal_ (BinningType) const
 
const std::vector< int > * getBinMapEE_ (BinningType, int) const
 
const std::vector< int > * getBinMapEEMEM_ (BinningType) const
 
const std::vector< int > * getBinMapSM_ (BinningType) const
 
const std::vector< int > * getBinMapSMMEM_ (BinningType) const
 
std::vector< AxisSpecsgetBinningEB_ (BinningType, bool) const
 
std::vector< AxisSpecsgetBinningEBMEM_ (BinningType, bool) const
 
std::vector< AxisSpecsgetBinningEcal_ (BinningType, bool) const
 
std::vector< AxisSpecsgetBinningEE_ (BinningType, bool, int) const
 
std::vector< AxisSpecsgetBinningEEMEM_ (BinningType, bool) const
 
std::vector< AxisSpecsgetBinningSM_ (BinningType, bool, unsigned) const
 
std::vector< AxisSpecsgetBinningSMMEM_ (BinningType, bool, unsigned) const
 

Private Attributes

std::vector< int > binMaps_ [nPlotType][nPresetBinnings]
 
std::pair< unsigned,
std::vector< int > > 
cache_
 
BinningType cacheBtype_
 
uint32_t cacheId_
 
ObjectType cacheOtype_
 
const double etaBound_
 
const CaloGeometrygeometry_
 
bool initialized_
 
int verbosity_
 

Detailed Description

Definition at line 26 of file EcalDQMBinningService.h.

Member Enumeration Documentation

Enumerator
nPlotType 
nPresetBinnings 
nDCC 
nDCCMEM 
nTCC 
kEEmTCCLow 
kEEmTCCHigh 
kEEpTCCLow 
kEEpTCCHigh 
kEBTCCLow 
kEBTCCHigh 
nEBSMEta 
nEBSMPhi 
nEBSMBins 
nEESMX 
nEESMY 
nEESMBins 
nEESMXExt 
nEESMBinsExt 
nEBEtaBins 
nEEEtaBins 
nPhiBins 

Definition at line 59 of file EcalDQMBinningService.h.

59  {
60  nPlotType = kEcal + 1,
62 
63  nDCC = 54,
64  nDCCMEM = 44,
65 
66  nTCC = 108,
67  kEEmTCCLow = 0, kEEmTCCHigh = 35,
68  kEEpTCCLow = 72, kEEpTCCHigh = 107,
69  kEBTCCLow = 36, kEBTCCHigh = 71,
70 
71  nEBSMEta = 85,
72  nEBSMPhi = 20,
74  nEESMX = 40,
75  nEESMY = 40,
76  nEESMBins = nEESMX * nEESMY,
77  nEESMXExt = 45, // for EE+-02&08
78  nEESMBinsExt = nEESMXExt * nEESMY,
79 
80 
81  nEBEtaBins = 34,
82  nEEEtaBins = 20,
83  nPhiBins = 36
84  };

Constructor & Destructor Documentation

EcalDQMBinningService::EcalDQMBinningService ( const edm::ParameterSet _ps,
edm::ActivityRegistry _registry 
)

Definition at line 27 of file EcalDQMBinningService.cc.

References postBeginRun(), and edm::ActivityRegistry::watchPostBeginRun().

27  :
28  cacheId_(0),
31  etaBound_(1.479),
32  geometry_(0),
33  initialized_(false),
34  verbosity_(_ps.getUntrackedParameter<int>("verbosity"))
35 {
37 }
void watchPostBeginRun(PostBeginRun::slot_type const &iSlot)
T getUntrackedParameter(std::string const &, T const &) const
void postBeginRun(const edm::Run &, const edm::EventSetup &)
const CaloGeometry * geometry_
EcalDQMBinningService::~EcalDQMBinningService ( )

Definition at line 39 of file EcalDQMBinningService.cc.

40 {
41 }

Member Function Documentation

std::string EcalDQMBinningService::channelName ( uint32_t  _rawId,
BinningType  _btype = kDCC 
) const

Definition at line 574 of file EcalDQMBinningService.cc.

References EcalTriggerElectronicsId::channelId(), EcalElectronicsId::dccId(), ecaldqm::getElectronicsMap(), EcalTrigTowerDetId::ieta(), EBDetId::ieta(), EBDetId::iphi(), EcalTrigTowerDetId::iphi(), EcalScDetId::ix(), EEDetId::ix(), EcalScDetId::iy(), EEDetId::iy(), kCrystal, kDCC, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, kSuperCrystal, kTCC, kTriggerTower, nDCC, EcalTriggerElectronicsId::pseudoStripId(), ecaldqm::smName(), EcalElectronicsId::stripId(), EcalTriggerElectronicsId::tccId(), EcalElectronicsId::towerId(), EcalTriggerElectronicsId::ttId(), and EcalElectronicsId::xtalId().

Referenced by ecaldqm::MESetEcal::book(), ecaldqm::MESetChannel::fill(), ecaldqm::MESetEcal::generateNames(), and ecaldqm::MESetChannel::setBinContent().

575 {
576  std::stringstream ss;
577 
578  switch(_btype){
579  case kCrystal:
580  {
581  // EB-03 DCC 12 CCU 12 strip 3 xtal 1 (EB ieta -13 iphi 60) (TCC 39 TT 12 pstrip 3 chan 1)
582  EcalElectronicsId eid(_rawId);
583  ss << smName(eid.dccId()) << " DCC " << eid.dccId() << " CCU " << eid.towerId() << " strip " << eid.stripId() << " xtal " << eid.xtalId();
584  if(eid.towerId() >= 69) break;
585 
586  if(eid.dccId() >= kEBmLow + 1 && eid.dccId() <= kEBpHigh + 1){
587  EBDetId ebid(getElectronicsMap()->getDetId(eid));
588  ss << " (EB ieta " << std::showpos << ebid.ieta() << std::noshowpos << " iphi " << ebid.iphi() << ")";
589  }
590  else{
591  EEDetId eeid(getElectronicsMap()->getDetId(eid));
592  ss << " (EE ix " << eeid.ix() << " iy " << eeid.iy() << ")";
593  }
594  EcalTriggerElectronicsId teid(getElectronicsMap()->getTriggerElectronicsId(eid));
595  ss << " (TCC " << teid.tccId() << " TT " << teid.ttId() << " pstrip " << teid.pseudoStripId() << " chan " << teid.channelId() << ")";
596  break;
597  }
598  case kTriggerTower:
599  {
600  // EB-03 DCC 12 TCC 18 TT 3
601  EcalTriggerElectronicsId teid(_rawId);
602  EcalElectronicsId eid(getElectronicsMap()->getElectronicsId(teid));
603  ss << smName(eid.dccId()) << " DCC " << eid.dccId() << " TCC " << teid.tccId() << " TT " << teid.ttId();
604  break;
605  }
606  case kSuperCrystal:
607  {
608  // EB-03 DCC 12 CCU 18 (EBTT ieta -13 iphi 60)
609  EcalElectronicsId eid(_rawId);
610  ss << smName(eid.dccId()) << " DCC " << eid.dccId() << " CCU " << eid.towerId();
611  if(eid.dccId() >= kEBmLow + 1 && eid.dccId() <= kEBpHigh + 1){
612  EcalTrigTowerDetId ttid(EBDetId(getElectronicsMap()->getDetId(eid)).tower());
613  ss << " (EBTT ieta " << std::showpos << ttid.ieta() << std::noshowpos << " iphi " << ttid.iphi() << ")";
614  }
615  else{
616  EcalScDetId scid(EEDetId(getElectronicsMap()->getDetId(eid)).sc());
617  ss << " (EESC ix " << scid.ix() << " iy " << scid.iy() << ")";
618  }
619  break;
620  }
621  case kTCC:
622  {
623  // EB-03 TCC 12
624  int tccid(_rawId - nDCC);
625  int dccid(getElectronicsMap()->DCCid(getElectronicsMap()->getTrigTowerDetId(tccid, 1)));
626  ss << smName(dccid) << " TCC " << (_rawId - nDCC);
627  break;
628  }
629  case kDCC:
630  ss << smName(_rawId);
631  break;
632  default:
633  break;
634  }
635 
636  return ss.str();
637 }
const EcalElectronicsMapping * getElectronicsMap()
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
std::string smName(unsigned _dccId)
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...
std::pair< unsigned, std::vector< int > > EcalDQMBinningService::findBins ( ObjectType  _otype,
BinningType  _btype,
const DetId _id 
) const

Definition at line 199 of file EcalDQMBinningService.cc.

References cache_, cacheBtype_, cacheId_, cacheOtype_, findBinsCrystal_(), findBinsDCC_(), findBinsProjEta_(), findBinsProjPhi_(), findBinsSuperCrystal_(), findBinsTCC_(), findBinsTriggerTower_(), findOffset(), getBinMap(), kCrystal, kDCC, kProjEta, kProjPhi, kSM, kSMMEM, kSuperCrystal, kTCC, kTriggerTower, nObjType, nPresetBinnings, objectFromOffset(), run_regression::ret, and smOffsetBins().

Referenced by ecaldqm::MESetDet1D::find_(), ecaldqm::MESetEcal::find_(), findBins(), and findBinsNoMap().

200 {
201  using namespace std;
202 
203  if(_otype == cacheOtype_ && _btype == cacheBtype_ && _id == cacheId_) return cache_;
204 
205  pair<unsigned, std::vector<int> > ret(-1, std::vector<int>(0));
206 
207  if(_otype >= nObjType || _btype >= unsigned(nPresetBinnings)) return ret;
208 
209  ret.first = findOffset(_otype, _id);
210  if(ret.first == unsigned(-1)) return ret;
211 
212  // bring up the appropriate dictionary
213  ObjectType okey(objectFromOffset(_otype, ret.first));
214  BinningType bkey(_btype);
215 
216  if(okey == nObjType) return ret;
217 
218  const std::vector<int>* binMap(getBinMap(okey, bkey));
219  if(binMap == 0) return ret;
220 
221  switch(bkey){
222  case kCrystal:
223  findBinsCrystal_(_id, okey, *binMap, ret.second);
224  break;
225  case kTriggerTower:
226  findBinsTriggerTower_(_id, okey, *binMap, ret.second);
227  break;
228  case kSuperCrystal:
229  findBinsSuperCrystal_(_id, okey, *binMap, ret.second);
230  break;
231  case kDCC:
232  findBinsDCC_(_id, okey, *binMap, ret.second);
233  break;
234  case kTCC:
235  findBinsTCC_(_id, okey, *binMap, ret.second);
236  break;
237  case kProjEta:
238  findBinsProjEta_(_id, okey, *binMap, ret.second);
239  break;
240  case kProjPhi:
241  findBinsProjPhi_(_id, okey, *binMap, ret.second);
242  default :
243  break;
244  }
245 
246  // binMap value differs from actual bin numbers for SM plots
247  if(_otype == kSM || _otype == kSMMEM){
248  for(vector<int>::iterator binItr(ret.second.begin()); binItr != ret.second.end(); ++binItr)
249  *binItr -= smOffsetBins(_otype, _btype, ret.first);
250  }
251 
252  cacheId_ = _id;
253  cacheOtype_ = _otype;
254  cacheBtype_ = _btype;
255  cache_ = ret;
256 
257  return ret;
258 }
void findBinsDCC_(const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
const std::vector< int > * getBinMap(ObjectType &, BinningType &) const
void findBinsTCC_(const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
ObjectType objectFromOffset(ObjectType, unsigned) const
void findBinsProjPhi_(const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
void findBinsCrystal_(const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
void findBinsSuperCrystal_(const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
unsigned findOffset(ObjectType, const DetId &) const
void findBinsTriggerTower_(const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
std::pair< unsigned, std::vector< int > > cache_
int smOffsetBins(ObjectType, BinningType, unsigned) const
void findBinsProjEta_(const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
std::pair< unsigned, std::vector< int > > EcalDQMBinningService::findBins ( ObjectType  _otype,
BinningType  _btype,
const EcalElectronicsId _id 
) const

Definition at line 261 of file EcalDQMBinningService.cc.

References findBins(), and ecaldqm::getElectronicsMap().

262 {
263  return findBins(_otype, _btype, getElectronicsMap()->getDetId(_id));
264 }
const EcalElectronicsMapping * getElectronicsMap()
std::pair< unsigned, std::vector< int > > findBins(ObjectType, BinningType, const DetId &) const
std::pair< unsigned, std::vector< int > > EcalDQMBinningService::findBins ( ObjectType  _otype,
BinningType  _btype,
unsigned  _dcctccid 
) const

Definition at line 267 of file EcalDQMBinningService.cc.

References cache_, cacheBtype_, cacheId_, cacheOtype_, findOffset(), getBinMap(), getHLTprescales::index, kDCC, kEB, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, kEBTCCHigh, kEBTCCLow, kEE, ecaldqm::kEEmHigh, kEEmTCCHigh, kEEp, ecaldqm::kEEpLow, kEEpTCCLow, kTCC, objectFromOffset(), and run_regression::ret.

268 {
269  using namespace std;
270 
271  if(_otype == cacheOtype_ && _btype == cacheBtype_ && _dcctccid == cacheId_) return cache_;
272 
273  pair<unsigned, std::vector<int> > ret(-1, std::vector<int>(0));
274 
275  if(_btype != kTCC && _btype != kDCC) return ret;
276 
277  ret.first = findOffset(_otype, _btype, _dcctccid);
278 
279  if(ret.first == unsigned(-1)) return ret;
280 
281  // bring up the appropriate dictionary
282  ObjectType okey(objectFromOffset(_otype, ret.first));
283  BinningType bkey(_btype);
284 
285  const std::vector<int>* binMap(getBinMap(okey, bkey));
286  if(binMap == 0) return ret;
287 
288  unsigned index(_dcctccid - 1);
289 
290  if(bkey == kDCC){
291  if(okey == kEB) index -= kEBmLow;
292  else if(okey == kEE && index >= kEEpLow) index -= (kEBpHigh - kEEmHigh);
293  else if(okey == kEEp) index -= kEEpLow;
294  }
295  else{
296  if(okey == kEB) index -= kEBTCCLow;
297  else if(okey == kEE && index >= kEEpLow) index -= (kEBTCCHigh - kEEmTCCHigh);
298  else if(okey == kEEp) index -= kEEpTCCLow;
299  }
300 
301  ret.second.push_back(binMap->at(index));
302 
303  cacheId_ = _dcctccid;
304  cacheOtype_ = _otype;
305  cacheBtype_ = _btype;
306  cache_ = ret;
307 
308  return ret;
309 }
const std::vector< int > * getBinMap(ObjectType &, BinningType &) const
ObjectType objectFromOffset(ObjectType, unsigned) const
unsigned findOffset(ObjectType, const DetId &) const
std::pair< unsigned, std::vector< int > > cache_
void EcalDQMBinningService::findBinsCrystal_ ( const DetId _id,
ObjectType  _okey,
const std::vector< int > &  _binMap,
std::vector< int > &  _bins 
) const
private

Definition at line 976 of file EcalDQMBinningService2.cc.

References EBDetId::denseIndex(), EEDetId::denseIndex(), EcalBarrel, EcalEndcap, EcalLaserPnDiode, EcalTriggerTower, ecaldqm::getElectronicsMap(), ecaldqm::getTrigTowerMap(), EcalPnDiodeDetId::iDCCId(), getHLTprescales::index, EcalPnDiodeDetId::iPnId(), ecaldqm::isEcalScDetId(), ecaldqm::kEBmLow, EEDetId::kEEhalf, ecaldqm::kEEmHigh, ecaldqm::kEEp, ecaldqm::kEEpLow, EBDetId::kSizeForDenseIndexing, ecaldqm::kSM, DetId::subdetId(), and EEDetId::zside().

Referenced by findBins().

977 {
978  using namespace std;
979 
980  bool fullRange(_okey == kSM || _okey == kEcal);
981 
982  switch(_id.subdetId()){
983  case EcalBarrel:
984  {
985  unsigned index(EBDetId(_id).denseIndex());
986  if(fullRange) index += EEDetId::kEEhalf;
987  if(index < _binMap.size()) _bins.push_back(_binMap[index]);
988  break;
989  }
990  case EcalEndcap:
991  if(isEcalScDetId(_id)){
992  pair<int, int> dccSc(getElectronicsMap()->getDCCandSC(EcalScDetId(_id)));
993  vector<DetId> detIds(getElectronicsMap()->dccTowerConstituents(dccSc.first, dccSc.second));
994  for(vector<DetId>::iterator idItr(detIds.begin()); idItr != detIds.end(); ++idItr) {
995  EEDetId eeid(*idItr);
996  unsigned index(eeid.denseIndex());
997  if(eeid.zside() > 0) {
998  if(fullRange) index += EBDetId::kSizeForDenseIndexing;
999  else if(_okey == kEEp) index -= EEDetId::kEEhalf;
1000  }
1001  if(index < _binMap.size()) _bins.push_back(_binMap[index]);
1002  }
1003  }
1004  else{
1005  EEDetId eeid(_id);
1006  unsigned index(eeid.denseIndex());
1007  if(eeid.zside() > 0) {
1008  if(fullRange) index += EBDetId::kSizeForDenseIndexing;
1009  else if(_okey == kEEp) index -= EEDetId::kEEhalf;
1010  }
1011  if(index < _binMap.size()) _bins.push_back(_binMap[index]);
1012  }
1013  break;
1014  case EcalTriggerTower:
1015  {
1016  EcalTrigTowerDetId ttid(_id);
1017  vector<DetId> detIds(getTrigTowerMap()->constituentsOf(ttid));
1018  for(vector<DetId>::iterator idItr(detIds.begin()); idItr != detIds.end(); ++idItr) {
1019  if(idItr->subdetId() == EcalBarrel) {
1020  unsigned index(EBDetId(*idItr).denseIndex());
1021  if(fullRange) index += EEDetId::kEEhalf;
1022  if(index < _binMap.size()) _bins.push_back(_binMap[index]);
1023  }
1024  else {
1025  EEDetId eeid(*idItr);
1026  unsigned index(eeid.denseIndex());
1027  if(eeid.zside() > 0) {
1028  if(fullRange) index += EBDetId::kSizeForDenseIndexing;
1029  else if(_okey == kEEp) index -= EEDetId::kEEhalf;
1030  }
1031  if (index < _binMap.size()) _bins.push_back(_binMap[index]);
1032  }
1033  }
1034  break;
1035  }
1036  case EcalLaserPnDiode:
1037  {
1038  EcalPnDiodeDetId pnid(_id);
1039  int iDCC(pnid.iDCCId() - 1);
1040  unsigned index(iDCC * 10 + pnid.iPnId());
1041  if(_okey == kEBMEM) index -= kEEmHigh * 10;
1042  else if(_okey == kEEMEM && iDCC >= kEEpLow) index -= (kEEpLow - kEBmLow) * 10;
1043  if(index < _binMap.size()) _bins.push_back(_binMap[index]);
1044  break;
1045  }
1046  default:
1047  break;
1048  }
1049 }
const EcalElectronicsMapping * getElectronicsMap()
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
bool isEcalScDetId(const DetId &_id)
const EcalTrigTowerConstituentsMap * getTrigTowerMap()
uint32_t denseIndex() const
Definition: EBDetId.h:88
void EcalDQMBinningService::findBinsDCC_ ( const DetId _id,
ObjectType  _okey,
const std::vector< int > &  _binMap,
std::vector< int > &  _bins 
) const
private

Definition at line 1146 of file EcalDQMBinningService2.cc.

References ecaldqm::dccId(), getHLTprescales::index, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, ecaldqm::kEEmHigh, ecaldqm::kEEp, and ecaldqm::kEEpLow.

Referenced by findBins().

1147 {
1148  unsigned index(dccId(_id) - 1);
1149  if(_okey == kEB) index -= kEBmLow;
1150  else if(_okey == kEE && index >= kEEpLow) index -= (kEBpHigh - kEEmHigh);
1151  else if(_okey == kEEp) index -= kEEpLow;
1152  if(index < _binMap.size()) _bins.push_back(_binMap[index]);
1153 }
unsigned dccId(const DetId &)
std::pair< unsigned, std::vector< int > > EcalDQMBinningService::findBinsNoMap ( ObjectType  _otype,
BinningType  _btype,
const DetId _id 
) const

Definition at line 312 of file EcalDQMBinningService.cc.

References newFWLiteAna::bin, edm::hlt::Exception, findBins(), findOffset(), kDCC, kEcal2P, kSM, kSuperCrystal, kTCC, kTriggerTower, SurfaceOrientation::outer, run_regression::ret, ecaldqm::tccId(), ecaldqm::towerId(), and ecaldqm::ttId().

Referenced by ecaldqm::MESetDet1D::find_(), and findBinsNoMap().

313 {
314  using namespace std;
315 
316  // Not yet implemented to scale to general cases
317  if(!((_otype == kSM && _btype == kSuperCrystal) ||
318  (_otype == kSM && _btype == kTriggerTower) ||
319  (_otype == kEcal2P && _btype == kDCC) ||
320  (_otype == kEcal2P && _btype == kTCC)))
321  throw cms::Exception("NotImplemented") << "1D bin finding only for SM - SC plots or Ecal2P - DCC plots" << std::endl;
322 
323  if(_otype == kEcal2P && (_btype == kDCC || _btype == kTCC))
324  return findBins(_otype, _btype, _id);
325 
326  pair<unsigned, std::vector<int> > ret(-1, std::vector<int>(0));
327 
328  ret.first = findOffset(_otype, _id);
329  if(ret.first == unsigned(-1)) return ret;
330 
331  if(_otype == kSM && _btype == kSuperCrystal)
332  ret.second.push_back(towerId(_id));
333  else if(_otype == kSM && _btype == kTriggerTower){
334  unsigned tccid(tccId(_id));
335  if(tccid >= 37 && tccid <= 72) // EB
336  ret.second.push_back(ttId(_id));
337  else{
338  unsigned bin(ttId(_id));
339  tccid = (tccid - 1) % 36;
340  bool outer(tccid >= 18);
341  tccid = (tccid + 1) % 18; // TCC numbering is shifted wrt DCC numbering by one
342  if(outer) bin += 48;
343  bin += (tccid % 2) * (outer ? 16 : 24);
344  ret.second.push_back(bin);
345  }
346  }
347 
348  return ret;
349 }
unsigned towerId(const DetId &)
unsigned findOffset(ObjectType, const DetId &) const
unsigned tccId(const DetId &)
unsigned ttId(const DetId &)
std::pair< unsigned, std::vector< int > > findBins(ObjectType, BinningType, const DetId &) const
std::pair< unsigned, std::vector< int > > EcalDQMBinningService::findBinsNoMap ( ObjectType  _otype,
BinningType  _btype,
const EcalElectronicsId _id 
) const

Definition at line 352 of file EcalDQMBinningService.cc.

References findBinsNoMap(), and ecaldqm::getElectronicsMap().

353 {
354  return findBinsNoMap(_otype, _btype, getElectronicsMap()->getDetId(_id));
355 }
const EcalElectronicsMapping * getElectronicsMap()
std::pair< unsigned, std::vector< int > > findBinsNoMap(ObjectType, BinningType, const DetId &) const
void EcalDQMBinningService::findBinsProjEta_ ( const DetId _id,
ObjectType  _okey,
const std::vector< int > &  _binMap,
std::vector< int > &  _bins 
) const
private

Definition at line 1166 of file EcalDQMBinningService2.cc.

References EEDetId::denseIndex(), EcalBarrel, EcalEndcap, EcalTriggerTower, ecaldqm::getTrigTowerMap(), EBDetId::ieta(), getHLTprescales::index, EEDetId::iquadrant(), ecaldqm::isEcalScDetId(), EEDetId::ix(), EEDetId::iy(), EEDetId::kEEhalf, ecaldqm::kEEp, EcalTrigTowerDetId::subDet(), DetId::subdetId(), and EEDetId::zside().

Referenced by findBins().

1167 {
1168  using namespace std;
1169 
1170  switch(_id.subdetId()){
1171  case EcalBarrel:
1172  {
1173  EBDetId ebid(_id);
1174  unsigned index(ebid.ieta() < 0 ? ebid.ieta() + 85 : ebid.ieta() + 84);
1175  if(_okey == kEcal) index += EEDetId::kEEhalf / 2;
1176  if(index < _binMap.size()) _bins.push_back(_binMap[index]);
1177  break;
1178  }
1179  case EcalEndcap:
1180  if(!isEcalScDetId(_id)){
1181  EEDetId eeid(_id);
1182  if(eeid.iquadrant() < 3)
1183  eeid = EEDetId(eeid.ix(), 101 - eeid.iy(), eeid.zside());
1184  unsigned index(eeid.denseIndex());
1185  if(_okey == kEEp) index -= EEDetId::kEEhalf;
1186  else if(_okey == kEcal && eeid.zside() > 0) index += 170 - EEDetId::kEEhalf / 2;
1187  if(index < _binMap.size()) _bins.push_back(_binMap[index]);
1188  break;
1189  }
1190  case EcalTriggerTower:
1191  {
1192  EcalTrigTowerDetId ttid(_id);
1193  vector<DetId> detIds(getTrigTowerMap()->constituentsOf(ttid));
1194  set<int> binset;
1195  if(ttid.subDet() == EcalBarrel){
1196  for(vector<DetId>::iterator idItr(detIds.begin()); idItr != detIds.end(); ++idItr){
1197  EBDetId ebid(*idItr);
1198  unsigned index(ebid.ieta() < 0 ? ebid.ieta() + 85 : ebid.ieta() + 84);
1199  if(_okey == kEcal) index += EEDetId::kEEhalf / 2;
1200  if(index < _binMap.size()) binset.insert(_binMap[index]);
1201  }
1202  }
1203  else{
1204  for(vector<DetId>::iterator idItr(detIds.begin()); idItr != detIds.end(); ++idItr){
1205  EEDetId eeid(*idItr);
1206  if(eeid.iquadrant() < 3)
1207  eeid = EEDetId(eeid.ix(), eeid.iy() <= 50 ? eeid.iy() : 101 - eeid.iy(), eeid.zside());
1208  unsigned index(eeid.denseIndex());
1209  if(_okey == kEEp) index -= EEDetId::kEEhalf;
1210  else if(_okey == kEcal && eeid.zside() > 0) index += 170 - EEDetId::kEEhalf / 2;
1211  if(index < _binMap.size()) binset.insert(_binMap[index]);
1212  }
1213  }
1214  for(set<int>::iterator binItr(binset.begin()); binItr != binset.end(); ++binItr)
1215  _bins.push_back(*binItr);
1216  break;
1217  }
1218  default:
1219  break;
1220  }
1221 }
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
bool isEcalScDetId(const DetId &_id)
const EcalTrigTowerConstituentsMap * getTrigTowerMap()
void EcalDQMBinningService::findBinsProjPhi_ ( const DetId _id,
ObjectType  _okey,
const std::vector< int > &  _binMap,
std::vector< int > &  _bins 
) const
private

Definition at line 1224 of file EcalDQMBinningService2.cc.

References EEDetId::denseIndex(), EcalBarrel, EcalEndcap, EcalTriggerTower, ecaldqm::getTrigTowerMap(), getHLTprescales::index, EBDetId::iphi(), ecaldqm::isEcalScDetId(), EEDetId::kEEhalf, EcalTrigTowerDetId::subDet(), DetId::subdetId(), and EEDetId::zside().

Referenced by findBins().

1225 {
1226  using namespace std;
1227 
1228  switch(_id.subdetId()){
1229  case EcalBarrel:
1230  {
1231  EBDetId ebid(_id);
1232  unsigned index(ebid.iphi() - 1);
1233  if(_okey == kEcal) index += EEDetId::kEEhalf;
1234  if(index < _binMap.size()) _bins.push_back(_binMap[index]);
1235  break;
1236  }
1237  case EcalEndcap:
1238  if(!isEcalScDetId(_id)){
1239  EEDetId eeid(_id);
1240  unsigned index(eeid.denseIndex());
1241  if(eeid.zside() > 0) index -= EEDetId::kEEhalf;
1242  if(index < _binMap.size()) _bins.push_back(_binMap[index]);
1243  break;
1244  }
1245  case EcalTriggerTower:
1246  {
1247  EcalTrigTowerDetId ttid(_id);
1248  vector<DetId> detIds(getTrigTowerMap()->constituentsOf(ttid));
1249  set<int> binset;
1250  if(ttid.subDet() == EcalBarrel){
1251  for(vector<DetId>::iterator idItr(detIds.begin()); idItr != detIds.end(); ++idItr){
1252  EBDetId ebid(*idItr);
1253  unsigned index(ebid.iphi() - 1);
1254  if(_okey == kEcal) index += EEDetId::kEEhalf;
1255  if(index < _binMap.size()) binset.insert(_binMap[index]);
1256  }
1257  }
1258  else{
1259  for(vector<DetId>::iterator idItr(detIds.begin()); idItr != detIds.end(); ++idItr){
1260  EEDetId eeid(*idItr);
1261  unsigned index(eeid.denseIndex());
1262  if(eeid.zside() > 0) index -= EEDetId::kEEhalf;
1263  if(index < _binMap.size()) binset.insert(_binMap[index]);
1264  }
1265  }
1266  for(set<int>::iterator binItr(binset.begin()); binItr != binset.end(); ++binItr)
1267  _bins.push_back(*binItr);
1268  break;
1269  }
1270  default:
1271  break;
1272  }
1273 }
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
bool isEcalScDetId(const DetId &_id)
const EcalTrigTowerConstituentsMap * getTrigTowerMap()
void EcalDQMBinningService::findBinsSuperCrystal_ ( const DetId _id,
ObjectType  _okey,
const std::vector< int > &  _binMap,
std::vector< int > &  _bins 
) const
private

Definition at line 1100 of file EcalDQMBinningService2.cc.

References EcalTrigTowerDetId::denseIndex(), EcalScDetId::denseIndex(), EcalBarrel, EcalEndcap, EcalTriggerTower, getHLTprescales::index, ecaldqm::isEcalScDetId(), EcalTrigTowerDetId::kEBTotalTowers, ecaldqm::kEEp, ecaldqm::kSM, EEDetId::sc(), EcalScDetId::SC_PER_EE_CNT, DetId::subdetId(), EcalScDetId::zside(), and EEDetId::zside().

Referenced by findBins().

1101 {
1102  bool fullRange(_okey == kSM || _okey == kEcal);
1103 
1104  switch(_id.subdetId()){
1105  case EcalBarrel:
1106  {
1107  unsigned index(EBDetId(_id).tower().denseIndex());
1108  if(fullRange) index += EcalScDetId::SC_PER_EE_CNT;
1109  if(index < _binMap.size()) _bins.push_back(_binMap[index]);
1110  break;
1111  }
1112  case EcalEndcap:
1113  {
1114  int zside(0);
1115  unsigned index;
1116  if (isEcalScDetId(_id)) {
1117  EcalScDetId scid(_id);
1118  zside = scid.zside();
1119  index = scid.denseIndex();
1120  }
1121  else {
1122  EEDetId eeid(_id);
1123  zside = eeid.zside();
1124  index = eeid.sc().denseIndex();
1125  }
1126  if(zside > 0) {
1127  if(fullRange) index += EcalTrigTowerDetId::kEBTotalTowers;
1128  else if(_okey == kEEp) index -= EcalScDetId::SC_PER_EE_CNT;
1129  }
1130  if(index < _binMap.size()) _bins.push_back(_binMap[index]);
1131  break;
1132  }
1133  case EcalTriggerTower: // btype == kSuperCrystal && subdet == EcalTriggerTower => only happens for EB
1134  {
1135  EcalTrigTowerDetId ttid(_id);
1136  unsigned index(ttid.denseIndex());
1137  if(fullRange) index += EcalScDetId::SC_PER_EE_CNT;
1138  if(index < _binMap.size()) _bins.push_back(_binMap[index]);
1139  break;
1140  }
1141  default:
1142  break;
1143  }
1144 }
static const int SC_PER_EE_CNT
Definition: EcalScDetId.h:144
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
bool isEcalScDetId(const DetId &_id)
void EcalDQMBinningService::findBinsTCC_ ( const DetId _id,
ObjectType  _okey,
const std::vector< int > &  _binMap,
std::vector< int > &  _bins 
) const
private
void EcalDQMBinningService::findBinsTriggerTower_ ( const DetId _id,
ObjectType  _okey,
const std::vector< int > &  _binMap,
std::vector< int > &  _bins 
) const
private

Definition at line 1052 of file EcalDQMBinningService2.cc.

References EEDetId::denseIndex(), EcalBarrel, EcalEndcap, EcalTriggerTower, ecaldqm::getTrigTowerMap(), EcalTrigTowerDetId::hashedIndex(), getHLTprescales::index, ecaldqm::isEcalScDetId(), EcalTrigTowerDetId::kEBTotalTowers, EEDetId::kEEhalf, EcalTrigTowerDetId::subDet(), DetId::subdetId(), and EEDetId::zside().

Referenced by findBins().

1053 {
1054  using namespace std;
1055 
1056  switch(_id.subdetId()){
1057  case EcalBarrel:
1058  {
1059  EcalTrigTowerDetId ttid(EBDetId(_id).tower());
1060  unsigned index(ttid.hashedIndex() + EEDetId::kEEhalf);
1061  if(index < _binMap.size()) _bins.push_back(_binMap[index]);
1062  break;
1063  }
1064  case EcalEndcap:
1065  if(!isEcalScDetId(_id)){
1066  vector<DetId> detIds(getTrigTowerMap()->constituentsOf(getTrigTowerMap()->towerOf(_id)));
1067  for(vector<DetId>::iterator idItr(detIds.begin()); idItr != detIds.end(); ++idItr){
1068  EEDetId eeid(*idItr);
1069  unsigned index(eeid.denseIndex());
1070  if(eeid.zside() > 0) index += EcalTrigTowerDetId::kEBTotalTowers;
1071  if(index < _binMap.size()) _bins.push_back(_binMap[index]);
1072  }
1073  break;
1074  }
1075  case EcalTriggerTower:
1076  {
1077  EcalTrigTowerDetId ttid(_id);
1078  if(ttid.subDet() == EcalBarrel){
1079  unsigned index(ttid.hashedIndex() + EEDetId::kEEhalf);
1080  if(index < _binMap.size()) _bins.push_back(_binMap[index]);
1081  }
1082  else{
1083  vector<DetId> detIds(getTrigTowerMap()->constituentsOf(ttid));
1084  for(vector<DetId>::iterator idItr(detIds.begin()); idItr != detIds.end(); ++idItr){
1085  EEDetId eeid(*idItr);
1086  unsigned index(eeid.denseIndex());
1087  if(eeid.zside() > 0) index += EcalTrigTowerDetId::kEBTotalTowers;
1088  if(index < _binMap.size()) _bins.push_back(_binMap[index]);
1089  }
1090  }
1091  break;
1092  }
1093  default:
1094  break;
1095  }
1096 
1097 }
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
bool isEcalScDetId(const DetId &_id)
const EcalTrigTowerConstituentsMap * getTrigTowerMap()
unsigned EcalDQMBinningService::findOffset ( ObjectType  _otype,
const DetId _id 
) const

Definition at line 358 of file EcalDQMBinningService.cc.

References cache_, cacheId_, cacheOtype_, ecaldqm::dccId(), kDCC, kEB, ecaldqm::kEBpHigh, kEcal, kEcal2P, kEcal3P, kEcalMEM2P, kEE, kEEm, ecaldqm::kEEmHigh, kEEp, and kUser.

Referenced by ecaldqm::MESetDet0D::fill(), ecaldqm::MESetEcal::fill(), ecaldqm::MESetTrend::fill(), findBins(), findBinsNoMap(), and findOffset().

359 {
360  if(_otype == cacheOtype_ && _id == cacheId_) return cache_.first;
361 
362  unsigned iSM(dccId(_id) - 1);
363 
364  if(_otype == kEcal3P){
365  if(iSM <= kEEmHigh) return findOffset(kEcal3P, kUser, (unsigned)kEEm + 1);
366  else if(iSM <= kEBpHigh) return findOffset(kEcal3P, kUser, (unsigned)kEB + 1);
367  else return findOffset(kEcal3P, kUser, (unsigned)kEEp + 1);
368  }
369  else if(_otype == kEcal2P){
370  if(iSM <= kEEmHigh) return findOffset(kEcal2P, kUser, (unsigned)kEE + 1);
371  else if(iSM <= kEBpHigh) return findOffset(kEcal2P, kUser, (unsigned)kEB + 1);
372  else return findOffset(kEcal2P, kUser, (unsigned)kEE + 1);
373  }
374  else if(_otype == kEcal)
375  return 0;
376  else if(_otype == kEcalMEM2P){
377  if(iSM <= kEEmHigh) return findOffset(kEcal2P, kUser, (unsigned)kEE + 1);
378  else if(iSM <= kEBpHigh) return findOffset(kEcal2P, kUser, (unsigned)kEB + 1);
379  else return findOffset(kEcal2P, kUser, (unsigned)kEE + 1);
380  }
381 
382  return findOffset(_otype, kDCC, iSM + 1);
383 }
unsigned dccId(const DetId &)
unsigned findOffset(ObjectType, const DetId &) const
std::pair< unsigned, std::vector< int > > cache_
unsigned EcalDQMBinningService::findOffset ( ObjectType  _otype,
const EcalElectronicsId _id 
) const

Definition at line 386 of file EcalDQMBinningService.cc.

References findOffset(), and ecaldqm::getElectronicsMap().

387 {
388  return findOffset(_otype, getElectronicsMap()->getDetId(_id));
389 }
const EcalElectronicsMapping * getElectronicsMap()
unsigned findOffset(ObjectType, const DetId &) const
unsigned EcalDQMBinningService::findOffset ( ObjectType  _otype,
BinningType  _btype,
unsigned  _dcctccid 
) const

Definition at line 392 of file EcalDQMBinningService.cc.

References ecaldqm::dccNoMEM, kDCC, kEB, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, kEBTCCHigh, kEBTCCLow, kEcal, kEcal2P, kEcal3P, kEcalMEM2P, kEE, kEEm, ecaldqm::kEEmHigh, kEEmTCCHigh, kEEp, ecaldqm::kEEpHigh, ecaldqm::kEEpLow, kEEpTCCHigh, kEEpTCCLow, kSM, kSMMEM, kTCC, kUser, ecaldqm::memDCCIndex(), nDCC, and nTCC.

393 {
394  unsigned iSM(_dcctccid - 1);
395 
396  switch(_otype){
397  case kEB:
398  if(_btype == kDCC && iSM >= kEBmLow && iSM <= kEBpHigh) return 0;
399  else if(_btype == kTCC && iSM >= kEBTCCLow && iSM <= kEBTCCHigh) return 0;
400  return -1;
401  case kEE:
402  if(_btype == kDCC &&
403  (iSM <= kEEmHigh ||
404  (iSM >= kEEpLow && iSM <= kEEpHigh))) return 0;
405  else if(_btype == kTCC &&
406  (iSM <= kEEmTCCHigh ||
407  (iSM >= kEEpTCCLow && iSM <= kEEpTCCHigh))) return 0;
408  return -1;
409  case kEEm:
410  if(_btype == kDCC && iSM <= kEEmHigh) return 0;
411  else if(_btype == kTCC && iSM <= kEEmTCCHigh) return 0;
412  else return -1;
413  case kEEp:
414  if(_btype == kDCC && (iSM >= kEEpLow && iSM <= kEEpHigh)) return 0;
415  else if(_btype == kTCC && (iSM >= kEEpTCCLow && iSM <= kEEpTCCHigh)) return 0;
416  else return -1;
417  case kSM:
418  if(iSM < nDCC) return iSM;
419  else return -1;
420  case kSMMEM:
421  if(iSM < nDCC && dccNoMEM.find(iSM) == dccNoMEM.end()) return memDCCIndex(_dcctccid);
422  else return -1;
423  case kEcal:
424  if(_btype == kDCC && iSM < nDCC) return 0;
425  else if(_btype == kTCC && iSM < nTCC) return 0;
426  else if(_btype == kUser) return 0;
427  else return -1;
428  case kEcal2P:
429  {
430  int iSubdet(iSM);
431  if(_btype == kDCC){
432  if(iSM <= kEEmHigh) iSubdet = kEE;
433  else if(iSM <= kEBpHigh) iSubdet = kEB;
434  else iSubdet = kEE;
435  }
436  else if(_btype == kTCC){
437  if(iSM <= kEEmTCCHigh) iSubdet = kEE;
438  else if(iSM <= kEBTCCHigh) iSubdet = kEB;
439  else iSubdet = kEE;
440  }
441  if(iSubdet == kEE || iSubdet == kEEm || iSubdet == kEEp) return 0;
442  else if(iSubdet == kEB) return 1;
443  else return -1;
444  }
445  case kEcal3P:
446  {
447  int iSubdet(iSM);
448  if(_btype == kDCC){
449  if(iSM <= kEEmHigh) iSubdet = kEEm;
450  else if(iSM <= kEBpHigh) iSubdet = kEB;
451  else iSubdet = kEEp;
452  }
453  else if(_btype == kTCC){
454  if(iSM <= kEEmTCCHigh) iSubdet = kEEm;
455  else if(iSM <= kEBTCCHigh) iSubdet = kEB;
456  else iSubdet = kEEp;
457  }
458  if(iSubdet == kEEm) return 0;
459  else if(iSubdet == kEB) return 1;
460  else if(iSubdet == kEEp) return 2;
461  else return -1;
462  }
463  case kEcalMEM2P:
464  {
465  int iSubdet(iSM);
466  if(iSubdet == kEE || iSubdet == kEEm || iSubdet == kEEp) return 0;
467  else if(iSubdet == kEB) return 1;
468  else return -1;
469  }
470  default:
471  return -1;
472  }
473 }
unsigned memDCCIndex(unsigned)
const std::set< unsigned > dccNoMEM
const std::vector< int > * EcalDQMBinningService::getBinMap ( ObjectType _okey,
BinningType _bkey 
) const

Definition at line 135 of file EcalDQMBinningService.cc.

References binMaps_, gather_cfg::cout, getBinMapEB_(), getBinMapEBMEM_(), getBinMapEcal_(), getBinMapEE_(), getBinMapEEMEM_(), getBinMapSM_(), getBinMapSMMEM_(), kCrystal, kEB, kEBMEM, kEcal, kEE, kEEm, kEEMEM, kEEp, kProjPhi, kSM, kSMMEM, kSuperCrystal, kTriggerTower, nPlotType, nPresetBinnings, findQualityFiles::size, and verbosity_.

Referenced by findBins(), and ecaldqm::MESetEcal::reset().

136 {
137  if(unsigned(_okey) >= nPlotType || unsigned(_bkey) >= nPresetBinnings) return 0;
138 
139  if((_okey == kEEm || _okey == kEEp) && _bkey == kProjPhi)
140  _okey = kEE;
141 
142  if(_bkey == kTriggerTower){
143  if(_okey == kEB) _bkey = kSuperCrystal;
144  else if(_okey == kEE || _okey == kEEm || _okey == kEEp) _bkey = kCrystal;
145  }
146 
147  if(binMaps_[_okey][_bkey].size() != 0) return &(binMaps_[_okey][_bkey]);
148 
149  // Map is not defined yet (or is not going to be)
150 
151  const std::vector<int>* binMap(0);
152 
153  switch(_okey){
154  case kEB:
155  binMap = getBinMapEB_(_bkey);
156  break;
157  case kEBMEM:
158  binMap = getBinMapEBMEM_(_bkey);
159  break;
160  case kEE:
161  binMap = getBinMapEE_(_bkey, 0);
162  break;
163  case kEEm:
164  binMap = getBinMapEE_(_bkey, -1);
165  break;
166  case kEEp:
167  binMap = getBinMapEE_(_bkey, 1);
168  break;
169  case kEEMEM:
170  binMap = getBinMapEEMEM_(_bkey);
171  break;
172  case kSM:
173  binMap = getBinMapSM_(_bkey);
174  break;
175  case kSMMEM:
176  binMap = getBinMapSMMEM_(_bkey);
177  break;
178  case kEcal:
179  binMap = getBinMapEcal_(_bkey);
180  break;
181  default:
182  return 0;
183  }
184 
185  if(verbosity_ > 0){
186  std::cout << "EcalDQMBinningService: Booked new binMap for " << int(_okey) << " " << int(_bkey);
187  std::cout << " (Current memory usage: ";
188  int bytes(0);
189  for(unsigned iO(0); iO < nPlotType; iO++)
190  for(unsigned iB(0); iB < nPresetBinnings; iB++)
191  bytes += binMaps_[iO][iB].size() * sizeof(int);
192  std::cout << bytes / 1024. << "kB)" << std::endl;
193  }
194 
195  return binMap;
196 }
const std::vector< int > * getBinMapSMMEM_(BinningType) const
const std::vector< int > * getBinMapEcal_(BinningType) const
const std::vector< int > * getBinMapEE_(BinningType, int) const
const std::vector< int > * getBinMapEEMEM_(BinningType) const
std::vector< int > binMaps_[nPlotType][nPresetBinnings]
const std::vector< int > * getBinMapSM_(BinningType) const
const std::vector< int > * getBinMapEB_(BinningType) const
const std::vector< int > * getBinMapEBMEM_(BinningType) const
tuple cout
Definition: gather_cfg.py:121
tuple size
Write out results.
const std::vector< int > * EcalDQMBinningService::getBinMapEB_ ( BinningType  _bkey) const
private

Definition at line 395 of file EcalDQMBinningService2.cc.

References eta(), ecalpyutils::hashedIndex(), i, ecaldqm::kCrystal, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, EcalTrigTowerDetId::kEBTotalTowers, EBDetId::kSizeForDenseIndexing, ecaldqm::kSuperCrystal, phi, and Pi.

Referenced by getBinMap().

396 {
397  std::vector<int>& binMap(binMaps_[kEB][_bkey]);
398 
399  switch(_bkey){
400  case kCrystal:
401  binMap.resize(EBDetId::kSizeForDenseIndexing); // EBDetId -> bin
402  for(int ix = 1; ix <= 360; ix++){
403  for(int iy = 1; iy <= 170; iy++){
404  uint32_t dIndex(EBDetId(iy < 86 ? iy - 86 : iy - 85, ix).hashedIndex());
405  binMap[dIndex] = 360 * (iy - 1) + ix ;
406  }
407  }
408  return &binMap;
409 
410  case kSuperCrystal:
411  binMap.resize(EcalTrigTowerDetId::kEBTotalTowers); // EcalTrigTowerDetId -> bin
412  for(int ix = 1; ix <= 72; ix++){
413  for(int iy = 1; iy <= 34; iy++){
414  int ieta(iy < 18 ? (iy - 18) * 5 : (iy - 17) * 5);
415  int iphi(ix * 5);
416  uint32_t dIndex(EBDetId(ieta, iphi).tower().hashedIndex());
417  binMap[dIndex] = 72 * (iy - 1) + ix;
418  }
419  }
420  return &binMap;
421 
422  case kDCC:
423  {
424  int nEBDCC(kEBpHigh - kEBmLow + 1);
425  binMap.resize(nEBDCC); // DCCId (shifted) -> bin
426  for(int ix = 1; ix <= nEBDCC; ix++)
427  binMap[ix - 1] = ix;
428  }
429  return &binMap;
430 
431  case kTCC:
432  {
433  int nEBTCC(kEBTCCHigh - kEBTCCLow + 1);
434  binMap.resize(nEBTCC); // TCCId (shifted) -> bin
435  for(int ix = 1; ix <= nEBTCC; ix++)
436  binMap[ix - 1] = ix;
437  }
438  return &binMap;
439 
440  case kProjEta:
441  {
442  float binEdges[nEBEtaBins + 1];
443  for(int i(0); i <= nEBEtaBins; i++)
444  binEdges[i] = -etaBound_ + 2. * etaBound_ / nEBEtaBins * i;
445  binMap.resize(170); // ieta -> bin
446  for(int ieta(-85); ieta <= 85; ieta++){
447  if(ieta == 0) continue;
448  EBDetId ebid(ieta, 1);
449  float eta(geometry_->getGeometry(ebid)->getPosition().eta());
450  float* pBin(std::upper_bound(binEdges, binEdges + nEBEtaBins + 1, eta));
451  uint32_t dIndex(ieta < 0 ? ieta + 85 : ieta + 84);
452  binMap[dIndex] = static_cast<int>(pBin - binEdges);
453  }
454  }
455  return &binMap;
456 
457  case kProjPhi:
458  {
459  float binEdges[nPhiBins + 1];
460  for(int i(0); i <= nPhiBins; i++)
461  binEdges[i] = TMath::Pi() * (-1./18. + 2. / nPhiBins * i);
462  binMap.resize(360); // iphi -> bin
463  for(int iphi(1); iphi <= 360; iphi++){
464  EBDetId ebid(1, iphi);
465  float phi(geometry_->getGeometry(ebid)->getPosition().phi());
466  if(phi < -TMath::Pi() * 1./18.) phi += 2. * TMath::Pi();
467  float* pBin(std::upper_bound(binEdges, binEdges + nPhiBins + 1, phi));
468  uint32_t dIndex(iphi - 1);
469  binMap[dIndex] = static_cast<int>(pBin - binEdges);
470  }
471  }
472  return &binMap;
473 
474  default:
475  return 0;
476  }
477 }
const double Pi
int i
Definition: DBlmapReader.cc:9
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T eta() const
int hashedIndex(int ieta, int iphi)
Definition: EcalPyUtils.cc:42
std::vector< int > binMaps_[nPlotType][nPresetBinnings]
T eta() const
Definition: PV3DBase.h:76
const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:76
const CaloGeometry * geometry_
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
Definition: DDAxes.h:10
const std::vector< int > * EcalDQMBinningService::getBinMapEBMEM_ ( BinningType  _bkey) const
private

Definition at line 480 of file EcalDQMBinningService2.cc.

References ecaldqm::kCrystal, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, and ecaldqm::kEBpLow.

Referenced by getBinMap().

481 {
482  if(_bkey != kCrystal) return 0;
483 
484  int nEBMEM((kEBpHigh - kEBmLow + 1) * 10);
485  std::vector<int>& binMap(binMaps_[kEBMEM][kCrystal]);
486 
487  binMap.resize(nEBMEM); // EcalPnDiodeDetId -> bin; original hashing (DCCId * 10 + PnId)
488  for(int ix = 1; ix <= 18; ix++){
489  for(int iy = 1; iy <= 20; iy++){
490  int idcc((iy < 11 ? kEBmLow : kEBpLow) + ix - 1);
491  int pnId(iy < 11 ? 11 - iy : iy - 10);
492  uint32_t dIndex((idcc - kEBmLow) * 10 + pnId - 1);
493  binMap[dIndex] = 18 * (iy - 1) + ix;
494  }
495  }
496  return &binMap;
497 }
std::vector< int > binMaps_[nPlotType][nPresetBinnings]
const std::vector< int > * EcalDQMBinningService::getBinMapEcal_ ( BinningType  _bkey) const
private

Definition at line 837 of file EcalDQMBinningService2.cc.

References eta(), ecalpyutils::hashedIndex(), EEDetId::hashedIndex(), i, ecaldqm::kCrystal, EcalTrigTowerDetId::kEBTotalTowers, EEDetId::kEEhalf, ecaldqm::kEEmLow, ecaldqm::kEEpHigh, EBDetId::kSizeForDenseIndexing, EcalScDetId::kSizeForDenseIndexing, EEDetId::kSizeForDenseIndexing, ecaldqm::kSuperCrystal, phi, Pi, EcalScDetId::SC_PER_EE_CNT, EcalScDetId::validDetId(), and EEDetId::validDetId().

Referenced by getBinMap().

838 {
839  std::vector<int>& binMap(binMaps_[kEcal][_bkey]);
840 
841  switch(_bkey){
842  case kCrystal:
843  binMap.resize(EBDetId::kSizeForDenseIndexing + EEDetId::kSizeForDenseIndexing); // DetId -> bin
844  for(int ix = 1; ix <= 360; ix++){
845  for(int iy = 101; iy <= 270; iy++){
846  uint32_t dIndex(EBDetId(iy < 186 ? iy - 186 : iy - 185, ix).hashedIndex() + EEDetId::kEEhalf);
847  binMap[dIndex] = 360 * (iy - 1) + ix ;
848  }
849  }
850  for(int ix = 1; ix <= 200; ix++){
851  int iix(ix > 100 ? ix - 100 : ix);
852  int zside(ix > 100 ? 1 : -1);
853  for(int iy = 1; iy <= 100; iy++){
854  if(!EEDetId::validDetId(iix, iy, zside)) continue;
855  uint32_t dIndex(EEDetId(iix, iy, zside).hashedIndex());
856  if(zside == 1) dIndex += EBDetId::kSizeForDenseIndexing;
857  binMap[dIndex] = 360 * (iy - 1) + ix;
858  }
859  }
860  return &binMap;
861 
862  case kSuperCrystal:
863  binMap.resize(EcalTrigTowerDetId::kEBTotalTowers + EcalScDetId::kSizeForDenseIndexing); // EcalTrigTowerDetId -> bin
864  for(int ix = 1; ix <= 72; ix++){
865  for(int iy = 21; iy <= 54; iy++){
866  int ieta(iy < 38 ? (iy - 38) * 5 : (iy - 37) * 5);
867  int iphi(ix * 5);
868  uint32_t dIndex(EBDetId(ieta, iphi).tower().hashedIndex() + EcalScDetId::SC_PER_EE_CNT);
869  binMap[dIndex] = 72 * (iy - 1) + ix;
870  }
871  }
872  for(int ix = 1; ix <= 40; ix++){
873  int iix((ix - 1) % 20 + 1);
874  int zside(ix > 20 ? 1 : -1);
875  for(int iy = 1; iy <= 20; iy++){
876  if(!EcalScDetId::validDetId(iix, iy, zside)) continue;
877  uint32_t dIndex(EcalScDetId(iix, iy, zside).hashedIndex());
878  if(zside == 1) dIndex += EcalTrigTowerDetId::kEBTotalTowers;
879  binMap[dIndex] = 72 * (iy - 1) + ix;
880  }
881  }
882  return &binMap;
883 
884  case kProjEta:
885  {
886  float binEdges[nEBEtaBins + 2 * nEEEtaBins + 1];
887  for(int i(0); i <= nEEEtaBins; i++)
888  binEdges[i] = -3. + (3. - etaBound_) / nEEEtaBins * i;
889  for(int i(1); i <= nEBEtaBins; i++)
890  binEdges[i + nEEEtaBins] = -etaBound_ + 2. * etaBound_ / nEBEtaBins * i;
891  for(int i(1); i <= nEEEtaBins; i++)
892  binEdges[i + nEEEtaBins + nEBEtaBins] = etaBound_ + (3. - etaBound_) / nEEEtaBins * i;
893 
894  float* lowEdge(binEdges);
895  binMap.resize(170 + EEDetId::kEEhalf); // EEDetId (half) -> bin
896  for(int ix = 1; ix <= 100; ix++){
897  for(int iy = 1; iy <= 50; iy++){
898  if(!EEDetId::validDetId(ix, iy, -1)) continue;
899  EEDetId eeid(ix, iy, -1);
900  float eta(geometry_->getGeometry(eeid)->getPosition().eta());
901  float* pBin(std::upper_bound(lowEdge, lowEdge + nEEEtaBins + 1, eta));
902  uint32_t dIndex(eeid.hashedIndex());
903  binMap[dIndex] = static_cast<int>(pBin - binEdges);
904  }
905  }
906  lowEdge += nEEEtaBins;
907  for(int ieta(-85); ieta <= 85; ieta++){
908  if(ieta == 0) continue;
909  EBDetId ebid(ieta, 1);
910  float eta(geometry_->getGeometry(ebid)->getPosition().eta());
911  float* pBin(std::upper_bound(lowEdge, lowEdge + nEBEtaBins + 1, eta));
912  uint32_t dIndex(ieta < 0 ? ieta + 85 : ieta + 84);
913  dIndex += EEDetId::kEEhalf / 2;
914  binMap[dIndex] = static_cast<int>(pBin - binEdges);
915  }
916  lowEdge += nEBEtaBins;
917  for(int ix = 1; ix <= 100; ix++){
918  for(int iy = 1; iy <= 50; iy++){
919  if(!EEDetId::validDetId(ix, iy, 1)) continue;
920  EEDetId eeid(ix, iy, 1);
921  float eta(geometry_->getGeometry(eeid)->getPosition().eta());
922  float* pBin(std::upper_bound(lowEdge, lowEdge + nEEEtaBins + 1, eta));
923  uint32_t dIndex(eeid.hashedIndex() - EEDetId::kEEhalf / 2 + 170);
924  binMap[dIndex] = static_cast<int>(pBin - binEdges);
925  }
926  }
927  }
928  return &binMap;
929 
930  case kProjPhi:
931  {
932  float binEdges[nPhiBins + 1];
933  for(int i(0); i <= nPhiBins; i++)
934  binEdges[i] = TMath::Pi() * (-1./18. + 2. / nPhiBins * i);
935  binMap.resize(360 + EEDetId::kEEhalf); // EEDetId(-) -> bin
936  for(int ix = 1; ix <= 100; ix++){
937  for(int iy = 1; iy <= 100; iy++){
938  if(!EEDetId::validDetId(ix, iy, -1)) continue;
939  EEDetId eeid(ix, iy, -1);
940  float phi(geometry_->getGeometry(eeid)->getPosition().phi());
941  if(phi < -TMath::Pi() * 1./18.) phi += 2. * TMath::Pi();
942  float* pBin(std::upper_bound(binEdges, binEdges + nPhiBins + 1, phi));
943  uint32_t dIndex(eeid.hashedIndex());
944  binMap[dIndex] = static_cast<int>(pBin - binEdges);
945  }
946  }
947  for(int iphi(1); iphi <= 360; iphi++){
948  EBDetId ebid(1, iphi);
949  float phi(geometry_->getGeometry(ebid)->getPosition().phi());
950  if(phi < -TMath::Pi() * 1./18.) phi += 2. * TMath::Pi();
951  float* pBin(std::upper_bound(binEdges, binEdges + nPhiBins + 1, phi));
952  uint32_t dIndex(iphi - 1 + EEDetId::kEEhalf);
953  binMap[dIndex] = static_cast<int>(pBin - binEdges);
954  }
955  }
956  return &binMap;
957 
958  case kTCC:
959  binMap.resize(nTCC);
960  for(int ix = 1; ix <= nTCC; ix++)
961  binMap[ix - 1] = ix;
962  return &binMap;
963 
964  case kDCC:
965  binMap.resize(nDCC);
966  for(int ix(kEEmLow); ix <= kEEpHigh; ix++)
967  binMap[ix] = ix + 1;
968  return &binMap;
969 
970  default:
971  return 0;
972  }
973 }
const double Pi
static bool validDetId(int ix, int iy, int iz)
Definition: EcalScDetId.cc:64
int i
Definition: DBlmapReader.cc:9
static const int SC_PER_EE_CNT
Definition: EcalScDetId.h:144
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T eta() const
int hashedIndex(int ieta, int iphi)
Definition: EcalPyUtils.cc:42
std::vector< int > binMaps_[nPlotType][nPresetBinnings]
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
T eta() const
Definition: PV3DBase.h:76
const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:76
const CaloGeometry * geometry_
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
Definition: DDAxes.h:10
const std::vector< int > * EcalDQMBinningService::getBinMapEE_ ( BinningType  _bkey,
int  _zside 
) const
private

Definition at line 500 of file EcalDQMBinningService2.cc.

References eta(), ecalpyutils::hashedIndex(), EEDetId::hashedIndex(), i, ecaldqm::kCrystal, EEDetId::kEEhalf, ecaldqm::kEEm, ecaldqm::kEEmHigh, ecaldqm::kEEmLow, ecaldqm::kEEp, ecaldqm::kEEpHigh, ecaldqm::kEEpLow, EcalScDetId::kSizeForDenseIndexing, EEDetId::kSizeForDenseIndexing, ecaldqm::kSuperCrystal, phi, Pi, EcalScDetId::SC_PER_EE_CNT, EcalScDetId::validDetId(), and EEDetId::validDetId().

Referenced by getBinMap().

501 {
502  unsigned okey(0);
503  switch(_zside){
504  case -1: okey = kEEm; break;
505  case 0: okey = kEE; break;
506  case 1: okey = kEEp; break;
507  default: return 0;
508  }
509 
510  std::vector<int>& binMap(binMaps_[okey][_bkey]);
511 
512  int ixmax(_zside == 0 ? 200 : 100);
513  int zside(_zside);
514 
515  switch(_bkey){
516  case kCrystal: // EEDetId -> bin
517  binMap.resize(_zside == 0 ? EEDetId::kSizeForDenseIndexing : EEDetId::kEEhalf);
518  for(int ix = 1; ix <= ixmax; ix++){
519  if(_zside == 0) zside = (ix <= 100 ? -1 : 1);
520  int iix(_zside == 0 && ix > 100 ? ix - 100 : ix);
521  for(int iy = 1; iy <= 100; iy++){
522  if(!EEDetId::validDetId(iix, iy, zside)) continue;
523  uint32_t dIndex(EEDetId(iix, iy, zside).hashedIndex());
524  if(_zside == 1) dIndex -= EEDetId::kEEhalf;
525  binMap[dIndex] = ixmax * (iy - 1) + ix;
526  }
527  }
528  return &binMap;
529 
530  case kSuperCrystal: // EcalScDetId -> bin
531  binMap.resize(_zside == 0 ? EcalScDetId::kSizeForDenseIndexing : EcalScDetId::SC_PER_EE_CNT);
532  for(int ix = 1; ix <= ixmax / 5; ix++){
533  if(_zside == 0) zside = (ix <= 20 ? -1 : 1);
534  int iix(_zside == 0 && ix > 20 ? ix - 20 : ix);
535  for(int iy = 1; iy <= 20; iy++){
536  if(!EcalScDetId::validDetId(iix, iy, zside)) continue;
537  uint32_t dIndex(EcalScDetId(iix, iy, zside).hashedIndex());
538  if(_zside == 1) dIndex -= EcalScDetId::SC_PER_EE_CNT;
539  binMap[dIndex] = ixmax / 5 * (iy - 1) + ix;
540  }
541  }
542  return &binMap;
543 
544  case kDCC:
545  {
546  int nEEDCC(kEEmHigh - kEEmLow + kEEpHigh - kEEpLow + 2);
547  if(_zside != 0) nEEDCC /= 2;
548  binMap.resize(nEEDCC); // DCCId (shifted) -> bin
549  for(int ix = 1; ix <= nEEDCC; ix++)
550  binMap[ix - 1] = (ix + 5) % 9 + 1 + 9 * ((ix - 1) / 9);
551  }
552  return &binMap;
553 
554  case kTCC:
555  {
556  int nEETCC(kEEmTCCHigh - kEEmTCCLow + kEEpTCCHigh - kEEpTCCLow + 2);
557  if(_zside != 0) nEETCC /= 2;
558  binMap.resize(nEETCC); // TCCId (shifted) -> bin
559  for(int ix = 1; ix <= nEETCC; ix++)
560  binMap[ix - 1] = ix;
561  }
562  return &binMap;
563 
564  case kProjEta:
565  {
566  if(_zside == 0) return 0;
567 
568  float binEdges[nEEEtaBins + 1];
569  if(_zside < 0){
570  for(int i(0); i <= nEEEtaBins; i++)
571  binEdges[i] = -3. + (3. - etaBound_) / nEEEtaBins * i;
572  }
573  else{
574  for(int i(0); i <= nEEEtaBins; i++)
575  binEdges[i] = etaBound_ + (3. - etaBound_) / nEEEtaBins * i;
576  }
577  binMap.resize(EEDetId::kEEhalf / 2); // EEDetId (half) -> bin
578  // Only a quadrant is really necessary, but the hashed index cannot be resolved for quadrants
579  for(int ix = 1; ix <= 100; ix++){
580  for(int iy = 1; iy <= 50; iy++){
581  if(!EEDetId::validDetId(ix, iy, _zside)) continue;
582  EEDetId eeid(ix, iy, _zside);
583  float eta(geometry_->getGeometry(eeid)->getPosition().eta());
584  float* pBin(std::upper_bound(binEdges, binEdges + nEEEtaBins + 1, eta));
585  uint32_t dIndex(eeid.hashedIndex());
586  if(_zside == 1) dIndex -= EEDetId::kEEhalf;
587  binMap[dIndex] = static_cast<int>(pBin - binEdges);
588  }
589  }
590  }
591  return &binMap;
592 
593  case kProjPhi:
594  {
595  if(_zside != 0) return 0;
596 
597  float binEdges[nPhiBins + 1];
598  for(int i(0); i <= nPhiBins; i++)
599  binEdges[i] = TMath::Pi() * (-1./18. + 2. / nPhiBins * i);
600  binMap.resize(EEDetId::kEEhalf); // EEDetId(-) -> bin
601  for(int ix = 1; ix <= 100; ix++){
602  for(int iy = 1; iy <= 100; iy++){
603  if(!EEDetId::validDetId(ix, iy, -1)) continue;
604  EEDetId eeid(ix, iy, -1);
605  float phi(geometry_->getGeometry(eeid)->getPosition().phi());
606  if(phi < -TMath::Pi() * 1./18.) phi += 2. * TMath::Pi();
607  float* pBin(std::upper_bound(binEdges, binEdges + nPhiBins + 1, phi));
608  uint32_t dIndex(eeid.hashedIndex());
609  binMap[dIndex] = static_cast<int>(pBin - binEdges);
610  }
611  }
612  }
613  return &binMap;
614 
615  default:
616  return 0;
617  }
618 }
const double Pi
static bool validDetId(int ix, int iy, int iz)
Definition: EcalScDetId.cc:64
int i
Definition: DBlmapReader.cc:9
static const int SC_PER_EE_CNT
Definition: EcalScDetId.h:144
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T eta() const
int hashedIndex(int ieta, int iphi)
Definition: EcalPyUtils.cc:42
std::vector< int > binMaps_[nPlotType][nPresetBinnings]
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
T eta() const
Definition: PV3DBase.h:76
const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:76
const CaloGeometry * geometry_
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
Definition: DDAxes.h:10
const std::vector< int > * EcalDQMBinningService::getBinMapEEMEM_ ( BinningType  _bkey) const
private

Definition at line 621 of file EcalDQMBinningService2.cc.

References ecaldqm::dccNoMEM, ecaldqm::kCrystal, ecaldqm::kEBmLow, ecaldqm::kEEmHigh, ecaldqm::kEEmLow, ecaldqm::kEEpHigh, ecaldqm::kEEpLow, and evf::evtn::offset().

Referenced by getBinMap().

622 {
623  if(_bkey != kCrystal) return 0;
624 
625  std::vector<int>& binMap(binMaps_[kEEMEM][kCrystal]);
626 
627  binMap.resize((kEEmHigh - kEEmLow + kEEpHigh - kEEpLow + 2) * 10); // EcalPnDiodeDetId -> bin (see above)
628  int memIx(1);
629  int iEEDCC(-1);
630  int offset(0);
631  for(int iSM(kEEmLow); iSM <= kEEpHigh; iSM++){
632  iEEDCC++;
633  if (dccNoMEM.find(iSM) != dccNoMEM.end()) {
634  for (int ich(0); ich < 10; ich++)
635  binMap[iEEDCC * 10 + ich] = 0;
636  continue;
637  }
638  if (iSM == kEBmLow) {
639  iSM = kEEpLow;
640  offset = 10;
641  memIx = 1;
642  }
643  for(int iy = 1 + offset; iy <= 10 + offset; iy++){
644  int pnId(iy < 11 ? 11 - iy : iy - 10);
645  uint32_t dIndex(iEEDCC * 10 + pnId - 1);
646  binMap[dIndex] = 4 * (iy - 1) + memIx;
647  }
648  memIx++;
649  }
650 
651  return &binMap;
652 }
std::vector< int > binMaps_[nPlotType][nPresetBinnings]
unsigned int offset(bool)
const std::set< unsigned > dccNoMEM
const std::vector< int > * EcalDQMBinningService::getBinMapSM_ ( BinningType  _bkey) const
private

Definition at line 655 of file EcalDQMBinningService2.cc.

References ecaldqm::getElectronicsMap(), ecalpyutils::hashedIndex(), i, ecaldqm::kCrystal, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, ecaldqm::kEBpLow, EcalTrigTowerDetId::kEBTotalTowers, EEDetId::kEEhalf, ecaldqm::kEEm02, ecaldqm::kEEm08, ecaldqm::kEEmHigh, ecaldqm::kEEp02, ecaldqm::kEEp08, ecaldqm::kEEpLow, EBDetId::kSizeForDenseIndexing, EcalScDetId::kSizeForDenseIndexing, EEDetId::kSizeForDenseIndexing, ecaldqm::kSM, ecaldqm::kSuperCrystal, ecaldqm::kTriggerTower, EcalScDetId::SC_PER_EE_CNT, and EcalScDetId::validDetId().

Referenced by getBinMap().

656 {
657  int totalBins(0);
658 
659  std::vector<int>& binMap(binMaps_[kSM][_bkey]);
660 
661  switch(_bkey){
662  case kCrystal:
664  for (int iDCC(0); iDCC < nDCC; iDCC++) {
665  if(iDCC >= kEBmLow && iDCC <= kEBpHigh){
666  for(int ix = 1; ix <= nEBSMEta; ix++){
667  for(int iy = 1; iy <= nEBSMPhi; iy++){
668  int ieta(ix + xlow(iDCC));
669  int iphi(iy + ylow(iDCC));
670  if (iDCC >= kEBpLow){
671  iphi -= 1;
672  iphi *= -1;
673  }
674  else
675  ieta *= -1;
676 
677  uint32_t dIndex(EBDetId(ieta, iphi).hashedIndex() + EEDetId::kEEhalf);
678  binMap[dIndex] = totalBins + nEBSMEta * (iy - 1) + ix;
679  }
680  }
681  totalBins += nEBSMBins;
682  }
683  else{
684  std::vector<DetId> crystals(getElectronicsMap()->dccConstituents(iDCC + 1));
685  int nEEX(nEESMX), nEEBins(nEESMBins);
686  if(iDCC == kEEm02 || iDCC == kEEm08 || iDCC == kEEp02 || iDCC == kEEp08){
687  nEEX = nEESMXExt;
688  nEEBins = nEESMBinsExt;
689  }
690  for(std::vector<DetId>::iterator idItr(crystals.begin()); idItr != crystals.end(); ++idItr){
691  EEDetId id(*idItr);
692  uint32_t dIndex(id.hashedIndex());
693  int ix(id.ix() - xlow(iDCC));
694  int iy(id.iy() - ylow(iDCC));
695  if (id.zside() > 0)
697 
698  binMap[dIndex] = totalBins + nEEX * (iy - 1) + ix;
699  }
700  totalBins += nEEBins;
701  }
702  }
703  return &binMap;
704 
705  case kSuperCrystal:
706  binMap.resize(EcalTrigTowerDetId::kEBTotalTowers + EcalScDetId::kSizeForDenseIndexing); // EcalTrigTowerDetId / EcalScDetId -> bin
707 
708  for(int iSM(0); iSM < nDCC; iSM++){
709  if(iSM >= kEBmLow && iSM <= kEBpHigh){
710  for(int ix = 1; ix <= nEBSMEta; ix += 5){
711  for(int iy = 1; iy <= nEBSMPhi; iy += 5){
712  int ieta(ix + xlow(iSM));
713  int iphi(iy + ylow(iSM));
714  if(iSM >= kEBpLow){
715  iphi -= 1;
716  iphi *= -1;
717  }
718  else
719  ieta *= -1;
720  uint32_t dIndex(EBDetId(ieta, iphi).tower().hashedIndex());
721  binMap[dIndex + EcalScDetId::SC_PER_EE_CNT] = totalBins + nEBSMEta / 5 * (iy - 1) / 5 + (ix - 1) / 5 + 1;
722  }
723  }
724  totalBins += nEBSMBins / 25;
725  }
726  else{
727  int nEEX(nEESMX), nEEBins(nEESMBins);
728  if(iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08){
729  nEEX = nEESMXExt;
730  nEEBins = nEESMBinsExt;
731  }
732  for (int ix(1); ix <= nEEX / 5; ix++) {
733  for (int iy(1); iy <= nEESMY / 5; iy++) {
734  int sciz(1);
735  if (iSM <= kEEmHigh) sciz = -1;
736  int scix(ix + xlow(iSM) / 5);
737  int sciy(iy + ylow(iSM) / 5);
738  if(scix <= 0 || scix > 20 || sciy <= 0 || sciy > 20) continue;
739  if(!EcalScDetId::validDetId(scix, sciy, sciz)) continue;
740  uint32_t dIndex(EcalScDetId(scix, sciy, sciz).hashedIndex());
741  if(sciz > 0) dIndex += EcalTrigTowerDetId::kEBTotalTowers;
742  binMap[dIndex] = totalBins + nEEX / 5 * (iy - 1) + ix;
743  }
744  }
745  totalBins += nEEBins / 25;
746  }
747  }
748  return &binMap;
749 
750  case kTriggerTower:
751  binMap.resize(EcalTrigTowerDetId::kEBTotalTowers + EEDetId::kSizeForDenseIndexing); // EcalTrigTowerDetId / EEDetId -> bin
752 
753  for(int iSM(0); iSM < nDCC; iSM++){
754  if(iSM >= kEBmLow && iSM <= kEBpHigh){
755  for(int ix = 1; ix <= nEBSMEta; ix += 5){
756  for(int iy = 1; iy <= nEBSMPhi; iy += 5){
757  int ieta(ix + xlow(iSM));
758  int iphi(iy + ylow(iSM));
759  if(iSM >= kEBpLow){
760  iphi -= 1;
761  iphi *= -1;
762  }
763  else
764  ieta *= -1;
765  uint32_t dIndex(EBDetId(ieta, iphi).tower().hashedIndex());
766  binMap[dIndex + EEDetId::kEEhalf] = totalBins + nEBSMEta / 5 * (iy - 1) / 5 + (ix - 1) / 5 + 1;
767  }
768  }
769  totalBins += nEBSMBins / 25;
770  }
771  else{
772  int nEEX(nEESMX), nEEBins(nEESMBins);
773  if(iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08){
774  nEEX = nEESMXExt;
775  nEEBins = nEESMBinsExt;
776  }
777 
778  int tccid[4];
779  tccid[0] = ((iSM % 9) * 2 + 17) % 18 + 1;
780  tccid[1] = tccid[0] % 18 + 1;
781  tccid[2] = tccid[0] + 18;
782  tccid[3] = tccid[1] + 18;
783  if(iSM >= int(kEEpLow))
784  for(int i(0); i < 4; i++) tccid[i] += kEEpTCCLow;
785  for(int it(0); it < 4; it++){
786  std::vector<DetId> crystals(getElectronicsMap()->tccConstituents(tccid[it]));
787  for(std::vector<DetId>::iterator idItr(crystals.begin()); idItr != crystals.end(); ++idItr){
788  EEDetId id(*idItr);
789  uint32_t dIndex(id.hashedIndex());
790  int ix(id.ix() - xlow(iSM));
791  int iy(id.iy() - ylow(iSM));
792  if (id.zside() > 0)
794 
795  binMap[dIndex] = totalBins + nEEX * (iy - 1) + ix;
796  }
797  }
798  totalBins += nEEBins;
799  }
800  }
801  return &binMap;
802 
803  default:
804  return 0;
805  }
806 }
static bool validDetId(int ix, int iy, int iz)
Definition: EcalScDetId.cc:64
int i
Definition: DBlmapReader.cc:9
static const int SC_PER_EE_CNT
Definition: EcalScDetId.h:144
const EcalElectronicsMapping * getElectronicsMap()
int hashedIndex(int ieta, int iphi)
Definition: EcalPyUtils.cc:42
std::vector< int > binMaps_[nPlotType][nPresetBinnings]
const std::vector< int > * EcalDQMBinningService::getBinMapSMMEM_ ( BinningType  _bkey) const
private

Definition at line 809 of file EcalDQMBinningService2.cc.

References ecaldqm::dccNoMEM, ecaldqm::kCrystal, and ecaldqm::kEBmHigh.

Referenced by getBinMap().

810 {
811  if(_bkey != kCrystal) return 0;
812 
813  int totalBins(0);
814 
815  std::vector<int>& binMap(binMaps_[kSMMEM][_bkey]);
816 
817  binMap.resize(nDCC * 10); // EcalPnDiodeDetId -> bin (see above)
818  for(int iSM(0); iSM < nDCC; iSM++){
819  if (dccNoMEM.find(iSM) != dccNoMEM.end()) {
820  for (int ich(0); ich < 10; ich++)
821  binMap[iSM * 10 + ich] = 0;
822  continue;
823  }
824  for(int ix = 1; ix <= 10; ix++){
825  int pnId(iSM <= kEBmHigh ? 11 - ix : ix);
826  uint32_t dIndex(iSM * 10 + pnId - 1);
827  binMap[dIndex] = totalBins + ix;
828  }
829 
830  totalBins += 10;
831  }
832 
833  return &binMap;
834 }
std::vector< int > binMaps_[nPlotType][nPresetBinnings]
const std::set< unsigned > dccNoMEM
std::vector< EcalDQMBinningService::AxisSpecs > EcalDQMBinningService::getBinning ( ObjectType  _otype,
BinningType  _btype,
bool  _isMap = true,
unsigned  _objOffset = 0 
) const

Definition at line 66 of file EcalDQMBinningService.cc.

References getBinningEB_(), getBinningEBMEM_(), getBinningEcal_(), getBinningEE_(), getBinningEEMEM_(), getBinningSM_(), getBinningSMMEM_(), kEB, kEBMEM, kEcal, kEE, kEEm, kEEMEM, kEEp, kSM, kSMMEM, nObjType, and nPresetBinnings.

Referenced by ecaldqm::MESetEcal::book().

67 {
68  if(_otype >= nObjType || _btype >= unsigned(nPresetBinnings))
69  return std::vector<AxisSpecs>(0); // you are on your own
70 
71  switch(_otype){
72  case kEB:
73  return getBinningEB_(_btype, _isMap);
74  case kEBMEM:
75  return getBinningEBMEM_(_btype, _isMap);
76  case kEE:
77  return getBinningEE_(_btype, _isMap, 0);
78  case kEEm:
79  return getBinningEE_(_btype, _isMap, -1);
80  case kEEp:
81  return getBinningEE_(_btype, _isMap, 1);
82  case kEEMEM:
83  return getBinningEEMEM_(_btype, _isMap);
84  case kSM:
85  return getBinningSM_(_btype, _isMap, _objOffset);
86  case kSMMEM:
87  return getBinningSMMEM_(_btype, _isMap, _objOffset);
88  case kEcal:
89  return getBinningEcal_(_btype, _isMap);
90  default:
91  return std::vector<AxisSpecs>(0);
92  }
93 }
std::vector< AxisSpecs > getBinningEBMEM_(BinningType, bool) const
std::vector< AxisSpecs > getBinningEcal_(BinningType, bool) const
std::vector< AxisSpecs > getBinningSMMEM_(BinningType, bool, unsigned) const
std::vector< AxisSpecs > getBinningEE_(BinningType, bool, int) const
std::vector< AxisSpecs > getBinningEB_(BinningType, bool) const
std::vector< AxisSpecs > getBinningSM_(BinningType, bool, unsigned) const
std::vector< AxisSpecs > getBinningEEMEM_(BinningType, bool) const
std::vector< EcalDQMBinningService::AxisSpecs > EcalDQMBinningService::getBinningEB_ ( BinningType  _btype,
bool  _isMap 
) const
private

Definition at line 16 of file EcalDQMBinningService2.cc.

References EcalDQMBinningService::AxisSpecs::high, ecaldqm::kCrystal, ecaldqm::kSuperCrystal, ecaldqm::kTriggerTower, EcalDQMBinningService::AxisSpecs::low, EcalDQMBinningService::AxisSpecs::nbins, Pi, and EcalDQMBinningService::AxisSpecs::title.

Referenced by getBinning().

17 {
18  std::vector<AxisSpecs> axes(0);
19  AxisSpecs xaxis, yaxis;
20 
21  if(!_isMap){
22 
23  switch(_btype){
24 // case kTriggerTower:
25 // case kSuperCrystal:
26 // xaxis.nbins = 2448;
27 // xaxis.low = 0.;
28 // xaxis.high = 2448.;
29 // xaxis.title = "iTT";
30 // break;
31  case kTCC:
32  xaxis.nbins = 36;
33  xaxis.low = 9.;
34  xaxis.high = 45.;
35  xaxis.title = "iTCC";
36  break;
37  case kDCC:
38  xaxis.nbins = 36;
39  xaxis.low = 9.;
40  xaxis.high = 45.;
41  break;
42  case kProjEta:
43  xaxis.nbins = nEBEtaBins;
44  xaxis.low = -etaBound_;
45  xaxis.high = etaBound_;
46  xaxis.title = "eta";
47  break;
48  case kProjPhi:
49  xaxis.nbins = nPhiBins;
50  xaxis.low = -TMath::Pi() / 18.;
51  xaxis.high = TMath::Pi() * 35./18.;
52  xaxis.title = "phi";
53  break;
54  default:
55  return axes;
56  }
57 
58  axes.push_back(xaxis);
59 
60  }
61  else{
62 
63  switch(_btype){
64  case kCrystal:
65  xaxis.nbins = 360;
66  yaxis.nbins = 170;
67  break;
68  case kSuperCrystal:
69  case kTriggerTower:
70  xaxis.nbins = 72;
71  yaxis.nbins = 34;
72  break;
73  default:
74  return axes;
75  }
76 
77  xaxis.low = 0.;
78  xaxis.high = 360.;
79  xaxis.title = "iphi";
80  yaxis.low = -85.;
81  yaxis.high = 85.;
82  yaxis.title = "ieta";
83 
84  axes.push_back(xaxis);
85  axes.push_back(yaxis);
86 
87  }
88 
89  return axes;
90 }
const double Pi
std::vector< EcalDQMBinningService::AxisSpecs > EcalDQMBinningService::getBinningEBMEM_ ( BinningType  _btype,
bool  _isMap 
) const
private

Definition at line 93 of file EcalDQMBinningService2.cc.

References EcalDQMBinningService::AxisSpecs::high, ecaldqm::kCrystal, EcalDQMBinningService::AxisSpecs::low, EcalDQMBinningService::AxisSpecs::nbins, and EcalDQMBinningService::AxisSpecs::title.

Referenced by getBinning().

94 {
95  std::vector<AxisSpecs> axes(0);
96  AxisSpecs xaxis, yaxis;
97 
98  if(_btype != kCrystal || !_isMap) return axes;
99 
100  xaxis.nbins = 18;
101  xaxis.low = 0.;
102  xaxis.high = 18.;
103  xaxis.title = "channel";
104 
105  yaxis.nbins = 20;
106  yaxis.low = -10.;
107  yaxis.high = 10.;
108  yaxis.title = "pseudo-strip";
109 
110  axes.push_back(xaxis);
111  axes.push_back(yaxis);
112 
113  return axes;
114 }
std::vector< EcalDQMBinningService::AxisSpecs > EcalDQMBinningService::getBinningEcal_ ( BinningType  _btype,
bool  _isMap 
) const
private

Definition at line 321 of file EcalDQMBinningService2.cc.

References EcalDQMBinningService::AxisSpecs::edges, EcalDQMBinningService::AxisSpecs::high, i, ecaldqm::kCrystal, ecaldqm::kSuperCrystal, EcalDQMBinningService::AxisSpecs::low, EcalDQMBinningService::AxisSpecs::nbins, Pi, and EcalDQMBinningService::AxisSpecs::title.

Referenced by getBinning().

322 {
323  std::vector<AxisSpecs> axes(0);
324  AxisSpecs xaxis, yaxis;
325 
326  if(!_isMap){
327 
328  switch(_btype){
329  case kTCC:
330  xaxis.nbins = 108;
331  xaxis.low = 0.;
332  xaxis.high = 108.;
333  xaxis.title = "iTCC";
334  break;
335  case kDCC:
336  xaxis.nbins = 54;
337  xaxis.low = 0.;
338  xaxis.high = 54.;
339  break;
340  case kProjEta:
341  xaxis.nbins = nEBEtaBins + 2 * nEEEtaBins;
342  xaxis.edges = new double[xaxis.nbins + 1];
343  for(int i(0); i <= nEEEtaBins; i++)
344  xaxis.edges[i] = -3. + (3. - etaBound_) / nEEEtaBins * i;
345  for(int i(1); i <= nEBEtaBins; i++)
346  xaxis.edges[i + nEEEtaBins] = -etaBound_ + 2. * etaBound_ / nEBEtaBins * i;
347  for(int i(1); i <= nEEEtaBins; i++)
348  xaxis.edges[i + nEEEtaBins + nEBEtaBins] = etaBound_ + (3. - etaBound_) / nEEEtaBins * i;
349  xaxis.title = "eta";
350  break;
351  case kProjPhi:
352  xaxis.nbins = nPhiBins;
353  xaxis.low = -TMath::Pi() / 18.;
354  xaxis.high = TMath::Pi() * 35./18.;
355  xaxis.title = "phi";
356  break;
357  default:
358  return axes;
359  }
360 
361  axes.push_back(xaxis);
362  }
363  else{
364 
365  switch(_btype){
366  case kCrystal:
367  xaxis.nbins = 360;
368  yaxis.nbins = 270;
369  break;
370  case kSuperCrystal:
371  xaxis.nbins = 72;
372  yaxis.nbins = 54;
373  break;
374  default:
375  return axes;
376  }
377 
378  xaxis.low = 0.;
379  xaxis.high = 360.;
380  xaxis.title = "iphi/ix/ix+100";
381  yaxis.low = 0.;
382  yaxis.high = 270.;
383  yaxis.title = "ieta/iy";
384 
385  axes.push_back(xaxis);
386  axes.push_back(yaxis);
387 
388  }
389 
390  return axes;
391 }
const double Pi
int i
Definition: DBlmapReader.cc:9
std::vector< EcalDQMBinningService::AxisSpecs > EcalDQMBinningService::getBinningEE_ ( BinningType  _btype,
bool  _isMap,
int  _zside 
) const
private

Definition at line 117 of file EcalDQMBinningService2.cc.

References EcalDQMBinningService::AxisSpecs::high, ecaldqm::kCrystal, ecaldqm::kSuperCrystal, ecaldqm::kTriggerTower, EcalDQMBinningService::AxisSpecs::low, EcalDQMBinningService::AxisSpecs::nbins, Pi, and EcalDQMBinningService::AxisSpecs::title.

Referenced by getBinning().

118 {
119  std::vector<AxisSpecs> axes(0);
120  AxisSpecs xaxis, yaxis;
121 
122  if(!_isMap){
123 
124  switch(_btype){
125 // case kTriggerTower:
126 // xaxis.nbins = _zside ? 720 : 1440;
127 // xaxis.low = 0.;
128 // xaxis.high = _zside ? 720. : 1440.;
129 // xaxis.title = "iTT";
130 // break;
131 // case kSuperCrystal:
132 // xaxis.nbins = _zside ? 312 : 624;
133 // xaxis.low = 0.;
134 // xaxis.high = _zside ? 312. : 624.;
135 // xaxis.title = "iSC";
136 // break;
137  case kTCC:
138  xaxis.nbins = _zside ? 36 : 72;
139  xaxis.low = 0.;
140  xaxis.high = _zside ? 36. : 72.;
141  xaxis.title = "iTCC";
142  break;
143  case kDCC:
144  xaxis.nbins = _zside ? 9 : 18;
145  xaxis.low = 0.;
146  xaxis.high = _zside ? 9. : 18.;
147  break;
148  case kProjEta:
149  if(!_zside) return axes;
150  xaxis.nbins = nEEEtaBins;
151  xaxis.low = _zside < 0 ? -3. : etaBound_;
152  xaxis.high = _zside < 0 ? -etaBound_ : 3.;
153  xaxis.title = "eta";
154  break;
155  case kProjPhi:
156  xaxis.nbins = nPhiBins;
157  xaxis.low = -TMath::Pi() / 18.;
158  xaxis.high = TMath::Pi() * 35./18.;
159  xaxis.title = "phi";
160  break;
161  default:
162  return axes;
163  }
164 
165  axes.push_back(xaxis);
166 
167  }else{
168 
169  switch(_btype){
170  case kCrystal:
171  case kTriggerTower:
172  xaxis.nbins = _zside ? 100 : 200;
173  yaxis.nbins = 100;
174  break;
175  case kSuperCrystal:
176  xaxis.nbins = _zside ? 20 : 40;
177  yaxis.nbins = 20;
178  break;
179  default:
180  return axes;
181  }
182 
183  xaxis.low = 0.;
184  xaxis.high = _zside ? 100. : 200.;
185  xaxis.title = "ix";
186  yaxis.low = 0.;
187  yaxis.high = 100.;
188  yaxis.title = "iy";
189 
190  axes.push_back(xaxis);
191  axes.push_back(yaxis);
192 
193  }
194 
195  return axes;
196 }
const double Pi
std::vector< EcalDQMBinningService::AxisSpecs > EcalDQMBinningService::getBinningEEMEM_ ( BinningType  _btype,
bool  _isMap 
) const
private

Definition at line 199 of file EcalDQMBinningService2.cc.

References EcalDQMBinningService::AxisSpecs::high, ecaldqm::kCrystal, EcalDQMBinningService::AxisSpecs::low, EcalDQMBinningService::AxisSpecs::nbins, and EcalDQMBinningService::AxisSpecs::title.

Referenced by getBinning().

200 {
201  std::vector<AxisSpecs> axes(0);
202  AxisSpecs xaxis, yaxis;
203 
204  if(_btype != kCrystal || !_isMap) return axes;
205 
206  xaxis.nbins = 4;
207  xaxis.low = 0.;
208  xaxis.high = 4.;
209  xaxis.title = "channel";
210 
211  yaxis.nbins = 20;
212  yaxis.low = -10.;
213  yaxis.high = 10.;
214  yaxis.title = "pseudo-strip";
215 
216  axes.push_back(xaxis);
217  axes.push_back(yaxis);
218 
219  return axes;
220 }
std::vector< EcalDQMBinningService::AxisSpecs > EcalDQMBinningService::getBinningSM_ ( BinningType  _btype,
bool  _isMap,
unsigned  _offset 
) const
private

Definition at line 223 of file EcalDQMBinningService2.cc.

References EcalElectronicsMapping::dccConstituents(), ecaldqm::getElectronicsMap(), ecaldqm::getNSuperCrystals(), EcalDQMBinningService::AxisSpecs::high, ecaldqm::kCrystal, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, ecaldqm::kEBpLow, ecaldqm::kEEm02, ecaldqm::kEEm08, ecaldqm::kEEp02, ecaldqm::kEEp08, ecaldqm::kSuperCrystal, ecaldqm::kTriggerTower, EcalDQMBinningService::AxisSpecs::low, EcalDQMBinningService::AxisSpecs::nbins, and EcalDQMBinningService::AxisSpecs::title.

Referenced by getBinning().

224 {
225  const bool isBarrel(_offset >= kEBmLow && _offset <= kEBpHigh);
226 
227  std::vector<AxisSpecs> axes(0);
228  AxisSpecs xaxis, yaxis;
229 
230  if(!_isMap){
231 
232  switch(_btype){
233  case kCrystal:
234  xaxis.nbins = isBarrel ? 1700 : getElectronicsMap()->dccConstituents(_offset + 1).size();
235  xaxis.low = 0.;
236  xaxis.high = xaxis.nbins;
237  xaxis.title = "channel";
238  break;
239  case kTriggerTower:
240  xaxis.nbins = isBarrel ? 68 : 80;
241  xaxis.low = 0.;
242  xaxis.high = xaxis.nbins;
243  xaxis.title = "tower";
244  break;
245  case kSuperCrystal:
246  xaxis.nbins = isBarrel ? 68 : getNSuperCrystals(_offset + 1);
247  xaxis.low = 0.;
248  xaxis.high = xaxis.nbins;
249  xaxis.title = "tower";
250  break;
251  default:
252  return axes;
253  }
254 
255  axes.push_back(xaxis);
256 
257  }else{
258 
259  int nEEX(nEESMX);
260  if(_offset == kEEm02 || _offset == kEEm08 || _offset == kEEp02 || _offset == kEEp08) nEEX = nEESMXExt;
261 
262  switch(_btype){
263  case kCrystal:
264  xaxis.nbins = isBarrel ? nEBSMEta : nEEX;
265  yaxis.nbins = isBarrel ? nEBSMPhi : nEESMY;
266  break;
267  case kTriggerTower:
268  xaxis.nbins = isBarrel ? nEBSMEta / 5 : nEEX;
269  yaxis.nbins = isBarrel ? nEBSMPhi / 5 : nEESMY;
270  break;
271  case kSuperCrystal:
272  xaxis.nbins = isBarrel ? nEBSMEta / 5 : nEEX / 5;
273  yaxis.nbins = isBarrel ? nEBSMPhi / 5 : nEESMY / 5;
274  break;
275  default:
276  return axes;
277  }
278  xaxis.low = xlow(_offset);
279  xaxis.high = xaxis.low + (isBarrel ? nEBSMEta : nEEX);
280  xaxis.title = isBarrel ? (_offset < kEBpLow ? "-ieta" : "ieta") : "ix";
281  yaxis.low = ylow(_offset);
282  yaxis.high = yaxis.low + (isBarrel ? nEBSMPhi : nEESMY);
283  yaxis.title = isBarrel ? "iphi" : "iy";
284 
285  axes.push_back(xaxis);
286  axes.push_back(yaxis);
287 
288  }
289 
290  return axes;
291 }
const EcalElectronicsMapping * getElectronicsMap()
std::vector< DetId > dccConstituents(int dccId) const
Get the constituent detids for this dccId.
unsigned getNSuperCrystals(unsigned)
std::vector< EcalDQMBinningService::AxisSpecs > EcalDQMBinningService::getBinningSMMEM_ ( BinningType  _btype,
bool  _isMap,
unsigned  _idcc 
) const
private

Definition at line 294 of file EcalDQMBinningService2.cc.

References ecaldqm::dccNoMEM, EcalDQMBinningService::AxisSpecs::high, ecaldqm::kCrystal, ecaldqm::kEBpLow, EcalDQMBinningService::AxisSpecs::low, EcalDQMBinningService::AxisSpecs::nbins, and EcalDQMBinningService::AxisSpecs::title.

Referenced by getBinning().

295 {
296  std::vector<AxisSpecs> axes(0);
297  AxisSpecs xaxis, yaxis;
298 
299  if(dccNoMEM.find(_idcc) != dccNoMEM.end()) return axes;
300  if(_btype != kCrystal) return axes;
301 
302  xaxis.nbins = 10;
303  xaxis.low = _idcc >= kEBpLow ? 0. : -10.;
304  xaxis.high = _idcc >= kEBpLow ? 10. : 0.;
305  xaxis.title = "pseudo-strip";
306 
307  axes.push_back(xaxis);
308 
309  if(_isMap){
310  yaxis.nbins = 1;
311  yaxis.low = 0.;
312  yaxis.high = 5.;
313  yaxis.title = "channel";
314  axes.push_back(yaxis);
315  }
316 
317  return axes;
318 }
const std::set< unsigned > dccNoMEM
uint32_t EcalDQMBinningService::idFromName ( std::string const &  _name) const

Definition at line 640 of file EcalDQMBinningService.cc.

References ecaldqm::kEBmLow, ecaldqm::kEEmLow, ecaldqm::kEEpLow, mergeVDriftHistosByStation::name, nDCC, evf::evtn::offset(), EcalElectronicsId::rawId(), and EcalTriggerElectronicsId::rawId().

Referenced by ecaldqm::MESetChannel::checkDirectory().

641 {
642  TString name(_name);
643  TPRegexp re("(EB|EE)([+-][0-9][0-9])(?: TCC ([0-9]+)| DCC ([0-9]+) (CCU|TCC) ([0-9]+)(?: (?:TT|strip) ([0-9]+)(?: xtal ([0-9]+)|)|)|)");
644  // 1 2 3 4 5 6 7 8
645  uint32_t rawId(0);
646 
647  TObjArray* matches(re.MatchS(name));
648  if(matches->GetEntries() == 0) return 0;
649  else if(matches->GetEntries() == 3){
650  TString subdet(static_cast<TObjString*>(matches->At(1))->GetString());
651  if(subdet == "EB"){
652  int dccid(static_cast<TObjString*>(matches->At(2))->GetString().Atoi());
653  unsigned offset(0);
654  if(dccid < 0){
655  dccid *= -1;
656  offset = kEEmLow;
657  }
658  else offset = kEEpLow;
659  rawId = (dccid + 2) % 9 + 1 + offset;
660  }
661  else{
662  int dccid(static_cast<TObjString*>(matches->At(2))->GetString().Atoi());
663  if(dccid < 0) dccid *= -1;
664  else dccid += 18;
665  rawId = kEBmLow + dccid;
666  }
667  }
668  else if(matches->GetEntries() == 4)
669  rawId = static_cast<TObjString*>(matches->At(3))->GetString().Atoi() + nDCC;
670  else{
671  TString subtype(static_cast<TObjString*>(matches->At(5))->GetString());
672  if(subtype == "TCC"){
673  int tccid(static_cast<TObjString*>(matches->At(6))->GetString().Atoi());
674  int ttid(static_cast<TObjString*>(matches->At(7))->GetString().Atoi());
675  rawId = EcalTriggerElectronicsId(tccid, ttid, 1, 1).rawId();
676  }
677  else{
678  int dccid(static_cast<TObjString*>(matches->At(4))->GetString().Atoi());
679  int towerid(static_cast<TObjString*>(matches->At(6))->GetString().Atoi());
680  if(matches->GetEntries() == 7)
681  rawId = EcalElectronicsId(dccid, towerid, 1, 1).rawId();
682  else{
683  int stripid(static_cast<TObjString*>(matches->At(7))->GetString().Atoi());
684  int xtalid(static_cast<TObjString*>(matches->At(8))->GetString().Atoi());
685  rawId = EcalElectronicsId(dccid, towerid, stripid, xtalid).rawId();
686  }
687  }
688  }
689 
690  delete matches;
691 
692  return rawId;
693 }
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
unsigned int offset(bool)
uint32_t rawId() const
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...
EcalDQMBinningService::ObjectType EcalDQMBinningService::objectFromOffset ( ObjectType  _otype,
unsigned  _offset 
) const

Definition at line 476 of file EcalDQMBinningService.cc.

References kEB, kEBMEM, kEcal2P, kEcal3P, kEcalMEM2P, kEE, kEEm, kEEMEM, kEEp, and nObjType.

Referenced by ecaldqm::MESetEcal::book(), findBins(), ecaldqm::MESetEcal::generateNames(), and ecaldqm::MESetEcal::reset().

477 {
478  if(_otype == kEcal3P) {
479  switch(_offset){
480  case 0: return kEEm;
481  case 1: return kEB;
482  case 2: return kEEp;
483  default: return nObjType;
484  }
485  }
486  else if(_otype == kEcal2P){
487  switch(_offset){
488  case 0: return kEE;
489  case 1: return kEB;
490  default: return nObjType;
491  }
492  }
493  else if(_otype == kEcalMEM2P){
494  switch(_offset){
495  case 0: return kEEMEM;
496  case 1: return kEBMEM;
497  default: return nObjType;
498  }
499  }
500  else
501  return _otype;
502 }
void EcalDQMBinningService::postBeginRun ( const edm::Run ,
const edm::EventSetup _es 
)

Definition at line 44 of file EcalDQMBinningService.cc.

References edm::hlt::Exception, geometry_, edm::EventSetup::get(), initialized_, edm::ESHandle< class >::product(), ecaldqm::setElectronicsMap(), and ecaldqm::setTrigTowerMap().

Referenced by EcalDQMBinningService().

45 {
46  // set up ecaldqm::electronicsMap in EcalDQMCommonUtils
48  _es.get<EcalMappingRcd>().get(elecMapHandle);
49  setElectronicsMap(elecMapHandle.product());
50 
51  // set up ecaldqm::electronicsMap in EcalDQMCommonUtils
53  _es.get<IdealGeometryRecord>().get(ttMapHandle);
54  setTrigTowerMap(ttMapHandle.product());
55 
57  _es.get<CaloGeometryRecord>().get(geomHndl);
58  geometry_ = geomHndl.product();
59  if(!geometry_)
60  throw cms::Exception("EventSetup") << "CaloGeometry invalid";
61 
62  initialized_ = true;
63 }
void setTrigTowerMap(const EcalTrigTowerConstituentsMap *)
void setElectronicsMap(const EcalElectronicsMapping *)
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
const CaloGeometry * geometry_
int EcalDQMBinningService::smOffsetBins ( ObjectType  _otype,
BinningType  _btype,
unsigned  _offset 
) const

Definition at line 505 of file EcalDQMBinningService.cc.

References kCrystal, ecaldqm::kEBmLow, ecaldqm::kEEm02, ecaldqm::kEEm08, ecaldqm::kEEmLow, ecaldqm::kEEp02, ecaldqm::kEEp08, ecaldqm::kEEpLow, kSM, kSMMEM, kSuperCrystal, kTriggerTower, nEBSMBins, nEESMBins, nEESMBinsExt, and evf::evtn::offset().

Referenced by findBins(), and ecaldqm::MESetEcal::reset().

506 {
507  if(!_offset) return 0;
508 
509  switch(_otype) {
510  case kSM :
511  {
512  int bins(0);
513  int offset(_offset);
514 
515  if(offset > kEEpLow){
516  int ext(0);
517  if(offset > kEEp02) ext += 1;
518  if(offset > kEEp08) ext += 1;
519  int offBins(nEESMBins * (offset - kEEpLow) + (nEESMBinsExt - nEESMBins) * ext);
520  switch(_btype){
521  case kCrystal:
522  case kTriggerTower:
523  bins += offBins; break;
524  case kSuperCrystal:
525  bins += offBins / 25; break;
526  default:
527  break;
528  }
529  offset = kEEpLow;
530  }
531  if(offset > kEBmLow){
532  int offBins(nEBSMBins * (offset - kEBmLow));
533  switch(_btype){
534  case kCrystal:
535  bins += offBins; break;
536  case kTriggerTower:
537  case kSuperCrystal:
538  bins += offBins / 25; break;
539  default:
540  break;
541  }
542  offset = kEBmLow;
543  }
544  if(offset > kEEmLow){
545  int ext(0);
546  if(offset > kEEm02) ext += 1;
547  if(offset > kEEm08) ext += 1;
548  int offBins(nEESMBins * (offset - kEEmLow) + (nEESMBinsExt - nEESMBins) * ext);
549  switch(_btype){
550  case kCrystal:
551  case kTriggerTower:
552  bins += offBins; break;
553  case kSuperCrystal:
554  bins += offBins / 25; break;
555  default:
556  break;
557  }
558  }
559 
560  return bins;
561  }
562  case kSMMEM :
563  {
564  return _offset * 10;
565  }
566  default :
567  break;
568  }
569 
570  return 0;
571 }
unsigned int offset(bool)
int EcalDQMBinningService::xlow ( int  _iSM) const

Definition at line 96 of file EcalDQMBinningService.cc.

References ecaldqm::kEBmLow, ecaldqm::kEBpHigh, ecaldqm::kEEm01, ecaldqm::kEEm02, ecaldqm::kEEm03, ecaldqm::kEEm04, ecaldqm::kEEm05, ecaldqm::kEEm06, ecaldqm::kEEm07, ecaldqm::kEEm08, ecaldqm::kEEm09, ecaldqm::kEEp01, ecaldqm::kEEp02, ecaldqm::kEEp03, ecaldqm::kEEp04, ecaldqm::kEEp05, ecaldqm::kEEp06, ecaldqm::kEEp07, ecaldqm::kEEp08, and ecaldqm::kEEp09.

97 {
98  switch(_iSM){
99  case kEEm01: case kEEp01: return 15;
100  case kEEm02: case kEEp02: return 0;
101  case kEEm03: case kEEp03: return 0;
102  case kEEm04: case kEEp04: return 5;
103  case kEEm05: case kEEp05: return 30;
104  case kEEm06: case kEEp06: return 55;
105  case kEEm07: case kEEp07: return 60;
106  case kEEm08: case kEEp08: return 55;
107  case kEEm09: case kEEp09: return 45;
108  default: break;
109  }
110 
111  if(_iSM >= kEBmLow && _iSM <= kEBpHigh) return 0;
112 
113  return 0;
114 }
int EcalDQMBinningService::ylow ( int  _iSM) const

Definition at line 117 of file EcalDQMBinningService.cc.

References ecaldqm::kEBmHigh, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, ecaldqm::kEBpLow, ecaldqm::kEEm01, ecaldqm::kEEm02, ecaldqm::kEEm03, ecaldqm::kEEm04, ecaldqm::kEEm05, ecaldqm::kEEm06, ecaldqm::kEEm07, ecaldqm::kEEm08, ecaldqm::kEEm09, ecaldqm::kEEp01, ecaldqm::kEEp02, ecaldqm::kEEp03, ecaldqm::kEEp04, ecaldqm::kEEp05, ecaldqm::kEEp06, ecaldqm::kEEp07, ecaldqm::kEEp08, and ecaldqm::kEEp09.

118 {
119  switch(_iSM){
120  case kEEm01: case kEEp01: case kEEm09: case kEEp09: return 60;
121  case kEEm02: case kEEp02: case kEEm08: case kEEp08: return 50;
122  case kEEm03: case kEEp03: case kEEm07: case kEEp07: return 25;
123  case kEEm04: case kEEp04: case kEEm06: case kEEp06: return 5;
124  case kEEm05: case kEEp05: return 0;
125  default: break;
126  }
127 
128  if(_iSM >= kEBmLow && _iSM <= kEBmHigh) return ((_iSM - kEBmLow) % 18) * 20;
129  if(_iSM >= kEBpLow && _iSM <= kEBpHigh) return (-1 - ((_iSM - kEBpLow) % 18)) * 20;
130 
131  return 0;
132 }

Member Data Documentation

std::vector<int> EcalDQMBinningService::binMaps_[nPlotType][nPresetBinnings]
mutableprivate

Definition at line 173 of file EcalDQMBinningService.h.

Referenced by getBinMap().

std::pair<unsigned, std::vector<int> > EcalDQMBinningService::cache_
mutableprivate

Definition at line 186 of file EcalDQMBinningService.h.

Referenced by findBins(), and findOffset().

BinningType EcalDQMBinningService::cacheBtype_
mutableprivate

Definition at line 185 of file EcalDQMBinningService.h.

Referenced by findBins().

uint32_t EcalDQMBinningService::cacheId_
mutableprivate

Definition at line 183 of file EcalDQMBinningService.h.

Referenced by findBins(), and findOffset().

ObjectType EcalDQMBinningService::cacheOtype_
mutableprivate

Definition at line 184 of file EcalDQMBinningService.h.

Referenced by findBins(), and findOffset().

const double EcalDQMBinningService::etaBound_
private

Definition at line 188 of file EcalDQMBinningService.h.

const CaloGeometry* EcalDQMBinningService::geometry_
private

Definition at line 190 of file EcalDQMBinningService.h.

Referenced by postBeginRun().

bool EcalDQMBinningService::initialized_
private

Definition at line 192 of file EcalDQMBinningService.h.

Referenced by postBeginRun().

int EcalDQMBinningService::verbosity_
private

Definition at line 194 of file EcalDQMBinningService.h.

Referenced by getBinMap().